agentic-code 0.5.1
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.
- package/.agents/context-maps/task-rule-matrix.yaml +248 -0
- package/.agents/rules/contextual/architecture/implementation-approach.md +202 -0
- package/.agents/rules/core/ai-development-guide.md +272 -0
- package/.agents/rules/core/documentation-criteria.md +184 -0
- package/.agents/rules/core/integration-e2e-testing.md +76 -0
- package/.agents/rules/core/metacognition.md +153 -0
- package/.agents/rules/core/testing-strategy.md +230 -0
- package/.agents/rules/language/general/rules.md +117 -0
- package/.agents/rules/language/general/testing.md +257 -0
- package/.agents/rules/language/typescript/rules.md +178 -0
- package/.agents/rules/language/typescript/testing.md +284 -0
- package/.agents/tasks/acceptance-test-generation.md +461 -0
- package/.agents/tasks/code-review.md +207 -0
- package/.agents/tasks/implementation.md +199 -0
- package/.agents/tasks/integration-test-review.md +132 -0
- package/.agents/tasks/prd-creation.md +336 -0
- package/.agents/tasks/quality-assurance.md +219 -0
- package/.agents/tasks/task-analysis.md +263 -0
- package/.agents/tasks/technical-design.md +432 -0
- package/.agents/tasks/technical-document-review.md +254 -0
- package/.agents/tasks/work-planning.md +239 -0
- package/.agents/workflows/agentic-coding.md +333 -0
- package/AGENTS.md +156 -0
- package/LICENSE +21 -0
- package/README.md +268 -0
- package/bin/cli.js +117 -0
- package/package.json +45 -0
- package/scripts/setup.js +82 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
# Technical Design
|
|
2
|
+
|
|
3
|
+
## Required Rules [MANDATORY - MUST BE ACTIVE]
|
|
4
|
+
|
|
5
|
+
**RULE AVAILABILITY VERIFICATION:**
|
|
6
|
+
1. [VERIFY ACTIVE] `.agents/rules/core/metacognition.md` (loaded at session start)
|
|
7
|
+
2. [LOAD IF NOT ACTIVE] `.agents/rules/core/documentation-criteria.md`
|
|
8
|
+
3. [CONDITIONAL LOAD] `.agents/rules/contextual/architecture/implementation-approach.md` (if Medium scale 3+ files OR Large scale)
|
|
9
|
+
|
|
10
|
+
**LOADING PROTOCOL:**
|
|
11
|
+
- STEP 1: VERIFY metacognition.md is active from initial session setup
|
|
12
|
+
- STEP 2: CHECK if documentation-criteria.md is active in working memory
|
|
13
|
+
- STEP 3: If documentation-criteria.md NOT active → Execute BLOCKING READ
|
|
14
|
+
- STEP 4: EVALUATE conditions for implementation-approach.md (Medium/Large scale: 3+ files)
|
|
15
|
+
- STEP 5: If conditions met AND implementation-approach.md NOT active → Execute BLOCKING READ
|
|
16
|
+
- STEP 6: CONFIRM all required rules active before proceeding
|
|
17
|
+
|
|
18
|
+
## Plan Injection Requirement [MANDATORY]
|
|
19
|
+
|
|
20
|
+
**Upon reading this file, IMMEDIATELY inject to work plan:**
|
|
21
|
+
1. All BLOCKING READs identified in Loading Protocol above:
|
|
22
|
+
- `.agents/rules/core/documentation-criteria.md` (if not active)
|
|
23
|
+
- `.agents/rules/contextual/architecture/implementation-approach.md` (if conditions met)
|
|
24
|
+
2. Mark each with "[From technical-design.md]" source tag
|
|
25
|
+
3. Show evidence of injection:
|
|
26
|
+
```
|
|
27
|
+
[PLAN INJECTION FROM technical-design.md]
|
|
28
|
+
Injected to work plan:
|
|
29
|
+
✓ BLOCKING READ: documentation-criteria.md - ADR/Design Doc criteria
|
|
30
|
+
✓ BLOCKING READ: implementation-approach.md - strategy selection (if applicable)
|
|
31
|
+
Status: VERIFIED
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**ENFORCEMENT:** Cannot proceed without Plan Injection evidence
|
|
35
|
+
|
|
36
|
+
**EVIDENCE REQUIRED:**
|
|
37
|
+
```
|
|
38
|
+
Rule Status Verification:
|
|
39
|
+
✓ metacognition.md - ACTIVE
|
|
40
|
+
✓ documentation-criteria.md - ACTIVE
|
|
41
|
+
✓ implementation-approach.md - [ACTIVE/NOT NEEDED]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Phase Entry Gate [BLOCKING - SYSTEM HALT IF VIOLATED]
|
|
45
|
+
|
|
46
|
+
**CHECKPOINT: System CANNOT proceed until ALL boxes checked:**
|
|
47
|
+
☐ [VERIFIED] Plan Injection completed (from task-analysis.md Step 8)
|
|
48
|
+
☐ [VERIFIED] Work plan contains "BLOCKING READ technical-design.md" item
|
|
49
|
+
☐ [VERIFIED] Project structure confirmed
|
|
50
|
+
☐ [VERIFIED] PRD reviewed (if exists) with requirements understood
|
|
51
|
+
☐ [VERIFIED] Related design documents investigation COMPLETED with evidence
|
|
52
|
+
☐ [VERIFIED] Existing ADRs reviewed for relevant decisions
|
|
53
|
+
☐ [VERIFIED] Existing codebase investigation COMPLETED with evidence
|
|
54
|
+
☐ [VERIFIED] Similar functionality search EXECUTED with results documented
|
|
55
|
+
☐ [VERIFIED] Required rules LOADED with file paths listed above
|
|
56
|
+
☐ [VERIFIED] SESSION_BASELINE_DATE established and active
|
|
57
|
+
|
|
58
|
+
**METACOGNITION GATE [MANDATORY]:**
|
|
59
|
+
BEFORE starting design, execute metacognition assessment:
|
|
60
|
+
- Understand fundamental goal (not surface task)
|
|
61
|
+
- Verify all necessary information available
|
|
62
|
+
- Confirm approach aligns with existing patterns
|
|
63
|
+
|
|
64
|
+
**GATE ENFORCEMENT:**
|
|
65
|
+
IF any box unchecked → HALT → Return to uncompleted step
|
|
66
|
+
IF attempting to skip → CRITICAL ERROR
|
|
67
|
+
|
|
68
|
+
## Purpose
|
|
69
|
+
|
|
70
|
+
Create ADR and Design Documents.
|
|
71
|
+
|
|
72
|
+
### ADR Creation Triggers [EVALUATE DURING DESIGN]:
|
|
73
|
+
- Data flow changes → ADR-ARCH-DATA-FLOW
|
|
74
|
+
- Architecture changes → ADR-ARCH-[SPECIFIC]
|
|
75
|
+
- External dependency changes → ADR-DEPS-[NAME]
|
|
76
|
+
- New technology introduction → ADR-TECH-[NAME] [BLOCKING: MUST CREATE]
|
|
77
|
+
- Performance optimization → ADR-PERF-[ASPECT]
|
|
78
|
+
- Security implementation → ADR-SEC-[FEATURE]
|
|
79
|
+
|
|
80
|
+
**EVALUATION**: Check conditions above - if ANY trigger met, ADR creation is MANDATORY
|
|
81
|
+
|
|
82
|
+
## Completion Conditions
|
|
83
|
+
|
|
84
|
+
### For ADR:
|
|
85
|
+
□ Problem background clearly stated
|
|
86
|
+
□ Minimum 3 options evaluated
|
|
87
|
+
□ Trade-offs explicitly documented
|
|
88
|
+
□ Decision rationale recorded
|
|
89
|
+
□ Latest technology research conducted
|
|
90
|
+
□ References cited with URLs
|
|
91
|
+
□ Consistency with existing architecture verified
|
|
92
|
+
|
|
93
|
+
### For Design Doc:
|
|
94
|
+
□ Agreement checklist completed
|
|
95
|
+
□ Existing codebase analysis included
|
|
96
|
+
□ Architecture approach documented
|
|
97
|
+
□ Component structure defined
|
|
98
|
+
□ Data flow mapped
|
|
99
|
+
□ Integration points identified
|
|
100
|
+
□ Error handling strategy defined
|
|
101
|
+
□ Testing strategy outlined
|
|
102
|
+
□ Acceptance criteria defined and verifiable
|
|
103
|
+
□ References cited
|
|
104
|
+
|
|
105
|
+
## Mandatory Process Before Document Creation [STRICT COMPLIANCE]
|
|
106
|
+
|
|
107
|
+
**These steps MUST be completed to pass the entry gate:**
|
|
108
|
+
|
|
109
|
+
### 1. Existing Documentation Investigation [REQUIRED - CANNOT SKIP]
|
|
110
|
+
Must be performed before any design:
|
|
111
|
+
|
|
112
|
+
1. **PRD Investigation** (if applicable)
|
|
113
|
+
- Check for related PRD in `docs/prd/` directory
|
|
114
|
+
- Review requirements and success criteria
|
|
115
|
+
- Note any constraints or scope boundaries defined
|
|
116
|
+
- Include PRD reference in design doc header
|
|
117
|
+
|
|
118
|
+
2. **Related Design Documents Search**
|
|
119
|
+
- Search existing designs in `docs/design/` directory
|
|
120
|
+
- Identify similar or dependent features
|
|
121
|
+
- Review architectural patterns used
|
|
122
|
+
- Note integration points and data flows
|
|
123
|
+
|
|
124
|
+
3. **Existing ADRs Review**
|
|
125
|
+
- Search ADRs in `docs/adr/` directory
|
|
126
|
+
- Identify relevant technical decisions
|
|
127
|
+
- Check for superseded ADRs that might need updating
|
|
128
|
+
- List applicable ADRs in "Prerequisite ADRs" section
|
|
129
|
+
|
|
130
|
+
### 2. Existing Code Investigation [REQUIRED - CANNOT SKIP]
|
|
131
|
+
Must be performed after documentation review:
|
|
132
|
+
|
|
133
|
+
1. **Implementation File Path Verification**
|
|
134
|
+
- First grasp overall project structure
|
|
135
|
+
- Then identify target files by searching for relevant component/module names
|
|
136
|
+
- Record and distinguish between existing implementation locations and planned new locations
|
|
137
|
+
|
|
138
|
+
2. **Existing API Investigation** (Only when changing existing features)
|
|
139
|
+
- List major public operations of target component
|
|
140
|
+
- Identify call sites by searching for component usage patterns
|
|
141
|
+
|
|
142
|
+
3. **Similar Functionality Search** (Pattern 5 prevention from ai-development-guide.md)
|
|
143
|
+
- Search existing code for keywords related to planned functionality
|
|
144
|
+
- Look for implementations with same domain, responsibilities, or configuration patterns
|
|
145
|
+
- Decision and action:
|
|
146
|
+
- Similar functionality found → Use that implementation (do not create new)
|
|
147
|
+
- Similar functionality is technical debt → Create ADR improvement proposal
|
|
148
|
+
- No similar functionality → Proceed with new implementation
|
|
149
|
+
|
|
150
|
+
4. **Include in Design Doc**
|
|
151
|
+
- Always include investigation results in "## Existing Codebase Analysis" section
|
|
152
|
+
- Clearly document similar functionality search results
|
|
153
|
+
- Record adopted decision and rationale
|
|
154
|
+
|
|
155
|
+
### 3. Agreement Checklist【MOST IMPORTANT】
|
|
156
|
+
Must be performed at the beginning of Design Doc creation:
|
|
157
|
+
|
|
158
|
+
1. **List agreements with user in bullet points**
|
|
159
|
+
- Scope (what to change)
|
|
160
|
+
- Non-scope (what not to change)
|
|
161
|
+
- Constraints (compatibility requirements, etc.)
|
|
162
|
+
- Performance requirements
|
|
163
|
+
|
|
164
|
+
2. **Confirm reflection in design**
|
|
165
|
+
- [ ] Specify where each agreement is reflected
|
|
166
|
+
- [ ] Confirm no design contradicts agreements
|
|
167
|
+
- [ ] If any agreements not reflected, state reason
|
|
168
|
+
|
|
169
|
+
### 4. Latest Information Research [BLOCKING REQUIREMENT]
|
|
170
|
+
|
|
171
|
+
**Web research MUST use SESSION_BASELINE_DATE year - NEVER hardcoded years:**
|
|
172
|
+
- Format: "[technology] best practices [YEAR from SESSION_BASELINE_DATE]"
|
|
173
|
+
- Required for: New technology/library introduction, security implementations
|
|
174
|
+
- Verify: Latest versions, breaking changes, security updates as of SESSION_BASELINE_DATE
|
|
175
|
+
|
|
176
|
+
**Search Examples**: `[tech] best practices [YEAR]`, `[framework] official docs`
|
|
177
|
+
|
|
178
|
+
## ADR Creation Guidelines
|
|
179
|
+
|
|
180
|
+
### ADR Superseding Process [MANDATORY FOR RELATED ADRS]
|
|
181
|
+
|
|
182
|
+
When creating an ADR that replaces or modifies a previous decision:
|
|
183
|
+
|
|
184
|
+
1. **Identify Related ADRs**
|
|
185
|
+
- Search for ADRs covering the same domain/technology
|
|
186
|
+
- Check for ADRs that would be contradicted by new decision
|
|
187
|
+
- List all ADRs that need to be superseded
|
|
188
|
+
|
|
189
|
+
2. **Update Existing ADR Status**
|
|
190
|
+
- Change status of old ADR: `Status: Superseded by ADR-XXXX`
|
|
191
|
+
- Add superseding note with date and new ADR reference
|
|
192
|
+
- DO NOT delete old ADRs - maintain history
|
|
193
|
+
|
|
194
|
+
3. **Reference in New ADR**
|
|
195
|
+
- Add "Supersedes: ADR-YYYY" in header
|
|
196
|
+
- Explain what changed and why
|
|
197
|
+
- Maintain traceability of decision evolution
|
|
198
|
+
|
|
199
|
+
### ADR Structure
|
|
200
|
+
|
|
201
|
+
```markdown
|
|
202
|
+
# ADR-XXXX: [Title]
|
|
203
|
+
Status: Proposed
|
|
204
|
+
Supersedes: ADR-YYYY (if applicable)
|
|
205
|
+
|
|
206
|
+
## Background
|
|
207
|
+
[Technical challenges and constraints in 1-2 sentences]
|
|
208
|
+
|
|
209
|
+
## Options
|
|
210
|
+
|
|
211
|
+
### Option A: [Approach Name]
|
|
212
|
+
- Overview: [One sentence]
|
|
213
|
+
- Benefits: [2-3 items]
|
|
214
|
+
- Drawbacks: [2-3 items]
|
|
215
|
+
- Effort: X days
|
|
216
|
+
- Risk: Low/Medium/High
|
|
217
|
+
|
|
218
|
+
### Option B/C: [Similarly structured, minimum 3 options total]
|
|
219
|
+
|
|
220
|
+
## Comparison Matrix
|
|
221
|
+
| Evaluation Axis | Option A | Option B | Option C |
|
|
222
|
+
|----------------|----------|----------|----------|
|
|
223
|
+
| Implementation Effort | X days | Y days | Z days |
|
|
224
|
+
| Maintainability | High/Med/Low | ... | ... |
|
|
225
|
+
| Performance Impact | +/-/None | ... | ... |
|
|
226
|
+
|
|
227
|
+
## Decision
|
|
228
|
+
Option [X] selected. Rationale: [2-3 sentences with trade-offs]
|
|
229
|
+
|
|
230
|
+
### Decision Details
|
|
231
|
+
|
|
232
|
+
| Item | Content |
|
|
233
|
+
|------|---------|
|
|
234
|
+
| **Decision** | [The decision in one sentence] |
|
|
235
|
+
| **Why now** | [Why this needs to happen now (timing rationale)] |
|
|
236
|
+
| **Why this** | [Why this option over alternatives (1-3 lines)] |
|
|
237
|
+
| **Known unknowns** | [At least one uncertainty at this point] |
|
|
238
|
+
| **Kill criteria** | [One signal that should trigger reversal of this decision] |
|
|
239
|
+
|
|
240
|
+
## Implementation Guidelines
|
|
241
|
+
[Principle-based guidelines]
|
|
242
|
+
|
|
243
|
+
## References
|
|
244
|
+
- [Documentation](URL) - Description
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Design Doc Creation Guidelines
|
|
248
|
+
|
|
249
|
+
### Design Doc Structure
|
|
250
|
+
|
|
251
|
+
````markdown
|
|
252
|
+
# Technical Design: [Feature Name]
|
|
253
|
+
|
|
254
|
+
## PRD Reference
|
|
255
|
+
- PRD: `docs/prd/[feature-name]-prd.md` (if applicable)
|
|
256
|
+
- Requirements addressed: [key requirements]
|
|
257
|
+
|
|
258
|
+
## Overview
|
|
259
|
+
[Brief description]
|
|
260
|
+
|
|
261
|
+
## Design Summary (Meta)
|
|
262
|
+
|
|
263
|
+
```yaml
|
|
264
|
+
design_type: "new_feature|extension|refactoring"
|
|
265
|
+
risk_level: "low|medium|high"
|
|
266
|
+
main_constraints:
|
|
267
|
+
- "[constraint 1]"
|
|
268
|
+
- "[constraint 2]"
|
|
269
|
+
biggest_risks:
|
|
270
|
+
- "[risk 1]"
|
|
271
|
+
- "[risk 2]"
|
|
272
|
+
unknowns:
|
|
273
|
+
- "[uncertainty 1]"
|
|
274
|
+
- "[uncertainty 2]"
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Agreement Checklist
|
|
278
|
+
- [ ] Scope: [what to implement]
|
|
279
|
+
- [ ] Non-scope: [what not to change]
|
|
280
|
+
- [ ] Constraints: [limitations]
|
|
281
|
+
- [ ] Performance: [requirements]
|
|
282
|
+
|
|
283
|
+
## Existing Codebase Analysis
|
|
284
|
+
[Investigation results, similar functionality, decision]
|
|
285
|
+
|
|
286
|
+
## Requirements
|
|
287
|
+
[Functional, Non-functional, Constraints]
|
|
288
|
+
|
|
289
|
+
## Acceptance Criteria
|
|
290
|
+
### Functional Requirements
|
|
291
|
+
- [ ] [Specific testable conditions]
|
|
292
|
+
|
|
293
|
+
### Non-functional Requirements
|
|
294
|
+
- [ ] [Performance/Security metrics]
|
|
295
|
+
|
|
296
|
+
## Architecture
|
|
297
|
+
|
|
298
|
+
### Approach
|
|
299
|
+
[Selected pattern and rationale]
|
|
300
|
+
|
|
301
|
+
### Components
|
|
302
|
+
[Component list with responsibilities]
|
|
303
|
+
|
|
304
|
+
### Data Flow
|
|
305
|
+
[System data movement]
|
|
306
|
+
|
|
307
|
+
### Integration Points
|
|
308
|
+
[External systems, APIs, Databases]
|
|
309
|
+
|
|
310
|
+
### Integration Point Analysis [MANDATORY for feature modifications]
|
|
311
|
+
[Use format from section above]
|
|
312
|
+
|
|
313
|
+
## Implementation Details
|
|
314
|
+
|
|
315
|
+
### Technology Stack
|
|
316
|
+
[Languages, frameworks, libraries, tools]
|
|
317
|
+
|
|
318
|
+
### Change Impact Map
|
|
319
|
+
[Target, Direct impact, Indirect impact]
|
|
320
|
+
|
|
321
|
+
## Testing Strategy
|
|
322
|
+
[Unit and integration test approaches]
|
|
323
|
+
|
|
324
|
+
## Risks and Mitigations
|
|
325
|
+
[Technical risks]
|
|
326
|
+
|
|
327
|
+
## References
|
|
328
|
+
- [Source](URL) - Description
|
|
329
|
+
````
|
|
330
|
+
|
|
331
|
+
## Acceptance Criteria Creation Guidelines
|
|
332
|
+
|
|
333
|
+
**Principle**: Specific, verifiable conditions that translate to test cases
|
|
334
|
+
**Good**: "After auth with correct credentials, navigates to dashboard"
|
|
335
|
+
**Bad**: "Login works"
|
|
336
|
+
|
|
337
|
+
### EARS Format [RECOMMENDED]
|
|
338
|
+
|
|
339
|
+
Use EARS keywords to standardize AC structure:
|
|
340
|
+
|
|
341
|
+
| Keyword | Test Type | Example |
|
|
342
|
+
|---------|-----------|---------|
|
|
343
|
+
| **When** | Event trigger | "**When** user clicks submit, the system shall save the form" |
|
|
344
|
+
| **While** | State-based | "**While** logged in, the system shall display username" |
|
|
345
|
+
| **If-then** | Conditional | "**If** cart is empty, **then** show empty message" |
|
|
346
|
+
| (none) | Always-true | "The system shall encrypt all passwords" |
|
|
347
|
+
|
|
348
|
+
### Behavior-First Principle [CRITICAL]
|
|
349
|
+
|
|
350
|
+
**Core Principle**: AC = User-observable behavior verifiable in isolated CI environment
|
|
351
|
+
|
|
352
|
+
**BEFORE writing any AC, apply 3 mandatory checks:**
|
|
353
|
+
|
|
354
|
+
#### 1. User-Observable Check
|
|
355
|
+
**Question**: "Can a user (or system operator) observe this behavior?"
|
|
356
|
+
- **If NO** → This is an **implementation detail**, exclude from AC
|
|
357
|
+
- **If YES** → Continue to check 2
|
|
358
|
+
|
|
359
|
+
**Examples**:
|
|
360
|
+
- ❌ Bad (Implementation Detail): "Password must be hashed using bcrypt with 10 salt rounds"
|
|
361
|
+
- ✅ Good (User-Observable): "After failed login attempts, user is locked out for 15 minutes"
|
|
362
|
+
|
|
363
|
+
#### 2. Verification Context Check
|
|
364
|
+
**Question**: "Can this be verified without full system integration?"
|
|
365
|
+
- **If YES** → This is **unit/component level**, exclude from integration/E2E AC
|
|
366
|
+
- **If NO** → This is a valid AC for integration/E2E tests, continue to check 3
|
|
367
|
+
|
|
368
|
+
**Examples**:
|
|
369
|
+
- ❌ Bad (Unit-level): "calculateTax function returns correct value for given input"
|
|
370
|
+
- ✅ Good (Integration-level): "After checkout, order total includes correct tax amount"
|
|
371
|
+
|
|
372
|
+
#### 3. CI Environment Check
|
|
373
|
+
**Question**: "Is this verifiable deterministically in CI?"
|
|
374
|
+
- **If NO** → Exclude (e.g., performance metrics, real external services)
|
|
375
|
+
- **If YES** → Valid AC
|
|
376
|
+
|
|
377
|
+
**Examples**:
|
|
378
|
+
- ❌ Bad (Non-deterministic): "API response time must be < 200ms"
|
|
379
|
+
- ✅ Good (Deterministic): "System processes checkout requests without blocking user interaction"
|
|
380
|
+
|
|
381
|
+
**Enhanced Include/Exclude Criteria**:
|
|
382
|
+
|
|
383
|
+
**Include (High Automation ROI)**:
|
|
384
|
+
- Business logic correctness (calculations, state transitions)
|
|
385
|
+
- Data integrity and persistence behavior
|
|
386
|
+
- User-visible functionality completeness
|
|
387
|
+
- Error handling behavior (what user sees/experiences)
|
|
388
|
+
|
|
389
|
+
**Exclude (Low Automation ROI)**:
|
|
390
|
+
- External service real connections → Use contract/interface verification instead
|
|
391
|
+
- Performance metrics → Non-deterministic in CI, use dedicated performance testing
|
|
392
|
+
- Implementation details (hashing algorithms, internal function calls) → Focus on observable behavior
|
|
393
|
+
- UI layout specifics → Focus on information availability, not pixel-perfect rendering
|
|
394
|
+
|
|
395
|
+
## Design Validation
|
|
396
|
+
|
|
397
|
+
Verify: Completeness, Consistency, Feasibility, Testability, Maintainability, Scalability
|
|
398
|
+
|
|
399
|
+
## Deliverables
|
|
400
|
+
|
|
401
|
+
### When ADR needed:
|
|
402
|
+
- ADR document in `docs/adr/ADR-[4-digit]-[title].md`
|
|
403
|
+
- Status: "Proposed" → "Accepted" or "Rejected" after decision
|
|
404
|
+
|
|
405
|
+
### Always:
|
|
406
|
+
- Design document in `docs/design/[feature-name]-design.md`
|
|
407
|
+
- Include all investigation results
|
|
408
|
+
- Include all references
|
|
409
|
+
|
|
410
|
+
## Post-Design Metacognition Gate [MANDATORY]
|
|
411
|
+
|
|
412
|
+
**AFTER completing design document:**
|
|
413
|
+
☐ Execute "After Completion" metacognition checklist
|
|
414
|
+
☐ Verify design addresses all requirements
|
|
415
|
+
☐ Confirm technical approach is simplest viable solution
|
|
416
|
+
☐ Document any assumptions or risks identified
|
|
417
|
+
☐ Evaluate if additional research needed
|
|
418
|
+
|
|
419
|
+
**CANNOT proceed to implementation without:**
|
|
420
|
+
- Metacognition assessment complete
|
|
421
|
+
- Design document created
|
|
422
|
+
- User approval received
|
|
423
|
+
|
|
424
|
+
## Anti-Patterns to Avoid
|
|
425
|
+
|
|
426
|
+
**ADR Anti-Patterns**
|
|
427
|
+
Recommended: Evaluate 3+ options with research-backed trade-offs
|
|
428
|
+
Reason: Single option decisions lack validation; options without drawbacks are unrealistic
|
|
429
|
+
|
|
430
|
+
**Design Anti-Patterns**
|
|
431
|
+
Recommended: Specific, testable acceptance criteria with impact analysis
|
|
432
|
+
Reason: Vague criteria prevent verification; missing impact analysis causes integration issues
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# Document Review
|
|
2
|
+
|
|
3
|
+
## Required Rules [MANDATORY - MUST BE ACTIVE]
|
|
4
|
+
|
|
5
|
+
**RULE AVAILABILITY VERIFICATION:**
|
|
6
|
+
1. [LOAD IF NOT ACTIVE] `.agents/rules/core/documentation-criteria.md`
|
|
7
|
+
2. [CONDITIONAL LOAD] `.agents/rules/core/testing-strategy.md` (if reviewing Design Doc with test strategy)
|
|
8
|
+
|
|
9
|
+
**LOADING PROTOCOL:**
|
|
10
|
+
- STEP 1: CHECK if documentation-criteria.md is active in working memory
|
|
11
|
+
- STEP 2: If documentation-criteria.md NOT active → Execute BLOCKING READ
|
|
12
|
+
- STEP 3: EVALUATE if testing-strategy.md needed (Design Doc with test strategy section)
|
|
13
|
+
- STEP 4: If needed AND NOT active → Execute BLOCKING READ
|
|
14
|
+
- STEP 5: CONFIRM all required rules active before proceeding
|
|
15
|
+
|
|
16
|
+
## Purpose
|
|
17
|
+
|
|
18
|
+
Review technical documents (Design Docs, ADRs, PRDs) for completeness, consistency, and quality. Identify gaps, validate structure compliance, and evaluate failure scenario coverage.
|
|
19
|
+
|
|
20
|
+
## When to Use
|
|
21
|
+
|
|
22
|
+
- When reviewing existing design documents
|
|
23
|
+
- Before approving technical decisions
|
|
24
|
+
- When evaluating document quality from third-party perspective
|
|
25
|
+
|
|
26
|
+
## Required Information
|
|
27
|
+
|
|
28
|
+
- **documentPath**: Path to document to review (required)
|
|
29
|
+
- **documentType**: Type of document (required)
|
|
30
|
+
- `design-doc`: Technical Design Document
|
|
31
|
+
- `adr`: Architecture Decision Record
|
|
32
|
+
- `prd`: Product Requirements Document
|
|
33
|
+
- **templatePath**: Path to template for validation baseline (optional - uses default if not provided)
|
|
34
|
+
- **reviewMode**:
|
|
35
|
+
- `full`: Complete validation (default)
|
|
36
|
+
- `structure`: Structure compliance only
|
|
37
|
+
- `content`: Content quality only
|
|
38
|
+
- `failure-scenarios`: Failure scenario coverage only
|
|
39
|
+
|
|
40
|
+
## Completion Conditions
|
|
41
|
+
|
|
42
|
+
□ Document loaded and type confirmed
|
|
43
|
+
□ Structure compliance verified against template
|
|
44
|
+
□ Content quality evaluated
|
|
45
|
+
□ Failure scenarios reviewed (for Design Docs)
|
|
46
|
+
□ Issues documented with severity
|
|
47
|
+
□ Verdict determined with rationale
|
|
48
|
+
|
|
49
|
+
## Review Process
|
|
50
|
+
|
|
51
|
+
### Stage 1: Document Type Identification
|
|
52
|
+
|
|
53
|
+
Confirm document type and determine validation baseline:
|
|
54
|
+
- If template path provided → Use specified template as baseline
|
|
55
|
+
- If no template provided → Request template path from user
|
|
56
|
+
- Default templates by type:
|
|
57
|
+
- Design Doc → `.agents/tasks/technical-design.md`
|
|
58
|
+
- ADR → ADR section in `.agents/tasks/technical-design.md`
|
|
59
|
+
- PRD → PRD section in `.agents/rules/core/documentation-criteria.md`
|
|
60
|
+
|
|
61
|
+
### Stage 2: Structure Compliance Check
|
|
62
|
+
|
|
63
|
+
#### For Design Doc
|
|
64
|
+
|
|
65
|
+
| Required Section | Check Item |
|
|
66
|
+
|-----------------|------------|
|
|
67
|
+
| Overview | Purpose clearly stated |
|
|
68
|
+
| Design Summary (Meta) | risk_level, constraints, unknowns defined |
|
|
69
|
+
| Agreement Checklist | Scope/Non-scope/Constraints documented |
|
|
70
|
+
| Existing Codebase Analysis | Investigation results included |
|
|
71
|
+
| Acceptance Criteria | Specific, testable conditions |
|
|
72
|
+
| Architecture | Approach, components, data flow defined |
|
|
73
|
+
| Integration Points | External dependencies identified |
|
|
74
|
+
| Testing Strategy | Test approach outlined |
|
|
75
|
+
| Risks and Mitigations | Technical risks documented |
|
|
76
|
+
| References | Sources cited |
|
|
77
|
+
|
|
78
|
+
#### For ADR
|
|
79
|
+
|
|
80
|
+
| Required Section | Check Item |
|
|
81
|
+
|-----------------|------------|
|
|
82
|
+
| Background | Problem context in 1-2 sentences |
|
|
83
|
+
| Options | Minimum 3 options evaluated |
|
|
84
|
+
| Comparison Matrix | Trade-offs quantified |
|
|
85
|
+
| Decision | Selected option with rationale |
|
|
86
|
+
| Decision Details | Why now / Why this / Known unknowns / Kill criteria |
|
|
87
|
+
| Implementation Guidelines | Principle-based guidelines |
|
|
88
|
+
| References | Documentation URLs cited |
|
|
89
|
+
|
|
90
|
+
#### For PRD
|
|
91
|
+
|
|
92
|
+
| Required Section | Check Item |
|
|
93
|
+
|-----------------|------------|
|
|
94
|
+
| Business Requirements | User value articulated |
|
|
95
|
+
| Success Metrics | KPIs in measurable format |
|
|
96
|
+
| User Stories | Use cases documented |
|
|
97
|
+
| MoSCoW Prioritization | Must/Should/Could/Won't defined |
|
|
98
|
+
| Scope Boundaries | MVP and future phases separated |
|
|
99
|
+
|
|
100
|
+
### Stage 3: Content Quality Check
|
|
101
|
+
|
|
102
|
+
| Check Item | Verification Content | Failure Condition |
|
|
103
|
+
|------------|---------------------|-------------------|
|
|
104
|
+
| Specificity | Concrete, not vague | Abstract statements without examples |
|
|
105
|
+
| Testability | Acceptance criteria verifiable | Cannot be tested |
|
|
106
|
+
| Consistency | No internal contradictions | Sections contradict each other |
|
|
107
|
+
| Completeness | All required sections present | Missing sections |
|
|
108
|
+
| Clarity | Unambiguous language | Multiple interpretations possible |
|
|
109
|
+
|
|
110
|
+
### Stage 4: Failure Scenario Review (Design Docs Only)
|
|
111
|
+
|
|
112
|
+
Identify failure scenarios across three categories:
|
|
113
|
+
|
|
114
|
+
| Category | Description | Required Coverage |
|
|
115
|
+
|----------|-------------|-------------------|
|
|
116
|
+
| Normal usage | Failures during typical operation | At least 1 scenario |
|
|
117
|
+
| High load | Failures under stress | At least 1 scenario |
|
|
118
|
+
| External failures | Failures from dependencies | At least 1 scenario |
|
|
119
|
+
|
|
120
|
+
For each identified scenario, verify:
|
|
121
|
+
- Failure scenario is explicitly documented
|
|
122
|
+
- Bottleneck element is specified
|
|
123
|
+
- Mitigation strategy is defined
|
|
124
|
+
|
|
125
|
+
### Stage 5: Technical Claim Verification
|
|
126
|
+
|
|
127
|
+
When sources exist:
|
|
128
|
+
- Verify claims with current best practices
|
|
129
|
+
- Check if referenced technologies/versions are current
|
|
130
|
+
- Flag outdated information
|
|
131
|
+
|
|
132
|
+
## Validation Checklist
|
|
133
|
+
|
|
134
|
+
### Structure Validation
|
|
135
|
+
- [ ] All required sections present
|
|
136
|
+
- [ ] Section order follows template
|
|
137
|
+
- [ ] Formatting consistent
|
|
138
|
+
|
|
139
|
+
### Content Validation
|
|
140
|
+
- [ ] Acceptance criteria specific and testable
|
|
141
|
+
- [ ] Technical decisions justified
|
|
142
|
+
- [ ] Risks identified and mitigated
|
|
143
|
+
- [ ] References cited and valid
|
|
144
|
+
|
|
145
|
+
### Failure Scenario Validation (Design Docs)
|
|
146
|
+
- [ ] Normal usage failure scenario identified
|
|
147
|
+
- [ ] High load failure scenario identified
|
|
148
|
+
- [ ] External failure scenario identified
|
|
149
|
+
- [ ] Bottlenecks specified for each scenario
|
|
150
|
+
|
|
151
|
+
### Consistency Validation
|
|
152
|
+
- [ ] No contradictions between sections
|
|
153
|
+
- [ ] Terminology used consistently
|
|
154
|
+
- [ ] Scope aligned throughout document
|
|
155
|
+
|
|
156
|
+
## Output Format
|
|
157
|
+
|
|
158
|
+
### Status Determination
|
|
159
|
+
|
|
160
|
+
**approved**:
|
|
161
|
+
- All required sections present and complete
|
|
162
|
+
- Content is specific and testable
|
|
163
|
+
- Failure scenarios covered (Design Docs)
|
|
164
|
+
- No high severity issues
|
|
165
|
+
|
|
166
|
+
**needs_revision**:
|
|
167
|
+
- Some sections incomplete
|
|
168
|
+
- Content quality issues exist
|
|
169
|
+
- Failure scenarios partially covered
|
|
170
|
+
- Medium severity issues present
|
|
171
|
+
|
|
172
|
+
**blocked**:
|
|
173
|
+
- Critical sections missing
|
|
174
|
+
- Major contradictions found
|
|
175
|
+
- Document type unclear
|
|
176
|
+
- Cannot proceed without significant rewrite
|
|
177
|
+
|
|
178
|
+
### Report Structure
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
[REVIEW RESULT]
|
|
182
|
+
documentType: design-doc | adr | prd
|
|
183
|
+
documentPath: [path]
|
|
184
|
+
verdict: approved | needs_revision | blocked
|
|
185
|
+
completenessRate: [X]%
|
|
186
|
+
|
|
187
|
+
[STRUCTURE COMPLIANCE]
|
|
188
|
+
requiredSections: [count]
|
|
189
|
+
presentSections: [count]
|
|
190
|
+
missingSections:
|
|
191
|
+
- [section name]
|
|
192
|
+
|
|
193
|
+
[CONTENT QUALITY]
|
|
194
|
+
issues:
|
|
195
|
+
- severity: high | medium | low
|
|
196
|
+
section: [section name]
|
|
197
|
+
issue: [problem description]
|
|
198
|
+
suggestion: [specific improvement]
|
|
199
|
+
|
|
200
|
+
[FAILURE SCENARIO REVIEW] (Design Docs only)
|
|
201
|
+
normalUsage:
|
|
202
|
+
covered: yes | no
|
|
203
|
+
scenario: [if covered]
|
|
204
|
+
bottleneck: [if covered]
|
|
205
|
+
highLoad:
|
|
206
|
+
covered: yes | no
|
|
207
|
+
scenario: [if covered]
|
|
208
|
+
bottleneck: [if covered]
|
|
209
|
+
externalFailures:
|
|
210
|
+
covered: yes | no
|
|
211
|
+
scenario: [if covered]
|
|
212
|
+
bottleneck: [if covered]
|
|
213
|
+
|
|
214
|
+
[VERDICT]
|
|
215
|
+
decision: approved | needs_revision | blocked
|
|
216
|
+
reason: [decision rationale]
|
|
217
|
+
prioritizedActions:
|
|
218
|
+
1. [highest priority fix]
|
|
219
|
+
2. [next fix]
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Review Principles
|
|
223
|
+
|
|
224
|
+
1. **Template Compliance**
|
|
225
|
+
- Use document type template as baseline
|
|
226
|
+
- Verify all required elements present
|
|
227
|
+
|
|
228
|
+
2. **Constructive Feedback**
|
|
229
|
+
- Provide specific improvement suggestions
|
|
230
|
+
- Prioritize issues by impact
|
|
231
|
+
|
|
232
|
+
3. **Objectivity**
|
|
233
|
+
- Evaluate against documented standards
|
|
234
|
+
- Avoid subjective preferences
|
|
235
|
+
|
|
236
|
+
4. **Actionability**
|
|
237
|
+
- Each issue should have clear resolution path
|
|
238
|
+
- Distinguish must-fix from nice-to-have
|
|
239
|
+
|
|
240
|
+
## Escalation Criteria
|
|
241
|
+
|
|
242
|
+
Recommend escalation when:
|
|
243
|
+
- Document contradicts existing ADRs
|
|
244
|
+
- Security implications not addressed
|
|
245
|
+
- Scope significantly exceeds original requirements
|
|
246
|
+
- Technical claims cannot be verified
|
|
247
|
+
|
|
248
|
+
## Anti-Patterns to Avoid
|
|
249
|
+
|
|
250
|
+
- Approving documents with missing required sections
|
|
251
|
+
- Ignoring vague acceptance criteria
|
|
252
|
+
- Overlooking failure scenario gaps
|
|
253
|
+
- Accepting documents without references
|
|
254
|
+
- Providing feedback without specific solutions
|