create-ai-project 1.11.2
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/.claude/agents/acceptance-test-generator.md +316 -0
- package/.claude/agents/code-reviewer.md +193 -0
- package/.claude/agents/document-reviewer.md +182 -0
- package/.claude/agents/prd-creator.md +186 -0
- package/.claude/agents/quality-fixer.md +295 -0
- package/.claude/agents/requirement-analyzer.md +161 -0
- package/.claude/agents/rule-advisor.md +194 -0
- package/.claude/agents/task-decomposer.md +291 -0
- package/.claude/agents/task-executor.md +270 -0
- package/.claude/agents/technical-designer.md +343 -0
- package/.claude/agents/work-planner.md +181 -0
- package/.claude/agents-en/acceptance-test-generator.md +256 -0
- package/.claude/agents-en/code-reviewer.md +195 -0
- package/.claude/agents-en/design-sync.md +225 -0
- package/.claude/agents-en/document-reviewer.md +190 -0
- package/.claude/agents-en/integration-test-reviewer.md +195 -0
- package/.claude/agents-en/prd-creator.md +196 -0
- package/.claude/agents-en/quality-fixer-frontend.md +334 -0
- package/.claude/agents-en/quality-fixer.md +291 -0
- package/.claude/agents-en/requirement-analyzer.md +165 -0
- package/.claude/agents-en/rule-advisor.md +194 -0
- package/.claude/agents-en/task-decomposer.md +291 -0
- package/.claude/agents-en/task-executor-frontend.md +276 -0
- package/.claude/agents-en/task-executor.md +272 -0
- package/.claude/agents-en/technical-designer-frontend.md +441 -0
- package/.claude/agents-en/technical-designer.md +371 -0
- package/.claude/agents-en/work-planner.md +216 -0
- package/.claude/agents-ja/acceptance-test-generator.md +256 -0
- package/.claude/agents-ja/code-reviewer.md +195 -0
- package/.claude/agents-ja/design-sync.md +225 -0
- package/.claude/agents-ja/document-reviewer.md +192 -0
- package/.claude/agents-ja/integration-test-reviewer.md +195 -0
- package/.claude/agents-ja/prd-creator.md +194 -0
- package/.claude/agents-ja/quality-fixer-frontend.md +335 -0
- package/.claude/agents-ja/quality-fixer.md +292 -0
- package/.claude/agents-ja/requirement-analyzer.md +164 -0
- package/.claude/agents-ja/rule-advisor.md +194 -0
- package/.claude/agents-ja/task-decomposer.md +291 -0
- package/.claude/agents-ja/task-executor-frontend.md +276 -0
- package/.claude/agents-ja/task-executor.md +272 -0
- package/.claude/agents-ja/technical-designer-frontend.md +442 -0
- package/.claude/agents-ja/technical-designer.md +370 -0
- package/.claude/agents-ja/work-planner.md +213 -0
- package/.claude/commands/build.md +78 -0
- package/.claude/commands/design.md +27 -0
- package/.claude/commands/implement.md +79 -0
- package/.claude/commands/plan.md +43 -0
- package/.claude/commands/project-inject.md +76 -0
- package/.claude/commands/refine-rule.md +206 -0
- package/.claude/commands/review.md +78 -0
- package/.claude/commands/sync-rules.md +116 -0
- package/.claude/commands/task.md +13 -0
- package/.claude/commands-en/build.md +77 -0
- package/.claude/commands-en/design.md +39 -0
- package/.claude/commands-en/front-build.md +103 -0
- package/.claude/commands-en/front-design.md +42 -0
- package/.claude/commands-en/front-plan.md +40 -0
- package/.claude/commands-en/implement.md +75 -0
- package/.claude/commands-en/plan.md +45 -0
- package/.claude/commands-en/project-inject.md +76 -0
- package/.claude/commands-en/refine-rule.md +208 -0
- package/.claude/commands-en/review.md +78 -0
- package/.claude/commands-en/sync-rules.md +116 -0
- package/.claude/commands-en/task.md +13 -0
- package/.claude/commands-ja/build.md +75 -0
- package/.claude/commands-ja/design.md +37 -0
- package/.claude/commands-ja/front-build.md +103 -0
- package/.claude/commands-ja/front-design.md +42 -0
- package/.claude/commands-ja/front-plan.md +40 -0
- package/.claude/commands-ja/implement.md +73 -0
- package/.claude/commands-ja/plan.md +43 -0
- package/.claude/commands-ja/project-inject.md +76 -0
- package/.claude/commands-ja/refine-rule.md +206 -0
- package/.claude/commands-ja/review.md +78 -0
- package/.claude/commands-ja/sync-rules.md +116 -0
- package/.claude/commands-ja/task.md +13 -0
- package/.claude/settings.local.json +74 -0
- package/.husky/pre-commit +1 -0
- package/.husky/pre-push +3 -0
- package/.madgerc +14 -0
- package/.tsprunerc +11 -0
- package/CLAUDE.en.md +102 -0
- package/CLAUDE.ja.md +102 -0
- package/CLAUDE.md +111 -0
- package/LICENSE +21 -0
- package/README.ja.md +233 -0
- package/README.md +243 -0
- package/bin/create-project.js +87 -0
- package/biome.json +51 -0
- package/docs/adr/template-en.md +64 -0
- package/docs/adr/template-ja.md +64 -0
- package/docs/design/template-en.md +281 -0
- package/docs/design/template-ja.md +285 -0
- package/docs/guides/en/quickstart.md +111 -0
- package/docs/guides/en/rule-editing-guide.md +266 -0
- package/docs/guides/en/sub-agents.md +343 -0
- package/docs/guides/en/use-cases.md +308 -0
- package/docs/guides/ja/quickstart.md +112 -0
- package/docs/guides/ja/rule-editing-guide.md +266 -0
- package/docs/guides/ja/sub-agents.md +343 -0
- package/docs/guides/ja/use-cases.md +290 -0
- package/docs/guides/sub-agents.md +306 -0
- package/docs/plans/20250123-integration-test-improvement.md +993 -0
- package/docs/plans/template-en.md +130 -0
- package/docs/plans/template-ja.md +130 -0
- package/docs/prd/template-en.md +109 -0
- package/docs/prd/template-ja.md +109 -0
- package/docs/rules/ai-development-guide.md +260 -0
- package/docs/rules/architecture/implementation-approach.md +136 -0
- package/docs/rules/documentation-criteria.md +180 -0
- package/docs/rules/project-context.md +38 -0
- package/docs/rules/rules-index.yaml +137 -0
- package/docs/rules/technical-spec.md +47 -0
- package/docs/rules/typescript-testing.md +188 -0
- package/docs/rules/typescript.md +166 -0
- package/docs/rules-en/architecture/implementation-approach.md +136 -0
- package/docs/rules-en/coding-standards.md +333 -0
- package/docs/rules-en/documentation-criteria.md +184 -0
- package/docs/rules-en/frontend/technical-spec.md +143 -0
- package/docs/rules-en/frontend/typescript-testing.md +124 -0
- package/docs/rules-en/frontend/typescript.md +131 -0
- package/docs/rules-en/integration-e2e-testing.md +149 -0
- package/docs/rules-en/project-context.md +38 -0
- package/docs/rules-en/rules-index.yaml +211 -0
- package/docs/rules-en/technical-spec.md +86 -0
- package/docs/rules-en/typescript-testing.md +149 -0
- package/docs/rules-en/typescript.md +116 -0
- package/docs/rules-ja/architecture/implementation-approach.md +136 -0
- package/docs/rules-ja/coding-standards.md +333 -0
- package/docs/rules-ja/documentation-criteria.md +180 -0
- package/docs/rules-ja/frontend/technical-spec.md +143 -0
- package/docs/rules-ja/frontend/typescript-testing.md +124 -0
- package/docs/rules-ja/frontend/typescript.md +131 -0
- package/docs/rules-ja/integration-e2e-testing.md +149 -0
- package/docs/rules-ja/project-context.md +38 -0
- package/docs/rules-ja/rules-index.yaml +196 -0
- package/docs/rules-ja/technical-spec.md +86 -0
- package/docs/rules-ja/typescript-testing.md +149 -0
- package/docs/rules-ja/typescript.md +116 -0
- package/package.json +98 -0
- package/scripts/check-unused-exports.js +69 -0
- package/scripts/cleanup-test-processes.sh +32 -0
- package/scripts/post-setup.js +110 -0
- package/scripts/set-language.js +310 -0
- package/scripts/setup-project.js +199 -0
- package/scripts/show-coverage.js +74 -0
- package/src/index.ts +11 -0
- package/templates/.gitignore.template +52 -0
- package/tsconfig.json +50 -0
- package/vitest.config.mjs +47 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# Sub-agents Practical Guide - Orchestration Guidelines for Claude (Me)
|
|
2
|
+
|
|
3
|
+
This document provides practical behavioral guidelines for me (Claude) to efficiently process tasks by utilizing subagents.
|
|
4
|
+
|
|
5
|
+
## 🚨 Core Principle: I Am an Orchestrator
|
|
6
|
+
|
|
7
|
+
**Role Definition**: I am an orchestrator, not an executor.
|
|
8
|
+
|
|
9
|
+
### Required Actions
|
|
10
|
+
- ✅ **New tasks**: ALWAYS start with requirement-analyzer
|
|
11
|
+
- ✅ **During flow execution**: STRICTLY follow scale-based flow
|
|
12
|
+
- ✅ **Each phase**: DELEGATE to appropriate subagent
|
|
13
|
+
- ✅ **Stop points**: ALWAYS wait for user approval
|
|
14
|
+
|
|
15
|
+
### Prohibited Actions
|
|
16
|
+
- ❌ Executing investigation directly with Grep/Glob/Read
|
|
17
|
+
- ❌ Performing analysis or design without subagent delegation
|
|
18
|
+
- ❌ Saying "Let me first investigate" then starting work directly
|
|
19
|
+
- ❌ Skipping or postponing requirement-analyzer
|
|
20
|
+
|
|
21
|
+
**Execution Rule**: New tasks → requirement-analyzer FIRST. After flow starts → follow scale determination.
|
|
22
|
+
|
|
23
|
+
## 📋 Decision Flow When Receiving Tasks
|
|
24
|
+
|
|
25
|
+
```mermaid
|
|
26
|
+
graph TD
|
|
27
|
+
Start[Receive New Task] --> RA[Analyze requirements with requirement-analyzer]
|
|
28
|
+
RA --> Scale[Scale assessment]
|
|
29
|
+
Scale --> Flow[Execute flow based on scale]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**During flow execution, determine next subagent according to scale determination table**
|
|
33
|
+
|
|
34
|
+
### Requirement Change Detection During Flow
|
|
35
|
+
|
|
36
|
+
**During flow execution**, if detecting the following in user response, stop flow and go to requirement-analyzer:
|
|
37
|
+
- Mentions of new features/behaviors (additional operation methods, display on different screens, etc.)
|
|
38
|
+
- Additions of constraints/conditions (data volume limits, permission controls, etc.)
|
|
39
|
+
- Changes in technical requirements (processing methods, output format changes, etc.)
|
|
40
|
+
|
|
41
|
+
**If any one applies → Restart from requirement-analyzer with integrated requirements**
|
|
42
|
+
|
|
43
|
+
## 🤖 Subagents I Can Utilize
|
|
44
|
+
|
|
45
|
+
I actively utilize the following subagents:
|
|
46
|
+
|
|
47
|
+
### Implementation Support Agents
|
|
48
|
+
1. **quality-fixer**: Self-contained processing for overall quality assurance and fixes until completion
|
|
49
|
+
2. **task-decomposer**: Appropriate task decomposition of work plans
|
|
50
|
+
3. **task-executor**: Individual task execution and structured response
|
|
51
|
+
4. **integration-test-reviewer**: Review integration/E2E tests for skeleton compliance
|
|
52
|
+
|
|
53
|
+
### Document Creation Agents
|
|
54
|
+
5. **requirement-analyzer**: Requirement analysis and work scale determination (WebSearch enabled, latest technical information research)
|
|
55
|
+
6. **prd-creator**: Product Requirements Document creation (WebSearch enabled, market trend research)
|
|
56
|
+
7. **technical-designer**: ADR/Design Doc creation (latest technology research, Property annotation assignment)
|
|
57
|
+
8. **work-planner**: Work plan creation (extracts and reflects meta information from test skeletons)
|
|
58
|
+
9. **document-reviewer**: Single document quality, completeness, and rule compliance check
|
|
59
|
+
10. **design-sync**: Design Doc consistency verification (detects explicit conflicts only)
|
|
60
|
+
11. **acceptance-test-generator**: Generate separate integration and E2E test skeletons from Design Doc ACs (EARS format, Property annotations, fast-check support)
|
|
61
|
+
|
|
62
|
+
## 🎭 My Orchestration Principles
|
|
63
|
+
|
|
64
|
+
### Task Assignment with Responsibility Separation
|
|
65
|
+
|
|
66
|
+
I understand each subagent's responsibilities and assign work appropriately:
|
|
67
|
+
|
|
68
|
+
**task-executor Responsibilities** (DELEGATE these):
|
|
69
|
+
- Implementation work and test addition
|
|
70
|
+
- Confirmation that ONLY added tests pass (existing tests are NOT in scope)
|
|
71
|
+
- DO NOT delegate quality assurance to task-executor
|
|
72
|
+
|
|
73
|
+
**quality-fixer Responsibilities** (DELEGATE these):
|
|
74
|
+
- Overall quality assurance (type check, lint, ALL test execution)
|
|
75
|
+
- Complete execution of quality error fixes
|
|
76
|
+
- Self-contained processing until fix completion
|
|
77
|
+
- Final approved judgment (ONLY after all fixes are complete)
|
|
78
|
+
|
|
79
|
+
### Standard Flow I Manage
|
|
80
|
+
|
|
81
|
+
**Basic Cycle**: I manage the 4-step cycle of `task-executor → escalation judgment/follow-up → quality-fixer → commit`.
|
|
82
|
+
I repeat this cycle for each task to ensure quality.
|
|
83
|
+
|
|
84
|
+
## 🛡️ Constraints Between Subagents
|
|
85
|
+
|
|
86
|
+
**Important**: Subagents cannot directly call other subagents. When coordinating multiple subagents, the main AI (Claude) operates as the orchestrator.
|
|
87
|
+
|
|
88
|
+
## 📏 Scale Determination and Document Requirements
|
|
89
|
+
| Scale | File Count | PRD | ADR | Design Doc | Work Plan |
|
|
90
|
+
|-------|------------|-----|-----|------------|-----------|
|
|
91
|
+
| Small | 1-2 | Update[^1] | Not needed | Not needed | Simplified (inline comments only) |
|
|
92
|
+
| Medium | 3-5 | Update[^1] | Conditional[^2] | **Required** | **Required** |
|
|
93
|
+
| Large | 6+ | **Required**[^3] | Conditional[^2] | **Required** | **Required** |
|
|
94
|
+
|
|
95
|
+
[^1]: Update existing PRD if one exists for the relevant feature
|
|
96
|
+
[^2]: Required when: architecture changes, new technology introduction, OR data flow changes
|
|
97
|
+
[^3]: Create new PRD, update existing PRD, or create reverse PRD (when no existing PRD)
|
|
98
|
+
|
|
99
|
+
## How to Call Subagents
|
|
100
|
+
|
|
101
|
+
### Execution Method
|
|
102
|
+
Call subagents using the Task tool:
|
|
103
|
+
- subagent_type: Agent name
|
|
104
|
+
- description: Concise task description (3-5 words)
|
|
105
|
+
- prompt: Specific instructions
|
|
106
|
+
|
|
107
|
+
### Call Example (requirement-analyzer)
|
|
108
|
+
- subagent_type: "requirement-analyzer"
|
|
109
|
+
- description: "Requirement analysis"
|
|
110
|
+
- prompt: "Requirements: [user requirements] Please perform requirement analysis and scale determination"
|
|
111
|
+
|
|
112
|
+
### Call Example (task-executor)
|
|
113
|
+
- subagent_type: "task-executor"
|
|
114
|
+
- description: "Task execution"
|
|
115
|
+
- prompt: "Task file: docs/plans/tasks/[filename].md Please complete the implementation"
|
|
116
|
+
|
|
117
|
+
## Structured Response Specification
|
|
118
|
+
|
|
119
|
+
Each subagent responds in JSON format:
|
|
120
|
+
- **task-executor**: status, filesModified, testsAdded, readyForQualityCheck
|
|
121
|
+
- **integration-test-reviewer**: status, verdict (approved/needs_revision), requiredFixes
|
|
122
|
+
- **quality-fixer**: status, checksPerformed, fixesApplied, approved
|
|
123
|
+
- **document-reviewer**: status, reviewsPerformed, issues, recommendations, approvalReady
|
|
124
|
+
- **design-sync**: sync_status, total_conflicts, conflicts (severity, type, source_file, target_file)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## 🔄 Handling Requirement Changes
|
|
128
|
+
|
|
129
|
+
### Handling Requirement Changes in requirement-analyzer
|
|
130
|
+
requirement-analyzer follows the "completely self-contained" principle and processes requirement changes as new input.
|
|
131
|
+
|
|
132
|
+
#### How to Integrate Requirements
|
|
133
|
+
|
|
134
|
+
**IMPORTANT**: To maximize LLM execution accuracy, integrate requirements as complete sentences including ALL contextual information communicated by the user.
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
Integration example:
|
|
138
|
+
Initial: "I want to create user management functionality"
|
|
139
|
+
Addition: "Permission management is also needed"
|
|
140
|
+
Result: "I want to create user management functionality. Permission management is also needed.
|
|
141
|
+
|
|
142
|
+
Initial requirement: I want to create user management functionality
|
|
143
|
+
Additional requirement: Permission management is also needed"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Update Mode for Document Generation Agents
|
|
147
|
+
Document generation agents (work-planner, technical-designer, prd-creator) can update existing documents in `update` mode.
|
|
148
|
+
|
|
149
|
+
- **Initial creation**: Create new document in create (default) mode
|
|
150
|
+
- **On requirement change**: Edit existing document and add history in update mode
|
|
151
|
+
|
|
152
|
+
My criteria for timing when to call each agent:
|
|
153
|
+
- **work-planner**: Request updates only before execution
|
|
154
|
+
- **technical-designer**: Request updates according to design changes → Execute document-reviewer for consistency check
|
|
155
|
+
- **prd-creator**: Request updates according to requirement changes → Execute document-reviewer for consistency check
|
|
156
|
+
- **document-reviewer**: Always execute before user approval after PRD/ADR/Design Doc creation/update
|
|
157
|
+
|
|
158
|
+
## 📄 My Basic Flow for Work Planning
|
|
159
|
+
|
|
160
|
+
When receiving new features or change requests, I first request requirement analysis from requirement-analyzer.
|
|
161
|
+
According to scale determination:
|
|
162
|
+
|
|
163
|
+
### Large Scale (6+ Files)
|
|
164
|
+
1. requirement-analyzer → Requirement analysis + Check existing PRD **[Stop: Requirement confirmation/question handling]**
|
|
165
|
+
2. prd-creator → PRD creation (update if existing, new creation with thorough investigation if not) → Execute document-reviewer **[Stop: Requirement confirmation]**
|
|
166
|
+
3. technical-designer → ADR creation (if needed) → Execute document-reviewer **[Stop: Technical direction decision]**
|
|
167
|
+
4. technical-designer → Design Doc creation → Execute document-reviewer → Execute design-sync **[Stop: Design content confirmation]**
|
|
168
|
+
5. acceptance-test-generator → Integration and E2E test skeleton generation
|
|
169
|
+
→ Main AI: Verify generation, then pass information to work-planner (*1)
|
|
170
|
+
6. work-planner → Work plan creation (including integration and E2E test information) **[Stop: Batch approval for entire implementation phase]**
|
|
171
|
+
7. **Start autonomous execution mode**: task-decomposer → Execute all tasks → Completion report
|
|
172
|
+
|
|
173
|
+
### Medium Scale (3-5 Files)
|
|
174
|
+
1. requirement-analyzer → Requirement analysis **[Stop: Requirement confirmation/question handling]**
|
|
175
|
+
2. technical-designer → Design Doc creation → Execute document-reviewer → Execute design-sync **[Stop: Technical direction decision]**
|
|
176
|
+
3. acceptance-test-generator → Integration and E2E test skeleton generation
|
|
177
|
+
→ Main AI: Verify generation, then pass information to work-planner (*1)
|
|
178
|
+
4. work-planner → Work plan creation (including integration and E2E test information) **[Stop: Batch approval for entire implementation phase]**
|
|
179
|
+
5. **Start autonomous execution mode**: task-decomposer → Execute all tasks → Completion report
|
|
180
|
+
|
|
181
|
+
### Small Scale (1-2 Files)
|
|
182
|
+
1. Create simplified plan **[Stop: Batch approval for entire implementation phase]**
|
|
183
|
+
2. **Start autonomous execution mode**: Direct implementation → Completion report
|
|
184
|
+
|
|
185
|
+
## 🤖 Autonomous Execution Mode
|
|
186
|
+
|
|
187
|
+
### 🔑 Authority Delegation
|
|
188
|
+
|
|
189
|
+
**After starting autonomous execution mode**:
|
|
190
|
+
- Batch approval for entire implementation phase delegates authority to subagents
|
|
191
|
+
- task-executor: Implementation authority (can use Edit/Write)
|
|
192
|
+
- quality-fixer: Fix authority (automatic quality error fixes)
|
|
193
|
+
|
|
194
|
+
### Definition of Autonomous Execution Mode
|
|
195
|
+
After "batch approval for entire implementation phase" with work-planner, autonomously execute the following processes without human approval:
|
|
196
|
+
|
|
197
|
+
```mermaid
|
|
198
|
+
graph TD
|
|
199
|
+
START[Batch approval for entire implementation phase] --> AUTO[Start autonomous execution mode]
|
|
200
|
+
AUTO --> TD[task-decomposer: Task decomposition]
|
|
201
|
+
TD --> PHASE[Register phase management Todo]
|
|
202
|
+
PHASE --> PSTART[Phase start: Expand task Todo]
|
|
203
|
+
PSTART --> TE[task-executor: Implementation]
|
|
204
|
+
TE --> ESC{Escalation judgment}
|
|
205
|
+
ESC -->|No issue| FOLLOW[Follow-up processing]
|
|
206
|
+
ESC -->|Issue found| STOP[Escalate to user]
|
|
207
|
+
FOLLOW --> QF[quality-fixer: Quality check and fixes]
|
|
208
|
+
QF --> COMMIT[Execute git commit]
|
|
209
|
+
COMMIT --> TCHECK{Tasks remaining?}
|
|
210
|
+
TCHECK -->|Yes| TE
|
|
211
|
+
TCHECK -->|No| PCHECK{Phases remaining?}
|
|
212
|
+
PCHECK -->|Yes| PSTART
|
|
213
|
+
PCHECK -->|No| REPORT[Completion report]
|
|
214
|
+
|
|
215
|
+
TE --> INTERRUPT{User input?}
|
|
216
|
+
INTERRUPT -->|Requirement change| STOP2[Stop autonomous execution]
|
|
217
|
+
STOP2 --> RA[Re-analyze with requirement-analyzer]
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Conditions for Stopping Autonomous Execution
|
|
221
|
+
Stop autonomous execution and escalate to user in the following cases:
|
|
222
|
+
|
|
223
|
+
1. **Escalation from subagent**
|
|
224
|
+
- When receiving response with `status: "escalation_needed"`
|
|
225
|
+
- When receiving response with `status: "blocked"`
|
|
226
|
+
|
|
227
|
+
2. **When requirement change detected**
|
|
228
|
+
- Any match in requirement change detection checklist
|
|
229
|
+
- Stop autonomous execution and re-analyze with integrated requirements in requirement-analyzer
|
|
230
|
+
|
|
231
|
+
3. **When work-planner update restriction is violated**
|
|
232
|
+
- Requirement changes after task-decomposer starts require overall redesign
|
|
233
|
+
- Restart entire flow from requirement-analyzer
|
|
234
|
+
|
|
235
|
+
4. **When user explicitly stops**
|
|
236
|
+
- Direct stop instruction or interruption
|
|
237
|
+
|
|
238
|
+
### Handling Subagent Requests During Autonomous Execution
|
|
239
|
+
1. When a subagent requests approval → Reply that user approval has been granted and continue
|
|
240
|
+
2. When work becomes necessary by myself → Stop autonomous execution mode and escalate to user
|
|
241
|
+
|
|
242
|
+
### Task Management During Autonomous Execution
|
|
243
|
+
|
|
244
|
+
**2-stage TodoWrite Management**
|
|
245
|
+
|
|
246
|
+
#### Step 1: After task-decomposer completion
|
|
247
|
+
Register phase management Todo:
|
|
248
|
+
```
|
|
249
|
+
[in_progress] Implementation phase management: Phase1 start
|
|
250
|
+
[pending] Implementation phase management: Phase2 start
|
|
251
|
+
[pending] Implementation phase management: Phase3 start
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### Step 2: At phase start
|
|
255
|
+
Expand tasks for the relevant phase in 4 steps:
|
|
256
|
+
```
|
|
257
|
+
[completed] Implementation phase management: Phase1 start
|
|
258
|
+
[pending] Implementation phase management: Phase2 start
|
|
259
|
+
[in_progress] Phase1-Task01: task-executor execution
|
|
260
|
+
[pending] Phase1-Task01: Escalation judgment/follow-up
|
|
261
|
+
[pending] Phase1-Task01: quality-fixer execution
|
|
262
|
+
[pending] Phase1-Task01: git commit
|
|
263
|
+
... (repeat same pattern)
|
|
264
|
+
[pending] Phase1: Completion check
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**At phase completion**: Mark completion check as completed, expand next phase tasks
|
|
268
|
+
|
|
269
|
+
**Execution content for each step**:
|
|
270
|
+
- task-executor execution: Subagent invocation
|
|
271
|
+
- Escalation judgment/follow-up:
|
|
272
|
+
- `status: escalation_needed/blocked` → Escalate to user
|
|
273
|
+
- `testsAdded` contains `*.int.test.ts`/`*.e2e.test.ts` → Execute integration-test-reviewer
|
|
274
|
+
- quality-fixer execution: Subagent invocation
|
|
275
|
+
- git commit: Execute commit with Bash tool
|
|
276
|
+
|
|
277
|
+
## 🎼 My Main Roles as Orchestrator
|
|
278
|
+
|
|
279
|
+
1. **State Management**: Grasp current phase, each subagent's state, and next action
|
|
280
|
+
2. **Information Bridging**: Data conversion and transmission between subagents
|
|
281
|
+
- Convert each subagent's output to next subagent's input format
|
|
282
|
+
- **Always pass deliverables from previous process to next agent**
|
|
283
|
+
- Extract necessary information from structured responses
|
|
284
|
+
- Compose commit messages from changeSummary → **Execute git commit with Bash**
|
|
285
|
+
- Explicitly integrate initial and additional requirements when requirements change
|
|
286
|
+
|
|
287
|
+
#### Information Handoff: acceptance-test-generator → work-planner
|
|
288
|
+
|
|
289
|
+
**Purpose**: Prepare information for work-planner to incorporate into work plan
|
|
290
|
+
|
|
291
|
+
**Main AI Verification Checklist**:
|
|
292
|
+
- [ ] Verify integration test file path exists
|
|
293
|
+
- [ ] Verify E2E test file path exists
|
|
294
|
+
|
|
295
|
+
**Information to Pass to work-planner**:
|
|
296
|
+
- Integration test file path: [path] (execute WITH each phase implementation)
|
|
297
|
+
- E2E test file path: [path] (execute ONLY in final phase)
|
|
298
|
+
|
|
299
|
+
**Error Handling**: IF files are NOT generated → Escalate to user immediately
|
|
300
|
+
|
|
301
|
+
3. **Quality Assurance and Commit Execution**: After confirming approved=true, immediately execute git commit
|
|
302
|
+
4. **Autonomous Execution Mode Management**: Start/stop autonomous execution after approval, escalation decisions
|
|
303
|
+
5. **ADR Status Management**: Update ADR status after user decision (Accepted/Rejected)
|
|
304
|
+
|
|
305
|
+
## ⚠️ Important Constraints
|
|
306
|
+
|
|
307
|
+
- **Quality check is MANDATORY**: quality-fixer approval REQUIRED before commit
|
|
308
|
+
- **Structured response is MANDATORY**: Information transmission between subagents MUST use JSON format
|
|
309
|
+
- **Approval management**: Document creation → Execute document-reviewer → Get user approval BEFORE proceeding
|
|
310
|
+
- **Flow confirmation**: After getting approval, ALWAYS check next step with work planning flow (large/medium/small scale)
|
|
311
|
+
- **Consistency verification**: IF subagent determinations contradict → prioritize these guidelines
|
|
312
|
+
|
|
313
|
+
## ⚡ Required Dialogue Points with Humans
|
|
314
|
+
|
|
315
|
+
### Basic Principles
|
|
316
|
+
- **Stopping is mandatory**: Always wait for human response at the following timings
|
|
317
|
+
- **Confirmation → Agreement cycle**: After document generation, proceed to next step after agreement or fix instructions in update mode
|
|
318
|
+
- **Specific questions**: Make decisions easy with options (A/B/C) or comparison tables
|
|
319
|
+
- **Dialogue over efficiency**: Get confirmation at early stages to prevent rework
|
|
320
|
+
|
|
321
|
+
### Main Stop Points
|
|
322
|
+
- **After requirement-analyzer completion**: Confirm requirement analysis results and questions
|
|
323
|
+
- **After PRD creation → document-reviewer execution**: Confirm requirement understanding and consistency (confirm with question list)
|
|
324
|
+
- **After ADR creation → document-reviewer execution**: Confirm technical direction and consistency (present multiple options with comparison table)
|
|
325
|
+
- On user approval: Main AI (me) updates Status to Accepted
|
|
326
|
+
- On user rejection: Main AI (me) updates Status to Rejected
|
|
327
|
+
- **After Design Doc creation → document-reviewer execution**: Confirm design content and consistency
|
|
328
|
+
- **After work plan creation**: Batch approval for entire implementation phase (confirm with plan summary)
|
|
329
|
+
|
|
330
|
+
### Stop Points During Autonomous Execution
|
|
331
|
+
- **When requirement change detected**: Match in requirement change checklist → Return to requirement-analyzer
|
|
332
|
+
- **When critical error occurs**: Report error content → Wait for response instructions
|
|
333
|
+
- **When user interrupts**: Explicit stop instruction → Confirm situation
|
|
334
|
+
|
|
335
|
+
## 🎯 My Action Checklist
|
|
336
|
+
|
|
337
|
+
When receiving a task, I check the following:
|
|
338
|
+
|
|
339
|
+
- [ ] Confirmed if there is an orchestrator instruction
|
|
340
|
+
- [ ] Determined task type (new feature/fix/research, etc.)
|
|
341
|
+
- [ ] Considered appropriate subagent utilization
|
|
342
|
+
- [ ] Decided next action according to decision flow
|
|
343
|
+
- [ ] Monitored requirement changes and errors during autonomous execution mode
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# Use Cases Quick Reference
|
|
2
|
+
|
|
3
|
+
New here? Start with the [Quick Start Guide](./quickstart.md). This page serves as your daily development cheatsheet.
|
|
4
|
+
|
|
5
|
+
## Top 5 Commands (Learn These First)
|
|
6
|
+
|
|
7
|
+
| Command | Purpose | Example |
|
|
8
|
+
|---------|---------|---------|
|
|
9
|
+
| `/implement` | End-to-end feature implementation (from requirements to completion) | `/implement Add rate limiting to API` |
|
|
10
|
+
| `/task` | Single task with rule-based precision | `/task Fix bug` |
|
|
11
|
+
| `/design` | Design docs only (no implementation) | `/design Design payment system` |
|
|
12
|
+
| `/review` | Code review and auto-fix | `/review auth-system` |
|
|
13
|
+
| `/build` | Execute implementation from plan | `/build` |
|
|
14
|
+
|
|
15
|
+
## Overall Flow
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
graph LR
|
|
19
|
+
A[Requirements] --> B[Scale Detection]
|
|
20
|
+
B -->|Small:1-2 files| C[Direct Implementation]
|
|
21
|
+
B -->|Medium:3-5 files| D[Design Doc→Implementation]
|
|
22
|
+
B -->|Large:6+ files| E[PRD→ADR→Design Doc→Implementation]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Inside /implement Command
|
|
26
|
+
|
|
27
|
+
```mermaid
|
|
28
|
+
graph TD
|
|
29
|
+
Start["/implement requirements"] --> RA["requirement-analyzer scale detection"]
|
|
30
|
+
RA -->|Small| Direct[Direct implementation]
|
|
31
|
+
RA -->|Medium| TD["technical-designer Design Doc"]
|
|
32
|
+
RA -->|Large| PRD["prd-creator PRD"]
|
|
33
|
+
|
|
34
|
+
PRD --> ADR["technical-designer ADR"]
|
|
35
|
+
ADR --> TD
|
|
36
|
+
TD --> WP["work-planner Work plan"]
|
|
37
|
+
WP --> TE["task-executor Execute tasks"]
|
|
38
|
+
Direct --> QF["quality-fixer Quality checks"]
|
|
39
|
+
TE --> QF
|
|
40
|
+
QF --> End[Complete]
|
|
41
|
+
|
|
42
|
+
style Start fill:#e1f5fe
|
|
43
|
+
style End fill:#c8e6c9
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
# Detailed Use Cases
|
|
49
|
+
|
|
50
|
+
## Want to add a feature?
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
/implement Add webhook API with retry logic and signature verification
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The LLM automatically detects scale, creates necessary documentation, and completes the implementation.
|
|
57
|
+
|
|
58
|
+
## Want to fix a bug?
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
/task Fix email validation bug with "+" character
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Clarifies rules before fixing the issue.
|
|
65
|
+
`/task` triggers a process of metacognition (self-reflection on reasoning). It helps the LLM clarify the situation, retrieve relevant rules, build task lists, and understand the work context—improving execution accuracy.
|
|
66
|
+
|
|
67
|
+
## Want design only?
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
/design Design large-scale batch processing system
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Creates design documents, conducts LLM self-review, requests user review as needed, and finalizes the design docs. Does not implement.
|
|
74
|
+
|
|
75
|
+
## Want to work step by step?
|
|
76
|
+
|
|
77
|
+
Execute Design → Plan → Build individually. You can work more incrementally by specifying phases directly in the command arguments.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
/design # Create design docs
|
|
81
|
+
/plan # Create work plan
|
|
82
|
+
/build implement phase 1 # Execute implementation (with phase specification)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Want to resume work?
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Check progress
|
|
89
|
+
ls docs/plans/tasks/*.md | head -5
|
|
90
|
+
git log --oneline -5
|
|
91
|
+
|
|
92
|
+
# Resume with the build command
|
|
93
|
+
/build auth-implementation
|
|
94
|
+
# Or simply continue where you left off
|
|
95
|
+
/build
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Tasks are marked complete with checkmarks (- [x]) in Markdown format.
|
|
99
|
+
Some Claude Code models may not automatically mark tasks as completed. In that case, you can instruct: "Please mark completed tasks by reviewing the commit history."
|
|
100
|
+
|
|
101
|
+
## Want code review?
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
/review # Check Design Doc compliance
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Auto-fix is suggested if compliance is below 70%.
|
|
108
|
+
Fixes are created as task files under `docs/plans/tasks` and executed by sub-agents.
|
|
109
|
+
|
|
110
|
+
## Want to initialize or customize project settings?
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
/project-inject # Set project context
|
|
114
|
+
/sync-rules # Sync metadata
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
# Command Reference
|
|
120
|
+
|
|
121
|
+
## Scale Detection Criteria
|
|
122
|
+
|
|
123
|
+
| Scale | Files | Examples | Generated Docs |
|
|
124
|
+
|-------|-------|----------|----------------|
|
|
125
|
+
| Small | 1-2 | Bug fixes, refactoring | None |
|
|
126
|
+
| Medium | 3-5 | API additions, rate limiting | Design Doc + Work plan |
|
|
127
|
+
| Large | 6+ | Auth system, payment system | PRD + ADR + Design Doc + Work plan |
|
|
128
|
+
|
|
129
|
+
## Command Details
|
|
130
|
+
|
|
131
|
+
### /implement
|
|
132
|
+
**Purpose**: Full automation from requirements to implementation
|
|
133
|
+
**Args**: Requirements description
|
|
134
|
+
**Process**:
|
|
135
|
+
1. requirement-analyzer detects scale
|
|
136
|
+
2. Generate docs based on scale
|
|
137
|
+
3. task-executor implements
|
|
138
|
+
4. quality-fixer ensures quality
|
|
139
|
+
5. Commit per task
|
|
140
|
+
|
|
141
|
+
Helps clarify requirements and creates design documents. Creates work plans and task files from design docs, then completes implementation according to the plan.
|
|
142
|
+
Aimed at completing Agentic Coding (LLMs autonomously making decisions and executing implementation tasks), performing automatic execution following the flow with minimal human intervention except for design clarification and handling issues beyond LLM judgment.
|
|
143
|
+
|
|
144
|
+
### /task
|
|
145
|
+
**Purpose**: Rule-based high-precision task execution
|
|
146
|
+
**Args**: Task description
|
|
147
|
+
**Process**:
|
|
148
|
+
1. Clarify applicable rules
|
|
149
|
+
2. Determine initial action
|
|
150
|
+
3. Confirm restrictions
|
|
151
|
+
4. Execute task
|
|
152
|
+
|
|
153
|
+
Encourages metacognition (self-reflection on reasoning), understands task essence and applicable rules, then refines the specified task. Uses the `rule-advisor` sub-agent to retrieve and utilize appropriate rules from rule files under `docs/rules`.
|
|
154
|
+
|
|
155
|
+
### /design
|
|
156
|
+
**Purpose**: Design docs creation (no implementation)
|
|
157
|
+
**Args**: What to design
|
|
158
|
+
**Process**:
|
|
159
|
+
1. Requirements analysis (requirement-analyzer)
|
|
160
|
+
2. PRD creation (if large scale)
|
|
161
|
+
3. ADR creation (if tech choices needed)
|
|
162
|
+
4. Design Doc creation
|
|
163
|
+
5. End with approval
|
|
164
|
+
|
|
165
|
+
Interacts with users to organize requirements and create various design documents. Determines necessary documents based on implementation scale, finalizes design docs through creation, self-review, and user review reflection.
|
|
166
|
+
Use when not adopting the full design-to-implementation process via `/implement`.
|
|
167
|
+
|
|
168
|
+
### /plan
|
|
169
|
+
**Purpose**: Create work plan
|
|
170
|
+
**Args**: [design doc name] (optional)
|
|
171
|
+
**Prerequisite**: Design Doc must exist
|
|
172
|
+
**Process**:
|
|
173
|
+
1. Select design doc
|
|
174
|
+
2. Confirm E2E test generation
|
|
175
|
+
3. work-planner creates plan
|
|
176
|
+
4. Get approval
|
|
177
|
+
|
|
178
|
+
Creates work plan from Design Doc. Also creates integration/E2E tests required for implementation.
|
|
179
|
+
Use when not adopting the full design-to-implementation process via `/implement`.
|
|
180
|
+
|
|
181
|
+
### /build
|
|
182
|
+
**Purpose**: Automated implementation execution
|
|
183
|
+
**Args**: [task file name] (optional)
|
|
184
|
+
**Prerequisite**: Task files or work plan must exist
|
|
185
|
+
**Process**:
|
|
186
|
+
1. Check task files
|
|
187
|
+
2. Generate with task-decomposer if missing
|
|
188
|
+
3. Execute with task-executor
|
|
189
|
+
4. quality-fixer checks quality
|
|
190
|
+
5. Commit per task
|
|
191
|
+
|
|
192
|
+
Executes implementation tasks described in specified task files. If only work plan exists without task files, uses `task-decomposer` to break down tasks before executing.
|
|
193
|
+
Use when not adopting the full design-to-implementation process via `/implement`.
|
|
194
|
+
|
|
195
|
+
Unless specified otherwise, automatically executes until completing the implementation described in the plan. If you want work done in phases or task units, clearly communicate the desired phase in arguments. Be careful as explicitly interrupting implementation midway may leave code in an unexecutable state.
|
|
196
|
+
|
|
197
|
+
**Example for phase-based implementation**
|
|
198
|
+
```bash
|
|
199
|
+
/build Refer to docs/plans/tasks and complete phase 1 tasks
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### /review
|
|
203
|
+
**Purpose**: Design Doc compliance, code quality verification
|
|
204
|
+
**Args**: [Design Doc name] (optional)
|
|
205
|
+
**Process**:
|
|
206
|
+
1. code-reviewer calculates compliance
|
|
207
|
+
2. List unmet items
|
|
208
|
+
3. Suggest auto-fixes
|
|
209
|
+
4. Execute fixes with task-executor after approval
|
|
210
|
+
|
|
211
|
+
Conducts code review. Primarily reviews whether implementation complies with Design Doc and meets rule-based code quality standards, providing feedback. Creates task files and uses sub-agents like `task-executor` to fix issues upon user instruction.
|
|
212
|
+
Use when not adopting the full design-to-implementation process via `/implement`.
|
|
213
|
+
|
|
214
|
+
### /refine-rule
|
|
215
|
+
**Purpose**: Rule improvement
|
|
216
|
+
**Args**: What to change
|
|
217
|
+
**Process**:
|
|
218
|
+
1. Select rule file
|
|
219
|
+
2. Create change proposal
|
|
220
|
+
3. 3-pass review process
|
|
221
|
+
4. Apply
|
|
222
|
+
|
|
223
|
+
Assists with rule file editing. Since rules must be optimized for LLMs to maintain execution accuracy, creating optimal rules with this command alone is difficult. Refer to the [Rule Editing Guide](./rule-editing-guide.md) and refine rules through command usage or direct dialogue with LLMs.
|
|
224
|
+
|
|
225
|
+
### /sync-rules
|
|
226
|
+
**Purpose**: Sync rule metadata
|
|
227
|
+
**Args**: None
|
|
228
|
+
**When**: After rule file edits
|
|
229
|
+
|
|
230
|
+
Updates metadata files used by the `rule-advisor` sub-agent to find rules to reference. Must be executed after changing rules. Not needed if rules haven't changed.
|
|
231
|
+
|
|
232
|
+
Common behavior patterns:
|
|
233
|
+
- "9 files checked, all synchronized, no updates needed" → This is normal
|
|
234
|
+
- "3 improvement suggestions: [specific suggestions]" → Approve as needed
|
|
235
|
+
- Forcing changes every time → This is inappropriate behavior, please report
|
|
236
|
+
|
|
237
|
+
### /project-inject
|
|
238
|
+
**Purpose**: Set project context
|
|
239
|
+
**Args**: None
|
|
240
|
+
**Process**: Interactive project information collection
|
|
241
|
+
|
|
242
|
+
**When to use**:
|
|
243
|
+
- Initial setup (required)
|
|
244
|
+
- When project direction changes significantly
|
|
245
|
+
- When target users change
|
|
246
|
+
- When business requirements change significantly
|
|
247
|
+
|
|
248
|
+
This command sets project background information as rule files to maximize the probability of work being done with understanding of context. Therefore, it doesn't need to be run daily. Use only at initial setup and when fundamental project assumptions change.
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
# Troubleshooting
|
|
254
|
+
|
|
255
|
+
## Task Files
|
|
256
|
+
|
|
257
|
+
Task files exist under `docs/plans/tasks`. Implementation is performed in units of these task files, with completed tasks marked with Markdown checkmarks (- [x]) upon completion.
|
|
258
|
+
Some Claude Code models may not automatically mark tasks as completed. In that case, you can instruct: "Please mark completed tasks by reviewing the commit history."
|
|
259
|
+
|
|
260
|
+
## When implementation is interrupted
|
|
261
|
+
|
|
262
|
+
Use the `/implement` or `/build` commands to resume work.
|
|
263
|
+
```bash
|
|
264
|
+
/implement Resume from task 3 and complete the work
|
|
265
|
+
/build Search for incomplete tasks from docs/plans/tasks and resume implementation
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
| Issue | Check Command | Solution |
|
|
269
|
+
|-------|---------------|----------|
|
|
270
|
+
| Repeating same error | `npm run check:all` | Check environment, fix with `/task` |
|
|
271
|
+
| Code differs from design | `/review` | Check compliance, auto-fix |
|
|
272
|
+
| Task stuck | `ls docs/plans/tasks/` | Identify blocker, check task file |
|
|
273
|
+
| Command not recognized | `ls .claude/commands-en/` | Check typo |
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
# Examples
|
|
278
|
+
|
|
279
|
+
## Webhook Feature (Medium scale – about 4 files)
|
|
280
|
+
```bash
|
|
281
|
+
/implement External system webhook API
|
|
282
|
+
```
|
|
283
|
+
**Generated files**:
|
|
284
|
+
- docs/design/webhook-system.md
|
|
285
|
+
- src/services/webhook.service.ts
|
|
286
|
+
- src/services/retry.service.ts
|
|
287
|
+
- src/controllers/webhook.controller.ts
|
|
288
|
+
|
|
289
|
+
## Auth System (Large scale – 10+ files)
|
|
290
|
+
```bash
|
|
291
|
+
/implement JWT auth with RBAC system
|
|
292
|
+
```
|
|
293
|
+
**Generated files**:
|
|
294
|
+
- docs/prd/auth-system.md
|
|
295
|
+
- docs/adr/auth-architecture.md
|
|
296
|
+
- docs/design/auth-system.md
|
|
297
|
+
- src/auth/ (implementation files)
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Next Steps
|
|
302
|
+
|
|
303
|
+
Once you understand the basics, start applying them in practice. As you gain experience and feel the need to improve, try customizing the rules.
|
|
304
|
+
|
|
305
|
+
→ **[Rule Editing Guide](./rule-editing-guide.md)** - How to understand LLM characteristics and create effective rules
|
|
306
|
+
|
|
307
|
+
See command definitions in `.claude/commands-en/` for details.
|
|
308
|
+
Having issues? Check [GitHub Issues](https://github.com/shinpr/ai-coding-project-boilerplate/issues).
|