Skip to content

Commit 9cea5ca

Browse files
authored
Merge pull request #66 from shinpr/feat/update-implement-command-v2
feat: improve implement command with situation-based decision flow
2 parents 5d91dd0 + 04caa1d commit 9cea5ca

File tree

2 files changed

+85
-31
lines changed

2 files changed

+85
-31
lines changed

.claude/commands-en/implement.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,45 @@ Strictly adhere to @docs/guides/sub-agents.md and operate exclusively as an orch
88

99
## Execution Decision Flow
1010

11-
### 1. Work Phase Identification
11+
### 1. Current Situation Assessment
1212
Instruction Content: $ARGUMENTS
1313

14-
**Think deeply** Analyze the instruction intent and determine the appropriate work phase:
14+
**Think deeply** Assess the current situation:
1515

16-
| Instruction Patterns | Identified Phase | Initial Sub-agent |
17-
|---------------------|------------------|-------------------|
18-
| task, implement, fix, bug fix, patch | Implementation Phase | task-executor |
19-
| plan, decompose, break down, organize steps | Planning Phase | work-planner/task-decomposer |
20-
| design, architecture, tech selection, approach | Design Phase | technical-designer |
21-
| requirement, need, want, "I want to..." | Requirements Phase | requirement-analyzer |
22-
| unclear, ambiguous, vague | Clarification Required | Initiate dialogue |
16+
| Situation Pattern | Decision Criteria | Next Action |
17+
|------------------|------------------|-------------|
18+
| New Requirements | No existing work, new feature/fix request | Start with requirement-analyzer |
19+
| Flow Continuation | Existing docs/tasks present, continuation directive | Identify next step in sub-agents.md flow |
20+
| Quality Errors | Error detection, test failures, build errors | Execute quality-fixer |
21+
| Ambiguous | Intent unclear, multiple interpretations possible | Confirm with user |
2322

24-
### 2. Phase-Based Execution Protocol
23+
### 2. Progress Verification for Continuation
2524

26-
**Clear Phase Identified**: Execute with corresponding sub-agent immediately
27-
**Ambiguous Phase**: Execution without clarification is STRICTLY PROHIBITED
25+
When continuing existing flow, verify:
26+
- Latest artifacts (PRD/ADR/Design Doc/Work Plan/Tasks)
27+
- Current phase position (Requirements/Design/Planning/Implementation/QA)
28+
- Identify next step in sub-agents.md corresponding flow
2829

29-
### 3. Clarification Dialogue Protocol
30+
### 3. Next Action Execution
3031

31-
**When unclear**: Initiate structured dialogue to identify the work phase
32-
**Post-clarification**: Begin execution with the identified phase's sub-agent
32+
**MANDATORY sub-agents.md reference**:
33+
- Verify scale-based flow (Large/Medium/Small scale)
34+
- Confirm autonomous execution mode conditions
35+
- Recognize mandatory stopping points
36+
- Invoke next sub-agent defined in flow
37+
38+
## 📋 sub-agents.md Compliance Execution
39+
40+
**Pre-execution Checklist (MANDATORY)**:
41+
- [ ] Confirmed relevant sub-agents.md flow
42+
- [ ] Identified current progress position
43+
- [ ] Clarified next step
44+
- [ ] Recognized stopping points
45+
- [ ] Understood task execution quality cycle (task → quality-check → commit)
46+
47+
**Flow Deviation PROHIBITED**: Deviating from sub-agents.md defined flows is strictly forbidden. Specifically:
48+
- Never skip quality-fixer before committing
49+
- Never use Edit/Write/MultiEdit without user approval outside autonomous mode
3350

3451
## 🚨 CRITICAL Sub-agent Invocation Constraints
3552

