Skip to content

Commit 90bc74e

Browse files
authored
Merge pull request #68 from shinpr/feat/add-command-and-guide
docs: improve Japanese documentation usability and clarity
2 parents 9cea5ca + f79852f commit 90bc74e

File tree

12 files changed

+1289
-86
lines changed

12 files changed

+1289
-86
lines changed

.claude/commands-en/build.md

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,73 @@
22
description: Execute decomposed tasks in autonomous execution mode
33
---
44

5-
Strictly follow @docs/guides/sub-agents.md and act as an orchestrator.
5+
**STRICTLY AND PRECISELY** follow @docs/guides/sub-agents.md and act as the PRIMARY ORCHESTRATOR.
66

77
Work plan: $ARGUMENTS
88

9-
## Metacognition for Each Task
10-
**Required cycle**: `task-executor → quality-fixer → commit`
9+
## 📋 Pre-execution Prerequisites
1110

12-
Before starting any task, always:
13-
1. **Execute rule-advisor**: Understand the essence of the task
14-
2. **Update TodoWrite**: Structure progress tracking
15-
3. **Process structured responses**: When `readyForQualityCheck: true` is detected, execute quality-fixer immediately
11+
### Task File Existence Check
12+
```bash
13+
# Check work plans
14+
! ls -la docs/plans/*.md | grep -v template | tail -5
1615

17-
**Think deeply** Monitor structured responses carefully and ensure all quality gates are passed without exception.
16+
# Check task files
17+
! ls docs/plans/tasks/*.md 2>/dev/null || echo "⚠️ No task files found"
18+
```
19+
20+
### Task Generation Decision Flow
21+
22+
**THINK DEEPLY AND SYSTEMATICALLY** Analyze task file existence state and determine the EXACT action required:
23+
24+
| State | Criteria | Next Action |
25+
|-------|----------|-------------|
26+
| Tasks exist | .md files in tasks/ directory | Proceed to autonomous execution |
27+
| No tasks + plan exists | Plan exists but no task files | Confirm with user → run task-decomposer |
28+
| Neither exists | No plan or task files | Error: Prerequisites not met |
29+
30+
## 🔄 Task Decomposition Phase (Conditional)
31+
32+
When task files don't exist:
33+
34+
### 1. User Confirmation
35+
```
36+
No task files found.
37+
Work plan: docs/plans/[plan-name].md
38+
39+
Generate tasks from the work plan? (y/n):
40+
```
41+
42+
### 2. Task Decomposition (if approved)
43+
```
44+
@task-decomposer Read work plan and decompose into atomic tasks:
45+
- Input: docs/plans/[plan-name].md
46+
- Output: Individual task files in docs/plans/tasks/
47+
- Granularity: 1 task = 1 commit = independently executable
48+
```
49+
50+
### 3. Verify Generation
51+
```bash
52+
# Verify generated task files
53+
! ls -la docs/plans/tasks/*.md | head -10
54+
```
55+
56+
**MANDATORY**: After task generation, AUTOMATICALLY proceed to autonomous execution
57+
**PROHIBITED**: Starting implementation without task generation
58+
59+
## 🧠 Metacognition for Each Task
60+
**MANDATORY EXECUTION CYCLE**: `task-executor → quality-fixer → commit`
61+
62+
Before starting EACH task, YOU MUST:
63+
1. **EXECUTE rule-advisor**: Extract the TRUE ESSENCE of the task
64+
2. **UPDATE TodoWrite**: Structure and track progress IMMEDIATELY
65+
3. **PROCESS structured responses**: When `readyForQualityCheck: true` is detected → EXECUTE quality-fixer IMMEDIATELY
66+
67+
**THINK DEEPLY** Monitor ALL structured responses WITHOUT EXCEPTION and ENSURE every quality gate is passed.
1868

