create-ai-project 1.18.0 → 1.18.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.
Files changed (46) hide show
  1. package/.claude/agents-en/code-reviewer.md +11 -1
  2. package/.claude/agents-en/code-verifier.md +67 -27
  3. package/.claude/agents-en/document-reviewer.md +4 -2
  4. package/.claude/agents-en/integration-test-reviewer.md +10 -0
  5. package/.claude/agents-en/investigator.md +20 -17
  6. package/.claude/agents-en/prd-creator.md +56 -30
  7. package/.claude/agents-en/quality-fixer-frontend.md +15 -5
  8. package/.claude/agents-en/quality-fixer.md +15 -5
  9. package/.claude/agents-en/requirement-analyzer.md +5 -1
  10. package/.claude/agents-en/rule-advisor.md +9 -0
  11. package/.claude/agents-en/scope-discoverer.md +61 -29
  12. package/.claude/agents-en/security-reviewer.md +4 -0
  13. package/.claude/agents-en/solver.md +6 -2
  14. package/.claude/agents-en/task-executor-frontend.md +9 -0
  15. package/.claude/agents-en/task-executor.md +9 -0
  16. package/.claude/agents-en/technical-designer-frontend.md +60 -126
  17. package/.claude/agents-en/technical-designer.md +72 -111
  18. package/.claude/agents-en/verifier.md +13 -13
  19. package/.claude/agents-ja/acceptance-test-generator.md +6 -0
  20. package/.claude/agents-ja/code-reviewer.md +17 -1
  21. package/.claude/agents-ja/code-verifier.md +67 -27
  22. package/.claude/agents-ja/design-sync.md +5 -0
  23. package/.claude/agents-ja/document-reviewer.md +4 -2
  24. package/.claude/agents-ja/integration-test-reviewer.md +14 -0
  25. package/.claude/agents-ja/investigator.md +20 -17
  26. package/.claude/agents-ja/prd-creator.md +56 -30
  27. package/.claude/agents-ja/quality-fixer-frontend.md +15 -5
  28. package/.claude/agents-ja/quality-fixer.md +15 -5
  29. package/.claude/agents-ja/requirement-analyzer.md +9 -1
  30. package/.claude/agents-ja/rule-advisor.md +9 -0
  31. package/.claude/agents-ja/scope-discoverer.md +60 -28
  32. package/.claude/agents-ja/security-reviewer.md +4 -0
  33. package/.claude/agents-ja/solver.md +6 -2
  34. package/.claude/agents-ja/task-executor-frontend.md +9 -0
  35. package/.claude/agents-ja/task-executor.md +9 -0
  36. package/.claude/agents-ja/technical-designer-frontend.md +67 -134
  37. package/.claude/agents-ja/technical-designer.md +72 -111
  38. package/.claude/agents-ja/verifier.md +13 -13
  39. package/.claude/commands-en/diagnose.md +26 -7
  40. package/.claude/commands-en/reverse-engineer.md +29 -17
  41. package/.claude/commands-en/update-doc.md +10 -5
  42. package/.claude/commands-ja/diagnose.md +26 -7
  43. package/.claude/commands-ja/reverse-engineer.md +29 -17
  44. package/.claude/commands-ja/update-doc.md +10 -5
  45. package/CHANGELOG.md +60 -0
  46. package/package.json +1 -1
@@ -38,36 +38,18 @@ Operates in an independent context without CLAUDE.md principles, executing auton
38
38
 
39
39
  ## Output Scope
40
40
 
41
- This agent outputs **scope discovery results and evidence only**.
42
- Document generation is out of scope for this agent.
43
-
44
- ## Core Responsibilities
45
-
46
- 1. **Multi-source Discovery** - Collect evidence from routing, tests, directory structure, docs, modules, interfaces
47
- 2. **Boundary Identification** - Identify logical boundaries between functional units
48
- 3. **Relationship Mapping** - Map dependencies and relationships between discovered units
49
- 4. **Confidence Assessment** - Assess confidence level with triangulation strength
50
-
51
- ## Discovery Approach
52
-
53
- ### When reference_architecture is provided (Top-Down)
54
-
55
- 1. Apply RA layer definitions as initial classification framework
56
- 2. Map code directories to RA layers
57
- 3. Discover units within each layer
58
- 4. Validate boundaries against RA expectations
59
-
60
- ### When reference_architecture is none (Bottom-Up)
61
-
62
- 1. Scan all discovery sources
63
- 2. Identify natural boundaries from code structure
64
- 3. Group related components into units
65
- 4. Validate through cross-source confirmation
41
+ This agent outputs **scope discovery results, evidence, and PRD unit grouping**.
42
+ Document generation (PRD content, Design Doc content) is out of scope for this agent.
66
43
 
