$npx -y skills add TencentCloudBase/cloudbase-skills --skill spec-workflowUse when medium-to-large changes need explicit requirements, technical design, and task planning before implementation, especially for multi-module work, unclear acceptance criteria, or architecture-heavy requests.
| 1 | ## Standalone Install Note |
| 2 | |
| 3 | If this environment only installed the current skill, start from the CloudBase main entry and use the published `cloudbase/references/...` paths for sibling skills. |
| 4 | |
| 5 | - CloudBase main entry: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md` |
| 6 | - Current skill raw source: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/spec-workflow/SKILL.md` |
| 7 | |
| 8 | Keep local `references/...` paths for files that ship with the current skill directory. When this file points to a sibling skill such as `auth-tool` or `web-development`, use the standalone fallback URL shown next to that reference. |
| 9 | |
| 10 | # Spec Workflow |
| 11 | |
| 12 | ## Activation Contract |
| 13 | |
| 14 | ### Use this first when |
| 15 | |
| 16 | - The request is a new feature, multi-step product change, cross-module integration, or architecture/design task. |
| 17 | - Acceptance criteria are unclear and need to be made explicit before implementation. |
| 18 | - The work involves multiple files, user flows, database design, or UI design that needs staged confirmation. |
| 19 | |
| 20 | ### Read before writing code if |
| 21 | |
| 22 | - You are unsure whether the task should go straight to coding or should first go through requirements, design, and task planning. |
| 23 | - The request mentions a new page, a new system, a redesign, a workflow, or a multi-module refactor. |
| 24 | |
| 25 | ### Then also read |
| 26 | |
| 27 | - Frontend page or visual design work -> `../ui-design/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/ui-design/SKILL.md`) |
| 28 | - Advanced data-model work -> `../data-model-creation/SKILL.md` (standalone fallback: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/data-model-creation/SKILL.md`) |
| 29 | |
| 30 | ### Do NOT use for |
| 31 | |
| 32 | - Small bug fixes with clear scope. |
| 33 | - One-file documentation updates. |
| 34 | - Straightforward config changes. |
| 35 | - Tiny refactors where the user already gave exact implementation instructions. |
| 36 | |
| 37 | ### Common mistakes / gotchas |
| 38 | |
| 39 | - Jumping into coding before acceptance criteria are explicit. |
| 40 | - Skipping user confirmation between requirements, design, and tasks. |
| 41 | - Writing vague tasks that do not map back to user-visible outcomes. |
| 42 | - Treating UI work as purely technical implementation without clarifying design intent. |
| 43 | |
| 44 | ### Minimal checklist |
| 45 | |
| 46 | - Decide whether the change really needs the full spec flow. |
| 47 | - If yes, stop and produce requirements first. |
| 48 | - If the change is small, low-risk, and acceptance is already clear, allow direct execution without forcing spec artifacts. |
| 49 | - Use EARS-style acceptance criteria. |
| 50 | - Get confirmation before moving to the next phase. |
| 51 | |
| 52 | ## When to use this skill |
| 53 | |
| 54 | Use this workflow for structured development when you need to: |
| 55 | |
| 56 | - Define or refine a new feature |
| 57 | - Design complex architecture |
| 58 | - Coordinate changes across modules |
| 59 | - Plan database or UI-heavy work |
| 60 | - Improve requirement quality and acceptance boundaries |
| 61 | |
| 62 | ## Decision rule |
| 63 | |
| 64 | ### Use the full workflow when |
| 65 | |
| 66 | - The task is medium or large |
| 67 | - The impact spans multiple modules |
| 68 | - Acceptance boundaries are fuzzy |
| 69 | - The user wants disciplined planning before implementation |
| 70 | |
| 71 | ### Skip the full workflow when |
| 72 | |
| 73 | - The task is small, low-risk, and already precise |
| 74 | - Goal, scope, and acceptance are already clear enough to execute directly |
| 75 | - The user explicitly wants a direct code change with no planning phase |
| 76 | |
| 77 | ## Core workflow |
| 78 | |
| 79 | ### Phase 1: Requirements |
| 80 | |
| 81 | Create `specs/<spec_name>/requirements.md`. |
| 82 | |
| 83 | What to do: |
| 84 | |
| 85 | - Restate the problem and scope |
| 86 | - Write user stories |
| 87 | - Write acceptance criteria in EARS style |
| 88 | - Clarify business rules, constraints, and non-goals |
| 89 | |
| 90 | EARS pattern: |
| 91 | |
| 92 | ```text |
| 93 | While <optional precondition>, when <optional trigger>, the <system name> shall <system response> |
| 94 | ``` |
| 95 | |
| 96 | Example: |
| 97 | |
| 98 | ```text |
| 99 | When the user submits the form, the booking system shall validate required fields before creating the record. |
| 100 | ``` |
| 101 | |
| 102 | ### Phase 2: Design |
| 103 | |
| 104 | Create `specs/<spec_name>/design.md`. |
| 105 | |
| 106 | What to do: |
| 107 | |
| 108 | - Describe architecture and module boundaries |
| 109 | - Explain technology choices and trade-offs |
| 110 | - Define data model, API, security, and testing strategy as needed |
| 111 | - Use Mermaid only when a diagram materially improves clarity |
| 112 | |
| 113 | ### Phase 3: Tasks |
| 114 | |
| 115 | Create `specs/<spec_name>/tasks.md`. |
| 116 | |
| 117 | What to do: |
| 118 | |
| 119 | - Break the design into executable tasks |
| 120 | - Keep tasks specific and reviewable |
| 121 | - Link each task back to the relevant requirement |
| 122 | - Update task status as work progresses |
| 123 | |
| 124 | Task format: |
| 125 | |
| 126 | ```markdown |
| 127 | # Implementation Plan |
| 128 | |
| 129 | - [ ] 1. Task title |
| 130 | - Specific work item |
| 131 | - Another concrete step |
| 132 | - _Requirement: 1 |
| 133 | ``` |
| 134 | |
| 135 | ### Phase 4: Execution |
| 136 | |
| 137 | Only start implementation after the user confirms the task plan. |
| 138 | |
| 139 | During execution: |
| 140 | |
| 141 | - Keep task sta |