1969
! ls -la docs/plans/*.md | head -10
2070

21-
Verify approval status before proceeding. Once confirmed, initiate autonomous execution mode.
71+
VERIFY approval status before proceeding. Once confirmed, INITIATE autonomous execution mode. STOP IMMEDIATELY upon detecting ANY requirement changes.
2272

2373
## Output Example
2474
Implementation phase completed.

.claude/commands-en/refine-rule.md

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
---
2+
description: Optimize rule changes for maximum AI execution accuracy
3+
---
4+
5+
Change request: $ARGUMENTS
6+
7+
**THINK DEEPLY AND SYSTEMATICALLY** Extract the TRUE INTENT behind user's change request and implement with MAXIMUM PRECISION to eliminate ALL ambiguity:
8+
9+
## 9 Optimization Perspectives
10+
1. Context efficiency vs execution accuracy - Maximum accuracy with minimal description
11+
2. Deduplication - Consistency within and across rule files
12+
3. Proper responsibility aggregation - Group related content (minimize read operations)
13+
4. Clear decision criteria - Measurable standards
14+
5. Transform negatives to recommendations - Recommended format (background: including NG examples)
15+
6. Consistent notation - Unified expressions
16+
7. Explicit prerequisites - Make implicit assumptions visible
17+
8. Optimized description order - Most important first, exceptions last
18+
9. Clear scope boundaries - What's covered vs what's not
19+
20+
## Execution Flow
21+
22+
### 1. Understand the Request
23+
24+
Question template when unspecified:
25+
```
26+
1. Which rule file to modify?
27+
e.g.: typescript.md / ai-development-guide.md / documentation-criteria.md
28+
29+
2. Select change type:
30+
a) Add new rule (add new criteria)
31+
b) Modify existing rule (clarify ambiguous descriptions)
32+
c) Delete rule (remove obsolete criteria)
33+
34+
3. Specific changes:
35+
e.g.: "Add rule prohibiting 'any' type usage"
36+
e.g.: "Clarify error handling criteria"
37+
[User input]
38+
```
39+
40+
### 2. Create Design Proposal
41+
42+
Target file identification and current state check:
43+
44+
```
45+
# Tool selection criteria (measurable decisions)
46+
if file path is explicitly provided:
47+
Read: Direct file read (background: Skip Glob to save context)
48+
else if partial filename known:
49+
Glob: docs/rules/*{keyword}*.md search
50+
Read: Check identified file's current state
51+
else:
52+
Glob: docs/rules/*.md for full scan (background: comprehensive search when unclear)
53+
Confirm target file selection with user
54+
```
55+
56+
Design template:
57+
```
58+
【Current】
59+
"Handle errors appropriately" (ambiguous: "appropriately" undefined)
60+
61+
【Understanding User Request】
62+
"Want stricter error handling" → Set measurable criteria
63+
64+
【Proposal】
65+
"Error handling implementation criteria:
66+
1. try-catch required for:
67+
- External API calls (fetch, axios, etc.)
68+
- File I/O operations (fs.readFile, etc.)
69+
- Parsing operations (JSON.parse, parseInt, etc.)
70+
2. Required error log items:
71+
- error.name (error type)
72+
- error.stack (location)
73+
- Timestamp (ISO 8601 format)
74+
3. User notification criteria:
75+
- No technical details (NG: stack trace display)
76+
- Clear action items (recommended: "Please try again")"
77+
78+
Proceed with this design? (y/n)
79+
```
80+
81+
### 3. Three-Pass Review Process
82+
83+
#### Pass 1: Add for Maximum Accuracy【Addition-Only Mode】
84+
**MANDATORY DECLARATION**: "Pass 1: Addition mode execution. Deletions are STRICTLY PROHIBITED."
85+
**REQUIRED ACTIONS**:
86+
- CONVERT all ambiguous expressions → measurable criteria
87+
Example: "large" → "100+ lines" "5+ files"
88+
- MAKE all implicit prerequisites explicit
89+
Example: "In TypeScript environment" "Within async functions"
90+
- DEFINE all exceptions and edge cases
91+
Example: "When null/undefined" "For empty arrays"
92+
**MANDATORY REPORT**: Count added items (MINIMUM 5 items required)
93+
94+
#### Pass 2: Critical Modification to Reduce Redundancy【Actual Modification Mode】
95+
**MANDATORY DECLARATION**: "Pass 2: Critical modification mode execution. ACTUALLY DELETE and CONSOLIDATE redundant parts."
96+
97+
**REQUIRED MODIFICATION WORK**:
98+
1. CRITICALLY REVIEW all Pass 1 additions
99+
2. APPLY modifications using these EXACT criteria:
100+
- Duplicate concepts → MUST consolidate
101+
- Overly detailed explanations → MUST simplify
102+
- Overlap with other rules → MUST replace with references
103+
3. RECORD complete before/after diff (deletion reasons REQUIRED)
104+
105+
Report format:
106+
```
107+
Modified locations: X items
108+
Deleted/consolidated content:
109+
- [Before]: "Detailed description"
110+
[After]: "Concise description"
111+
[Reason]: Redundancy elimination
112+
```
113+
114+
#### Pass 3: Accuracy Assurance via Diff Evaluation【Restoration Decision Mode】
115+
**MANDATORY DECLARATION**: "Pass 3: Diff evaluation mode execution. REVIEW all Pass 2 modifications and RESTORE if accuracy compromised."
116+
117+
**REQUIRED VERIFICATION WORK**:
118+
1. EVALUATE EACH Pass 2 modification against these criteria:
119+
- Does deletion create implementation ambiguity? YES = RESTORE
120+
- Are ALL edge cases still covered? NO = RESTORE
121+
2. Action mapping:
122+
- Deletions with accuracy risks → MUST restore
123+
- Valid deletions → KEEP
124+
125+
**MANDATORY FINAL CONFIRMATION** (MUST answer explicitly):
126+
"Are necessary and sufficient conditions present for accurate implementation of user requirements? YES/NO with justification"
127+
128+
**MANDATORY REPORT**: Number of restored items AND final reduction percentage
129+
130+
### 4. Get Approval
131+
132+
Present before/after comparison for user approval.
133+
134+
### 5. Implementation
135+
136+
1. Apply changes with appropriate tool (after user approval)
137+
2. Final verification with git diff
138+
3. Suggest `/sync-rules` execution
139+
140+
## Decision Criteria Checklist
141+
- [ ] Expressible in "if-then" format ("if X then Y")
142+
- [ ] Measurable by numbers/counts/states (eliminate subjective judgment)
143+
- [ ] Related content aggregated in single file (minimize read operations)
144+
- [ ] Relationships with other rules specified (dependencies/references/delegation)
145+
- [ ] NG examples included as background information
146+
- [ ] All prerequisites explicitly stated
147+
148+
## Reduction Pattern Examples
149+
| Pattern | Before | After |
150+
|---------|--------|-------|
151+
| Emotional expressions | "must always" | "execute when (background: build error if skipped)" |
152+
| Time expressions | "immediately" | "execute first after error detection" |
153+
| Implicit prerequisites | "implement error handling" | "TypeScript async function error handling" |
154+
| Unclear order | "consider: A, B, C" | "Priority: 1.A (required), 2.B (recommended), 3.C (optional)" |
155+
| Redundant explanation | "ensure type safety by defining types, checking types, and preventing type errors" | "type safety (define・check・prevent errors)" |
156+
| Ambiguous scope | "write tests" | "write unit tests (see test-guide for E2E tests)" |
157+
158+
## Output Example
159+
160+
```
161+
=== Change Implementation Complete ===
162+
163+
【User Request】
164+
"Strengthen TypeScript error handling rules"
165+
166+
【Changes】
167+
Target: docs/rules/typescript.md
168+
Section: ## Error Handling
169+
170+
Before:
171+
"Handle errors appropriately"
172+
173+
After (3-pass review complete):
174+
"Error handling implementation criteria:
175+
1. try-catch block required for:
176+
- External API calls (fetch, axios, etc.)
177+
- File I/O operations (fs.readFile, fs.writeFile, etc.)
178+
- Exception-prone operations (JSON.parse, parseInt, etc.)
179+
2. Required error log items:
180+
- error.name (error type)
181+
- error.stack (location)
182+
- new Date().toISOString() (timestamp)
183+
3. User-facing messages:
184+
- No technical details (NG: stack trace display)
185+
- Clear action items (recommended: "Please try again")"
186+
187+
【Improvement Metrics】
188+
- Decision clarity: 0% → 100% (all measurable)
189+
- Ambiguous expressions: 1 → 0
190+
- NG examples included as background
191+
192+
Run /sync-rules for metadata synchronization.
193+
```
194+
195+
## Execution Order
196+
1. Understand user request
197+
2. Analyze current state
198+
3. Design changes with 9 perspectives
199+
4. 3-pass review process
200+
5. User approval
201+
6. Apply changes
202+
7. Suggest sync-rules
203+
204+
**Scope**: Understanding user change requests and implementing with maximum accuracy
205+
206+
## Error Handling
207+
- **File not found**: Display available rule list
208+
- **Large change detected**: Suggest phased implementation for 50%+ changes

.claude/commands-ja/build.md

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,56 @@ description: 分解済みタスクを自律実行モードで実装
66

77
作業計画書: $ARGUMENTS
88

9+
## 📋 実行前の前提確認
10+
11+
### タスクファイル存在チェック
12+
```bash
13+
# 計画書の確認
14+
! ls -la docs/plans/*.md | grep -v template | tail -5
15+
16+
# タスクファイルの確認
17+
! ls docs/plans/tasks/*.md 2>/dev/null || echo "⚠️ タスクファイルが見つかりません"
18+
```
19+
20+
### タスク生成判定フロー
21+
22+
**Think deeply** タスクファイルの存在状態を確認し、適切な対応を決定:
23+
24+
| 状態 | 判定基準 | 次のアクション |
25+
|------|---------|--------------|
26+
| タスク存在 | tasks/ディレクトリに.mdファイルあり | 自律実行モードへ移行 |
27+
| タスクなし+計画書あり | 計画書は存在するがタスクファイルなし | ユーザーに確認 → task-decomposer実行 |
28+
| 両方なし | 計画書もタスクファイルもなし | エラー:実行条件を満たさない |
29+
30+
## 🔄 タスク分解フェーズ(条件付き実行)
31+
32+
タスクファイルが存在しない場合の処理:
33+
34+
### 1. ユーザー確認
35+
```
36+
タスクファイルが見つかりません。
37+
作業計画書: docs/plans/[計画書名].md
38+
39+
計画書からタスクを分解して生成しますか? (y/n):
40+
```
41+
42+
### 2. タスク分解実行(承認時)
43+
```
44+
@task-decomposer 作業計画書を読み込み、1コミット粒度の独立したタスクに分解:
45+
- 入力: docs/plans/[計画書名].md
46+
- 出力: docs/plans/tasks/配下に個別タスクファイル生成
47+
- 粒度: 1タスク = 1コミット = 独立して実行可能
48+
```
49+
50+
### 3. 生成確認
51+
```bash
52+
# 生成されたタスクファイルを確認
53+
! ls -la docs/plans/tasks/*.md | head -10
54+
```
55+
56+
**推奨**: タスク生成完了後、自動的に自律実行モードへ移行
57+
**避ける**: タスク未生成のまま実装を開始
58+
959
## 🧠 各タスクでメタ認知
1060
**必須サイクル**: `task-executor → quality-fixer → commit`
1161

@@ -16,15 +66,13 @@ description: 分解済みタスクを自律実行モードで実装
1666

1767
**Think deeply** 構造化レスポンスを見落とさず、品質ゲートを確実に通過させます。
1868

19-
! ls -la docs/plans/*.md | head -10
20-
2169
承認確認後、自律実行モードを開始。要件変更検知時は即座に停止。
2270

2371
## 出力例
2472
実装フェーズが完了しました。
25-
- タスク分解: docs/plans/tasks/ 配下に生成
73+
- タスク分解: docs/plans/tasks/ 配下に生成(実行時のみ)
2674
- 実装されたタスク: [タスク数]
2775
- 品質チェック: すべて通過
2876
- コミット: [コミット数]件作成
2977

30-
**重要**: 本コマンドはタスク分解から実装完了まで担当。要件変更検知時は自動停止
78+
**責務境界**: 本コマンドはタスク分解から実装完了まで担当。

0 commit comments

Comments
 (0)