@@ -41,7 +58,17 @@ DO NOT invoke rule-advisor under any circumstances (Task tool rule-advisor speci
4158

4259
⚠️ **HIGH RISK**: task-executor/quality-fixer in autonomous mode have elevated crash risk - ALWAYS append this constraint to prompt end
4360

61+
## 🎯 Mandatory Orchestrator Responsibilities
62+
63+
### Task Execution Quality Cycle Management
64+
**ABSOLUTE RULE**: After task-executor execution, MUST execute:
65+
1. quality-fixer invocation (until approved: true is returned)
66+
2. git commit execution (using Bash tool)
67+
3. Next task execution or completion report
68+
69+
**NO OMISSION**: Skipping this cycle guarantees implementation quality failure
70+
4471
## Responsibility Boundaries
4572

46-
**This Command's Responsibility**: Orchestrate sub-agents through the complete implementation lifecycle
73+
**This Command's Responsibility**: Orchestrate sub-agents through the complete implementation lifecycle
4774
**OUT OF SCOPE**: Direct implementation work, investigation tasks (Grep/Glob/Read operations)

.claude/commands-ja/implement.md

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,45 @@ description: オーケストレーターとして要件分析から実装まで
88

99
## 実行判断フロー
1010

11-
### 1. 指示内容の作業フェーズ判定
11+
### 1. 現在状況の判定
1212
指示内容: $ARGUMENTS
1313

14-
**Think deeply** 指示の意図を理解し、作業フェーズを判定
14+
**Think deeply** 現在の状況を判定
1515

16-
| フェーズ判定の例 | 該当フェーズ | 開始サブエージェント |
17-
|-------------|------------|--------------|
18-
| タスク・実装・修正・バグ修正 | 実装フェーズ | task-executor |
19-
| 計画・タスク分解・ステップ整理 | 計画フェーズ | work-planner/task-decomposer |
20-
| 設計・アーキテクチャ・技術選定 | 設計フェーズ | technical-designer |
21-
| 要件・〜したい・何が必要か | 要件フェーズ | requirement-analyzer |
22-
| 不明瞭・曖昧 | ヒアリング | 対話で明確化 |
16+
| 状況パターン | 判定基準 | 次のアクション |
17+
|------------|---------|-------------|
18+
| 新規要件 | 既存作業なし、新しい機能/修正依頼 | requirement-analyzerから開始 |
19+
| フロー継続 | 既存ドキュメント/タスクあり、継続指示 | sub-agents.mdのフローで次のステップを特定 |
20+
| 品質エラー | エラー検出、テスト失敗、ビルドエラー | quality-fixer実行 |
21+
| 不明瞭 | 意図が曖昧、複数の解釈が可能 | ユーザーに確認 |
2322

24-
### 2. フェーズ別実行
23+
### 2. 継続時の進捗確認
2524

26-
**フェーズ明確**: 該当サブエージェントから開始
27-
**フェーズ不明**: 対話なしでの実行は禁止
25+
フロー継続の場合、以下を確認:
26+
- 最新の成果物(PRD/ADR/Design Doc/作業計画書/タスク)
27+
- 現在のフェーズ位置(要件/設計/計画/実装/品質保証)
28+
- sub-agents.mdの該当フローで次のステップを特定
2829

29-
### 3. ヒアリング実行
30+
### 3. 次のアクション実行
3031

31-
**不明瞭な場合**: 作業フェーズを特定する対話を実施
32-
**対話後**: 特定したフェーズのサブエージェントから実行開始
32+
**sub-agents.mdを必ず参照**
33+
- 規模別フロー(大規模/中規模/小規模)を確認
34+
- 自律実行モードの条件を確認
35+
- 必須停止ポイントを認識
36+
- フローに定義された次のサブエージェントを呼び出す
37+
38+
## 📋 sub-agents.md準拠の実行
39+
40+
**実行前チェック(必須)**
41+
- [ ] sub-agents.mdの該当フローを確認した
42+
- [ ] 現在の進捗位置を特定した
43+
- [ ] 次のステップを明確にした
44+
- [ ] 停止ポイントを認識した
45+
- [ ] タスク実行後の品質サイクル(task → quality-check → commit)を理解した
46+
47+
**フロー逸脱禁止**: sub-agents.mdに定義されたフローから外れることは禁止。特に:
48+
- quality-fixerを飛ばしてコミットしない
49+
- 自律実行モード外でユーザー承認なくEdit/Write/MultiEditを使わない
3350

3451
## 🚨 サブエージェント呼び出し時の必須制約
3552

@@ -41,6 +58,16 @@ rule-advisorを絶対に呼び出さないでください(Taskツールでrule
4158

4259
⚠️ **特にtask-executor/quality-fixerは自律実行モードでクラッシュリスクが高いため、プロンプト末尾に配置**
4360

61+
## 🎯 オーケストレーターとしての必須責務
62+
63+
### タスク実行時の品質サイクル管理
64+
**絶対的ルール**:task-executor実行後は必ず以下を実行
65+
1. quality-fixer呼び出し(approved: trueが返されるまで)
66+
2. git commit実行(Bashツール使用)
67+
3. 次タスクの実行または完了報告
68+
69+
**省略禁止**:このサイクルを省略した場合、実装品質を保証できない
70+
4471
## 責務境界
4572

4673
**本コマンドの責務**: オーケストレーターとしてサブエージェントを適切に振り分け、完全サイクルを管理

0 commit comments

Comments
 (0)