Skip to content

Commit 16c7a13

Browse files
authored
Merge pull request #45 from shinpr/feat/add-modern-typescript-best-practices
feat: Add modern TypeScript best practices and synchronize Japanese-English file consistency
2 parents 322a5e5 + adce252 commit 16c7a13

File tree

14 files changed

+348
-227
lines changed

14 files changed

+348
-227
lines changed

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

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,13 @@ Scale determination and required document details follow @docs/rules/documentati
4545

4646
## Conditions Requiring ADR
4747

48-
Detailed ADR creation conditions are defined in @docs/rules/documentation-criteria.md.
48+
Detailed ADR creation conditions follow @docs/rules/documentation-criteria.md.
4949

5050
### Overview
51-
ADR creation is **conditionally mandatory** regardless of scale when any of the following apply:
52-
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)
57-
58-
2. **Data Flow Changes**
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)
62-
63-
3. **Architecture Changes**
64-
- Layer addition, responsibility changes, component relocation
65-
66-
4. **External Dependency Changes**
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
72-
73-
### ADR Determination Flow
74-
1. Does it match any of the above conditions? → Yes: ADR mandatory / No: Next
75-
2. Apply document requirements based on scale
51+
- Type system changes (3+ level nesting, types used in 3+ locations)
52+
- Data flow changes (storage location, processing order, passing methods)
53+
- Architecture changes (layer addition, responsibility changes)
54+
- External dependency changes (libraries, frameworks, APIs)
7655

7756
## Ensuring Determination Consistency
7857

.claude/commands-en/build.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
description: Execute decomposed tasks in autonomous execution mode
33
---
44

5-
**Command Context**: This command is dedicated to the implementation phase with autonomous execution.
6-
75
Strictly follow @docs/guides/sub-agents.md and act as an orchestrator.
86

97
Work plan: $ARGUMENTS
@@ -22,8 +20,6 @@ Before starting any task, always:
2220

2321
Verify approval status before proceeding. Once confirmed, initiate autonomous execution mode.
2422

25-
**Scope**: From task decomposition through implementation completion. Immediate halt upon detecting requirement changes.
26-
2723
## Output Example
2824
Implementation phase completed.
2925
- Task decomposition: Generated under docs/plans/tasks/

docs/design/template-en.md

Lines changed: 113 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
### Agreement Checklist
1515

1616
#### Scope
17-
- [ ] [Functions/components to change]
18-
- [ ] [Functions to add]
17+
- [ ] [Features/components to change]
18+
- [ ] [Features to add]
1919

2020
#### Non-Scope (Explicitly not changing)
21-
- [ ] [Functions/components not to change]
21+
- [ ] [Features/components not to change]
2222
- [ ] [Existing logic to preserve]
2323

2424
#### Constraints
@@ -28,11 +28,11 @@
2828

2929
### Problem to Solve
3030

31-
[Specific problems or challenges this feature aims to solve]
31+
[Specific problems or challenges this feature aims to address]
3232

3333
### Current Challenges
3434

35-
[Problems or limitations in the current system]
35+
[Current system issues or limitations]
3636

3737
### Requirements
3838

@@ -42,58 +42,87 @@
4242

4343
#### Non-Functional Requirements
4444

45-
- **Performance**: [Requirements for response time, throughput, etc.]
45+
- **Performance**: [Response time, throughput requirements]
4646
- **Scalability**: [Requirements for handling increased load]
47-
- **Reliability**: [Requirements for error rate, availability, etc.]
48-
- **Maintainability**: [Code understandability, ease of modification]
47+
- **Reliability**: [Error rate, availability requirements]
48+
- **Maintainability**: [Code readability and changeability]
4949

5050
## Acceptance Criteria
5151

52-
Define specific and verifiable conditions for determining successful implementation of each functional requirement.
53-
These conditions serve as the basis for test cases and are used to objectively judge implementation completion.
54-
(Note: Checkboxes remain empty at design time since implementation is not yet complete)
52+
Define specific and verifiable conditions that determine successful implementation for each functional requirement.
53+
These conditions serve as the basis for test cases and are used to objectively determine implementation completion.
54+
(Note: Checkboxes remain empty at design time as implementation is not yet complete)
5555

5656
- [ ] [Specific acceptance criteria for functional requirement 1]
5757
- Example: "When user clicks login button, authentication succeeds with correct credentials"
58-
- Example: "When invalid credentials are entered, appropriate error message displays"
58+
- Example: "When credentials are invalid, appropriate error message is displayed"
5959
- [ ] [Specific acceptance criteria for functional requirement 2]
60-
- Example: "In data list screen, pagination displays 10 items per page"
61-
- Example: "When typing in search field, real-time filtering occurs"
60+
- Example: "Data list screen displays with pagination of 10 items per page"
61+
- Example: "When input is entered in search field, real-time filtering is applied"
6262

