doc-naming Skill
Enforces unified ID naming standards and threshold naming rules for all SDD documentation artifacts.
1. Purpose & Scope
When to Invoke
Invoke this skill BEFORE creating or editing any SDD documentation artifact. Use it to:
- Verify element ID format compliance
- Check for removed/legacy patterns
- Validate threshold tag syntax
- Ensure document ID format correctness
Coverage
This skill covers all 12 SDD document types:
| Layer |
Document Type |
Description |
| 1 |
BRD |
Business Requirements Document |
| 2 |
PRD |
Product Requirements Document |
| 3 |
EARS |
Easy Approach to Requirements Syntax |
| 4 |
BDD |
Behavior-Driven Development |
| 5 |
ADR |
Architecture Decision Record |
| 6 |
SYS |
System Requirements |
| 7 |
REQ |
Atomic Requirements |
| 8 |
IMPL |
Implementation Approach |
| 9 |
CTR |
Data Contracts |
| 10 |
SPEC |
Technical Specifications |
| 11 |
TASKS |
AI Task Breakdown |
2. Reserved ID Exemption (TYPE-00_*)
Scope
Documents with reserved ID 000 are FULLY EXEMPT from standard validation.
Pattern
{DOC_TYPE}-00_{slug}.{ext}
Document Types
- Index documents (e.g.,
BRD-00_index.md, REQ-00_index.md)
- Traceability matrix templates (e.g.,
SPEC-00_TRACEABILITY_MATRIX-TEMPLATE.md)
- Glossaries, registries, checklists
Rationale
Reserved ID 000 documents are framework infrastructure (indexes, templates, reference materials), not project artifacts requiring traceability or quality gates.
Validation Behavior
Skip all element ID and traceability checks when filename matches {TYPE}-00_* pattern.
3. Document ID Format (TYPE-NN)
Pattern
TYPE-NN
- TYPE: Uppercase document type acronym (BRD, PRD, EARS, etc.)
- Separator: Single dash
-
- NN: 2+ digit sequential number with leading zeros
Validation Regex
^[A-Z]{2,5}-[0-9]{2,}$
Examples
| Document ID |
Valid |
Reason |
BRD-01 |
✅ |
Correct format |
PRD-02 |
✅ |
Correct format |
ADR-001 |
✅ |
3-digit ID allowed |
TASKS-12 |
✅ |
Correct format |
brd-01 |
❌ |
Lowercase not allowed |
PRD_02 |
❌ |
Underscore not allowed |
BRD-1 |
❌ |
Single digit not allowed |
BRD01 |
❌ |
Missing dash separator |
Filename Convention
TYPE-NN_descriptive_slug.md
Example: BRD-01_ib_stock_options_mcp_server.md
REF Document Pattern
Reference documents use a modified pattern within parent TYPE directories:
| Component |
Pattern |
Example |
| H1 ID |
{TYPE}-REF-NN |
# BRD-REF-01: Project Overview |
| Filename |
{TYPE}-REF-NN_{slug}.md |
BRD-REF-01_project_overview.md |
| Location |
Within parent TYPE directory |
docs/BRD/BRD-REF-01_project_overview.md |
Notes:
- REF documents are supplementary and do not participate in formal traceability chain
- Similar exemption treatment as
{TYPE}-000 index documents
- Numbering is independent per parent TYPE (BRD-REF-01, ADR-REF-01 are separate sequences)
4. Element ID Format (TYPE.NN.TT.SS)
Pattern
{DOC_TYPE}.{DOC_NUM}.{ELEM_TYPE}.{SEQ}
| Segment |
Description |
Format |
| DOC_TYPE |
Document type acronym |
2-5 uppercase letters |
| DOC_NUM |
Document number |
2+ digits |
| ELEM_TYPE |
Element type code |
2+ digits (01-31) |
| SEQ |
Sequential number |
2+ digits |
Validation Regex
^[A-Z]{2,5}\.[0-9]{2,}\.[0-9]{2,}\.[0-9]{2,}$
Examples
| Element ID |
Valid |
Breakdown |
BRD.02.06.01 |
✅ |
BRD doc 02, Acceptance Criteria (06), item 01 |
PRD.01.09.03 |
✅ |
PRD doc 01, User Story (09), item 03 |
ADR.05.10.01 |
✅ |
ADR doc 05, Decision (10), item 01 |
SPEC.03.16.02 |
✅ |
SPEC doc 03, Interface (16), item 02 |
AC-001 |
❌ |
Legacy pattern - use TYPE.NN.06.SS |
FR-01 |
❌ |
Legacy pattern - use TYPE.NN.01.SS |
BRD-02-06-01 |
❌ |
Wrong separator (use dots) |
brd.02.06.01 |
❌ |
Lowercase not allowed |
Heading Format
Element IDs appear as markdown headings:
### BRD.02.06.01: User Authentication Acceptance Criteria
#### PRD.01.09.03: User Login Story
5. Element Type Codes Table
All 31 element type codes with document type applicability:
| Code |
Element Type |
Applicable Document Types |
| 01 |
Functional Requirement |
BRD, PRD, SYS, REQ |
| 02 |
Quality Attribute |
BRD, PRD, SYS |
| 03 |
Constraint |
BRD, PRD |
| 04 |
Assumption |
BRD, PRD |
| 05 |
Dependency |
BRD, PRD, REQ |
| 06 |
Acceptance Criteria |
BRD, PRD, REQ |
| 07 |
Risk |
BRD, PRD |
| 08 |
Metric |
BRD, PRD |
| 09 |
User Story |
PRD, BRD |
| 10 |
Decision |
ADR, BRD |
| 11 |
Use Case |
PRD, SYS |
| 12 |
Alternative |
ADR |
| 13 |
Consequence |
ADR |
| 14 |
Test Scenario |
BDD |
| 15 |
Step |
BDD, SPEC |
| 16 |
Interface |
SPEC, CTR |
| 17 |
Data Model |
SPEC, CTR |
| 18 |
Task |
TASKS |
| 20 |
Contract Clause |
CTR |
| 21 |
Validation Rule |
SPEC |
| 22 |
Feature Item |
BRD, PRD |
| 23 |
Business Objective |
BRD |
| 24 |
Stakeholder Need |
BRD, PRD |
| 25 |
EARS Statement |
EARS |
| 26 |
System Requirement |
SYS |
| 27 |
Atomic Requirement |
REQ |
| 28 |
Specification Element |
SPEC |
| 29 |
Implementation Phase |
IMPL |
| 30 |
Task Item |
TASKS |
Quick Lookup by Document Type
| Document |
Common Element Codes |
| BRD |
01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 22, 23, 24 |
| PRD |
01, 02, 03, 04, 05, 06, 07, 08, 09, 11, 22, 24 |
| EARS |
25 |
| BDD |
14, 15 |
| ADR |
10, 12, 13 |
| SYS |
01, 02, 11, 26 |
| REQ |
01, 05, 06, 27 |
| IMPL |
29 |
| CTR |
16, 17, 20 |
| SPEC |
15, 16, 17, 21, 28 |
| TASKS |
18, 30 |
6. Removed/Legacy Patterns
These patterns are DEPRECATED. Do NOT use them in new documents.
| Removed Pattern |
Migration Path |
Applies To |
AC-XXX |
TYPE.NN.06.SS |
BRD, PRD, REQ |
FR-XXX |
TYPE.NN.01.SS |
BRD, PRD, SYS, REQ |
BC-XXX |
TYPE.NN.03.SS |
BRD, PRD |
BA-XXX |
TYPE.NN.04.SS |
BRD, PRD |
QA-XXX |
TYPE.NN.02.SS |
BRD, PRD, SYS |
BO-XXX |
TYPE.NN.23.SS |
BRD |
RISK-XXX |
TYPE.NN.07.SS |
BRD, PRD |
METRIC-XXX |
TYPE.NN.08.SS |
BRD, PRD |
Feature F-XXX |
TYPE.NN.22.SS |
BRD, PRD |
Event-XXX |
TYPE.NN.25.SS |
EARS |
State-XXX |
TYPE.NN.25.SS |
EARS |
TASK-XXX |
TYPE.NN.18.SS |
TASKS |
T-XXX |
TYPE.NN.18.SS |
TASKS |
Phase-XXX |
TYPE.NN.29.SS |
IMPL |
IP-XXX |
TYPE.NN.29.SS |
IMPL |
IF-XXX |
TYPE.NN.16.SS |
CTR |
DM-XXX |
TYPE.NN.17.SS |
CTR |
CC-XXX |
TYPE.NN.20.SS |
CTR |
DEC-XXX |
TYPE.NN.10.SS |
ADR |
ALT-XXX |
TYPE.NN.12.SS |
ADR |
CON-XXX |
TYPE.NN.13.SS |
ADR |
Migration Examples
| Legacy |
Unified Format |
### AC-001: Login Validation |
### BRD.02.06.01: Login Validation |
#### FR-01: User Auth |
#### PRD.01.01.01: User Auth |
### Event-001: KYC Submission |
### EARS.06.25.01: KYC Submission |
### TASK-01: Setup |
### TASKS.02.18.01: Setup |
### Phase-01: Init |
### IMPL.02.29.01: Init |
### DEC-01: Use PostgreSQL |
### ADR.05.10.01: Use PostgreSQL |
### ALT-01: MongoDB Option |
### ADR.05.12.01: MongoDB Option |
7. Threshold Tag Format
Tag Pattern
@threshold: {DOC_TYPE}.{DOC_NUM}.{threshold_key}
Key Format
{category}.{subcategory}.{attribute}[.{qualifier}]
Valid Categories
| Category |
Description |
Example Keys |
| perf |
Performance metrics |
perf.latency.p99 |
| timeout |
Timeout values |
timeout.api.request |
| rate |
Rate limits |
rate.api.requests_per_second |
| retry |
Retry policies |
retry.max_attempts |
| circuit |
Circuit breaker |
circuit.failure_threshold |
| alert |
Alerting thresholds |
alert.error_rate.critical |
| cache |
Cache settings |
cache.ttl.session |
| pool |
Connection pools |
pool.max_connections |
| queue |
Queue settings |
queue.max_size |
| batch |
Batch processing |
batch.size.max |
Examples
| Threshold Tag |
Valid |
Breakdown |
@threshold: PRD.035.timeout.partner.bridge |
✅ |
PRD doc 035, timeout category |
@threshold: BRD.02.perf.latency.p99 |
✅ |
BRD doc 02, performance category |
@threshold: ADR.05.circuit.failure_threshold |
✅ |
ADR doc 05, circuit breaker |
@threshold: timeout.partner.bridge |
❌ |
Missing doc reference |
@threshold: PRD-035.timeout |
❌ |
Wrong separator (dash vs dot) |
Source Documents for Thresholds
| Doc Type |
Threshold Scope |
| BRD |
Business-level thresholds (SLAs, business rules) |
| PRD |
Product-level thresholds (user experience, product metrics) |
| ADR |
Technical thresholds (architecture decisions, system limits) |
8. Validation Examples by Document Type
BRD Examples
### BRD.02.01.01: User Authentication Requirement
### BRD.02.06.01: Login Acceptance Criteria
### BRD.02.23.01: Revenue Growth Objective
### BRD.02.09.01: User Onboarding Story
### BRD.02.10.01: Database Selection Decision
@threshold: BRD.02.perf.response_time.max
PRD Examples
### PRD.01.09.01: User Login Story
### PRD.01.22.01: Dashboard Feature
### PRD.01.06.01: Feature Acceptance Criteria
@threshold: PRD.01.timeout.session.idle
EARS Examples
#### EARS.06.25.01: KYC Submission Event
#### EARS.06.25.02: Pending Status State
ADR Examples
### ADR.05.10.01: Use PostgreSQL Decision
### ADR.05.12.01: MongoDB Alternative
### ADR.05.13.01: Migration Consequence
@threshold: ADR.05.circuit.failure_threshold
SPEC Examples
### SPEC.03.16.01: REST API Interface
### SPEC.03.17.01: User Data Model
### SPEC.03.21.01: Email Validation Rule
CTR Examples
### CTR.02.16.01: Partner API Interface
### CTR.02.17.01: Order Data Model
### CTR.02.20.01: Rate Limit Clause
TASKS Examples
### TASKS.02.18.01: Setup Development Environment
### TASKS.02.30.01: Configure CI Pipeline
IMPL Examples
### IMPL.02.29.01: Foundation Phase
### IMPL.02.29.02: Integration Phase
9. Pre-Flight Checklist
Run this checklist BEFORE creating any SDD document:
Document Setup
Element IDs
Threshold Tags
Cross-References
10. Error Recovery
Detecting Legacy Patterns
Use grep to find legacy patterns:
# Find all legacy patterns in a file
grep -E "(AC|FR|BC|BA|QA|BO|RISK|METRIC)-[0-9]+" file.md
grep -E "(Event|State|TASK|Phase|IP|IF|DM|CC)-[0-9]+" file.md
grep -E "(DEC|ALT|CON)-[0-9]+" file.md
grep -E "Feature F-[0-9]+" file.md
grep -E "T-[0-9]+" file.md
Migration Procedure
Identify the document type and number from the filename
- Example:
BRD-02_requirements.md → DOC_TYPE=BRD, DOC_NUM=02
Look up the element type code from Section 5
- Example:
AC-XXX → Acceptance Criteria → Code 06
- Example:
DEC-XXX → Decision → Code 10
Construct the unified ID
- Pattern:
{DOC_TYPE}.{DOC_NUM}.{ELEM_TYPE}.{SEQ}
- Example:
AC-001 in BRD-02 → BRD.02.06.01
- Example:
DEC-01 in ADR-05 → ADR.05.10.01
Replace all occurrences
# Example sed replacement
sed -i 's/### AC-001:/### BRD.02.06.01:/g' file.md
sed -i 's/### DEC-01:/### ADR.05.10.01:/g' file.md
Validate the result
# Verify no legacy patterns remain
grep -E "(AC|FR|BC|BA|DEC|ALT|CON)-[0-9]+" file.md
Common Migration Errors
| Error |
Cause |
Fix |
| Wrong element code |
Using FR code (01) for Acceptance Criteria |
Use code 06 for AC |
| Missing document number |
BRD..06.01 |
Include document number: BRD.02.06.01 |
| Dash instead of dot |
BRD-02-06-01 |
Use dots: BRD.02.06.01 |
| Lowercase type |
brd.02.06.01 |
Uppercase: BRD.02.06.01 |
11. Source References
Primary Sources
| Document |
Location |
Content |
| ID Naming Standards |
ai_dev_flow/ID_NAMING_STANDARDS.md |
Document IDs, Element IDs, 31 type codes |
| Threshold Naming Rules |
ai_dev_flow/THRESHOLD_NAMING_RULES.md |
Threshold tags, key formats, categories |
Validation Rules Files
Each document type has validation rules with Element ID compliance checks:
| Document Type |
Validation Rules File |
| BRD |
ai_dev_flow/BRD/BRD_VALIDATION_RULES.md |
| PRD |
ai_dev_flow/PRD/PRD_VALIDATION_RULES.md |
| EARS |
ai_dev_flow/EARS/EARS_VALIDATION_RULES.md |
| BDD |
ai_dev_flow/BDD/BDD_VALIDATION_RULES.md |
| ADR |
ai_dev_flow/ADR/ADR_VALIDATION_RULES.md |
| SYS |
ai_dev_flow/SYS/SYS_VALIDATION_RULES.md |
| REQ |
ai_dev_flow/REQ/REQ_VALIDATION_RULES.md |
| IMPL |
ai_dev_flow/IMPL/IMPL_VALIDATION_RULES.md |
| CTR |
ai_dev_flow/CTR/CTR_VALIDATION_RULES.md |
| SPEC |
ai_dev_flow/SPEC/SPEC_VALIDATION_RULES.md |
| TASKS |
ai_dev_flow/TASKS/TASKS_VALIDATION_RULES.md |
Related Skills
| Skill |
Purpose |
| doc-validator |
Automated validation of SDD documents |
| doc-flow |
SDD workflow orchestration |
| trace-check |
Traceability validation |
Diagram Standards
All diagrams MUST use Mermaid syntax. Text-based diagrams (ASCII art, box drawings) are prohibited.
See: ai_dev_flow/DIAGRAM_STANDARDS.md and mermaid-gen skill.
Version History
| Version |
Date |
Changes |
| 1.2.0 |
2026-01-17 |
Updated to 11 active artifact types; Removed legacy element codes 19, 31 |
| 1.1.0 |
2025-12-29 |
Added Reserved ID Exemption, REF document pattern, ADR removed patterns, fixed element type codes for BRD |
| 1.0.0 |
2025-12-19 |
Initial release with all 31 element codes and 18 removed patterns |
1---2name: doc-naming3description: Enforces unified ID naming standards and threshold naming rules for all SDD documentation artifacts4---5
6# doc-naming Skill
7
8Enforces unified ID naming standards and threshold naming rules for all SDD documentation artifacts.
9
10---
11
12## 1. Purpose & Scope
13
14### When to Invoke
15
16Invoke this skill BEFORE creating or editing any SDD documentation artifact. Use it to:
17- Verify element ID format compliance
18- Check for removed/legacy patterns
19- Validate threshold tag syntax
20- Ensure document ID format correctness
21
22### Coverage
23
24This skill covers all 12 SDD document types:
25
26| Layer | Document Type | Description |
27|-------|---------------|-------------|
28| 1 | BRD | Business Requirements Document |
29| 2 | PRD | Product Requirements Document |
30| 3 | EARS | Easy Approach to Requirements Syntax |
31| 4 | BDD | Behavior-Driven Development |
32| 5 | ADR | Architecture Decision Record |
33| 6 | SYS | System Requirements |
34| 7 | REQ | Atomic Requirements |
35| 8 | IMPL | Implementation Approach |
36| 9 | CTR | Data Contracts |
37| 10 | SPEC | Technical Specifications |
38| 11 | TASKS | AI Task Breakdown |
39
40---
41
42## 2. Reserved ID Exemption (TYPE-00_*)
43
44### Scope
45
46Documents with reserved ID `000` are FULLY EXEMPT from standard validation.
47
48### Pattern
49
50`{DOC_TYPE}-00_{slug}.{ext}`
51
52### Document Types
53
54- Index documents (e.g., `BRD-00_index.md`, `REQ-00_index.md`)
55- Traceability matrix templates (e.g., `SPEC-00_TRACEABILITY_MATRIX-TEMPLATE.md`)
56- Glossaries, registries, checklists
57
58### Rationale
59
60Reserved ID 000 documents are framework infrastructure (indexes, templates, reference materials), not project artifacts requiring traceability or quality gates.
61
62### Validation Behavior
63
64Skip all element ID and traceability checks when filename matches `{TYPE}-00_*` pattern.
65
66---
67
68## 3. Document ID Format (TYPE-NN)
69
70### Pattern
71
72```
73TYPE-NN
74```
75
76- **TYPE**: Uppercase document type acronym (BRD, PRD, EARS, etc.)
77- **Separator**: Single dash `-`
78- **NN**: 2+ digit sequential number with leading zeros
79
80### Validation Regex
81
82```regex
83^[A-Z]{2,5}-[0-9]{2,}$
84```
85
86### Examples
87
88| Document ID | Valid | Reason |
89|-------------|-------|--------|
90| `BRD-01` | ✅ | Correct format |
91| `PRD-02` | ✅ | Correct format |
92| `ADR-001` | ✅ | 3-digit ID allowed |
93| `TASKS-12` | ✅ | Correct format |
94| `brd-01` | ❌ | Lowercase not allowed |
95| `PRD_02` | ❌ | Underscore not allowed |
96| `BRD-1` | ❌ | Single digit not allowed |
97| `BRD01` | ❌ | Missing dash separator |
98
99### Filename Convention
100
101```
102TYPE-NN_descriptive_slug.md
103```
104
105Example: `BRD-01_ib_stock_options_mcp_server.md`
106
107### REF Document Pattern
108
109Reference documents use a modified pattern within parent TYPE directories:
110
111| Component | Pattern | Example |
112|-----------|---------|---------|
113| H1 ID | `{TYPE}-REF-NN` | `# BRD-REF-01: Project Overview` |
114| Filename | `{TYPE}-REF-NN_{slug}.md` | `BRD-REF-01_project_overview.md` |
115| Location | Within parent TYPE directory | `docs/BRD/BRD-REF-01_project_overview.md` |
116
117**Notes**:
118- REF documents are supplementary and do not participate in formal traceability chain
119- Similar exemption treatment as `{TYPE}-000` index documents
120- Numbering is independent per parent TYPE (BRD-REF-01, ADR-REF-01 are separate sequences)
121
122---
123
124## 4. Element ID Format (TYPE.NN.TT.SS)
125
126### Pattern
127
128```
129{DOC_TYPE}.{DOC_NUM}.{ELEM_TYPE}.{SEQ}
130```
131
132| Segment | Description | Format |
133|---------|-------------|--------|
134| DOC_TYPE | Document type acronym | 2-5 uppercase letters |
135| DOC_NUM | Document number | 2+ digits |
136| ELEM_TYPE | Element type code | 2+ digits (01-31) |
137| SEQ | Sequential number | 2+ digits |
138
139### Validation Regex
140
141```regex
142^[A-Z]{2,5}\.[0-9]{2,}\.[0-9]{2,}\.[0-9]{2,}$
143```
144
145### Examples
146
147| Element ID | Valid | Breakdown |
148|------------|-------|-----------|
149| `BRD.02.06.01` | ✅ | BRD doc 02, Acceptance Criteria (06), item 01 |
150| `PRD.01.09.03` | ✅ | PRD doc 01, User Story (09), item 03 |
151| `ADR.05.10.01` | ✅ | ADR doc 05, Decision (10), item 01 |
152| `SPEC.03.16.02` | ✅ | SPEC doc 03, Interface (16), item 02 |
153| `AC-001` | ❌ | Legacy pattern - use TYPE.NN.06.SS |
154| `FR-01` | ❌ | Legacy pattern - use TYPE.NN.01.SS |
155| `BRD-02-06-01` | ❌ | Wrong separator (use dots) |
156| `brd.02.06.01` | ❌ | Lowercase not allowed |
157
158### Heading Format
159
160Element IDs appear as markdown headings:
161
162```markdown
163### BRD.02.06.01: User Authentication Acceptance Criteria
164#### PRD.01.09.03: User Login Story
165```
166
167---
168
169## 5. Element Type Codes Table
170
171All 31 element type codes with document type applicability:
172
173| Code | Element Type | Applicable Document Types |
174|------|--------------|---------------------------|
175| 01 | Functional Requirement | BRD, PRD, SYS, REQ |
176| 02 | Quality Attribute | BRD, PRD, SYS |
177| 03 | Constraint | BRD, PRD |
178| 04 | Assumption | BRD, PRD |
179| 05 | Dependency | BRD, PRD, REQ |
180| 06 | Acceptance Criteria | BRD, PRD, REQ |
181| 07 | Risk | BRD, PRD |
182| 08 | Metric | BRD, PRD |
183| 09 | User Story | PRD, BRD |
184| 10 | Decision | ADR, BRD |
185| 11 | Use Case | PRD, SYS |
186| 12 | Alternative | ADR |
187| 13 | Consequence | ADR |
188| 14 | Test Scenario | BDD |
189| 15 | Step | BDD, SPEC |
190| 16 | Interface | SPEC, CTR |
191| 17 | Data Model | SPEC, CTR |
192| 18 | Task | TASKS |
193| 20 | Contract Clause | CTR |
194| 21 | Validation Rule | SPEC |
195| 22 | Feature Item | BRD, PRD |
196| 23 | Business Objective | BRD |
197| 24 | Stakeholder Need | BRD, PRD |
198| 25 | EARS Statement | EARS |
199| 26 | System Requirement | SYS |
200| 27 | Atomic Requirement | REQ |
201| 28 | Specification Element | SPEC |
202| 29 | Implementation Phase | IMPL |
203| 30 | Task Item | TASKS |
204
205### Quick Lookup by Document Type
206
207| Document | Common Element Codes |
208|----------|---------------------|
209| BRD | 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 22, 23, 24 |
210| PRD | 01, 02, 03, 04, 05, 06, 07, 08, 09, 11, 22, 24 |
211| EARS | 25 |
212| BDD | 14, 15 |
213| ADR | 10, 12, 13 |
214| SYS | 01, 02, 11, 26 |
215| REQ | 01, 05, 06, 27 |
216| IMPL | 29 |
217| CTR | 16, 17, 20 |
218| SPEC | 15, 16, 17, 21, 28 |
219| TASKS | 18, 30 |
220
221---
222
223## 6. Removed/Legacy Patterns
224
225These patterns are DEPRECATED. Do NOT use them in new documents.
226
227| Removed Pattern | Migration Path | Applies To |
228|-----------------|----------------|------------|
229| `AC-XXX` | `TYPE.NN.06.SS` | BRD, PRD, REQ |
230| `FR-XXX` | `TYPE.NN.01.SS` | BRD, PRD, SYS, REQ |
231| `BC-XXX` | `TYPE.NN.03.SS` | BRD, PRD |
232| `BA-XXX` | `TYPE.NN.04.SS` | BRD, PRD |
233| `QA-XXX` | `TYPE.NN.02.SS` | BRD, PRD, SYS |
234| `BO-XXX` | `TYPE.NN.23.SS` | BRD |
235| `RISK-XXX` | `TYPE.NN.07.SS` | BRD, PRD |
236| `METRIC-XXX` | `TYPE.NN.08.SS` | BRD, PRD |
237| `Feature F-XXX` | `TYPE.NN.22.SS` | BRD, PRD |
238| `Event-XXX` | `TYPE.NN.25.SS` | EARS |
239| `State-XXX` | `TYPE.NN.25.SS` | EARS |
240| `TASK-XXX` | `TYPE.NN.18.SS` | TASKS |
241| `T-XXX` | `TYPE.NN.18.SS` | TASKS |
242| `Phase-XXX` | `TYPE.NN.29.SS` | IMPL |
243| `IP-XXX` | `TYPE.NN.29.SS` | IMPL |
244| `IF-XXX` | `TYPE.NN.16.SS` | CTR |
245| `DM-XXX` | `TYPE.NN.17.SS` | CTR |
246| `CC-XXX` | `TYPE.NN.20.SS` | CTR |
247| `DEC-XXX` | `TYPE.NN.10.SS` | ADR |
248| `ALT-XXX` | `TYPE.NN.12.SS` | ADR |
249| `CON-XXX` | `TYPE.NN.13.SS` | ADR |
250
251### Migration Examples
252
253| Legacy | Unified Format |
254|--------|----------------|
255| `### AC-001: Login Validation` | `### BRD.02.06.01: Login Validation` |
256| `#### FR-01: User Auth` | `#### PRD.01.01.01: User Auth` |
257| `### Event-001: KYC Submission` | `### EARS.06.25.01: KYC Submission` |
258| `### TASK-01: Setup` | `### TASKS.02.18.01: Setup` |
259| `### Phase-01: Init` | `### IMPL.02.29.01: Init` |
260| `### DEC-01: Use PostgreSQL` | `### ADR.05.10.01: Use PostgreSQL` |
261| `### ALT-01: MongoDB Option` | `### ADR.05.12.01: MongoDB Option` |
262
263---
264
265## 7. Threshold Tag Format
266
267### Tag Pattern
268
269```
270@threshold: {DOC_TYPE}.{DOC_NUM}.{threshold_key}
271```
272
273### Key Format
274
275```
276{category}.{subcategory}.{attribute}[.{qualifier}]
277```
278
279### Valid Categories
280
281| Category | Description | Example Keys |
282|----------|-------------|--------------|
283| perf | Performance metrics | `perf.latency.p99` |
284| timeout | Timeout values | `timeout.api.request` |
285| rate | Rate limits | `rate.api.requests_per_second` |
286| retry | Retry policies | `retry.max_attempts` |
287| circuit | Circuit breaker | `circuit.failure_threshold` |
288| alert | Alerting thresholds | `alert.error_rate.critical` |
289| cache | Cache settings | `cache.ttl.session` |
290| pool | Connection pools | `pool.max_connections` |
291| queue | Queue settings | `queue.max_size` |
292| batch | Batch processing | `batch.size.max` |
293
294### Examples
295
296| Threshold Tag | Valid | Breakdown |
297|---------------|-------|-----------|
298| `@threshold: PRD.035.timeout.partner.bridge` | ✅ | PRD doc 035, timeout category |
299| `@threshold: BRD.02.perf.latency.p99` | ✅ | BRD doc 02, performance category |
300| `@threshold: ADR.05.circuit.failure_threshold` | ✅ | ADR doc 05, circuit breaker |
301| `@threshold: timeout.partner.bridge` | ❌ | Missing doc reference |
302| `@threshold: PRD-035.timeout` | ❌ | Wrong separator (dash vs dot) |
303
304### Source Documents for Thresholds
305
306| Doc Type | Threshold Scope |
307|----------|-----------------|
308| BRD | Business-level thresholds (SLAs, business rules) |
309| PRD | Product-level thresholds (user experience, product metrics) |
310| ADR | Technical thresholds (architecture decisions, system limits) |
311
312---
313
314## 8. Validation Examples by Document Type
315
316### BRD Examples
317
318```markdown
319### BRD.02.01.01: User Authentication Requirement
320### BRD.02.06.01: Login Acceptance Criteria
321### BRD.02.23.01: Revenue Growth Objective
322### BRD.02.09.01: User Onboarding Story
323### BRD.02.10.01: Database Selection Decision
324@threshold: BRD.02.perf.response_time.max
325```
326
327### PRD Examples
328
329```markdown
330### PRD.01.09.01: User Login Story
331### PRD.01.22.01: Dashboard Feature
332### PRD.01.06.01: Feature Acceptance Criteria
333@threshold: PRD.01.timeout.session.idle
334```
335
336### EARS Examples
337
338```markdown
339#### EARS.06.25.01: KYC Submission Event
340#### EARS.06.25.02: Pending Status State
341```
342
343### ADR Examples
344
345```markdown
346### ADR.05.10.01: Use PostgreSQL Decision
347### ADR.05.12.01: MongoDB Alternative
348### ADR.05.13.01: Migration Consequence
349@threshold: ADR.05.circuit.failure_threshold
350```
351
352### SPEC Examples
353
354```markdown
355### SPEC.03.16.01: REST API Interface
356### SPEC.03.17.01: User Data Model
357### SPEC.03.21.01: Email Validation Rule
358```
359
360### CTR Examples
361
362```markdown
363### CTR.02.16.01: Partner API Interface
364### CTR.02.17.01: Order Data Model
365### CTR.02.20.01: Rate Limit Clause
366```
367
368### TASKS Examples
369
370```markdown
371### TASKS.02.18.01: Setup Development Environment
372### TASKS.02.30.01: Configure CI Pipeline
373```
374
375### IMPL Examples
376
377```markdown
378### IMPL.02.29.01: Foundation Phase
379### IMPL.02.29.02: Integration Phase
380```
381
382---
383
384## 9. Pre-Flight Checklist
385
386Run this checklist BEFORE creating any SDD document:
387
388### Document Setup
389
390- [ ] Document ID follows `TYPE-NN` format
391- [ ] Filename follows `TYPE-NN_descriptive_slug.md` pattern
392- [ ] YAML frontmatter includes correct `artifact_type` and `layer`
393- [ ] Not a reserved ID document (TYPE-00_*) requiring exemption
394
395### Element IDs
396
397- [ ] All element IDs use 4-segment dot notation: `TYPE.NN.TT.SS`
398- [ ] Element type code (TT) is valid for this document type (see Section 5)
399- [ ] Sequential numbers (SS) are unique within the document
400- [ ] No legacy patterns (AC-XXX, FR-XXX, DEC-XXX, etc.) are used
401
402### Threshold Tags
403
404- [ ] All `@threshold:` tags include document reference: `TYPE.NN.key`
405- [ ] Threshold keys follow category.subcategory.attribute format
406- [ ] Categories are from the approved list (perf, timeout, rate, etc.)
407
408### Cross-References
409
410- [ ] Traceability tags use correct prefixes (@brd:, @prd:, @adr:, etc.)
411- [ ] Referenced document IDs exist
412- [ ] Element ID references are complete (all 4 segments)
413
414---
415
416## 10. Error Recovery
417
418### Detecting Legacy Patterns
419
420Use grep to find legacy patterns:
421
422```bash
423# Find all legacy patterns in a file
424grep -E "(AC|FR|BC|BA|QA|BO|RISK|METRIC)-[0-9]+" file.md
425grep -E "(Event|State|TASK|Phase|IP|IF|DM|CC)-[0-9]+" file.md
426grep -E "(DEC|ALT|CON)-[0-9]+" file.md
427grep -E "Feature F-[0-9]+" file.md
428grep -E "T-[0-9]+" file.md
429```
430
431### Migration Procedure
432
4331. **Identify the document type and number** from the filename
434 - Example: `BRD-02_requirements.md` → DOC_TYPE=BRD, DOC_NUM=02
435
4362. **Look up the element type code** from Section 5
437 - Example: `AC-XXX` → Acceptance Criteria → Code 06
438 - Example: `DEC-XXX` → Decision → Code 10
439
4403. **Construct the unified ID**
441 - Pattern: `{DOC_TYPE}.{DOC_NUM}.{ELEM_TYPE}.{SEQ}`
442 - Example: `AC-001` in BRD-02 → `BRD.02.06.01`
443 - Example: `DEC-01` in ADR-05 → `ADR.05.10.01`
444
4454. **Replace all occurrences**
446 ```bash
447 # Example sed replacement
448 sed -i 's/### AC-001:/### BRD.02.06.01:/g' file.md
449 sed -i 's/### DEC-01:/### ADR.05.10.01:/g' file.md
450 ```
451
4525. **Validate the result**
453 ```bash
454 # Verify no legacy patterns remain
455 grep -E "(AC|FR|BC|BA|DEC|ALT|CON)-[0-9]+" file.md
456 ```
457
458### Common Migration Errors
459
460| Error | Cause | Fix |
461|-------|-------|-----|
462| Wrong element code | Using FR code (01) for Acceptance Criteria | Use code 06 for AC |
463| Missing document number | `BRD..06.01` | Include document number: `BRD.02.06.01` |
464| Dash instead of dot | `BRD-02-06-01` | Use dots: `BRD.02.06.01` |
465| Lowercase type | `brd.02.06.01` | Uppercase: `BRD.02.06.01` |
466
467---
468
469## 11. Source References
470
471### Primary Sources
472
473| Document | Location | Content |
474|----------|----------|---------|
475| ID Naming Standards | `ai_dev_flow/ID_NAMING_STANDARDS.md` | Document IDs, Element IDs, 31 type codes |
476| Threshold Naming Rules | `ai_dev_flow/THRESHOLD_NAMING_RULES.md` | Threshold tags, key formats, categories |
477
478### Validation Rules Files
479
480Each document type has validation rules with Element ID compliance checks:
481
482| Document Type | Validation Rules File |
483|---------------|----------------------|
484| BRD | `ai_dev_flow/BRD/BRD_VALIDATION_RULES.md` |
485| PRD | `ai_dev_flow/PRD/PRD_VALIDATION_RULES.md` |
486| EARS | `ai_dev_flow/EARS/EARS_VALIDATION_RULES.md` |
487| BDD | `ai_dev_flow/BDD/BDD_VALIDATION_RULES.md` |
488| ADR | `ai_dev_flow/ADR/ADR_VALIDATION_RULES.md` |
489| SYS | `ai_dev_flow/SYS/SYS_VALIDATION_RULES.md` |
490| REQ | `ai_dev_flow/REQ/REQ_VALIDATION_RULES.md` |
491| IMPL | `ai_dev_flow/IMPL/IMPL_VALIDATION_RULES.md` |
492| CTR | `ai_dev_flow/CTR/CTR_VALIDATION_RULES.md` |
493| SPEC | `ai_dev_flow/SPEC/SPEC_VALIDATION_RULES.md` |
494| TASKS | `ai_dev_flow/TASKS/TASKS_VALIDATION_RULES.md` |
495
496### Related Skills
497
498| Skill | Purpose |
499|-------|---------|
500| doc-validator | Automated validation of SDD documents |
501| doc-flow | SDD workflow orchestration |
502| trace-check | Traceability validation |
503
504---
505
506### Diagram Standards
507
508All diagrams MUST use Mermaid syntax. Text-based diagrams (ASCII art, box drawings) are prohibited.
509See: `ai_dev_flow/DIAGRAM_STANDARDS.md` and `mermaid-gen` skill.
510
511## Version History
512
513| Version | Date | Changes |
514|---------|------|---------|
515| 1.2.0 | 2026-01-17 | Updated to 11 active artifact types; Removed legacy element codes 19, 31 |
516| 1.1.0 | 2025-12-29 | Added Reserved ID Exemption, REF document pattern, ADR removed patterns, fixed element type codes for BRD |
517| 1.0.0 | 2025-12-19 | Initial release with all 31 element codes and 18 removed patterns |