ai-workflow-init 3.2.3 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/commands/check-implementation.md +127 -15
- package/.cursor/commands/code-review.md +164 -58
- package/.cursor/commands/create-plan.md +163 -66
- package/.cursor/commands/execute-plan.md +143 -33
- package/.cursor/commands/generate-standards.md +109 -51
- package/.cursor/commands/init-chat.md +5 -0
- package/.cursor/commands/writing-test.md +94 -163
- package/AGENTS.md +118 -18
- package/cli.js +12 -3
- package/docs/ai/planning/feature-template.md +10 -3
- package/docs/ai/requirements/req-template.md +137 -0
- package/package.json +1 -1
|
@@ -13,61 +13,146 @@ Generate a single planning doc at `docs/ai/planning/feature-{name}.md` using the
|
|
|
13
13
|
- For medium/large tasks, create todos (≤14 words, verb-led). Keep only one `in_progress` item.
|
|
14
14
|
- Update todos immediately after progress; mark completed upon finish.
|
|
15
15
|
|
|
16
|
-
## Step 1:
|
|
16
|
+
## Step 1: Analyze User Prompt
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
**Parse user request to identify:**
|
|
19
|
+
- **Feature type:** UI/Page, API/Service, Data/Database, Full-stack, Other
|
|
20
|
+
- **Explicit requirements:** Framework, libraries, constraints mentioned
|
|
21
|
+
- **Design context:**
|
|
22
|
+
- Has Figma URL/mention? → Flag for Step 4
|
|
23
|
+
- Has design description/screenshot? → Skip Steps 4-5
|
|
24
|
+
- No design source? → Flag for Step 5 (theme selection)
|
|
25
|
+
- **Scope hints:** MVP mentions, deadlines, specific exclusions
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
**Design Source Priority** (if multiple sources detected):
|
|
28
|
+
1. **Figma URL** (highest priority) → Extract from Figma MCP (Step 4)
|
|
29
|
+
2. **Screenshot/Image** → Use as visual reference, skip Figma extraction
|
|
30
|
+
3. **Design description** → Use as text reference, skip Figma extraction
|
|
31
|
+
4. **Multiple sources** → Ask user which to prioritize by asking user:
|
|
32
|
+
- Example: "You provided both Figma URL and screenshots. Which should I use as primary design source?"
|
|
33
|
+
- Options: "Figma design (extract full specs)", "Screenshots (visual reference only)", "Combine both"
|
|
21
34
|
|
|
22
|
-
|
|
23
|
-
- Ask only what is missing to produce Goal, Tasks, Risks, and DoD. Keep to 3–7 questions.
|
|
24
|
-
- Do not re-ask what the user already stated; if ambiguous, confirm briefly (yes/no or single choice).
|
|
25
|
-
- Keep each question short and single-purpose; avoid multi-part questions.
|
|
26
|
-
- Answers may be a/b/c or free text; the agent is not required to present fixed option lists.
|
|
35
|
+
**Output:** Internal classification to make Step 2 (Q&A) adaptive.
|
|
27
36
|
|
|
28
|
-
|
|
37
|
+
**Purpose:** Understand what user provided → Ask only what's missing in Step 2.
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
- Under each question, provide 2–4 suggested options labeled with lowercase letters + ")" (e.g., "a)", "b)").
|
|
32
|
-
- Keep options short (≤7 words) and add an "other" when useful.
|
|
33
|
-
- Example:
|
|
34
|
-
1. UI library?
|
|
35
|
-
a) TailwindCSS b) Bootstrap c) SCSS d) Other
|
|
39
|
+
## Step 2: Clarify Scope (Adaptive Q&A)
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
**Purpose:** Generate short Q&A (3-7 questions) to clarify scope. Ask only what's missing for Goal/Tasks/Risks/DoD.
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
2. In-scope vs Out-of-scope: what is included and excluded (e.g., MVP, no i18n, no payments).
|
|
41
|
-
3. Acceptance Criteria (GWT): 2–3 key Given–When–Then scenarios.
|
|
42
|
-
4. Constraints & Dependencies: technical constraints, libraries, real API vs mock, deadlines, external deps.
|
|
43
|
-
5. Risks & Assumptions: known risks and key assumptions.
|
|
44
|
-
6. Tasks Overview: 3–7 high-level work items.
|
|
45
|
-
7. Definition of Done: completion criteria (build/test/docs/review).
|
|
43
|
+
**Tool:** ask user for clarification
|
|
46
44
|
|
|
47
|
-
|
|
45
|
+
**Q&A Strategy** (based on Step 1 classification):
|
|
46
|
+
- **If feature type clear:** Skip feature type question
|
|
47
|
+
- **If design source detected:** Skip design-related questions
|
|
48
|
+
- **If tech stack mentioned:** Skip framework questions
|
|
49
|
+
- Prioritize scope/acceptance criteria over implementation details
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
51
|
+
**Core Scope Questions** (ask only missing items):
|
|
52
|
+
1. **Problem & Users:** What problem does this solve? Who uses it?
|
|
53
|
+
2. **In-scope vs Out-of-scope:** What's included/excluded? (MVP features, no i18n, etc.)
|
|
54
|
+
3. **Acceptance Criteria:** 2-3 Given-When-Then scenarios
|
|
55
|
+
4. **Constraints:** Tech stack, libraries, APIs (real/mock), deadlines
|
|
56
|
+
5. **Risks & Assumptions:** Known blockers or assumptions
|
|
57
|
+
6. **Tasks:** 3-7 high-level work items
|
|
58
|
+
7. **Definition of Done:** Build/test/review/docs criteria
|
|
52
59
|
|
|
53
|
-
|
|
60
|
+
**Q&A Format:** Use ask user with 2-4 options per question.
|
|
61
|
+
- Example: "1. UI library? a) TailwindCSS b) Bootstrap c) Other"
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
- Definition of Done (build/test/review/docs)
|
|
63
|
+
**Collect after Q&A:**
|
|
64
|
+
- Feature name (kebab-case) - Ask if not derivable from prompt
|
|
65
|
+
- Goal, scope, tasks, DoD
|
|
59
66
|
|
|
60
|
-
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Step 3: Research Codebase
|
|
71
|
+
|
|
72
|
+
**Purpose:** Understand existing patterns to ensure plan follows project standards and reuses existing features.
|
|
73
|
+
|
|
74
|
+
**Automated process:**
|
|
75
|
+
- Use workspace search and analysis to accomplish this task
|
|
76
|
+
|
|
77
|
+
**What to explore** (based on feature type from Step 1):
|
|
78
|
+
- **UI/Page:** Component patterns, styling approach, state management
|
|
79
|
+
- **API/Service:** Endpoint patterns, middleware, validation, error handling
|
|
80
|
+
- **Data:** Schema patterns, migration structure, model definitions
|
|
81
|
+
- **Full-stack:** Both frontend and backend patterns
|
|
82
|
+
|
|
83
|
+
**Exploration output** (concise summary, focus on actionable findings):
|
|
84
|
+
- Similar features: [2-3 implementations]
|
|
85
|
+
- Reusable components/utils: [key files]
|
|
86
|
+
- Patterns to follow: [architecture patterns]
|
|
87
|
+
- Files to reference: [key file paths]
|
|
88
|
+
|
|
89
|
+
**Skip exploration if:**
|
|
90
|
+
- New project (no similar patterns exist)
|
|
91
|
+
- User says "fresh start"
|
|
92
|
+
|
|
93
|
+
## Step 4: Extract Figma Design (Optional)
|
|
94
|
+
|
|
95
|
+
**Trigger:** User mentions "figma", "design file", "mockup", or provides Figma URL (detected in Step 1).
|
|
96
|
+
|
|
97
|
+
**Follow step by step in `.claude/skills/design/figma-extraction/SKILL.md`:**
|
|
98
|
+
- Validate Figma MCP connection
|
|
99
|
+
- Extract design tokens (colors, typography, spacing, shadows, border radius)
|
|
100
|
+
- Extract component specs (states, variants, dimensions, hierarchies)
|
|
101
|
+
- Extract responsive breakpoints (mobile/tablet/desktop)
|
|
102
|
+
- Document extraction in planning doc format
|
|
103
|
+
|
|
104
|
+
**Expected output:** "Design Specifications" section in planning doc with:
|
|
105
|
+
- Reference (file name, frame, link, timestamp)
|
|
106
|
+
- Design Tokens (complete palette, typography scale, spacing scale)
|
|
107
|
+
- Component Breakdown (all components with detailed specs)
|
|
108
|
+
- Responsive Specs (breakpoints and layout changes)
|
|
109
|
+
|
|
110
|
+
**If extraction fails:**
|
|
111
|
+
- Figma MCP not connected: Ask user to configure MCP or provide design description
|
|
112
|
+
- Extraction fails: Ask user for alternative design source (screenshot, description)
|
|
113
|
+
- Continue to Step 5 for theme selection if needed
|
|
114
|
+
|
|
115
|
+
**Skip this step if:** No Figma URL/mention detected in Step 1.
|
|
116
|
+
|
|
117
|
+
## Step 5: Design System & Theme (Optional)
|
|
118
|
+
|
|
119
|
+
**Trigger:** Step 4 skipped (no Figma) AND user has NOT provided detailed design description/screenshot.
|
|
120
|
+
|
|
121
|
+
**Follow design guidelines in `.claude/skills/design/` to guide design decisions:**
|
|
122
|
+
- Design fundamentals (`.claude/skills/design/fundamentals/SKILL.md`): Core principles (spacing, typography, color, hierarchy)
|
|
123
|
+
- Theme selection (`.claude/skills/design/theme-factory/SKILL.md`): Interactive theme selection based on brand personality
|
|
124
|
+
- Responsive design (`.claude/skills/design/responsive/SKILL.md`): Mobile-first responsive patterns and breakpoints
|
|
125
|
+
|
|
126
|
+
**Expected workflow:**
|
|
127
|
+
1. Ask about brand personality/preferences if needed
|
|
128
|
+
2. Choose aesthetic direction (minimal, bold, elegant, etc.)
|
|
129
|
+
3. Propose complete design system (colors, fonts, spacing)
|
|
130
|
+
4. Consider responsive strategy (mobile-first for target devices)
|
|
131
|
+
5. Document theme/design specs in planning doc
|
|
61
132
|
|
|
62
|
-
**
|
|
133
|
+
**Expected output:** "Design System" or "Theme Specification" section in planning doc.
|
|
63
134
|
|
|
64
|
-
|
|
135
|
+
**Skip this step if:** User provided design description/screenshot in Step 1.
|
|
136
|
+
|
|
137
|
+
## Step 6: Load Template
|
|
138
|
+
|
|
139
|
+
**Tool:** read `docs/ai/planning/feature-template.md`
|
|
140
|
+
|
|
141
|
+
- Validate template contains required sections: Goal, Implementation Plan, DoD
|
|
142
|
+
- If template not found: Use fallback minimal structure (Goal → Tasks → DoD)
|
|
65
143
|
|
|
66
144
|
This template defines the required structure and format. Use it as the baseline for creating the planning doc.
|
|
67
145
|
|
|
68
|
-
## Step
|
|
146
|
+
## Step 7: Draft the Plan (Auto-generate)
|
|
69
147
|
|
|
70
|
-
Using
|
|
148
|
+
**Using inputs from:**
|
|
149
|
+
- Step 2: Scope, acceptance criteria, tasks, DoD
|
|
150
|
+
- Step 3: Codebase patterns (if done)
|
|
151
|
+
- Step 4: Figma design specs (if done)
|
|
152
|
+
- Step 5: Theme specification (if done)
|
|
153
|
+
- Step 6: Template structure
|
|
154
|
+
|
|
155
|
+
**Generate immediately without asking for confirmation.**
|
|
71
156
|
|
|
72
157
|
Auto-name feature:
|
|
73
158
|
|
|
@@ -77,15 +162,39 @@ Auto-name feature:
|
|
|
77
162
|
|
|
78
163
|
### Generate Single Planning Doc
|
|
79
164
|
|
|
80
|
-
Produce a Markdown doc following `docs/ai/planning/feature-template.md
|
|
165
|
+
Produce a Markdown doc following `docs/ai/planning/feature-template.md`.
|
|
166
|
+
|
|
167
|
+
**Include these sections** (in suggested order):
|
|
168
|
+
|
|
169
|
+
1. **Codebase Context** (if exploration was done):
|
|
170
|
+
- Similar features found
|
|
171
|
+
- Reusable components/utils to use
|
|
172
|
+
- Architectural patterns to follow
|
|
173
|
+
- Key files to reference
|
|
174
|
+
|
|
175
|
+
2. **Design Specifications** (if Figma extraction was done):
|
|
176
|
+
- Complete Figma design specs from Step 4
|
|
177
|
+
- Design tokens, component breakdown, responsive specs
|
|
178
|
+
|
|
179
|
+
**OR**
|
|
180
|
+
|
|
181
|
+
**Theme Specification** (if theme selection was done):
|
|
182
|
+
- Theme name and source file
|
|
183
|
+
- Color palette (primary, neutral, semantic)
|
|
184
|
+
- Typography (fonts, scale)
|
|
185
|
+
- Spacing scale and visual style
|
|
81
186
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
187
|
+
3. **Goal & Acceptance Criteria**: Brief goal + Given-When-Then scenarios
|
|
188
|
+
|
|
189
|
+
4. **Risks & Assumptions**: Known risks and key assumptions
|
|
190
|
+
|
|
191
|
+
5. **Definition of Done**: Build/test/review/docs checklist
|
|
192
|
+
|
|
193
|
+
6. **Implementation Plan**:
|
|
86
194
|
- Summary: Brief description of solution approach (1-3 sentences)
|
|
87
195
|
- Phases: Detailed tasks with pseudo-code
|
|
88
|
-
|
|
196
|
+
|
|
197
|
+
7. **Follow-ups**: TODOs or deferred work
|
|
89
198
|
|
|
90
199
|
**Estimate phase scope**:
|
|
91
200
|
- Count total tasks from Q&A
|
|
@@ -93,40 +202,28 @@ Produce a Markdown doc following `docs/ai/planning/feature-template.md` with all
|
|
|
93
202
|
- If tasks 6–12: suggest 2–3 phases (group by feature area or dependency order)
|
|
94
203
|
- If tasks > 12: suggest 3–5 phases; prioritize logical grouping
|
|
95
204
|
|
|
96
|
-
**For each phase
|
|
97
|
-
- Phase name (
|
|
205
|
+
**For each phase:**
|
|
206
|
+
- Phase name: Descriptive (e.g., "API Endpoints", "UI Components")
|
|
98
207
|
- Tasks list: `[ ] [ACTION] path/to/file — Summary`
|
|
99
|
-
- Pseudo-code
|
|
208
|
+
- Pseudo-code: 3-5 lines, natural language, show inputs → logic → outputs
|
|
100
209
|
```
|
|
101
|
-
|
|
102
|
-
- [Step 1]: what will be done
|
|
103
|
-
- [Step 2]: validation or check
|
|
104
|
-
- [Step 3]: data storage/return
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
**Pseudo-code guidelines**:
|
|
108
|
-
- Keep to 3–5 lines per task
|
|
109
|
-
- Show inputs, key logic, outputs
|
|
110
|
-
- Use natural language, not actual syntax
|
|
111
|
-
- Example for "Create user endpoint":
|
|
112
|
-
```
|
|
113
|
-
Pseudo-code:
|
|
210
|
+
Example:
|
|
114
211
|
- Parse username + password from request
|
|
115
|
-
- Validate password strength
|
|
116
|
-
-
|
|
117
|
-
- Store user in database
|
|
118
|
-
- Return success + user ID
|
|
212
|
+
- Validate password strength → Hash with bcrypt
|
|
213
|
+
- Store user in database → Return success + user ID
|
|
119
214
|
```
|
|
120
215
|
|
|
121
216
|
Create the file automatically:
|
|
122
217
|
|
|
123
218
|
- `docs/ai/planning/feature-{name}.md` - Use complete structure from `feature-template.md`
|
|
124
219
|
|
|
125
|
-
Notify
|
|
220
|
+
**Notify user:** "Created plan with X phases: [Phase 1], [Phase 2], ..."
|
|
221
|
+
|
|
222
|
+
## Step 8: Next Actions
|
|
126
223
|
|
|
127
|
-
|
|
224
|
+
Suggest: `/execute-plan` to begin implementation.
|
|
128
225
|
|
|
129
|
-
|
|
226
|
+
Implementation will be driven from `docs/ai/planning/feature-{name}.md`.
|
|
130
227
|
|
|
131
228
|
Note: Test documentation will be created separately using the `writing-test` command.
|
|
132
229
|
|
|
@@ -19,13 +19,79 @@ Execute the feature plan by implementing tasks from the planning doc and updatin
|
|
|
19
19
|
- Feature name (kebab-case, e.g., `user-authentication`)
|
|
20
20
|
- Planning doc exists: `docs/ai/planning/feature-{name}.md`
|
|
21
21
|
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
|
|
22
25
|
## Step 1: Gather Context
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
+
**Tools:**
|
|
28
|
+
- ask user for clarification if feature name not provided
|
|
29
|
+
- read `docs/ai/planning/feature-{name}.md`
|
|
30
|
+
- read `docs/ai/planning/feature-template.md`
|
|
31
|
+
- read `docs/ai/project/CODE_CONVENTIONS.md`
|
|
32
|
+
- read `docs/ai/project/PROJECT_STRUCTURE.md`
|
|
33
|
+
|
|
34
|
+
**Process:**
|
|
35
|
+
- Ask for feature name if not provided (must be kebab-case)
|
|
36
|
+
- Load planning doc: `docs/ai/planning/feature-{name}.md`
|
|
37
|
+
- Load template: `docs/ai/planning/feature-template.md` to understand required structure
|
|
38
|
+
|
|
39
|
+
**Error handling:**
|
|
40
|
+
- Planning doc not found: Cannot proceed, notify user and exit
|
|
41
|
+
- Template not found: Continue without template structure validation
|
|
42
|
+
- Standards docs not found: Warn user, proceed without standards guidance
|
|
43
|
+
|
|
44
|
+
### 1a: Load Project Standards
|
|
45
|
+
|
|
46
|
+
**Read and extract relevant sections** (keep summaries, not full content):
|
|
47
|
+
|
|
48
|
+
1. **CODE_CONVENTIONS.md** (`docs/ai/project/CODE_CONVENTIONS.md`):
|
|
49
|
+
- Identify sections relevant to this feature type (e.g., frontend conventions for UI features)
|
|
50
|
+
- Extract key rules: naming patterns, file organization, code structure
|
|
51
|
+
- Keep concise summary of applicable rules
|
|
52
|
+
|
|
53
|
+
2. **PROJECT_STRUCTURE.md** (`docs/ai/project/PROJECT_STRUCTURE.md`):
|
|
54
|
+
- Understand project architecture
|
|
55
|
+
- Identify where new files should go
|
|
56
|
+
- Note existing patterns to follow
|
|
57
|
+
|
|
58
|
+
**Purpose**: These standards will guide implementation quality. Refresh this context at each phase boundary to prevent quality degradation in long plans.
|
|
59
|
+
|
|
60
|
+
### 1b: Load Design/Theme Specifications (If Exists)
|
|
61
|
+
|
|
62
|
+
**Check planning doc for design section**:
|
|
63
|
+
|
|
64
|
+
**If "Design Specifications" exists** (Figma extraction):
|
|
65
|
+
- Extract complete design specs into memory
|
|
66
|
+
- Design tokens, component breakdown, responsive specs
|
|
67
|
+
- **Note**: DO NOT fetch from Figma MCP again
|
|
68
|
+
|
|
69
|
+
**If "Theme Specification" exists** (Theme selection):
|
|
70
|
+
- Load theme details from planning doc
|
|
71
|
+
- Extract: color palette, typography, spacing, visual style
|
|
72
|
+
|
|
73
|
+
**Priority** (if multiple design sources exist):
|
|
74
|
+
1. **Use Figma Design Specifications** (highest fidelity) - ignore Theme if Figma exists
|
|
75
|
+
2. **Use Theme Specification** only if no Figma design
|
|
76
|
+
3. **No design constraints** if neither exists
|
|
77
|
+
|
|
78
|
+
If both Figma and Theme sections exist, use ONLY Figma and ignore Theme completely.
|
|
79
|
+
|
|
80
|
+
**Purpose**: Implementation must match these exact specifications for consistency.
|
|
81
|
+
|
|
82
|
+
### 1c: Load Codebase Context (If Exists)
|
|
83
|
+
|
|
84
|
+
**Check planning doc for "Codebase Context" section**:
|
|
85
|
+
|
|
86
|
+
If exists (exploration was done):
|
|
87
|
+
- Similar features to reference
|
|
88
|
+
- Reusable components/utils
|
|
89
|
+
- Architectural patterns to follow
|
|
90
|
+
- Key files to study
|
|
91
|
+
|
|
92
|
+
**Purpose**: Follow existing patterns for consistency.
|
|
27
93
|
|
|
28
|
-
###
|
|
94
|
+
### 1d: Phase Progress Detection
|
|
29
95
|
|
|
30
96
|
If planning doc exists, scan for phase markers (`### Phase X:`):
|
|
31
97
|
|
|
@@ -49,7 +115,7 @@ If no phases detected (old format):
|
|
|
49
115
|
|
|
50
116
|
## Step 2: Build Task Queue
|
|
51
117
|
|
|
52
|
-
- Parse tasks (checkboxes `[ ]`, `[x]`) from **current phase only** (from phase detection in Step
|
|
118
|
+
- Parse tasks (checkboxes `[ ]`, `[x]`) from **current phase only** (from phase detection in Step 1d):
|
|
53
119
|
- Primary source: Tasks under `### Phase X:` with `[ ] [ACTION] ...` entries (incomplete only).
|
|
54
120
|
- For `[MODIFIED]` files, parse sub-bullets representing distinct logic items with line ranges.
|
|
55
121
|
- **Skip completed phases** entirely (do not re-execute)
|
|
@@ -60,48 +126,53 @@ Note: Do not include Follow-ups section unless explicitly in current phase.
|
|
|
60
126
|
|
|
61
127
|
## Step 3: Implement Iteratively (per task)
|
|
62
128
|
|
|
129
|
+
**Tools:**
|
|
130
|
+
- Read(file_path=...) to check existing files
|
|
131
|
+
- Write(file_path=..., content=...) for new files
|
|
132
|
+
- Edit(file_path=..., old_string=..., new_string=...) for modifications
|
|
133
|
+
- edit `docs/ai/planning/feature-{name}.md` to update checkboxes
|
|
134
|
+
|
|
135
|
+
**At Phase Boundary** (when starting new phase):
|
|
136
|
+
|
|
137
|
+
Refresh context to prevent quality degradation (see Notes for template format):
|
|
138
|
+
- Remind code standards from CODE_CONVENTIONS.md
|
|
139
|
+
- Remind design/theme specs if applicable
|
|
140
|
+
- Remind codebase patterns to follow
|
|
141
|
+
|
|
142
|
+
This reminder keeps standards visible during long implementations.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
63
146
|
For each task in queue:
|
|
64
147
|
|
|
65
148
|
1. **Status update**: Brief note (1–3 sentences) on what will be done.
|
|
66
149
|
2. Plan minimal change set:
|
|
67
150
|
- Identify files/regions to modify
|
|
68
151
|
- Map changes to acceptance criteria from plan (reference if needed)
|
|
152
|
+
- **If design/theme specs exist**: Verify implementation matches colors, spacing, typography
|
|
153
|
+
- **Follow CODE_CONVENTIONS**: Apply naming patterns, file organization rules
|
|
69
154
|
3. Implement changes:
|
|
70
155
|
- Write/edit code according to the planning doc entries (`[ACTION]` items)
|
|
156
|
+
- **Apply design/theme specifications** (if exists): Use exact values from design specs (colors, spacing, typography, etc.)
|
|
157
|
+
- **Follow codebase patterns** (if exists): Match existing implementation style
|
|
71
158
|
- Keep changes minimal and incremental
|
|
72
159
|
- Avoid speculative changes beyond implementation scope
|
|
73
|
-
4.
|
|
74
|
-
- Run build/compile if available
|
|
75
|
-
- Run fast unit/smoke tests if available
|
|
76
|
-
- Fix immediate issues before proceeding
|
|
77
|
-
5. Persist notes to planning doc:
|
|
160
|
+
4. Persist notes to planning doc:
|
|
78
161
|
- File: `docs/ai/planning/feature-{name}.md`
|
|
79
162
|
- Update the relevant `[ ]` entry to `[x]` when completed
|
|
80
163
|
- For `MODIFIED` files with sub-bullets, mark each completed sub-bullet `[x]`
|
|
81
164
|
- Include line ranges and concise summaries as per template
|
|
82
|
-
|
|
165
|
+
5. Update planning doc:
|
|
83
166
|
- Mark completed tasks `[x]` with brief notes
|
|
84
167
|
- Mark blocked tasks with reason
|
|
85
168
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
- Linting on changed files (prefer non-interactive):
|
|
92
|
-
- JavaScript/TypeScript: `npx eslint .` or `pnpm eslint .` (add `--max-warnings=0` if desired)
|
|
93
|
-
- Python: `ruff .` or `flake8 .`
|
|
94
|
-
- Go: `golangci-lint run` or `go vet ./...`
|
|
95
|
-
- Rust: `cargo clippy -- -D warnings`
|
|
96
|
-
- Java: `./gradlew check` or `mvn -q -DskipTests=false -Dspotbugs.failOnError=true verify`
|
|
97
|
-
- Scope to changed files when possible for speed
|
|
98
|
-
- Type checks (non-emitting where applicable):
|
|
99
|
-
- TypeScript: `npx tsc --noEmit`
|
|
100
|
-
- Python: `mypy .` (if configured) or `pyright` if present
|
|
101
|
-
- Go/Rust/Java: rely on compiler/type system via build step
|
|
102
|
-
- Parallelize lint and type-check when safe; fix issues (up to 3 attempts) before proceeding.
|
|
169
|
+
**Error handling:**
|
|
170
|
+
- File write/edit fails: Retry once, then notify user
|
|
171
|
+
- Design specs reference missing value: Use fallback or ask user
|
|
172
|
+
- Cannot parse task description: Skip task, flag for manual review
|
|
173
|
+
- Code generation uncertain: Ask user for clarification before implementing
|
|
103
174
|
|
|
104
|
-
## Step
|
|
175
|
+
## Step 4: Phase Completion Check
|
|
105
176
|
|
|
106
177
|
After completing all tasks in current phase:
|
|
107
178
|
|
|
@@ -113,13 +184,26 @@ After completing all tasks in current phase:
|
|
|
113
184
|
Ready for Phase 3 (Frontend)?
|
|
114
185
|
Run: /execute-plan
|
|
115
186
|
```
|
|
116
|
-
- If
|
|
187
|
+
- If all phases are complete:
|
|
117
188
|
```
|
|
118
189
|
✓ All phases complete!
|
|
119
|
-
|
|
120
|
-
Run: /code-review
|
|
190
|
+
Running quality checks now...
|
|
121
191
|
```
|
|
122
192
|
|
|
193
|
+
## Step 5: Final Quality Checks (After All Phases Complete)
|
|
194
|
+
|
|
195
|
+
Only run after ALL phases are marked complete. If incomplete phases remain, skip to Step 6.
|
|
196
|
+
|
|
197
|
+
**Follow step by step in `.claude/skills/quality/code-check/SKILL.md` for automated validation:**
|
|
198
|
+
- **Linting**: Code style and best practices validation
|
|
199
|
+
- **Type Checking**: Type safety verification across modules
|
|
200
|
+
- **Build Verification**: Ensure code compiles and bundles successfully
|
|
201
|
+
|
|
202
|
+
**Error handling:**
|
|
203
|
+
- Quality checks fail: Fix issues and retry until checks pass
|
|
204
|
+
- Persistent failures: Document issues, proceed with caution
|
|
205
|
+
- See Notes section for manual commands if needed
|
|
206
|
+
|
|
123
207
|
## Step 6: Next Actions
|
|
124
208
|
|
|
125
209
|
After all phases complete:
|
|
@@ -130,12 +214,38 @@ After all phases complete:
|
|
|
130
214
|
|
|
131
215
|
If phases remain:
|
|
132
216
|
|
|
133
|
-
- User runs `/execute-plan` again; Phase detection (Step
|
|
217
|
+
- User runs `/execute-plan` again; Phase detection (Step 1d) will resume correctly
|
|
134
218
|
|
|
135
219
|
## Notes
|
|
136
220
|
|
|
221
|
+
### General Guidelines
|
|
222
|
+
|
|
137
223
|
- Keep code changes minimal and focused on planning tasks
|
|
138
224
|
- Document all changes by updating checkboxes in the planning doc
|
|
139
225
|
- Avoid implementing features not in the planning doc scope
|
|
140
226
|
- Modifies source code per planning scope; updates `docs/ai/planning/feature-{name}.md`. Does not modify unrelated files.
|
|
141
227
|
- Idempotent: safe to re-run; updates checkboxes deterministically.
|
|
228
|
+
|
|
229
|
+
### Context Refresh Template (Step 3 - Phase Boundary)
|
|
230
|
+
|
|
231
|
+
When starting a new phase, remind agent of key context:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
Phase X: [Phase Name]
|
|
235
|
+
|
|
236
|
+
Code Standards Reminder:
|
|
237
|
+
- [Key convention 1 from CODE_CONVENTIONS.md]
|
|
238
|
+
- [Key convention 2 from CODE_CONVENTIONS.md]
|
|
239
|
+
- [Key pattern from PROJECT_STRUCTURE.md]
|
|
240
|
+
|
|
241
|
+
Design/Theme Active: [Yes/No]
|
|
242
|
+
- Colors: [primary colors if applicable]
|
|
243
|
+
- Typography: [font families if applicable]
|
|
244
|
+
- Spacing: [scale values if applicable]
|
|
245
|
+
|
|
246
|
+
Codebase Patterns:
|
|
247
|
+
- Reference: [similar feature files]
|
|
248
|
+
- Reuse: [components/utils to use]
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
This reminder keeps standards visible during long implementations and prevents quality degradation.
|