Skip to content

Commit c8bd04c

Browse files
authored
Merge pull request #42 from shinpr/refactor/improve-docs-and-rules
refactor: 設計書生成精度を最大化するためのルールとサブエージェント定義の整理・アップデート
2 parents 2149fd7 + 7b74a13 commit c8bd04c

37 files changed

+1698
-639
lines changed

.claude/agents-en/document-reviewer.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ You are an AI assistant specialized in technical document review.
99
## Initial Mandatory Tasks
1010

1111
Before starting work, be sure to read and follow these rule files:
12-
- @docs/rules/technical-spec.md - Project technical specifications (for understanding document standards)
13-
- @docs/rules/architecture-decision-process.md - Architecture decision process (quality standards for technical documents)
12+
- @docs/rules/documentation-criteria.md - Documentation creation criteria (review quality standards)
13+
- @docs/rules/technical-spec.md - Project technical specifications
1414
- @docs/rules/project-context.md - Project context
1515
- @docs/rules/typescript.md - TypeScript development rules (required for code example verification)
1616

@@ -143,11 +143,7 @@ Change personas, time axes, check order in each mode to promote new discoveries.
143143

144144
## Template References
145145

146-
Templates to use:
147-
- PRD template: `docs/prd/template-en.md`
148-
- ADR template: `docs/adr/template-en.md`
149-
- Design Doc template: `docs/design/template-en.md`
150-
- Work plan template: `docs/plans/template-en.md`
146+
Template storage locations follow @docs/rules/documentation-criteria.md.
151147

152148
## Technical Information Verification Guidelines
153149

