Skip to content

Commit 3087762

Browse files
committed
feat: enforce prioritizing reading all the rules before agents gets to work
1 parent 80044e5 commit 3087762

13 files changed

+137
-159
lines changed

rules/core-principles.rules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
**MANDATORY: ALL CODING AGENTS MUST FOLLOW THIS WORKFLOW**
44

5+
**CRITICAL PRECEDENCE:** Before executing ANY step in this workflow, agents MUST complete the enforcement requirements defined in [rules/index.rules.md](./index.rules.md) - Enforcement Requirements. NO exceptions.
6+
57
This file defines the fundamental workflow and core principles that ALL coding agents must follow during any coding session. These are the foundational rules that govern how agents think, research, decide, and implement.
68

79
**VIOLATION ENFORCEMENT:** All violations of rules in this file are subject to the universal violation enforcement system defined in [rules/violation-enforcement.rules.md](./violation-enforcement.rules.md).
@@ -111,9 +113,7 @@ This file defines the fundamental workflow and core principles that ALL coding a
111113
6. **LEGACY CODE VIOLATIONS** - Modifying existing code without following the mandatory legacy code specification workflow defined in [rules/spec-management.rules.md](./spec-management.rules.md)
112114

113115
**VIOLATION CONSEQUENCES:**
114-
- **FIRST VIOLATION:** Stop immediately, follow proper workflow, restart implementation
115-
- **REPEATED VIOLATIONS:** Session termination and restart with proper compliance
116-
- **CRITICAL VIOLATIONS:** Immediate rollback and specification creation before proceeding
116+
All violations are subject to the universal violation enforcement system defined in [violation-enforcement.rules.md](./violation-enforcement.rules.md).
117117

118118
---
119119

rules/file-caching.rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ edit_file/update_file [with updated current content understanding]
259259

260260
### Violation Consequences
261261

262-
**CRITICAL VIOLATION** - Violations result in immediate corrective action and rule reload requirement.
262+
All violations are subject to the universal violation enforcement system defined in [violation-enforcement.rules.md](./violation-enforcement.rules.md).
263263

264264
---
265265

rules/index.rules.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,32 @@
66

77
---
88

9+
## 🚨 ENFORCEMENT REQUIREMENTS
10+
11+
**CRITICAL:** These 4 enforcement requirements take absolute precedence over all other actions:
12+
13+
1. **Reading all required rules takes precedence over any agent action**
14+
- NO exceptions - rules must be read before ANY file operations, code changes, or workflow triggers
15+
- Agent MUST halt all activities until rule reading is complete
16+
17+
2. **All required rules must be read before acting on any file**
18+
- File modifications, creations, deletions FORBIDDEN until rules are read
19+
- Includes viewing, editing, or analyzing any project files
20+
21+
3. **All required rules must be read before triggering any rules workflow**
22+
- Persona setup, spec creation, violation enforcement FORBIDDEN until rules are read
23+
- No workflow exceptions - rules reading is the prerequisite for ALL workflows
24+
25+
4. **All required rules must be read and understood before proceeding with user requests in every new session**
26+
- Agent must complete reading all required rules before handling user requests
27+
- Rule reading takes precedence over file operations, code changes, or other agent actions
28+
- After rule reading completion, agent proceeds with Core Agent Workflow from core-principles.rules.md
29+
- Ensures comprehensive rule compliance before proceeding with user requests
30+
31+
**VIOLATION:** Proceeding without reading rules = CRITICAL VIOLATION requiring immediate session restart
32+
33+
---
34+
935
## REQUIRED READING
1036

1137
**MANDATORY:** Read ALL rule files in this exact order before any coding session:

rules/interactive-input.rules.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ Agent **MUST STOP** and ask questions when encountering:
6161
- Removing working ContactCard component during "cleanup"
6262
- **CORRECT APPROACH**: Ask "Should I add features like accept/decline buttons?" or "Should I preserve existing [component] or modify it?"
6363

64-
**Violation Consequences**: Acknowledge missed opportunity → ask retroactively → restart session if repeated → rollback if critical
64+
**Violation Consequences:**
65+
All violations are subject to the universal violation enforcement system defined in [violation-enforcement.rules.md](./violation-enforcement.rules.md).
6566

6667
---
6768

rules/spec-management.rules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
**MANDATORY: ALL AGENTS MUST FOLLOW THESE SPECIFICATION RULES**
44

5+
**ENFORCEMENT PRECEDENCE:** All specification workflows can ONLY be initiated AFTER completing the enforcement requirements defined in [rules/index.rules.md](./index.rules.md) - Enforcement Requirements. Rule reading takes absolute precedence over spec creation or management.
6+
57
**VIOLATION ENFORCEMENT:** All violations of rules in this file are subject to the universal violation enforcement system defined in [rules/violation-enforcement.rules.md](./violation-enforcement.rules.md).
68

79
---
@@ -312,9 +314,7 @@ Before creating any specification file, agents MUST ask these questions to ensur
312314
- Index file updates are CRITICAL - never skip this step
313315

314316
**VIOLATION CONSEQUENCES:**
315-
- **FIRST VIOLATION:** Stop immediately, create required specification, restart implementation
316-
- **REPEATED VIOLATIONS:** Session termination and restart with proper spec compliance
317-
- **CRITICAL VIOLATIONS:** Immediate rollback and specification creation before proceeding
317+
All violations are subject to the universal violation enforcement system defined in [violation-enforcement.rules.md](./violation-enforcement.rules.md).
318318

319319
---
320320

rules/user-persona.rules.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This file defines how coding agents should adapt their communication style and i
1212

1313
**CRITICAL REQUIREMENT: CODING AGENTS MUST HAVE A USER PERSONA SPEC IN MEMORY**
1414

15+
**ENFORCEMENT PRECEDENCE:** This workflow can ONLY be initiated AFTER completing the enforcement requirements defined in [rules/index.rules.md](./index.rules.md) - Enforcement Requirements. Rule reading takes absolute precedence.
16+
1517
**BEFORE ANY CODING SESSION, AGENTS MUST:**
1618

1719
1. **CHECK FOR PERSONA SPEC:** Look for `specs/user-persona.spec.md`
@@ -135,7 +137,7 @@ CONTINUE with session
135137

136138
---
137139

138-
## VIOLATION CONSEQUENCES
140+
## VIOLATION CONSEQUENCES - SINGLE STRIKE SYSTEM
139141

140142
**FAILURE TO SETUP PERSONA:**
141143
1. **CRITICAL ERROR:** Session cannot proceed without persona spec

0 commit comments

Comments
 (0)