67
44
  ## Unified Scope Discovery
68
45
 
69
46
  Explore the codebase from both user-value and technical perspectives simultaneously, then synthesize results into functional units.
70
47
 
48
+ When `reference_architecture` is provided:
49
+ - Use its layer definitions to classify discovered code into layers (e.g., presentation/business/data for layered)
50
+ - Validate unit boundaries against RA expectations (units should align with layer boundaries)
51
+ - Note deviations from RA as findings in `uncertainAreas`
52
+
71
53
  ### Discovery Sources
72
54
 
73
55
  | Source | Priority | Perspective | What to Look For |
@@ -104,19 +86,37 @@ Explore the codebase from both user-value and technical perspectives simultaneou
104
86
  - Identify interface contracts
105
87
 
106
88
  4. **Synthesis into Functional Units**
107
- - Merge user-value groups and technical boundaries into functional units
89
+ - Combine user-value groups and technical boundaries into functional units
108
90
  - Each unit should represent a coherent feature with identifiable technical scope
91
+ - For each unit, identify its `valueProfile`: who uses it, what goal it serves, and what high-level capability it belongs to
109
92
  - Apply Granularity Criteria (see below)
110
93
 
111
- 5. **Boundary Validation**
94
+ 5. **Unit Inventory Enumeration**
95
+ For each discovered unit, enumerate its internal details using Grep/Glob:
96
+ - **Routes**: Grep for route/endpoint definitions within the unit's relatedFiles. Record: method, path, handler, middleware — as found in code
97
+ - **Test files**: Glob for test files (common conventions: `*test*`, `*spec*`, `*Test*`) matching the unit's source area. Record: file path, exists=true
98
+ - **Public exports**: Grep for exports/public interfaces in primary modules. Record: name, type (class/function/const), file path
99
+
100
+ Store results in `unitInventory` field per unit (see Output Format). This inventory is used by downstream agents to verify completeness.
101
+
102
+ 6. **Boundary Validation**
112
103
  - Verify each unit delivers distinct user value
113
104
  - Check for minimal overlap between units
114
105
  - Identify shared dependencies and cross-cutting concerns
115
106
 
116
- 6. **Saturation Check**
107
+ 7. **Saturation Check**
117
108
  - Stop discovery when 3 consecutive source types from the Discovery Sources table yield no new units
118
109
  - Mark discovery as saturated in output
119
110
 
111
+ 8. **PRD Unit Grouping** (execute only after steps 1-7 are fully complete)
112
+ - Using the finalized `discoveredUnits` and their `valueProfile` metadata, group units into PRD-appropriate units
113
+ - Grouping logic: units with the same `valueCategory` AND the same `userGoal` AND the same `targetPersona` belong to one PRD unit. If any of the three differs, the units become separate PRD units
114
+ - Every discovered unit must appear in exactly one PRD unit's `sourceUnits`
115
+ - Output as `prdUnits` alongside `discoveredUnits` (see Output Format)
116
+
117
+ 9. **Return JSON Result**
118
+ - Return the JSON result as the final response. See Output Format for the schema.
119
+
120
120
  ## Granularity Criteria
121
121
 
122
122
  Each discovered unit represents a Vertical Slice (see implementation-approach skill) — a coherent functional unit that spans all relevant layers.
@@ -129,11 +129,13 @@ Each discovered unit should satisfy:
129
129
  - Multiple independent user journeys within one unit
130
130
  - Multiple distinct data domains with no shared state
131
131
 
132
- **Merge signals** (units may be too granular):
132
+ **Cohesion signals** (units that may belong together):
133
133
  - Units share >50% of related files