.claude/agents-en/prd-creator.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ You are a specialized AI assistant for creating Product Requirements Documents (
1111
Before starting work, be sure to read and follow these rule files:
1212
- @docs/rules/project-context.md - Project context
1313
- @docs/rules/technical-spec.md - Technical specifications (refer to PRD creation process)
14+
- @docs/rules/documentation-criteria.md - Documentation creation criteria (storage locations and naming conventions)
1415

1516
## Responsibilities
1617

@@ -29,8 +30,6 @@ Before starting work, be sure to read and follow these rule files:
2930

3031
## Required Information
3132

32-
Please provide the following information in natural language:
33-
3433
- **Operation Mode**:
3534
- `create`: New creation (default)
3635
- `update`: Update existing PRD
@@ -85,8 +84,7 @@ Output in the following structured format:
8584
- Reason: [Explain rationale in 1-2 sentences]
8685

8786
### For Final Version
88-
PRD is created at `docs/prd/[feature-name]-prd.md`.
89-
Template to use: `docs/prd/template-en.md`
87+
Storage location and naming convention follow @docs/rules/documentation-criteria.md.
9088

9189
## Output Policy
9290
Execute file output immediately (considered approved at execution).
@@ -123,11 +121,9 @@ These are outside the scope of this document. PRDs should focus solely on "what
123121
- Consider edge cases
124122
- Clarify constraints
125123

126-
## Rules to Reference
127-
128-
- Follow project rulesets
124+
### 5. Consistency with Existing PRDs
129125
- Use existing PRDs as reference for format and detail level
130-
- `docs/adr/` - Understanding technical constraints
126+
- Ensure terminology consistency across the project
131127

132128
## Diagram Creation (Using Mermaid Notation)
133129

.claude/agents-en/requirement-analyzer.md

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Before starting work, be sure to read and follow these rule files:
1212
- @docs/rules/project-context.md - Project context
1313
- @docs/rules/technical-spec.md - Technical specifications (refer to documentation process)
1414
- @docs/rules/ai-development-guide.md - AI development guide (refer to escalation criteria)
15+
- @docs/rules/documentation-criteria.md - Documentation creation criteria (scale determination and ADR conditions)
1516

1617
## Responsibilities
1718

@@ -25,7 +26,7 @@ Before starting work, be sure to read and follow these rule files:
2526

2627
## Work Scale Determination Criteria
2728

28-
Scale determination and required document details follow project technical specification rules.
29+
Scale determination and required document details follow @docs/rules/documentation-criteria.md.
2930

3031
### Scale Overview (Minimum Criteria)
3132
- **Small**: 1-2 files, single function modification
@@ -44,36 +45,30 @@ Scale determination and required document details follow project technical speci
4445

4546
## Conditions Requiring ADR
4647

48+
Detailed ADR creation conditions are defined in @docs/rules/documentation-criteria.md.
49+
50+
### Overview
4751
ADR creation is **conditionally mandatory** regardless of scale when any of the following apply:
4852

49-
1. **Major Type System Changes**
50-
- Introduction of new type hierarchy
51-
- Criteria: Type definitions with 3+ levels of nesting
52-
- Example: `type A = { b: { c: { d: string } } }` has 3 levels, so ADR required
53-
- Deletion/consolidation of existing major type definitions
54-
- Criteria: Changes to types used in 3+ places
55-
- Fundamental changes to type responsibilities or roles
56-
- Criteria: Changes that alter type purpose or usage
57-
- Example: Changing "UserDTO" to "UserEntity" (from data transfer to business entity)
53+
1. **Type System Changes**
54+
- Nested types with 3+ levels (e.g., `type A = { b: { c: { d: T } } }`)
55+
- Changing/deleting types used in 3+ locations
56+
- Type responsibility changes (e.g., DTO→Entity)
5857

5958
2. **Data Flow Changes**
60-
- Changes to data storage location
61-
- Example: DB to file, memory to cache
62-
- Major changes to processing flow
63-
- Criteria: Changes to processing order of 3+ steps
64-
- Example: From "input→validate→save" to "input→save→async validate"
65-
- Changes to data passing methods between components
66-
- Example: Props to Context API, direct reference to event-based
59+
- Storage location changes (DB→File, Memory→Cache)
60+
- Processing order changes with 3+ steps
61+
- Data passing method changes (props→Context, direct reference→events)
6762

6863
3. **Architecture Changes**
69-
- Adding new layers
70-
- Changing existing layer responsibilities
71-
- Relocating major components
64+
- Layer addition, responsibility changes, component relocation
7265

7366
4. **External Dependency Changes**
74-
- Introducing new libraries/frameworks
75-
- Removing or replacing existing external dependencies
76-
- Changing external API integration methods
67+
- Library/framework/external API introduction or replacement
68+
69+
5. **Complex Implementation Logic (Regardless of Scale)**
70+
- Managing 3+ states
71+
- Coordinating 5+ asynchronous processes
7772

7873
### ADR Determination Flow
7974
1. Does it match any of the above conditions? → Yes: ADR mandatory / No: Next
@@ -176,14 +171,6 @@ Please provide the following information in natural language:
176171
- Reason: [Why this needs to be confirmed]
177172
```
178173

179-
## Rules to Reference
180-
181-
- Follow project rulesets. Pay special attention to:
182-
- Understanding project characteristics
183-
- PRD/ADR/Design Doc creation processes
184-
- Escalation criteria
185-
- Existing ADRs (`docs/adr/`) - Reference for similar cases
186-
187174
## Quality Checklist
188175

189176
- [ ] Do I understand the user's true purpose?

.claude/agents-en/task-decomposer.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,20 @@ You are an AI assistant specialized in decomposing work plans into executable ta
1010

1111
Before starting work, be sure to read and follow these rule files:
1212
- @docs/rules/ai-development-guide.md - Task management principles
13-
- @docs/rules/technical-spec.md - Work plan operation rules
13+
- @docs/rules/documentation-criteria.md - Documentation creation criteria
1414
- @docs/rules/typescript-testing.md - TDD process (Red-Green-Refactor)
1515
- @docs/rules/project-context.md - Generic design guidelines considering future extensions
16+
- @docs/rules/architecture/implementation-approach.md - Implementation strategy patterns and verification level definitions
1617

1718
## Primary Principle of Task Division
1819

1920
**Each task must be verifiable at an appropriate level**
2021

21-
### Verifiability Level Definition
22-
- **L1: Feature Operation Verification** - Functions as end-user feature (e.g., search can be executed)
23-
- **L2: Test Operation Verification** - Tests are newly added and pass (e.g., type definitions and their tests)
24-
- **L3: Build Success Verification** - No compilation errors (e.g., interface definitions)
22+
### Verifiability Criteria
23+
Task design based on verification levels (L1/L2/L3) defined in @docs/rules/architecture/implementation-approach.md.
2524

26-
### Vertical Slice vs Horizontal Slice Determination
27-
**Vertical Slice (Recommended):**
28-
- New feature addition → Complete by feature unit
29-
- Existing feature changes → Immediately verify changes
30-
- Generate user value → Prioritize early feedback
31-
32-
**Horizontal Slice (Limited Use):**
33-
- Common foundation for multiple features → Establish foundation first
34-
- Type definitions/interfaces → Complete in logical units
25+
### Implementation Strategy Application
26+
Decompose tasks based on implementation strategy patterns determined in @docs/rules/architecture/implementation-approach.md.
3527

3628
## Main Responsibilities
3729

@@ -43,7 +35,7 @@ Before starting work, be sure to read and follow these rule files:
4335

4436
2. **Task Decomposition**
4537
- Decompose at 1 commit = 1 task granularity (logical change unit)
46-
- **Prioritize verifiability** (L1 > L2 > L3 order priority)
38+
- **Prioritize verifiability** (follow priority defined in implementation-approach.md)
4739
- Ensure each task is independently executable (minimize interdependencies)
4840
- Clarify order when dependencies exist
4941
- Design implementation tasks in TDD format: Practice Red-Green-Refactor cycle in each task
@@ -90,6 +82,11 @@ Before starting work, be sure to read and follow these rule files:
9082
4. **Task File Generation**
9183
- Naming convention: `{plan-name}-task-{number}.md`
9284
- Example: `20250122-refactor-types-task-01.md`
85+
- **Phase Completion Task Auto-generation (Required)**:
86+
- Based on "Phase X" notation in work plan, generate after each phase's final task
87+
- Filename: `{plan-name}-phase{number}-completion.md`
88+
- Content: Copy E2E verification procedures from Design Doc, all task completion checklist
89+
- Criteria: Always generate if the plan contains the string "Phase"
9390

9491
5. **Task Structuring**
9592
Include the following in each task file:
@@ -137,7 +134,7 @@ Dependent Tasks: [Dependent task numbers, "None" if none]
137134
- [ ] __tests__/file1.test.ts
138135

139136
## Operation Verification Methods【Mandatory】
140-
Verification Level: [L1/L2/L3]
137+
Verification Level: [Select from L1/L2/L3 - follow implementation-approach.md]
141138
- [ ] Verification Command: `[specific command]`
142139
- [ ] Expected Result: [what should happen for success]
143140
- [ ] Alternative Method if Verification Impossible: [unit tests, etc.]
@@ -205,7 +202,7 @@ Target Plan Document: [Plan document filename]
205202
### Division Policy
206203
[From what perspective tasks were divided]
207204
- Vertical slice or horizontal slice selection reasoning
208-
- Verifiability level (L1/L2/L3) distribution
205+
- Verifiability level distribution (levels defined in implementation-approach.md)
209206

210207
### Inter-task Relationship Map
211208
```

.claude/agents-en/task-executor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ls docs/plans/tasks/*.md | grep -E "task-[0-9]{2}\.md$" | head -1
7171

7272
### 3.5 Operation Verification【Mandatory】
7373
- Execute "Operation Verification Methods" section within task
74-
- Perform verification according to verification level (L1/L2/L3)
74+
- Perform verification according to verification level defined in @docs/rules/architecture/implementation-approach.md
7575
- Record reason if verification cannot be performed
7676
- Include results in structured response
7777

0 commit comments

Comments
 (0)