You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rules/spec-management.rules.md
+64-35Lines changed: 64 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,17 +64,44 @@ When coding agents need context for:
64
64
65
65
**WHEN ENCOUNTERING DECISION POINTS THAT REQUIRE SPECIFICATION:**
66
66
67
+
## SPECIFICATION SELECTION AND REUSE PROTOCOL
68
+
69
+
**MANDATORY: BEFORE CREATING NEW SPECIFICATIONS, AGENTS MUST:**
70
+
71
+
1.**SCAN EXISTING SPECIFICATION NAMES** - Review all spec filenames in `project-specs/` directory to identify potential matches
72
+
2.**SELECT CANDIDATE SPECIFICATIONS** - Choose 2-3 specs whose names most closely match the current requirement
73
+
3.**READ CANDIDATE SPECIFICATIONS** - Examine selected specs for relevant content and applicability
74
+
4.**DETERMINE SPECIFICATION STRATEGY:**
75
+
-**REUSE EXISTING:** If a spec fully covers the requirement, use it and update if needed
76
+
-**EXTEND EXISTING:** If a spec partially covers the requirement, update it with additional sections
77
+
-**CREATE SUPPORTING SPEC:** If existing spec is too specific, create a complementary spec with clear separation of concerns
78
+
-**CREATE NEW SPEC:** Only if no existing spec is relevant or applicable
79
+
80
+
**SPECIFICATION NAMING REQUIREMENTS:**
81
+
-**DETAILED AND SPECIFIC:** Spec names MUST be descriptive enough to identify content from filename alone
82
+
-**SCOPE INDICATION:** Include scope indicators (e.g., `user-authentication.spec.md`, `api-error-handling.spec.md`)
83
+
-**AVOID GENERIC NAMES:** Never use vague names like `general.spec.md` or `misc.spec.md`
84
+
85
+
**CONFLICT RESOLUTION PROTOCOL:**
86
+
When uncertain between 2+ existing specifications:
87
+
-**ASK USER FOR GUIDANCE** - **USE `run_command` TOOL** - Present options and ask user to select preferred spec or approve new spec creation
88
+
-**PROVIDE CONTEXT** - Explain why each candidate spec might be relevant
89
+
-**WAIT FOR APPROVAL** - Do not proceed until user provides clear direction
90
+
91
+
**STANDARD WORKFLOW:**
92
+
67
93
1.**READ EXISTING SPECIFICATIONS** - Check `project-specs/index.spec.md` first
68
94
2.**FOLLOW EXISTING PATTERNS** - Use established patterns if applicable (see `project-specs/index.spec.md` for documented patterns)
69
-
3.**PAUSE IMPLEMENTATION** - Stop coding when new decisions are needed
70
-
4.**ASK CLARIFYING QUESTIONS** - **USE `run_command` TOOL** for all questions - **MUST FOLLOW**[rules/interactive-input.rules.md](./interactive-input.rules.md) for context on using run_command tool
71
-
5.**RESEARCH OPTIONS** - Present alternatives with trade-offs
72
-
6.**PROPOSE SPECIFICATION** - Create spec file with decision rationale
73
-
7.**WAIT FOR APPROVAL** - **USE `run_command` TOOL** for approval questions - **MUST FOLLOW**[rules/interactive-input.rules.md](./interactive-input.rules.md) for context on using run_command tool
74
-
8.**DOCUMENT USER DECISIONS** - **MANDATORY:** After ANY user decision or choice, ask: "Should this decision be documented in the relevant spec file for future reference?" - **USE `run_command` TOOL** - **MUST FOLLOW**[rules/interactive-input.rules.md](./interactive-input.rules.md) for context on using run_command tool
75
-
9.**ADD SPEC REFERENCES TO CODE** - **MANDATORY:** When implementing features based on specifications, ALL generated code files MUST include spec reference comments - **FOLLOW:**[rules/spec-reference.rules.md](./spec-reference.rules.md) for complete requirements and formats
76
-
10.**RE-READ SPECIFICATIONS** - **MANDATORY:** Read all relevant specs immediately before implementation to ensure most current information
77
-
11.**IMPLEMENT ACCORDING TO SPEC** - Follow approved specification exactly
95
+
3.**EXECUTE SPECIFICATION SELECTION PROTOCOL** - Follow the mandatory selection and reuse process above
96
+
4.**PAUSE IMPLEMENTATION** - Stop coding when new decisions are needed
97
+
5.**ASK CLARIFYING QUESTIONS** - **USE `run_command` TOOL** for all questions - **MUST FOLLOW**[rules/interactive-input.rules.md](./interactive-input.rules.md) for context on using run_command tool
98
+
6.**RESEARCH OPTIONS** - Present alternatives with trade-offs
99
+
7.**PROPOSE SPECIFICATION** - Create spec file with decision rationale
100
+
8.**WAIT FOR APPROVAL** - **USE `run_command` TOOL** for approval questions - **MUST FOLLOW**[rules/interactive-input.rules.md](./interactive-input.rules.md) for context on using run_command tool
101
+
9.**DOCUMENT USER DECISIONS** - **MANDATORY:** After ANY user decision or choice, ask: "Should this decision be documented in the relevant spec file for future reference?" - **USE `run_command` TOOL** - **MUST FOLLOW**[rules/interactive-input.rules.md](./interactive-input.rules.md) for context on using run_command tool
102
+
10.**ADD SPEC REFERENCES TO CODE** - **MANDATORY:** When implementing features based on specifications, ALL generated code files MUST include spec reference comments - **FOLLOW:**[rules/spec-reference.rules.md](./spec-reference.rules.md) for complete requirements and formats
103
+
11.**RE-READ SPECIFICATIONS** - **MANDATORY:** Read all relevant specs immediately before implementation to ensure most current information
104
+
12.**IMPLEMENT ACCORDING TO SPEC** - Follow approved specification exactly
78
105
79
106
**AGENT QUESTIONING PROTOCOL FOR SPECIFICATION DOCUMENTATION:**
80
107
Before creating any specification file, agents MUST ask these questions to ensure optimal documentation:
@@ -113,32 +140,34 @@ Before creating any specification file, agents MUST ask these questions to ensur
113
140
## MANDATORY SPEC-FIRST ENFORCEMENT RULE
114
141
115
142
**CRITICAL VIOLATIONS:**
116
-
- Implementing code without checking existing specifications = CRITICAL VIOLATION
117
-
- Making architectural decisions without creating specification = CRITICAL VIOLATION
118
-
- Proceeding with implementation before user approval = CRITICAL VIOLATION
0 commit comments