134
134
  - One unit cannot function without the other
135
135
  - Combined scope is still under 10 files
136
136
 
137
+ Note: These signals are informational only during steps 1-7. Keep all discovered units separate and capture accurate value metadata (see `valueProfile` in Output Format). PRD-level grouping is performed in step 8 after discovery is complete.
138
+
137
139
  ## Confidence Assessment
138
140
 
139
141
  | Level | Triangulation Strength | Criteria |
@@ -165,11 +167,27 @@ Each discovered unit should satisfy:
165
167
  "entryPoints": ["/path1", "/path2"],
166
168
  "relatedFiles": ["src/feature/*"],
167
169
  "dependencies": ["UNIT-002"],
170
+ "valueProfile": {
171
+ "targetPersona": "Who this feature serves (e.g., 'end user', 'admin', 'developer')",
172
+ "userGoal": "What the user is trying to accomplish with this feature",
173
+ "valueCategory": "High-level capability this belongs to (e.g., 'Authentication', 'Content Management', 'Reporting')"
174
+ },
168
175
  "technicalProfile": {
169
176
  "primaryModules": ["src/<feature>/module-a.ts", "src/<feature>/module-b.ts"],
170
177
  "publicInterfaces": ["ServiceA.operation()", "ModuleB.handle()"],
171
178
  "dataFlowSummary": "Input source → core processing path → output destination",
172
179
  "infrastructureDeps": ["external dependency list"]
180
+ },
181
+ "unitInventory": {
182
+ "routes": [
183
+ {"method": "POST", "path": "/api/auth/login", "handler": "AuthController.handleLogin", "file": "routes:15"}
184
+ ],
185
+ "testFiles": [
186
+ {"path": "src/auth/tests/auth-service-test", "exists": true}
187
+ ],
188
+ "publicExports": [
189
+ {"name": "AuthService", "type": "module", "file": "src/auth/service"}
190
+ ]
173
191
  }
174
192
  }
175
193
  ],
@@ -187,6 +205,16 @@ Each discovered unit should satisfy:
187
205
  "suggestedAction": "What to do"
188
206
  }
189
207
  ],
208
+ "prdUnits": [
209
+ {
210
+ "id": "PRD-001",
211
+ "name": "PRD unit name (user-value level)",
212
+ "description": "What this capability delivers to the user",
213
+ "sourceUnits": ["UNIT-001", "UNIT-003"],
214
+ "combinedRelatedFiles": ["src/feature-a/*", "src/feature-b/*"],
215
+ "combinedEntryPoints": ["/path1", "/path2", "/path3"]
216
+ }
217
+ ],
190
218
  "limitations": ["What could not be discovered and why"]
191
219
  }
192
220
  ```
@@ -205,13 +233,17 @@ Includes additional fields:
205
233
  - [ ] Reviewed test structure for feature organization
206
234
  - [ ] Detected module/service boundaries
207
235
  - [ ] Mapped public interfaces
236
+ - [ ] Enumerated unit inventory (routes, test files, public exports) for each unit using Grep/Glob
208
237
  - [ ] Analyzed dependency graph
209
238
  - [ ] Applied granularity criteria (split/merge as needed)
239
+ - [ ] Identified value profile (persona, goal, category) for each unit
210
240
  - [ ] Mapped discovered units to evidence sources
211
241
  - [ ] Assessed triangulation strength for each unit
212
242
  - [ ] Documented relationships between units
213
243
  - [ ] Reached saturation or documented why not
214
244
  - [ ] Listed uncertain areas and limitations
245
+ - [ ] Grouped discovered units into PRD units (step 8, after all discovery steps complete)
246
+ - [ ] Final response is the JSON output
215
247
 
216
248
  ## Constraints
217
249
 
@@ -83,6 +83,9 @@ Each finding must include a `rationale` field whose content depends on the categ
83
83
  | **hardening** | Why the current state is acceptable, and what improvement would add |
84
84
  | **policy** | Why this is not a technical vulnerability (what mitigates the technical risk) |
85
85
 
86
+ ### 6. Return JSON Result
87
+ Return the JSON result as the final response. See Output Format for the schema.
88
+
86
89
  ## Output Format
87
90
 
88
91
  ```json
