ai-workflow-init 2.0.0 → 3.1.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/CLAUDE.md +114 -0
- package/.cursor/commands/check-implementation.md +31 -22
- package/.cursor/commands/create-plan.md +136 -132
- package/.cursor/commands/execute-plan.md +141 -156
- package/.cursor/commands/modify-plan.md +48 -30
- package/cli.js +32 -2
- package/docs/ai/planning/README.md +27 -12
- package/docs/ai/planning/feature-template.md +58 -19
- package/package.json +1 -1
- package/docs/ai/implementation/README.md +0 -51
- package/docs/ai/implementation/feature-template.md +0 -53
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# AI Agent Workflow Standards
|
|
2
|
+
|
|
3
|
+
## Core Coding Philosophy
|
|
4
|
+
|
|
5
|
+
Apply these principles when providing solutions, generating code, or making technical decisions:
|
|
6
|
+
|
|
7
|
+
### 1. Simplicity First
|
|
8
|
+
- Choose the simplest solution that meets requirements
|
|
9
|
+
- Avoid over-engineering and unnecessary abstractions
|
|
10
|
+
- Simple code = fewer bugs, easier to maintain, easier to understand
|
|
11
|
+
- Ask: "Can this be done more simply while still working?"
|
|
12
|
+
- Complexity is a last resort, not a first choice
|
|
13
|
+
|
|
14
|
+
### 2. Deep Understanding
|
|
15
|
+
- Understand requirements fully before planning or coding
|
|
16
|
+
- If unclear about requirement, flow, edge cases, or expected behavior → Ask the user
|
|
17
|
+
- Never assume or guess - clarification prevents wasted effort
|
|
18
|
+
- Ask questions like:
|
|
19
|
+
- "What should happen when X occurs?"
|
|
20
|
+
- "How should the system behave if Y fails?"
|
|
21
|
+
- "Is this the expected flow: A → B → C?"
|
|
22
|
+
|
|
23
|
+
### 3. Multiple Options
|
|
24
|
+
- Provide 2-5 solution options for each problem when appropriate
|
|
25
|
+
- Present trade-offs clearly: pros/cons, complexity, performance, maintainability
|
|
26
|
+
- Format: "Option 1: [approach] - Pros: [...] Cons: [...]"
|
|
27
|
+
- Let user choose based on their context and priorities
|
|
28
|
+
- Not every problem has one "best" solution
|
|
29
|
+
|
|
30
|
+
### 4. Think Ahead
|
|
31
|
+
- While keeping solutions simple, consider future implications:
|
|
32
|
+
- How will this scale with more data/users?
|
|
33
|
+
- What if requirements change slightly?
|
|
34
|
+
- Are there security vulnerabilities?
|
|
35
|
+
- What are performance bottlenecks?
|
|
36
|
+
- Balance: Simple now + adaptable for reasonable future needs
|
|
37
|
+
- Do not build for hypothetical futures, but be aware of likely changes
|
|
38
|
+
|
|
39
|
+
**Philosophy in practice:**
|
|
40
|
+
- Simplicity: Use built-in array methods instead of custom loop logic
|
|
41
|
+
- Deep Understanding: "Should this API return 404 or 400 for invalid IDs?"
|
|
42
|
+
- Multiple Options: "We can use: 1) localStorage (simple), 2) IndexedDB (scalable), or 3) Backend API (persistent)"
|
|
43
|
+
- Think Ahead: "This works for 100 items, but consider pagination for 10,000+"
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Core Workflow: Plan → Implement → Test → Review
|
|
48
|
+
|
|
49
|
+
### Workflow Alignment
|
|
50
|
+
- **Plan:** Create feature planning doc at `docs/ai/planning/feature-{name}.md` before coding. Do not start until planning exists and is agreed.
|
|
51
|
+
- **Implement:** Provide 1-3 sentence status updates before operations. Use file editing tools, not copy-paste. Update checkboxes `[ ]` → `[x]` in planning doc.
|
|
52
|
+
- **Test:** Run linter/type-check/build on changed files after each batch. Auto-fix issues (up to 3 attempts) before asking for help.
|
|
53
|
+
- **Review:** When complete, validate against planning doc acceptance criteria and CODE_CONVENTIONS.md.
|
|
54
|
+
|
|
55
|
+
## File Structure
|
|
56
|
+
|
|
57
|
+
### Planning Documents
|
|
58
|
+
- Location: `docs/ai/planning/feature-{name}.md` (kebab-case)
|
|
59
|
+
- Must include: Goal, Acceptance Criteria (GWT), Risks, Implementation Phases, Follow-ups
|
|
60
|
+
- Template: `docs/ai/planning/feature-template.md`
|
|
61
|
+
|
|
62
|
+
### Project Standards
|
|
63
|
+
- Coding conventions: `docs/ai/project/CODE_CONVENTIONS.md`
|
|
64
|
+
- Architecture guide: `docs/ai/project/PROJECT_STRUCTURE.md`
|
|
65
|
+
- Language templates: `docs/ai/project/template-convention/`
|
|
66
|
+
|
|
67
|
+
## Tooling Strategy
|
|
68
|
+
- Prefer semantic search across codebase; use grep only for exact matches
|
|
69
|
+
- Default to parallel execution for independent operations
|
|
70
|
+
- Quality tools: ESLint, TypeScript, Prettier (auto-format/auto-fix when possible)
|
|
71
|
+
|
|
72
|
+
## Communication
|
|
73
|
+
- Use Markdown only when necessary; backticks for `files/dirs/functions/classes`
|
|
74
|
+
- Status updates before/after important actions
|
|
75
|
+
- Mirror user's chat language; code/comments always in English
|
|
76
|
+
|
|
77
|
+
## Code Presentation
|
|
78
|
+
- Existing code: cite with `startLine:endLine:filepath` (no language tag)
|
|
79
|
+
- New code: fenced blocks with language tag, no line numbers
|
|
80
|
+
|
|
81
|
+
## TODO Policy
|
|
82
|
+
- For medium/large tasks: create todos (≤14 words, verb-led)
|
|
83
|
+
- Keep only ONE `in_progress` item
|
|
84
|
+
- Update immediately after progress; mark completed upon finish
|
|
85
|
+
|
|
86
|
+
## Git Workflow
|
|
87
|
+
- Feature branches: `feature/{name}` (match planning doc name)
|
|
88
|
+
- Commit format: `[phase] brief description`
|
|
89
|
+
- Examples: `[planning] create user auth plan`, `[phase-1] implement database schema`
|
|
90
|
+
|
|
91
|
+
## Slash Commands
|
|
92
|
+
- `/create-plan` - Generate planning doc
|
|
93
|
+
- `/execute-plan` - Implement tasks from planning doc
|
|
94
|
+
- `/modify-plan` - Modify plan after implementation
|
|
95
|
+
- `/code-review` - Validate against standards
|
|
96
|
+
- `/generate-standards` - Update CODE_CONVENTIONS.md
|
|
97
|
+
- `/writing-test` - Generate tests from acceptance criteria
|
|
98
|
+
- `/init-chat` - Load project rules (AGENTS.md)
|
|
99
|
+
|
|
100
|
+
## Quality Gates
|
|
101
|
+
### Before marking task complete:
|
|
102
|
+
- Code matches planning doc specification
|
|
103
|
+
- Linting passes (no warnings)
|
|
104
|
+
- Type checking passes (if applicable)
|
|
105
|
+
- Build succeeds (if applicable)
|
|
106
|
+
- Checkbox updated in planning doc: `[x]`
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
**Claude Code Specifics:**
|
|
111
|
+
- This file is automatically loaded every session
|
|
112
|
+
- Commands inherit these standards
|
|
113
|
+
- Use `/context` to see loaded memory
|
|
114
|
+
- Use `/usage` to monitor token consumption
|
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
1
|
+
---
|
|
2
|
+
name: check-implementation
|
|
3
|
+
description: Validates implementation against planning doc.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Compare current implementation against planning doc.
|
|
7
|
+
|
|
8
|
+
## Workflow Alignment
|
|
9
|
+
|
|
10
|
+
- Provide brief status updates (1–3 sentences) before/after important actions.
|
|
11
|
+
- Provide a high-signal summary at completion highlighting key mismatches and next steps.
|
|
12
|
+
|
|
13
|
+
1. Ask me for:
|
|
14
|
+
|
|
15
|
+
- Feature name (if not provided)
|
|
16
|
+
- Then locate planning doc by feature name:
|
|
17
|
+
- Planning: `docs/ai/planning/feature-{name}.md`
|
|
18
|
+
|
|
19
|
+
2. Validation Scope (no inference):
|
|
20
|
+
|
|
21
|
+
- Verify code follows the acceptance criteria from the planning doc
|
|
22
|
+
- Verify code matches the steps/changes in the implementation plan phases
|
|
23
|
+
- Check that completed tasks (marked `[x]`) have corresponding code changes
|
|
24
|
+
- Do NOT invent or infer alternative logic beyond what the docs specify
|
|
25
|
+
|
|
26
|
+
3. Output
|
|
27
|
+
|
|
28
|
+
- List concrete mismatches between code and planning doc
|
|
29
|
+
- List missing pieces the planning doc requires but code lacks
|
|
30
|
+
- List tasks marked complete `[x]` but code not implemented
|
|
31
|
+
- Short actionable next steps
|
|
@@ -1,132 +1,136 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
1.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
1
|
+
---
|
|
2
|
+
name: create-plan
|
|
3
|
+
description: Generates a feature planning doc with implementation details.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Goal
|
|
7
|
+
|
|
8
|
+
Generate a single planning doc at `docs/ai/planning/feature-{name}.md` using the template, with goal, acceptance criteria, risks, and detailed implementation phases with pseudo-code.
|
|
9
|
+
|
|
10
|
+
## Workflow Alignment
|
|
11
|
+
|
|
12
|
+
- Provide brief status updates (1–3 sentences) before/after important actions.
|
|
13
|
+
- For medium/large tasks, create todos (≤14 words, verb-led). Keep only one `in_progress` item.
|
|
14
|
+
- Update todos immediately after progress; mark completed upon finish.
|
|
15
|
+
|
|
16
|
+
## Step 1: Clarify Scope (Focused Q&A Guidelines)
|
|
17
|
+
|
|
18
|
+
Purpose: the agent MUST generate a short, numbered Q&A for the user to clarify scope; keep it relevant, avoid off-topic, and do not build a static question bank.
|
|
19
|
+
|
|
20
|
+
Principles:
|
|
21
|
+
|
|
22
|
+
- Quickly classify context: a) Micro-UI, b) Page/Flow, c) Service/API/Data, d) Cross-cutting.
|
|
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.
|
|
27
|
+
|
|
28
|
+
Output format for Q&A:
|
|
29
|
+
|
|
30
|
+
- Number questions sequentially starting at 1 (e.g., "1.", "2.").
|
|
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
|
|
36
|
+
|
|
37
|
+
Scope checklist to cover (ask only missing items, based on context):
|
|
38
|
+
|
|
39
|
+
1. Problem & Users: the core problem and target user groups.
|
|
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).
|
|
46
|
+
|
|
47
|
+
Adaptive behavior:
|
|
48
|
+
|
|
49
|
+
- Always reduce questions to what is necessary; once Goal/Tasks/Risks/DoD can be written, stop asking.
|
|
50
|
+
- Prioritize clarifying scope and acceptance criteria before implementation details.
|
|
51
|
+
- If the user already specified items (framework, API/Mock, deadlines, etc.), confirm briefly only.
|
|
52
|
+
|
|
53
|
+
Then collect inputs (after Q&A):
|
|
54
|
+
|
|
55
|
+
- Feature name (kebab-case, e.g., `user-authentication`)
|
|
56
|
+
- Short goal and scope
|
|
57
|
+
- High-level tasks overview (3–7 items)
|
|
58
|
+
- Definition of Done (build/test/review/docs)
|
|
59
|
+
|
|
60
|
+
## Step 2: Load Template
|
|
61
|
+
|
|
62
|
+
**Before creating the plan doc, read the following file:**
|
|
63
|
+
|
|
64
|
+
- `docs/ai/planning/feature-template.md` - Template structure to follow
|
|
65
|
+
|
|
66
|
+
This template defines the required structure and format. Use it as the baseline for creating the planning doc.
|
|
67
|
+
|
|
68
|
+
## Step 3: Draft the Plan (auto-generate)
|
|
69
|
+
|
|
70
|
+
Using the Q&A results and template, immediately generate the plan without asking for confirmation.
|
|
71
|
+
|
|
72
|
+
Auto-name feature:
|
|
73
|
+
|
|
74
|
+
- Derive `feature-{name}` from user prompt + Q&A (kebab-case, concise, specific).
|
|
75
|
+
- Example: "Login Page (HTML/CSS)" → `feature-login-page`.
|
|
76
|
+
- If a file with the same name already exists, append a numeric suffix: `feature-{name}-2`, `feature-{name}-3`, ...
|
|
77
|
+
|
|
78
|
+
### Generate Single Planning Doc
|
|
79
|
+
|
|
80
|
+
Produce a Markdown doc following `docs/ai/planning/feature-template.md` with all 5 sections:
|
|
81
|
+
|
|
82
|
+
1. **Goal & Acceptance Criteria**: Brief goal + Given-When-Then scenarios
|
|
83
|
+
2. **Risks & Assumptions**: Known risks and key assumptions
|
|
84
|
+
3. **Definition of Done**: Build/test/review/docs checklist
|
|
85
|
+
4. **Implementation Plan**:
|
|
86
|
+
- Summary: Brief description of solution approach (1-3 sentences)
|
|
87
|
+
- Phases: Detailed tasks with pseudo-code
|
|
88
|
+
5. **Follow-ups**: TODOs or deferred work
|
|
89
|
+
|
|
90
|
+
**Estimate phase scope**:
|
|
91
|
+
- Count total tasks from Q&A
|
|
92
|
+
- If tasks ≤ 5: use single phase named "Core Implementation"
|
|
93
|
+
- If tasks 6–12: suggest 2–3 phases (group by feature area or dependency order)
|
|
94
|
+
- If tasks > 12: suggest 3–5 phases; prioritize logical grouping
|
|
95
|
+
|
|
96
|
+
**For each phase, generate**:
|
|
97
|
+
- Phase name (descriptive, e.g., "Database Schema Setup", "API Endpoints", "UI Components")
|
|
98
|
+
- Tasks list: `[ ] [ACTION] path/to/file — Summary`
|
|
99
|
+
- Pseudo-code outline (show logic structure, not real code):
|
|
100
|
+
```
|
|
101
|
+
Pseudo-code:
|
|
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:
|
|
114
|
+
- Parse username + password from request
|
|
115
|
+
- Validate password strength
|
|
116
|
+
- Hash password with bcrypt
|
|
117
|
+
- Store user in database
|
|
118
|
+
- Return success + user ID
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Create the file automatically:
|
|
122
|
+
|
|
123
|
+
- `docs/ai/planning/feature-{name}.md` - Use complete structure from `feature-template.md`
|
|
124
|
+
|
|
125
|
+
Notify the user when done with summary: "Created plan with X phases: Phase 1 (name), Phase 2 (name), ..."
|
|
126
|
+
|
|
127
|
+
## Step 4: Next Actions
|
|
128
|
+
|
|
129
|
+
Suggest running `execute-plan` to begin task execution. Implementation work will be driven from `docs/ai/planning/feature-{name}.md` as the task source.
|
|
130
|
+
|
|
131
|
+
Note: Test documentation will be created separately using the `writing-test` command.
|
|
132
|
+
|
|
133
|
+
## Notes
|
|
134
|
+
|
|
135
|
+
- This command creates a single planning doc with both overview and implementation details.
|
|
136
|
+
- Idempotent: safe to re-run; auto-appends numeric suffix if files exist.
|
|
@@ -1,156 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
- Suggest running `code-review` to verify against standards
|
|
143
|
-
- Suggest running `writing-test` if edge cases need coverage
|
|
144
|
-
- Suggest running `check-implementation` to validate alignment with implementation entries
|
|
145
|
-
|
|
146
|
-
If phases remain:
|
|
147
|
-
|
|
148
|
-
- User runs `/execute-plan` again; Phase detection (Step 1a) will resume correctly
|
|
149
|
-
|
|
150
|
-
## Notes
|
|
151
|
-
|
|
152
|
-
- Keep code changes minimal and focused on implementation tasks
|
|
153
|
-
- Document all changes in the implementation doc; use checkboxes to track progress
|
|
154
|
-
- Avoid implementing features not in the implementation doc scope
|
|
155
|
-
- Modifies source code per implementation scope; updates `docs/ai/implementation/feature-{name}.md`. Does not modify unrelated files.
|
|
156
|
-
- Idempotent: safe to re-run; updates checkboxes deterministically.
|
|
1
|
+
---
|
|
2
|
+
name: execute-plan
|
|
3
|
+
description: Executes the planning doc tasks, edits code, and persists notes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Goal
|
|
7
|
+
|
|
8
|
+
Execute the feature plan by implementing tasks from the planning doc and updating task checkboxes as work progresses.
|
|
9
|
+
|
|
10
|
+
## Workflow Alignment
|
|
11
|
+
|
|
12
|
+
- Provide brief status updates (1–3 sentences) before each operation.
|
|
13
|
+
- For medium/large tasks, create todos (≤14 words, verb-led). Keep only one `in_progress` item.
|
|
14
|
+
- Update todos immediately after progress; mark completed upon finish.
|
|
15
|
+
- Perform edits via file editing tools, not by printing code for copy-paste.
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- Feature name (kebab-case, e.g., `user-authentication`)
|
|
20
|
+
- Planning doc exists: `docs/ai/planning/feature-{name}.md`
|
|
21
|
+
|
|
22
|
+
## Step 1: Gather Context
|
|
23
|
+
|
|
24
|
+
- Ask for feature name if not provided (must be kebab-case).
|
|
25
|
+
- Load planning doc: `docs/ai/planning/feature-{name}.md`.
|
|
26
|
+
- **Load template:** Read `docs/ai/planning/feature-template.md` to understand required structure.
|
|
27
|
+
|
|
28
|
+
### 1a: Phase Progress Detection
|
|
29
|
+
|
|
30
|
+
If planning doc exists, scan for phase markers (`### Phase X:`):
|
|
31
|
+
|
|
32
|
+
- **Count total phases** in the document
|
|
33
|
+
- **Detect last completed phase**: Find the highest phase where ALL tasks (checkbox `[x]`) are marked complete
|
|
34
|
+
- **Detect current phase**: Find the first phase with incomplete tasks (`[ ]` marks)
|
|
35
|
+
- **Show summary to user**:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Found 3 phases.
|
|
39
|
+
- Phase 1 (Database Setup): Complete [x]
|
|
40
|
+
- Phase 2 (API Endpoints): In Progress [2/4 tasks done]
|
|
41
|
+
- Phase 3 (Frontend): Not Started
|
|
42
|
+
|
|
43
|
+
Resuming Phase 2...
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If no phases detected (old format):
|
|
47
|
+
|
|
48
|
+
- Treat entire "Implementation Plan" section as single phase (backward compatible)
|
|
49
|
+
|
|
50
|
+
## Step 2: Build Task Queue
|
|
51
|
+
|
|
52
|
+
- Parse tasks (checkboxes `[ ]`, `[x]`) from **current phase only** (from phase detection in Step 1a):
|
|
53
|
+
- Primary source: Tasks under `### Phase X:` with `[ ] [ACTION] ...` entries (incomplete only).
|
|
54
|
+
- For `[MODIFIED]` files, parse sub-bullets representing distinct logic items with line ranges.
|
|
55
|
+
- **Skip completed phases** entirely (do not re-execute)
|
|
56
|
+
- Build prioritized task queue (top-to-bottom unless dependencies block).
|
|
57
|
+
- Identify blocked tasks and note reasons.
|
|
58
|
+
|
|
59
|
+
Note: Do not include Follow-ups section unless explicitly in current phase.
|
|
60
|
+
|
|
61
|
+
## Step 3: Implement Iteratively (per task)
|
|
62
|
+
|
|
63
|
+
For each task in queue:
|
|
64
|
+
|
|
65
|
+
1. **Status update**: Brief note (1–3 sentences) on what will be done.
|
|
66
|
+
2. Plan minimal change set:
|
|
67
|
+
- Identify files/regions to modify
|
|
68
|
+
- Map changes to acceptance criteria from plan (reference if needed)
|
|
69
|
+
3. Implement changes:
|
|
70
|
+
- Write/edit code according to the planning doc entries (`[ACTION]` items)
|
|
71
|
+
- Keep changes minimal and incremental
|
|
72
|
+
- Avoid speculative changes beyond implementation scope
|
|
73
|
+
4. Quick validation:
|
|
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:
|
|
78
|
+
- File: `docs/ai/planning/feature-{name}.md`
|
|
79
|
+
- Update the relevant `[ ]` entry to `[x]` when completed
|
|
80
|
+
- For `MODIFIED` files with sub-bullets, mark each completed sub-bullet `[x]`
|
|
81
|
+
- Include line ranges and concise summaries as per template
|
|
82
|
+
6. Update planning doc:
|
|
83
|
+
- Mark completed tasks `[x]` with brief notes
|
|
84
|
+
- Mark blocked tasks with reason
|
|
85
|
+
|
|
86
|
+
## Step 4: Quality Checks
|
|
87
|
+
|
|
88
|
+
After completing each task batch:
|
|
89
|
+
|
|
90
|
+
- Detect available tools from project config (e.g., `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, build files) and run the appropriate non-interactive checks.
|
|
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.
|
|
103
|
+
|
|
104
|
+
## Step 5: Phase Completion Check
|
|
105
|
+
|
|
106
|
+
After completing all tasks in current phase:
|
|
107
|
+
|
|
108
|
+
1. **Mark phase complete** in planning doc (optional visual marker)
|
|
109
|
+
2. **Check remaining phases**:
|
|
110
|
+
- If more incomplete phases exist:
|
|
111
|
+
```
|
|
112
|
+
✓ Phase 2 complete!
|
|
113
|
+
Ready for Phase 3 (Frontend)?
|
|
114
|
+
Run: /execute-plan
|
|
115
|
+
```
|
|
116
|
+
- If this is final phase:
|
|
117
|
+
```
|
|
118
|
+
✓ All phases complete!
|
|
119
|
+
Ready for code review?
|
|
120
|
+
Run: /code-review
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Step 6: Next Actions
|
|
124
|
+
|
|
125
|
+
After all phases complete:
|
|
126
|
+
|
|
127
|
+
- Suggest running `code-review` to verify against standards
|
|
128
|
+
- Suggest running `writing-test` if edge cases need coverage
|
|
129
|
+
- Suggest running `check-implementation` to validate alignment with planning entries
|
|
130
|
+
|
|
131
|
+
If phases remain:
|
|
132
|
+
|
|
133
|
+
- User runs `/execute-plan` again; Phase detection (Step 1a) will resume correctly
|
|
134
|
+
|
|
135
|
+
## Notes
|
|
136
|
+
|
|
137
|
+
- Keep code changes minimal and focused on planning tasks
|
|
138
|
+
- Document all changes by updating checkboxes in the planning doc
|
|
139
|
+
- Avoid implementing features not in the planning doc scope
|
|
140
|
+
- Modifies source code per planning scope; updates `docs/ai/planning/feature-{name}.md`. Does not modify unrelated files.
|
|
141
|
+
- Idempotent: safe to re-run; updates checkboxes deterministically.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: modify-plan
|
|
3
|
+
description: Modify plan and code after implementation; support revert or apply new approach.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
## Goal
|
|
2
7
|
|
|
3
8
|
Modify a feature plan after partial/full implementation. Support reverting to a previous git state or applying new requirement changes with both code and documentation sync.
|
|
@@ -6,13 +11,12 @@ Modify a feature plan after partial/full implementation. Support reverting to a
|
|
|
6
11
|
|
|
7
12
|
- Feature name (kebab-case, e.g., `user-authentication`)
|
|
8
13
|
- Planning doc exists: `docs/ai/planning/feature-{name}.md`
|
|
9
|
-
- Implementation doc exists: `docs/ai/implementation/feature-{name}.md`
|
|
10
14
|
- Git repo initialized (for tracking code state)
|
|
11
15
|
|
|
12
16
|
## Workflow Alignment
|
|
13
17
|
|
|
14
18
|
- Provide brief status updates (1–3 sentences) before/after important actions.
|
|
15
|
-
- Update
|
|
19
|
+
- Update planning doc when making changes.
|
|
16
20
|
- Do NOT auto-commit; user reviews all changes before pushing.
|
|
17
21
|
|
|
18
22
|
## Step 1: Load Current State
|
|
@@ -21,8 +25,7 @@ Ask for feature name (must be kebab-case).
|
|
|
21
25
|
|
|
22
26
|
Load and summarize:
|
|
23
27
|
|
|
24
|
-
1. **Planning doc**: Current goal, scope,
|
|
25
|
-
2. **Implementation doc**: Current phases, completion status, files affected
|
|
28
|
+
1. **Planning doc**: Current goal, scope, implementation phases, completion status
|
|
26
29
|
|
|
27
30
|
Display summary:
|
|
28
31
|
|
|
@@ -46,31 +49,35 @@ Total files touched: 4
|
|
|
46
49
|
Ask user what's changing:
|
|
47
50
|
|
|
48
51
|
**1. Type of modification:**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
a) Modify goal/scope (entire plan changes)
|
|
53
|
+
b) Modify specific phase(s) (tactical change)
|
|
54
|
+
c) Revert to previous approach (git reset)
|
|
55
|
+
d) Other (describe)
|
|
53
56
|
|
|
54
57
|
**2a. If modifying goal/scope:**
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
|
|
59
|
+
- What's the new goal/scope?
|
|
60
|
+
- How does it impact existing tasks?
|
|
57
61
|
|
|
58
62
|
**2b. If modifying specific phase(s):**
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
|
|
64
|
+
- Which phase(s)? (list by name)
|
|
65
|
+
- What requirement/approach is changing?
|
|
61
66
|
|
|
62
67
|
**2c. If reverting approach:**
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
|
|
69
|
+
- Show last 5 commits; ask which to revert to
|
|
70
|
+
- Or reset to specific phase (revert all code changes after phase X)?
|
|
65
71
|
|
|
66
72
|
## Step 3: Apply Changes
|
|
67
73
|
|
|
68
|
-
### Option A: Revert to Previous
|
|
74
|
+
### Option A: Revert to Previous Git State
|
|
69
75
|
|
|
70
76
|
If user selects revert:
|
|
71
77
|
|
|
72
78
|
1. **Identify affected files & changes**:
|
|
73
|
-
|
|
79
|
+
|
|
80
|
+
- Parse planning doc; list all files modified in affected phase(s)
|
|
74
81
|
- Show file list that needs reverting:
|
|
75
82
|
```
|
|
76
83
|
Files to revert (manual):
|
|
@@ -80,15 +87,19 @@ If user selects revert:
|
|
|
80
87
|
```
|
|
81
88
|
|
|
82
89
|
2. **Manual revert guidance**:
|
|
90
|
+
|
|
83
91
|
- For MODIFIED files: show current state vs. target state (code snippets/line ranges)
|
|
84
92
|
- For DELETED files: ask user to delete manually
|
|
85
93
|
- Ask: "Ready to manually revert these files?"
|
|
86
94
|
|
|
87
95
|
3. **If user confirms**:
|
|
96
|
+
|
|
88
97
|
- User manually reverts files (copy-paste old code back, undo in IDE, etc.)
|
|
89
|
-
- Update
|
|
98
|
+
- Update planning doc:
|
|
99
|
+
|
|
90
100
|
- Mark affected phases/tasks `[ ]` (reset to pending)
|
|
91
101
|
- Add "Modification History" entry:
|
|
102
|
+
|
|
92
103
|
```
|
|
93
104
|
## Modification History
|
|
94
105
|
|
|
@@ -106,9 +117,12 @@ If user selects revert:
|
|
|
106
117
|
If user selects new approach:
|
|
107
118
|
|
|
108
119
|
1. **Update planning doc**:
|
|
120
|
+
|
|
109
121
|
- Modify goal/scope section if changed
|
|
110
122
|
- Update affected task(s) with new approach
|
|
123
|
+
- Update pseudo-code to match new approach
|
|
111
124
|
- Add "Modification History" section:
|
|
125
|
+
|
|
112
126
|
```
|
|
113
127
|
## Modification History
|
|
114
128
|
|
|
@@ -119,12 +133,13 @@ If user selects new approach:
|
|
|
119
133
|
- **Affected phases**: Phase X, Y
|
|
120
134
|
```
|
|
121
135
|
|
|
122
|
-
2. **Update implementation
|
|
136
|
+
2. **Update implementation phases**:
|
|
137
|
+
|
|
123
138
|
- For affected phases:
|
|
124
139
|
- Modify pseudo-code to match new approach
|
|
125
140
|
- Reset incomplete tasks `[ ]` (if approach changed significantly)
|
|
126
141
|
- Keep completed tasks as-is (do not re-implement)
|
|
127
|
-
- Update "
|
|
142
|
+
- Update "Implementation Plan" section with new structure (files/logic outline)
|
|
128
143
|
|
|
129
144
|
3. **Show git impact**:
|
|
130
145
|
- Highlight files that may need re-editing
|
|
@@ -135,26 +150,29 @@ If user selects new approach:
|
|
|
135
150
|
Before finalizing, show:
|
|
136
151
|
|
|
137
152
|
1. **Updated planning doc** snippet (modified sections)
|
|
138
|
-
2. **
|
|
139
|
-
3. **Files affected** (files that will be changed)
|
|
153
|
+
2. **Git state** (files that will be changed)
|
|
140
154
|
|
|
141
|
-
Ask: **"Apply changes and update
|
|
155
|
+
Ask: **"Apply changes and update doc?"** (yes/no)
|
|
142
156
|
|
|
143
157
|
If **yes**:
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
- If
|
|
158
|
+
|
|
159
|
+
- Save updated planning doc
|
|
160
|
+
- If revert: `git status` shows reverted files (unstaged)
|
|
161
|
+
- If new approach: doc updated; code changes staged for review
|
|
147
162
|
|
|
148
163
|
If **no**:
|
|
149
|
-
|
|
164
|
+
|
|
165
|
+
- Rollback changes to doc
|
|
150
166
|
- Discard any temporary changes
|
|
151
167
|
|
|
152
168
|
## Step 5: Next Actions
|
|
153
169
|
|
|
154
170
|
**After manual revert**:
|
|
171
|
+
|
|
155
172
|
- "Docs updated. Affected tasks reset to `[ ]`. Run `/execute-plan` to re-implement Phase X with new approach."
|
|
156
173
|
|
|
157
174
|
**After apply new approach**:
|
|
175
|
+
|
|
158
176
|
- If only pseudo-code/docs changed (no code revert needed): "Continue current phase with `/execute-plan`."
|
|
159
177
|
- If code changes needed (revert old approach + implement new): "Manually update code files first, then run `/execute-plan`."
|
|
160
178
|
- "When done, run `/code-review` to validate standards."
|
|
@@ -163,7 +181,7 @@ If **no**:
|
|
|
163
181
|
|
|
164
182
|
- **Manual revert**: User manually reverts code files (no git reset); AI guides the process
|
|
165
183
|
- **Multi-feature safe**: Works when implementing multiple features simultaneously (selective revert possible)
|
|
166
|
-
- **Backward compatible**: Works with both phase-based and non-phase-based
|
|
184
|
+
- **Backward compatible**: Works with both phase-based and non-phase-based planning docs
|
|
167
185
|
- **Audit trail**: "Modification History" section preserves decision rationale and affected files
|
|
168
186
|
- **Idempotent**: Safe to re-run; modification history accumulates
|
|
169
187
|
- **Safe defaults**: Asks confirmation before any changes; user always has final say
|
|
@@ -176,12 +194,12 @@ Agent: Load state, show summary
|
|
|
176
194
|
|
|
177
195
|
User: Revert Phase 2 (API Endpoints) - use different auth approach
|
|
178
196
|
Agent: Identify affected files (src/api/users.ts, src/api/auth.ts)
|
|
179
|
-
|
|
180
|
-
|
|
197
|
+
Show current state vs. target state (pseudo-code + old implementation)
|
|
198
|
+
Ask: Ready to manually revert these files?
|
|
181
199
|
|
|
182
200
|
User: Yes, I'll manually revert
|
|
183
201
|
Agent: (User manually copies old code back or undoes changes in IDE)
|
|
184
|
-
Update
|
|
202
|
+
Update planning doc:
|
|
185
203
|
- Mark Phase 2 tasks [ ] (reset)
|
|
186
204
|
- Add Modification History: Phase 2 reverted, reason: better auth strategy
|
|
187
205
|
|
package/cli.js
CHANGED
|
@@ -75,9 +75,9 @@ function cloneDocsAI(source, dest) {
|
|
|
75
75
|
run(`npx degit ${source} ${tempDir} --force`);
|
|
76
76
|
|
|
77
77
|
// Xử lý từng subfolder
|
|
78
|
-
const subfolders = ["
|
|
78
|
+
const subfolders = ["planning", "testing"];
|
|
79
79
|
|
|
80
|
-
// Xử lý folders:
|
|
80
|
+
// Xử lý folders: planning, testing
|
|
81
81
|
for (const subfolder of subfolders) {
|
|
82
82
|
const tempSubfolder = path.join(tempDir, subfolder);
|
|
83
83
|
const destSubfolder = path.join(dest, subfolder);
|
|
@@ -203,6 +203,7 @@ async function main() {
|
|
|
203
203
|
}
|
|
204
204
|
step("🚚 Downloading Cursor agent commands (.cursor/commands)...");
|
|
205
205
|
run(`npx degit ${REPO}/.cursor/commands .cursor/commands --force`);
|
|
206
|
+
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
// Clone GitHub Copilot prompts (luôn ghi đè)
|
|
@@ -212,6 +213,7 @@ async function main() {
|
|
|
212
213
|
}
|
|
213
214
|
step("🚚 Downloading GitHub Copilot prompts (.github/prompts)...");
|
|
214
215
|
run(`npx degit ${REPO}/.github/prompts .github/prompts --force`);
|
|
216
|
+
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
// Clone Claude Code commands (luôn ghi đè)
|
|
@@ -221,6 +223,34 @@ async function main() {
|
|
|
221
223
|
}
|
|
222
224
|
step("🚚 Downloading Claude Code commands (.claude/commands)...");
|
|
223
225
|
run(`npx degit ${REPO}/.claude/commands .claude/commands --force`);
|
|
226
|
+
|
|
227
|
+
// Download CLAUDE.md (context memory) - only if not exists
|
|
228
|
+
step("🚚 Downloading Claude Code context memory (.claude/CLAUDE.md)...");
|
|
229
|
+
const claudeMdPath = ".claude/CLAUDE.md";
|
|
230
|
+
if (existsSync(claudeMdPath)) {
|
|
231
|
+
console.log(`⏭️ Skipping (already exists): ${claudeMdPath}`);
|
|
232
|
+
} else {
|
|
233
|
+
try {
|
|
234
|
+
run(`curl -fsSL ${RAW_BASE}/.claude/CLAUDE.md -o ${claudeMdPath}`);
|
|
235
|
+
} catch (_) {
|
|
236
|
+
run(`wget -qO ${claudeMdPath} ${RAW_BASE}/.claude/CLAUDE.md`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Download hooks.json (always overwrite to get latest)
|
|
241
|
+
step("🚚 Downloading Claude Code hooks (.claude/hooks.json)...");
|
|
242
|
+
try {
|
|
243
|
+
run(`curl -fsSL ${RAW_BASE}/.claude/hooks.json -o .claude/hooks.json`);
|
|
244
|
+
} catch (_) {
|
|
245
|
+
run(`wget -qO .claude/hooks.json ${RAW_BASE}/.claude/hooks.json`);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Download skills folder (always overwrite to get latest)
|
|
249
|
+
step("🚚 Downloading Claude Code skills (.claude/skills)...");
|
|
250
|
+
if (!existsSync(".claude/skills")) {
|
|
251
|
+
mkdirSync(".claude/skills", { recursive: true });
|
|
252
|
+
}
|
|
253
|
+
run(`npx degit ${REPO}/.claude/skills .claude/skills --force`);
|
|
224
254
|
}
|
|
225
255
|
|
|
226
256
|
// Clone Cursor prompts (luôn ghi đè)
|
|
@@ -7,26 +7,42 @@ description: Feature planning docs and workflow guidelines
|
|
|
7
7
|
# Planning Documentation
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
10
|
-
This directory contains planning documents for individual features. Each feature
|
|
10
|
+
This directory contains planning documents for individual features. Each feature plan includes both high-level goals and detailed implementation steps in a single file.
|
|
11
11
|
|
|
12
12
|
## Feature Planning Workflow
|
|
13
13
|
|
|
14
14
|
### Creating a Feature Plan
|
|
15
15
|
Use the `create-plan` command to generate a new feature plan:
|
|
16
|
-
- Command: `.cursor/commands/
|
|
16
|
+
- Command: Available in `.cursor/commands/`, `.claude/commands/`, or `.github/prompts/`
|
|
17
17
|
- Output: `docs/ai/planning/feature-{name}.md`
|
|
18
18
|
- Template: `docs/ai/planning/feature-template.md`
|
|
19
19
|
|
|
20
20
|
### Feature Plan Structure
|
|
21
|
-
Each feature plan follows the template structure:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
21
|
+
Each feature plan follows the template structure with 5 sections:
|
|
22
|
+
|
|
23
|
+
1. **Goal & Acceptance Criteria**: Objectives, scope, and Given-When-Then format
|
|
24
|
+
2. **Risks & Assumptions**: Key risks and assumptions to be aware of
|
|
25
|
+
3. **Definition of Done**: Completion criteria (build/test/review/docs)
|
|
26
|
+
4. **Implementation Plan**:
|
|
27
|
+
- Summary of solution approach
|
|
28
|
+
- Phases with detailed tasks and pseudo-code
|
|
29
|
+
5. **Follow-ups**: TODOs or deferred work
|
|
30
|
+
|
|
31
|
+
### What Makes a Good Plan?
|
|
32
|
+
A good plan helps both humans and AI agents understand:
|
|
33
|
+
- **For humans**: What problem we're solving, why, and how
|
|
34
|
+
- **For AI agents**: Exactly what files to change, what logic to implement, and in what order
|
|
35
|
+
|
|
36
|
+
The plan should be:
|
|
37
|
+
- Clear enough for a different AI agent to execute independently
|
|
38
|
+
- Detailed enough with pseudo-code to guide implementation
|
|
39
|
+
- Concise enough to avoid information overload
|
|
40
|
+
|
|
41
|
+
### From Plan to Execution
|
|
42
|
+
- After the plan is written, use the `execute-plan` command to begin implementation
|
|
43
|
+
- The AI agent will read the plan and implement tasks phase by phase
|
|
44
|
+
- Tasks are tracked with checkboxes `[ ]` → `[x]` as they complete
|
|
45
|
+
- Do not start coding until the plan is reviewed and agreed upon
|
|
30
46
|
|
|
31
47
|
### Feature Plan Naming Convention
|
|
32
48
|
- Format: `feature-{name}.md` (kebab-case)
|
|
@@ -37,7 +53,6 @@ Each feature plan follows the template structure:
|
|
|
37
53
|
See `feature-template.md` for the exact structure required for feature plans.
|
|
38
54
|
|
|
39
55
|
## Related Documentation
|
|
40
|
-
- Implementation notes: `../implementation/`
|
|
41
56
|
- Test plans: `../testing/`
|
|
42
57
|
- Project standards: `../project/`
|
|
43
58
|
|
|
@@ -2,29 +2,68 @@
|
|
|
2
2
|
|
|
3
3
|
Note: All content in this document must be written in English.
|
|
4
4
|
|
|
5
|
-
## Goal
|
|
6
|
-
|
|
5
|
+
## 1. Goal & Acceptance Criteria
|
|
6
|
+
|
|
7
|
+
### Goal
|
|
8
|
+
- [Brief description: what problem this solves and why it matters]
|
|
7
9
|
|
|
8
10
|
### Acceptance Criteria (Given/When/Then)
|
|
9
|
-
- Given
|
|
10
|
-
- When
|
|
11
|
-
- Then
|
|
11
|
+
- Given [context or initial state]
|
|
12
|
+
- When [action or event occurs]
|
|
13
|
+
- Then [expected result or outcome]
|
|
14
|
+
|
|
15
|
+
## 2. Risks & Assumptions
|
|
16
|
+
|
|
17
|
+
### Risks
|
|
18
|
+
- [Potential issues, blockers, or unknowns]
|
|
19
|
+
|
|
20
|
+
### Assumptions
|
|
21
|
+
- [What we assume is true for this plan to work]
|
|
22
|
+
|
|
23
|
+
## 3. Definition of Done
|
|
24
|
+
- [ ] Build passes (linter, type checks, compile)
|
|
25
|
+
- [ ] Tests added and passing
|
|
26
|
+
- [ ] Code reviewed and approved
|
|
27
|
+
- [ ] Documentation updated
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 4. Implementation Plan
|
|
32
|
+
|
|
33
|
+
### Summary
|
|
34
|
+
[Brief description of the solution approach in 1-3 sentences]
|
|
35
|
+
|
|
36
|
+
### Phase 1: [Phase Name]
|
|
37
|
+
|
|
38
|
+
- [ ] [ACTION] path/to/file — Summary of change
|
|
39
|
+
```
|
|
40
|
+
Pseudo-code:
|
|
41
|
+
- Step 1: describe what will be done
|
|
42
|
+
- Step 2: validation or key logic
|
|
43
|
+
- Step 3: output or return value
|
|
44
|
+
```
|
|
12
45
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
46
|
+
- [ ] [ACTION] path/to/file — Summary of change
|
|
47
|
+
```
|
|
48
|
+
Pseudo-code:
|
|
49
|
+
- ...
|
|
50
|
+
```
|
|
17
51
|
|
|
18
|
-
|
|
19
|
-
- Key risks / assumptions
|
|
52
|
+
### Phase 2: [Phase Name]
|
|
20
53
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
54
|
+
- [ ] [ACTION] path/to/file — Summary of change
|
|
55
|
+
```
|
|
56
|
+
Pseudo-code:
|
|
57
|
+
- ...
|
|
58
|
+
```
|
|
24
59
|
|
|
25
|
-
|
|
26
|
-
-
|
|
60
|
+
Notes:
|
|
61
|
+
- ACTION must be one of: ADDED | MODIFIED | DELETED | RENAMED
|
|
62
|
+
- For MODIFIED files, use sub-bullets for each distinct logic change and include line ranges
|
|
63
|
+
- Pseudo-code shows logic structure and key steps, not actual implementation code
|
|
64
|
+
- Each phase groups related tasks; phases execute sequentially
|
|
65
|
+
- Use only one phase for small features (≤ 5 tasks); use multiple phases for larger features
|
|
27
66
|
|
|
28
|
-
##
|
|
29
|
-
-
|
|
30
|
-
-
|
|
67
|
+
## 5. Follow-ups
|
|
68
|
+
- [ ] [TODO item or deferred work]
|
|
69
|
+
- [ ] [Future improvements]
|
package/package.json
CHANGED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
phase: implementation
|
|
3
|
-
title: Implementation Documentation
|
|
4
|
-
description: Feature implementation notes and tracking
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Implementation Documentation
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
This directory contains implementation notes for individual features. These docs track what code was written, why, and how it aligns with the plan.
|
|
11
|
-
|
|
12
|
-
## Implementation Documentation Workflow
|
|
13
|
-
|
|
14
|
-
### Creating Implementation Notes
|
|
15
|
-
Implementation notes are created automatically during `execute-plan`:
|
|
16
|
-
- Command: `.cursor/commands/execute-plan.md`
|
|
17
|
-
- Output: `docs/ai/implementation/feature-{name}.md`
|
|
18
|
-
- Template: `docs/ai/implementation/feature-template.md`
|
|
19
|
-
|
|
20
|
-
### Implementation Doc Structure
|
|
21
|
-
Each implementation doc follows the template structure:
|
|
22
|
-
- **Summary**: Brief description of overall solution approach
|
|
23
|
-
- **Changes**: Per-task entries with:
|
|
24
|
-
- File paths and line ranges
|
|
25
|
-
- Approach/pattern used
|
|
26
|
-
- Brief description of changes
|
|
27
|
-
- **Edge Cases**: List of handled edge cases
|
|
28
|
-
- **Follow-ups**: TODOs or deferred work
|
|
29
|
-
|
|
30
|
-
### Purpose
|
|
31
|
-
Implementation docs serve as:
|
|
32
|
-
- **Audit trail**: What code was written for this feature
|
|
33
|
-
- **Review reference**: For code-review and check-implementation commands
|
|
34
|
-
- **Refactor guide**: Understanding what was done for future improvements
|
|
35
|
-
|
|
36
|
-
### Execution Discipline
|
|
37
|
-
- Provide a short status update before each meaningful action (1–3 sentences).
|
|
38
|
-
- Perform edits via file editing tools; avoid printing large code for copy-paste.
|
|
39
|
-
- After each batch of edits, run linter/type/build on changed files; auto-fix issues (up to 3 attempts) before requesting review.
|
|
40
|
-
|
|
41
|
-
## Template Reference
|
|
42
|
-
See `feature-template.md` for the exact structure required for implementation notes.
|
|
43
|
-
|
|
44
|
-
## Related Documentation
|
|
45
|
-
- Planning docs: `../planning/`
|
|
46
|
-
- Test plans: `../testing/`
|
|
47
|
-
- Project standards: `../project/`
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
**Note**: For general implementation patterns and best practices, refer to `../project/CODE_CONVENTIONS.md` and `../project/PROJECT_STRUCTURE.md`.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Implementation Notes: {Feature Name}
|
|
2
|
-
|
|
3
|
-
Note: All content in this document must be written in English.
|
|
4
|
-
|
|
5
|
-
## Summary
|
|
6
|
-
|
|
7
|
-
- Short description of the solution approach
|
|
8
|
-
|
|
9
|
-
## Changes
|
|
10
|
-
|
|
11
|
-
### Phase 1: [Phase Name]
|
|
12
|
-
|
|
13
|
-
- [ ] [ACTION] path/to/file (lines: x–y) — Summary of change
|
|
14
|
-
```
|
|
15
|
-
Pseudo-code:
|
|
16
|
-
- function/logic outline
|
|
17
|
-
- key variables/state
|
|
18
|
-
```
|
|
19
|
-
- [ ] [ACTION] path/to/file (lines: a–b) — Summary of change
|
|
20
|
-
```
|
|
21
|
-
Pseudo-code:
|
|
22
|
-
- logic structure
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Phase 2: [Phase Name]
|
|
26
|
-
|
|
27
|
-
- [ ] [ACTION] path/to/file — Summary of change
|
|
28
|
-
```
|
|
29
|
-
Pseudo-code:
|
|
30
|
-
- ...
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Notes:
|
|
34
|
-
|
|
35
|
-
- ACTION must be one of: ADDED | MODIFIED | DELETED | RENAMED
|
|
36
|
-
- For MODIFIED files, use sub-bullets for each distinct logic change and include line ranges.
|
|
37
|
-
- Pseudo-code shows logic structure and key steps, not actual implementation code.
|
|
38
|
-
- Each phase groups related tasks; phases execute sequentially.
|
|
39
|
-
- Use only one phase for small features (≤ 5 tasks); use multiple phases for larger features.
|
|
40
|
-
|
|
41
|
-
## Edge Cases
|
|
42
|
-
|
|
43
|
-
- List of handled edge cases
|
|
44
|
-
|
|
45
|
-
## Follow-ups
|
|
46
|
-
|
|
47
|
-
- TODOs or deferred work
|
|
48
|
-
|
|
49
|
-
## Execution Discipline
|
|
50
|
-
|
|
51
|
-
- Before each edit, provide a short status update describing the next action (1–3 sentences).
|
|
52
|
-
- Perform edits via file editing tools; avoid printing large code blocks for copy-paste.
|
|
53
|
-
- After each batch of edits, run linter/type/build on changed files; auto-fix issues (up to 3 attempts) before requesting review.
|