6363
## Existing Codebase Analysis
6464

6565
### Implementation Path Mapping
6666
| Type | Path | Description |
6767
|------|------|-------------|
68-
| Existing | src/[actual path] | [Current implementation] |
69-
| New | src/[planned path] | [Planned new creation] |
68+
| Existing | src/[actual-path] | [Current implementation] |
69+
| New | src/[planned-path] | [Planned new creation] |
7070

71-
### Integration Points
72-
| Integration Point | Location | Old Implementation | New Implementation | Switch Method |
73-
|------------------|----------|-------------------|-------------------|---------------|
74-
| Point 1 | [Class/Function] | [Existing process] | [New process] | [DI/Factory etc.] |
75-
| Point 2 | [Another location] | [Existing] | [New] | [Method] |
71+
### Integration Points (Include even for new implementations)
72+
- **Integration Target**: [What to connect with]
73+
- **Invocation Method**: [How it will be invoked]
7674

77-
### Main Components
75+
## Design
7876

79-
#### Component 1
77+
### Change Impact Map
78+
79+
```yaml
80+
Change Target: [Component/feature to change]
81+
Direct Impact:
82+
- [Files/functions requiring direct changes]
83+
- [Interface change points]
84+
Indirect Impact:
85+
- [Data format changes]
86+
- [Processing time changes]
87+
No Ripple Effect:
88+
- [Explicitly specify unaffected features]
89+
```
90+
91+
### Architecture Overview
92+
93+
[How this feature is positioned within the overall system]
94+
95+
### Data Flow
96+
97+
```
98+
[Express data flow using diagrams or pseudo-code]
99+
```
80100

81-
**Responsibility**: [What this component is responsible for]
101+
### Integration Points List
82102

83-
**Input/Output**:
84-
- Input: [What it receives]
85-
- Output: [What it returns]
103+
| Integration Point | Location | Old Implementation | New Implementation | Switching Method |
104+
|-------------------|----------|-------------------|-------------------|------------------|
105+
| Integration Point 1 | [Class/Function] | [Existing Process] | [New Process] | [DI/Factory etc.] |
106+
| Integration Point 2 | [Another Location] | [Existing] | [New] | [Method] |
86107

87-
**Dependencies**: [What other components it depends on]
108+
### Main Components
109+
110+
#### Component 1
111+
112+
- **Responsibility**: [Scope of responsibility for this component]
113+
- **Interface**: [APIs and type definitions provided]
114+
- **Dependencies**: [Relationships with other components]
88115

89116
#### Component 2
90117

91-
[Same format]
118+
- **Responsibility**: [Scope of responsibility for this component]
119+
- **Interface**: [APIs and type definitions provided]
120+
- **Dependencies**: [Relationships with other components]
92121

93-
## Type Definitions
122+
### Type Definitions
94123

95124
```typescript
96-
// Include main type definitions here
125+
// Record major type definitions here
97126
```
98127

99128
### Data Contract
@@ -108,17 +137,17 @@ Input:
108137

109138
Output:
110139
Type: [TypeScript type definition]
111-
Guarantees: [Conditions always satisfied]
140+
Guarantees: [Conditions that must always be met]
112141
On Error: [Exception/null/default value]
113142

114143
Invariants:
115-
- [Conditions that remain unchanged before/after processing]
144+
- [Conditions that remain unchanged before and after processing]
116145
```
117146
118147
### State Transitions and Invariants (When Applicable)
119148
120149
```yaml
121-
State Definitions:
150+
State Definition:
122151
- Initial State: [Initial values and conditions]
123152
- Possible States: [List of states]
124153