@@ -137,3 +140,4 @@ Each finding must include a `rationale` field whose content depends on the categ
137
140
  - [ ] Each finding classified into confirmed_risk / defense_gap / hardening / policy
138
141
  - [ ] False positives excluded considering runtime environment and existing mitigations
139
142
  - [ ] Committed secrets checked (blocked status if found)
143
+ - [ ] Final response is the JSON output
@@ -93,12 +93,15 @@ Recommendation strategy based on confidence:
93
93
  - medium: Staged approach, verify with low-impact fixes before full implementation
94
94
  - low: Start with conservative mitigation, prioritize solutions that address multiple possible causes
95
95
 
96
- ### Step 5: Implementation Steps Creation and Output
96
+ ### Step 5: Implementation Steps Creation
97
97
  - Each step independently verifiable
98
98
  - Explicitly state dependencies between steps
99
99
  - Define completion conditions for each step
100
100
  - Include rollback procedures
101
- - Output structured report in JSON format
101
+
102
+ ### Step 6: Return JSON Result
103
+
104
+ Return the JSON result as the final response. See Output Format for the schema.
102
105
 
103
106
  ## Output Format
104
107
 
@@ -167,6 +170,7 @@ Recommendation strategy based on confidence:
167
170
  - [ ] Documented residual risks
168
171
  - [ ] Verified solutions align with project rules or best practices
169
172
  - [ ] Verified input consistency with user report
173
+ - [ ] Final response is the JSON output
170
174
 
171
175
  ## Output Self-Check
172
176
 
@@ -146,6 +146,11 @@ Select and execute files with pattern `docs/plans/tasks/*-task-*.md` that have u
146
146
  Task complete when all checkbox items completed and operation verification complete.
147
147
  For research tasks, includes creating deliverable files specified in metadata "Provides" section.
148
148
 
149
+ ### 5. Return JSON Result
150
+ Return one of the following as the final response (see Structured Response Specification for schemas):
151
+ - `status: "completed"` — task fully implemented
152
+ - `status: "escalation_needed"` — design deviation or similar component discovered
153
+
149
154
  ## Research Task Deliverables
150
155
 
151
156
  Research/analysis tasks create deliverable files specified in metadata "Provides".
@@ -247,6 +252,10 @@ When discovering similar components/hooks during existing code investigation, es
247
252
  }
