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 |
| 12 |
IPLAN |
Implementation Plans |
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 |
| 19 |
Command |
IPLAN |
| 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 |
| 31 |
Plan Step |
IPLAN |
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 |
| IPLAN |
19, 31 |
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 |
CMD-XXX |
TYPE.NN.19.SS |
IPLAN |
STEP-XXX |
TYPE.NN.31.SS |
IPLAN |
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 |
### CMD-01: Install deps |
### IPLAN.01.19.01: Install deps |
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
IPLAN Examples
### IPLAN.01.19.01: Initialize Repository
### IPLAN.01.31.01: Deploy to Staging
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|CMD|STEP)-[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
- Example:
CMD-XXX → Command → Code 19
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
- Example:
CMD-01 in IPLAN-01 → IPLAN.01.19.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
sed -i 's/### CMD-01:/### IPLAN.01.19.01:/g' file.md
Validate the result
# Verify no legacy patterns remain
grep -E "(AC|FR|BC|BA|DEC|ALT|CON|CMD|STEP)-[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 |
| Wrong IPLAN code |
Using 15 (Step) for Plan Step |
Use code 31 for Plan Step |
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 |
| IPLAN |
ai_dev_flow/IPLAN/IPLAN_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.1.0 |
2025-12-29 |
Added Reserved ID Exemption, REF document pattern, ADR/IPLAN 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-naming-23description: Enforces unified ID naming standards and threshold naming rules for all SDD documentation artifacts4---56# doc-naming Skill78Enforces unified ID naming standards and threshold naming rules for all SDD documentation artifacts.910---1112## 1. Purpose & Scope1314### When to Invoke1516Invoke this skill BEFORE creating or editing any SDD documentation artifact. Use it to:17- Verify element ID format compliance18- Check for removed/legacy patterns19- Validate threshold tag syntax20- Ensure document ID format correctness2122### Coverage2324This skill covers all 12 SDD document types:2526| 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| 12 | IPLAN | Implementation Plans |4041---4243## 2. Reserved ID Exemption (TYPE-00_*)4445### Scope4647Documents with reserved ID `000` are FULLY EXEMPT from standard validation.4849### Pattern5051`{DOC_TYPE}-00_{slug}.{ext}`5253### Document Types5455- Index documents (e.g., `BRD-00_index.md`, `REQ-00_index.md`)56- Traceability matrix templates (e.g., `SPEC-00_TRACEABILITY_MATRIX-TEMPLATE.md`)57- Glossaries, registries, checklists5859### Rationale6061Reserved ID 000 documents are framework infrastructure (indexes, templates, reference materials), not project artifacts requiring traceability or quality gates.6263### Validation Behavior6465Skip all element ID and traceability checks when filename matches `{TYPE}-00_*` pattern.6667---6869## 3. Document ID Format (TYPE-NN)7071### Pattern7273```74TYPE-NN75```7677- **TYPE**: Uppercase document type acronym (BRD, PRD, EARS, etc.)78- **Separator**: Single dash `-`79- **NN**: 2+ digit sequential number with leading zeros8081### Validation Regex8283```regex84^[A-Z]{2,5}-[0-9]{2,}$85```8687### Examples8889| Document ID | Valid | Reason |90|-------------|-------|--------|91| `BRD-01` | ✅ | Correct format |92| `PRD-02` | ✅ | Correct format |93| `ADR-001` | ✅ | 3-digit ID allowed |94| `TASKS-12` | ✅ | Correct format |95| `brd-01` | ❌ | Lowercase not allowed |96| `PRD_02` | ❌ | Underscore not allowed |97| `BRD-1` | ❌ | Single digit not allowed |98| `BRD01` | ❌ | Missing dash separator |99100### Filename Convention101102```103TYPE-NN_descriptive_slug.md104```105106Example: `BRD-01_ib_stock_options_mcp_server.md`107108### REF Document Pattern109110Reference documents use a modified pattern within parent TYPE directories:111112| Component | Pattern | Example |113|-----------|---------|---------|114| H1 ID | `{TYPE}-REF-NN` | `# BRD-REF-01: Project Overview` |115| Filename | `{TYPE}-REF-NN_{slug}.md` | `BRD-REF-01_project_overview.md` |116| Location | Within parent TYPE directory | `docs/BRD/BRD-REF-01_project_overview.md` |117118**Notes**:119- REF documents are supplementary and do not participate in formal traceability chain120- Similar exemption treatment as `{TYPE}-000` index documents121- Numbering is independent per parent TYPE (BRD-REF-01, ADR-REF-01 are separate sequences)122123---124125## 4. Element ID Format (TYPE.NN.TT.SS)126127### Pattern128129```130{DOC_TYPE}.{DOC_NUM}.{ELEM_TYPE}.{SEQ}131```132133| Segment | Description | Format |134|---------|-------------|--------|135| DOC_TYPE | Document type acronym | 2-5 uppercase letters |136| DOC_NUM | Document number | 2+ digits |137| ELEM_TYPE | Element type code | 2+ digits (01-31) |138| SEQ | Sequential number | 2+ digits |139140### Validation Regex141142```regex143^[A-Z]{2,5}\.[0-9]{2,}\.[0-9]{2,}\.[0-9]{2,}$144```145146### Examples147148| Element ID | Valid | Breakdown |149|------------|-------|-----------|150| `BRD.02.06.01` | ✅ | BRD doc 02, Acceptance Criteria (06), item 01 |151| `PRD.01.09.03` | ✅ | PRD doc 01, User Story (09), item 03 |152| `ADR.05.10.01` | ✅ | ADR doc 05, Decision (10), item 01 |153| `SPEC.03.16.02` | ✅ | SPEC doc 03, Interface (16), item 02 |154| `AC-001` | ❌ | Legacy pattern - use TYPE.NN.06.SS |155| `FR-01` | ❌ | Legacy pattern - use TYPE.NN.01.SS |156| `BRD-02-06-01` | ❌ | Wrong separator (use dots) |157| `brd.02.06.01` | ❌ | Lowercase not allowed |158159### Heading Format160161Element IDs appear as markdown headings:162163```markdown164### BRD.02.06.01: User Authentication Acceptance Criteria165#### PRD.01.09.03: User Login Story166```167168---169170## 5. Element Type Codes Table171172All 31 element type codes with document type applicability:173174| Code | Element Type | Applicable Document Types |175|------|--------------|---------------------------|176| 01 | Functional Requirement | BRD, PRD, SYS, REQ |177| 02 | Quality Attribute | BRD, PRD, SYS |178| 03 | Constraint | BRD, PRD |179| 04 | Assumption | BRD, PRD |180| 05 | Dependency | BRD, PRD, REQ |181| 06 | Acceptance Criteria | BRD, PRD, REQ |182| 07 | Risk | BRD, PRD |183| 08 | Metric | BRD, PRD |184| 09 | User Story | PRD, BRD |185| 10 | Decision | ADR, BRD |186| 11 | Use Case | PRD, SYS |187| 12 | Alternative | ADR |188| 13 | Consequence | ADR |189| 14 | Test Scenario | BDD |190| 15 | Step | BDD, SPEC |191| 16 | Interface | SPEC, CTR |192| 17 | Data Model | SPEC, CTR |193| 18 | Task | TASKS |194| 19 | Command | IPLAN |195| 20 | Contract Clause | CTR |196| 21 | Validation Rule | SPEC |197| 22 | Feature Item | BRD, PRD |198| 23 | Business Objective | BRD |199| 24 | Stakeholder Need | BRD, PRD |200| 25 | EARS Statement | EARS |201| 26 | System Requirement | SYS |202| 27 | Atomic Requirement | REQ |203| 28 | Specification Element | SPEC |204| 29 | Implementation Phase | IMPL |205| 30 | Task Item | TASKS |206| 31 | Plan Step | IPLAN |207208### Quick Lookup by Document Type209210| Document | Common Element Codes |211|----------|---------------------|212| BRD | 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 22, 23, 24 |213| PRD | 01, 02, 03, 04, 05, 06, 07, 08, 09, 11, 22, 24 |214| EARS | 25 |215| BDD | 14, 15 |216| ADR | 10, 12, 13 |217| SYS | 01, 02, 11, 26 |218| REQ | 01, 05, 06, 27 |219| IMPL | 29 |220| CTR | 16, 17, 20 |221| SPEC | 15, 16, 17, 21, 28 |222| TASKS | 18, 30 |223| IPLAN | 19, 31 |224225---226227## 6. Removed/Legacy Patterns228229These patterns are DEPRECATED. Do NOT use them in new documents.230231| Removed Pattern | Migration Path | Applies To |232|-----------------|----------------|------------|233| `AC-XXX` | `TYPE.NN.06.SS` | BRD, PRD, REQ |234| `FR-XXX` | `TYPE.NN.01.SS` | BRD, PRD, SYS, REQ |235| `BC-XXX` | `TYPE.NN.03.SS` | BRD, PRD |236| `BA-XXX` | `TYPE.NN.04.SS` | BRD, PRD |237| `QA-XXX` | `TYPE.NN.02.SS` | BRD, PRD, SYS |238| `BO-XXX` | `TYPE.NN.23.SS` | BRD |239| `RISK-XXX` | `TYPE.NN.07.SS` | BRD, PRD |240| `METRIC-XXX` | `TYPE.NN.08.SS` | BRD, PRD |241| `Feature F-XXX` | `TYPE.NN.22.SS` | BRD, PRD |242| `Event-XXX` | `TYPE.NN.25.SS` | EARS |243| `State-XXX` | `TYPE.NN.25.SS` | EARS |244| `TASK-XXX` | `TYPE.NN.18.SS` | TASKS |245| `T-XXX` | `TYPE.NN.18.SS` | TASKS |246| `Phase-XXX` | `TYPE.NN.29.SS` | IMPL |247| `IP-XXX` | `TYPE.NN.29.SS` | IMPL |248| `IF-XXX` | `TYPE.NN.16.SS` | CTR |249| `DM-XXX` | `TYPE.NN.17.SS` | CTR |250| `CC-XXX` | `TYPE.NN.20.SS` | CTR |251| `DEC-XXX` | `TYPE.NN.10.SS` | ADR |252| `ALT-XXX` | `TYPE.NN.12.SS` | ADR |253| `CON-XXX` | `TYPE.NN.13.SS` | ADR |254| `CMD-XXX` | `TYPE.NN.19.SS` | IPLAN |255| `STEP-XXX` | `TYPE.NN.31.SS` | IPLAN |256257### Migration Examples258259| Legacy | Unified Format |260|--------|----------------|261| `### AC-001: Login Validation` | `### BRD.02.06.01: Login Validation` |262| `#### FR-01: User Auth` | `#### PRD.01.01.01: User Auth` |263| `### Event-001: KYC Submission` | `### EARS.06.25.01: KYC Submission` |264| `### TASK-01: Setup` | `### TASKS.02.18.01: Setup` |265| `### Phase-01: Init` | `### IMPL.02.29.01: Init` |266| `### DEC-01: Use PostgreSQL` | `### ADR.05.10.01: Use PostgreSQL` |267| `### ALT-01: MongoDB Option` | `### ADR.05.12.01: MongoDB Option` |268| `### CMD-01: Install deps` | `### IPLAN.01.19.01: Install deps` |269270---271272## 7. Threshold Tag Format273274### Tag Pattern275276```277@threshold: {DOC_TYPE}.{DOC_NUM}.{threshold_key}278```279280### Key Format281282```283{category}.{subcategory}.{attribute}[.{qualifier}]284```285286### Valid Categories287288| Category | Description | Example Keys |289|----------|-------------|--------------|290| perf | Performance metrics | `perf.latency.p99` |291| timeout | Timeout values | `timeout.api.request` |292| rate | Rate limits | `rate.api.requests_per_second` |293| retry | Retry policies | `retry.max_attempts` |294| circuit | Circuit breaker | `circuit.failure_threshold` |295| alert | Alerting thresholds | `alert.error_rate.critical` |296| cache | Cache settings | `cache.ttl.session` |297| pool | Connection pools | `pool.max_connections` |298| queue | Queue settings | `queue.max_size` |299| batch | Batch processing | `batch.size.max` |300301### Examples302303| Threshold Tag | Valid | Breakdown |304|---------------|-------|-----------|305| `@threshold: PRD.035.timeout.partner.bridge` | ✅ | PRD doc 035, timeout category |306| `@threshold: BRD.02.perf.latency.p99` | ✅ | BRD doc 02, performance category |307| `@threshold: ADR.05.circuit.failure_threshold` | ✅ | ADR doc 05, circuit breaker |308| `@threshold: timeout.partner.bridge` | ❌ | Missing doc reference |309| `@threshold: PRD-035.timeout` | ❌ | Wrong separator (dash vs dot) |310311### Source Documents for Thresholds312313| Doc Type | Threshold Scope |314|----------|-----------------|315| BRD | Business-level thresholds (SLAs, business rules) |316| PRD | Product-level thresholds (user experience, product metrics) |317| ADR | Technical thresholds (architecture decisions, system limits) |318319---320321## 8. Validation Examples by Document Type322323### BRD Examples324325```markdown326### BRD.02.01.01: User Authentication Requirement327### BRD.02.06.01: Login Acceptance Criteria328### BRD.02.23.01: Revenue Growth Objective329### BRD.02.09.01: User Onboarding Story330### BRD.02.10.01: Database Selection Decision331@threshold: BRD.02.perf.response_time.max332```333334### PRD Examples335336```markdown337### PRD.01.09.01: User Login Story338### PRD.01.22.01: Dashboard Feature339### PRD.01.06.01: Feature Acceptance Criteria340@threshold: PRD.01.timeout.session.idle341```342343### EARS Examples344345```markdown346#### EARS.06.25.01: KYC Submission Event347#### EARS.06.25.02: Pending Status State348```349350### ADR Examples351352```markdown353### ADR.05.10.01: Use PostgreSQL Decision354### ADR.05.12.01: MongoDB Alternative355### ADR.05.13.01: Migration Consequence356@threshold: ADR.05.circuit.failure_threshold357```358359### SPEC Examples360361```markdown362### SPEC.03.16.01: REST API Interface363### SPEC.03.17.01: User Data Model364### SPEC.03.21.01: Email Validation Rule365```366367### CTR Examples368369```markdown370### CTR.02.16.01: Partner API Interface371### CTR.02.17.01: Order Data Model372### CTR.02.20.01: Rate Limit Clause373```374375### TASKS Examples376377```markdown378### TASKS.02.18.01: Setup Development Environment379### TASKS.02.30.01: Configure CI Pipeline380```381382### IMPL Examples383384```markdown385### IMPL.02.29.01: Foundation Phase386### IMPL.02.29.02: Integration Phase387```388389### IPLAN Examples390391```markdown392### IPLAN.01.19.01: Initialize Repository393### IPLAN.01.31.01: Deploy to Staging394```395396---397398## 9. Pre-Flight Checklist399400Run this checklist BEFORE creating any SDD document:401402### Document Setup403404- [ ] Document ID follows `TYPE-NN` format405- [ ] Filename follows `TYPE-NN_descriptive_slug.md` pattern406- [ ] YAML frontmatter includes correct `artifact_type` and `layer`407- [ ] Not a reserved ID document (TYPE-00_*) requiring exemption408409### Element IDs410411- [ ] All element IDs use 4-segment dot notation: `TYPE.NN.TT.SS`412- [ ] Element type code (TT) is valid for this document type (see Section 5)413- [ ] Sequential numbers (SS) are unique within the document414- [ ] No legacy patterns (AC-XXX, FR-XXX, DEC-XXX, CMD-XXX, etc.) are used415416### Threshold Tags417418- [ ] All `@threshold:` tags include document reference: `TYPE.NN.key`419- [ ] Threshold keys follow category.subcategory.attribute format420- [ ] Categories are from the approved list (perf, timeout, rate, etc.)421422### Cross-References423424- [ ] Traceability tags use correct prefixes (@brd:, @prd:, @adr:, etc.)425- [ ] Referenced document IDs exist426- [ ] Element ID references are complete (all 4 segments)427428---429430## 10. Error Recovery431432### Detecting Legacy Patterns433434Use grep to find legacy patterns:435436```bash437# Find all legacy patterns in a file438grep -E "(AC|FR|BC|BA|QA|BO|RISK|METRIC)-[0-9]+" file.md439grep -E "(Event|State|TASK|Phase|IP|IF|DM|CC)-[0-9]+" file.md440grep -E "(DEC|ALT|CON|CMD|STEP)-[0-9]+" file.md441grep -E "Feature F-[0-9]+" file.md442grep -E "T-[0-9]+" file.md443```444445### Migration Procedure4464471. **Identify the document type and number** from the filename448 - Example: `BRD-02_requirements.md` → DOC_TYPE=BRD, DOC_NUM=024494502. **Look up the element type code** from Section 5451 - Example: `AC-XXX` → Acceptance Criteria → Code 06452 - Example: `DEC-XXX` → Decision → Code 10453 - Example: `CMD-XXX` → Command → Code 194544553. **Construct the unified ID**456 - Pattern: `{DOC_TYPE}.{DOC_NUM}.{ELEM_TYPE}.{SEQ}`457 - Example: `AC-001` in BRD-02 → `BRD.02.06.01`458 - Example: `DEC-01` in ADR-05 → `ADR.05.10.01`459 - Example: `CMD-01` in IPLAN-01 → `IPLAN.01.19.01`4604614. **Replace all occurrences**462 ```bash463 # Example sed replacement464 sed -i 's/### AC-001:/### BRD.02.06.01:/g' file.md465 sed -i 's/### DEC-01:/### ADR.05.10.01:/g' file.md466 sed -i 's/### CMD-01:/### IPLAN.01.19.01:/g' file.md467 ```4684695. **Validate the result**470 ```bash471 # Verify no legacy patterns remain472 grep -E "(AC|FR|BC|BA|DEC|ALT|CON|CMD|STEP)-[0-9]+" file.md473 ```474475### Common Migration Errors476477| Error | Cause | Fix |478|-------|-------|-----|479| Wrong element code | Using FR code (01) for Acceptance Criteria | Use code 06 for AC |480| Missing document number | `BRD..06.01` | Include document number: `BRD.02.06.01` |481| Dash instead of dot | `BRD-02-06-01` | Use dots: `BRD.02.06.01` |482| Lowercase type | `brd.02.06.01` | Uppercase: `BRD.02.06.01` |483| Wrong IPLAN code | Using 15 (Step) for Plan Step | Use code 31 for Plan Step |484485---486487## 11. Source References488489### Primary Sources490491| Document | Location | Content |492|----------|----------|---------|493| ID Naming Standards | `ai_dev_flow/ID_NAMING_STANDARDS.md` | Document IDs, Element IDs, 31 type codes |494| Threshold Naming Rules | `ai_dev_flow/THRESHOLD_NAMING_RULES.md` | Threshold tags, key formats, categories |495496### Validation Rules Files497498Each document type has validation rules with Element ID compliance checks:499500| Document Type | Validation Rules File |501|---------------|----------------------|502| BRD | `ai_dev_flow/BRD/BRD_VALIDATION_RULES.md` |503| PRD | `ai_dev_flow/PRD/PRD_VALIDATION_RULES.md` |504| EARS | `ai_dev_flow/EARS/EARS_VALIDATION_RULES.md` |505| BDD | `ai_dev_flow/BDD/BDD_VALIDATION_RULES.md` |506| ADR | `ai_dev_flow/ADR/ADR_VALIDATION_RULES.md` |507| SYS | `ai_dev_flow/SYS/SYS_VALIDATION_RULES.md` |508| REQ | `ai_dev_flow/REQ/REQ_VALIDATION_RULES.md` |509| IMPL | `ai_dev_flow/IMPL/IMPL_VALIDATION_RULES.md` |510| CTR | `ai_dev_flow/CTR/CTR_VALIDATION_RULES.md` |511| SPEC | `ai_dev_flow/SPEC/SPEC_VALIDATION_RULES.md` |512| TASKS | `ai_dev_flow/TASKS/TASKS_VALIDATION_RULES.md` |513| IPLAN | `ai_dev_flow/IPLAN/IPLAN_VALIDATION_RULES.md` |514515### Related Skills516517| Skill | Purpose |518|-------|---------|519| doc-validator | Automated validation of SDD documents |520| doc-flow | SDD workflow orchestration |521| trace-check | Traceability validation |522523---524525### Diagram Standards526527All diagrams MUST use Mermaid syntax. Text-based diagrams (ASCII art, box drawings) are prohibited.528See: `ai_dev_flow/DIAGRAM_STANDARDS.md` and `mermaid-gen` skill.529530## Version History531532| Version | Date | Changes |533|---------|------|---------|534| 1.1.0 | 2025-12-29 | Added Reserved ID Exemption, REF document pattern, ADR/IPLAN removed patterns, fixed element type codes for BRD |535| 1.0.0 | 2025-12-19 | Initial release with all 31 element codes and 18 removed patterns |