@@ -131,105 +160,111 @@ System Invariants:
131160
132161
### Error Handling
133162
134-
[Types of errors and handling methods]
163+
[Types of errors and how to handle them]
135164
136-
### Security Considerations
165+
### Logging and Monitoring
137166
138-
[Security measures, authentication, authorization, data protection]
167+
[What to record in logs and how to monitor]
139168
140169
## Implementation Plan
141170
142171
### Phase Division
143172
144173
#### Phase 1: [Phase Name]
145-
**Purpose**: [What this phase aims to achieve]
174+
**Purpose**: [What to achieve in this phase]
146175
147-
**Implementation Content**:
176+
**Implementation Items**:
148177
- [Implementation item 1]
149178
- [Implementation item 2]
150179
151-
(Duration goes to work plan)
180+
(Timeline goes to work plan document)
152181
153-
**Phase Completion Criteria**:
154-
- [ ] [Functional completion criteria]
155-
- [ ] [Quality completion criteria]
182+
**Phase Completion Conditions**:
183+
- [ ] [Functional completion conditions]
184+
- [ ] [Quality completion conditions]
156185
157186
**E2E Verification Procedures**:
158187
1. [Operation verification steps]
159188
2. [Expected result verification]
160189
3. [Performance verification (when applicable)]
161190
162191
#### Phase 2: [Phase Name]
163-
**Purpose**: [What this phase aims to achieve]
192+
**Purpose**: [What to achieve in this phase]
164193
165-
**Implementation Content**:
194+
**Implementation Items**:
166195
- [Implementation item 1]
167196
- [Implementation item 2]
168197
169-
**Phase Completion Criteria**:
170-
- [ ] [Functional completion criteria]
171-
- [ ] [Quality completion criteria]
198+
**Phase Completion Conditions**:
199+
- [ ] [Functional completion conditions]
200+
- [ ] [Quality completion conditions]
172201
173202
**E2E Verification Procedures**:
174203
1. [Operation verification steps]
175204
2. [Expected result verification]
176205
177206
### Migration Strategy
178207
179-
[Technical migration approach, backward compatibility assurance methods]
208+
[Technical migration approach, ensuring backward compatibility]
180209
181210
## Test Strategy
182211
183-
### Test Categories
212+
### Basic Test Design Policy
213+
214+
Automatically derive test cases from acceptance criteria:
215+
- Create at least one test case for each acceptance criterion
216+
- Implement measurable standards from acceptance criteria as assertions
184217
185-
#### Unit Tests
186-
- [Testing scope and methods]
187-
- Target coverage: [percentage]
218+
### Unit Tests
188219
189-
#### Integration Tests
190-
- [What integration points to test]
220+
[Unit testing policy and coverage goals]
221+
- Verify individual elements of functional acceptance criteria
191222
192-
#### E2E Tests
193-
- [Main scenarios to test]
223+
### Integration Tests
194224
195-
### Test Data
225+
[Integration testing policy and important test cases]
226+
- Verify combined operations of functional acceptance criteria
196227
197-
[Test data requirements and preparation methods]
228+
### E2E Tests
198229
199-
## Performance and Monitoring
230+
[E2E testing policy]
231+
- Verify entire scenarios of acceptance criteria
232+
- Confirm functional operation from user perspective
200233
201-
### Performance Targets
234+
### Performance Tests
202235
203-
- Response time: [target value]
204-
- Throughput: [target value]
205-
- Resource usage: [memory, CPU, etc.]
236+
[Performance testing methods and standards]
237+
- Verify performance standards of non-functional acceptance criteria
206238
207-
### Monitoring
239+
## Security Considerations
208240
209-
[Metrics to monitor, logging strategy]
241+
[Security concerns and countermeasures]
210242
211-
## Deployment and Operations
243+
## Future Extensibility
212244
213-
### Deployment Strategy
245+
[Considerations for future feature additions or changes]
214246
215-
[Deployment method, rollback plan]
247+
## Alternative Solutions
216248
217-
### Feature Flags
249+
### Alternative 1
218250
219-
[If feature flags are used, describe control method]
251+
- **Overview**: [Description of alternative solution]
252+
- **Advantages**: [Advantages]
253+
- **Disadvantages**: [Disadvantages]
254+
- **Reason for Rejection**: [Why it wasn't adopted]
220255
221256
## Risks and Mitigation
222257
223258
| Risk | Impact | Probability | Mitigation |
224259
|------|--------|-------------|------------|
225-
| [Risk 1] | [High/Medium/Low] | [High/Medium/Low] | [Countermeasure] |
226-
| [Risk 2] | [High/Medium/Low] | [High/Medium/Low] | [Countermeasure] |
260+
| [Risk 1] | High/Medium/Low | High/Medium/Low | [Countermeasure] |
227261
228-
## Open Questions
262+
## References
229263
230-
- [ ] [Question 1]
231-
- [ ] [Question 2]
264+
- [Related documentation and links]
232265
233-
## References
266+
## Update History
234267
235-
- [Related documentation, technical articles, etc.]
268+
| Date | Version | Changes | Author |
269+
|------|---------|---------|--------|
270+
| YYYY-MM-DD | 1.0 | Initial version | [Name] |

0 commit comments

Comments
 (0)