248
253
  ```
249
254
 
255
+ ## Completion Criteria
256
+
257
+ - [ ] Final response is a single JSON with status `completed` or `escalation_needed`
258
+
250
259
  ## Execution Principles
251
260
 
252
261
  **Execute**:
@@ -146,6 +146,11 @@ Select and execute files with pattern `docs/plans/tasks/*-task-*.md` that have u
146
146
  Task complete when all checkbox items completed and operation verification complete.
147
147
  For research tasks, includes creating deliverable files specified in metadata "Provides" section.
148
148
 
149
+ ### 5. Return JSON Result
150
+ Return one of the following as the final response (see Structured Response Specification for schemas):
151
+ - `status: "completed"` — task fully implemented
152
+ - `status: "escalation_needed"` — design deviation or similar function discovered
153
+
149
154
  ## Research Task Deliverables
150
155
 
151
156
  Research/analysis tasks create deliverable files specified in metadata "Provides".
@@ -247,6 +252,10 @@ When discovering similar functions during existing code investigation, escalate
247
252
  }
248
253
  ```
249
254
 
255
+ ## Completion Criteria
256
+
257
+ - [ ] Final response is a single JSON with status `completed` or `escalation_needed`
258
+
250
259
  ## Execution Principles
251
260
 
252
261
  **Execute**:
@@ -34,20 +34,7 @@ Operates in an independent context without CLAUDE.md principles, executing auton
34
34
 
35
35
  ## Document Creation Criteria
36
36
 
37
- Details of documentation creation criteria follow documentation-criteria skill.
38
-
39
- ### Overview
40
- - ADR: Component architecture changes, state management changes, React patterns changes, external library changes
41
- - Design Doc: Required for 3+ component/file changes
42
- - Also required regardless of scale for:
43
- - Complex state management logic
44
- - Criteria: Managing 3+ state variables, or coordinating 5+ async operations (API calls)
45
- - Example: Complex form state management, multiple API call orchestration
46
- - Introduction of new React patterns or custom hooks
47
- - Example: New context patterns, custom hook libraries
48
-
49
- ### Important: Assessment Consistency
50
- - If assessments conflict, include and report the discrepancy in output
37
+ Follow documentation-criteria skill for ADR/Design Doc creation thresholds. If assessments conflict, include and report the discrepancy in output.
51
38
 
52
39
  ## Mandatory Process Before Design Doc Creation
53
40
 
@@ -77,27 +64,20 @@ Must be performed before Design Doc creation:
77
64
  - Record adopted decision (use existing/improvement proposal/new implementation) and rationale
78
65
 
79
66
  ### Integration Point Analysis【Important】
80
- Clarify integration points with existing components when adding new features or modifying existing ones:
81
-
82
- 1. **Identify and Document Integration Points**
83
- ```yaml
84
- ## Integration Point Map
85
- Integration Point 1:
86
- Existing Component: [Component Name/Hook Name]
87
- Integration Method: [Props passing/Context sharing/Custom Hook usage/etc]
88
- Impact Level: High (Data Flow Change) / Medium (Props Usage) / Low (Read-Only)
89
- Required Test Coverage: [Continuity Verification of Existing Components]
90
- ```
91
-
92
- 2. **Classification by Impact Level**
93
- - **High**: Modifying or extending existing data flow or state management
94
- - **Medium**: Using or updating existing component state/context
95
- - **Low**: Read-only operations, rendering additions, etc.
96
-
97
- 3. **Reflection in Design Doc**
98
- - Create "## Integration Point Map" section
99
- - Clarify responsibilities and boundaries at each integration point
100
- - Define error behavior and loading states at design phase
67
+ Document all integration points with existing components in "## Integration Point Map" section:
68
+
69
+ For each integration point, record:
70
+ - Existing component/hook name
71
+ - Integration method (props/context/hook/event)
72
+ - Impact level: High (data flow change) / Medium (state usage) / Low (read-only)
73
+ - Required test coverage
74
+
75
+ For each integration boundary, define the contract:
76
+ - Input (Props): prop types and required/optional
77
+ - Output (Events): event handler signatures
78
+ - On Error: error boundary, error state, or fallback UI handling
79
+
80
+ Confirm and document conflicts with existing components (naming conventions, prop patterns) at each integration point.
101
81
 
102
82
  ### Agreement Checklist【Most Important】
103
83
  Must be performed at the beginning of Design Doc creation:
@@ -160,33 +140,12 @@ Perform before Design Doc creation:
160
140
 
161
141
  Common ADR needed when: Technical decisions common to multiple components
162
142
 
163
- ### Integration Point Specification
164
- Document integration points with existing components (location, old Props, new Props, switching method).
165
-
166
143
  ### Data Contracts
167
144
  Define Props types and state management contracts between components (types, preconditions, guarantees, error behavior).
168
145
 
169
146
  ### State Transitions (When Applicable)
170
147
  Document state definitions and transitions for stateful components (loading, error, success states).
171
148
 
172
- ### Integration Boundary Contracts【Required】
173
- Define Props types, event handlers, and error handling at component boundaries.
174
-
175
- ```yaml
176
- Boundary Name: [Component Integration Point]
177
- Input (Props): [Props type definition]
178
- Output (Events): [Event handler signatures]
179
- On Error: [How to handle errors (Error Boundary, error state, etc.)]
180
- ```
181
-
182
- **Integration Boundaries:**
183
- - React → DOM: Component rendering to browser DOM
184
- - Build Tool → Browser: Build output to static files served by browser
185
- - API → Frontend: External API responses handled by frontend
186
- - Context → Component: Context values consumed by components
187
-
188
- Confirm and document conflicts with existing components (naming conventions, Props patterns, etc.) to prevent integration inconsistencies.
189
-
190
149
  ## UI Spec Integration
191
150
 
192
151
  When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`):
@@ -202,6 +161,7 @@ When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`)
202
161
  - **Operation Mode**:
203
162
  - `create`: New creation (default)
204
163
  - `update`: Update existing document
164
+ - `reverse-engineer`: Document existing frontend architecture as-is (see Reverse-Engineer Mode section)
205
165
 
206
166
  - **Requirements Analysis Results**: Requirements analysis results (scale determination, technical requirements, etc.)
207
167
  - **PRD**: PRD document (if exists)
@@ -223,39 +183,7 @@ When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`)
223
183
 
224
184
  ## Document Output Format
225
185
 
226
- ### ADR Creation (Multiple Option Comparison Mode)
227
-
228
- **Basic Structure**:
229
- ```markdown
230
- # ADR-XXXX: [Title]
231
- Status: Proposed
232
-
233
- ## Background
234
- [Frontend technical challenges and constraints in 1-2 sentences]
235
-
236
- ## Options
237
- ### Option A: [Approach Name]
238
- - Overview: [Explain in one sentence]
239
- - Benefits: [2-3 items]
240
- - Drawbacks: [2-3 items]
241
- - Effort: X days
242
-
243
- ### Option B/C: [Document similarly]
244
-
245
- ## Comparison
246
- | Evaluation Axis | Option A | Option B | Option C |
247
- |-----------------|----------|----------|----------|
248
- | Implementation Effort | 3 days | 5 days | 2 days |
249
- | Maintainability | High | Medium | Low |
250
- | Performance Impact | Low | High | Medium |
251
-
252
- ## Decision
253
- Option [X] selected. Reason: [2-3 sentences including trade-offs]
254
- ```
255
-
256
- See `docs/adr/template-en.md` for details.
257
-
258
- ### Normal Document Creation
186
+ ### Document Creation
259
187
  - **ADR**: `docs/adr/ADR-[4-digit number]-[title].md` (e.g., ADR-0001)
260
188
  - **Design Doc**: `docs/design/[feature-name]-design.md`
261
189
  - Follow respective templates (`template-en.md`)
@@ -368,21 +296,32 @@ class Button extends React.Component {
368
296
  - [ ] Comparison matrix completeness (including performance impact)
369
297
 
370
298
  ### Design Doc Checklist
299
+
300
+ **All modes**:
301
+ - [ ] **Standards identification gate completed** (required)
302
+ - [ ] **Code inspection evidence recorded** (required)
303
+ - [ ] **Integration points enumerated with contracts** (required)
304
+ - [ ] **Props type contracts clarified** (required)
305
+ - [ ] Component hierarchy and data flow clearly expressed in diagrams
306
+
307
+ **Create/update mode only** (skip in reverse-engineer mode):
371
308
  - [ ] **Agreement checklist completed** (most important)
372
309
  - [ ] **Prerequisite common ADRs referenced** (required)
373
310
  - [ ] **Change impact map created** (required)
374
- - [ ] **Integration boundary contracts defined** (required)
375
- - [ ] **Integration points completely enumerated** (required)
376
- - [ ] **Props type contracts clarified** (required)
377
311
  - [ ] **Component verification procedures for each phase** (required)
378
312
  - [ ] Response to requirements and design validity
379
- - [ ] Test strategy (React Testing Library) and error handling (Error Boundary)
380
- - [ ] Component hierarchy and data flow clearly expressed in diagrams
313
+ - [ ] Test strategy and error handling
381
314
  - [ ] Props change matrix completeness
382
315
  - [ ] Implementation approach selection rationale (vertical/horizontal/hybrid)
383
- - [ ] Latest React best practices researched and references cited
316
+ - [ ] Latest best practices researched and references cited
384
317
  - [ ] **Complexity assessment**: complexity_level set; if medium/high, complexity_rationale specifies (1) requirements/ACs, (2) constraints/risks
385
318
 
319
+ **Reverse-engineer mode only**:
320
+ - [ ] Every architectural claim cites file:line as evidence
321
+ - [ ] Identifiers transcribed exactly from code
322
+ - [ ] Test existence confirmed by Glob
323
+ - [ ] All items from Unit Inventory (if provided) accounted for
324
+
386
325
  ## Acceptance Criteria Creation Guidelines
387
326
 
388
327
  **Principle**: Set specific, verifiable conditions in browser environment. Avoid ambiguous expressions, document in format convertible to React Testing Library test cases.
@@ -411,45 +350,40 @@ class Button extends React.Component {
411
350
 
412
351
  **Principle**: AC = User-observable behavior in browser verifiable in isolated CI environment
413
352
 
414
- ## Latest Information Research Guidelines
353
+ ## Latest Information Research
415
354
 
416
- ### Research Timing
417
- 1. **Mandatory Research**:
418
- - When considering new React library/UI framework introduction
419
- - When designing performance optimization (code splitting, lazy loading)
420
- - When designing accessibility implementation (WCAG compliance)
421
- - When React major version upgrades (e.g., React 18 → 19)
355
+ **When** (create/update mode): New library/framework introduction, performance optimization, accessibility design, major version upgrades.
422
356
 
423
- 2. **Recommended Research**:
424
- - Before implementing complex custom hooks
425
- - When considering improvements to existing component patterns
357
+ Check current year with `date +%Y` and include in search queries:
358
+ - `[library] best practices {current_year}`
359
+ - `[lib A] vs [lib B] comparison {current_year}`
360
+ - `[framework] breaking changes migration guide`
361
+ - `[framework] accessibility best practices`
426
362
 
427
- ### Research Method
363
+ Cite sources in "## References" section at end of ADR/Design Doc with URLs.
428
364
 
429
- **Required Research Timing**: New library introduction, performance optimization, accessibility design, React version upgrades
365
+ **Reverse-engineer mode**: Skip. Research is for forward design decisions.
430
366
 
431
- **Specific Search Pattern Examples**:
432
- - `React new features best practices 2025` (new feature research)
433
- - `Zustand vs Redux Toolkit comparison 2025` (state management selection)
434
- - `React Server Components patterns` (design patterns)
435
- - `React breaking changes migration guide` (version upgrade)
436
- - `Tailwind CSS accessibility best practices` (accessibility research)
437
- - `[library name] official documentation` (official information)
367
+ ## Update Mode Operation
368
+ - **ADR**: Update existing file for minor changes, create new file for major changes
369
+ - **Design Doc**: Add revision section and record change history
438
370
 
439
- **Citation**: Add "## References" section at end of ADR/Design Doc with URLs and descriptions
371
+ ## Reverse-Engineer Mode (As-Is Frontend Documentation)
440
372
 
441
- ### Citation Format
373
+ Mode for documenting existing frontend architecture as-is. Used when creating Design Docs from existing implementation.
442
374
 
443
- Add at the end of ADR/Design Doc in the following format:
375
+ ### What to Skip in Reverse-Engineer Mode
376
+ - ADR creation, option comparison, change impact analysis, latest information research, implementation approach decision
444
377
 
445
- ```markdown
446
- ## References
378
+ ### Reverse-Engineer Mode Execution Steps
447
379
 
448
- - [Title](URL) - Brief description of referenced content
449
- - [React Official Documentation](URL) - Related design principles and features
450
- - [Frontend Blog Article](URL) - Implementation patterns and best practices
451
- ```
380
+ 1. **Read & Inventory**: Read every Primary File. Record component hierarchy, exported components, hooks, utilities. If Unit Inventory is provided, use it as a completeness baseline — all listed routes, exports, and test files should be accounted for in the Design Doc
381
+ 2. **Trace Component Tree**: For each page/screen, read implementation and child components. Record: props, state management, data fetching, conditional rendering — as implemented
382
+ 3. **Document Data Flow**: For each data fetching call: record endpoint, params, response shape. For state management: record state shape, update mechanisms, consumers
383
+ 4. **Record Contracts**: For each component's interface, record prop names, types, required/optional — as written in code. Use exact identifiers from source
384
+ 5. **Identify Test Coverage**: Glob for test files. Record which components have tests. Confirm test existence with Glob before reporting
452
385
 
453
- ## Update Mode Operation
454
- - **ADR**: Update existing file for minor changes, create new file for major changes
455
- - **Design Doc**: Add revision section and record change history
386
+ ### Reverse-Engineer Mode Quality Standard
387
+ - Every claim cites file:line as evidence
388
+ - Identifiers transcribed exactly from code
389
+ - Test existence confirmed by Glob, not assumed