azclaude-copilot 0.4.22 → 0.4.23

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.
@@ -8,8 +8,8 @@
8
8
  "plugins": [
9
9
  {
10
10
  "name": "azclaude",
11
- "description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 33 commands, 9 auto-invoked skills, 15 specialized agents, 4 hooks, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 102-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
12
- "version": "0.4.22",
11
+ "description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 34 commands, 9 auto-invoked skills, 15 specialized agents, 4 hooks, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 102-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
12
+ "version": "0.4.23",
13
13
  "source": {
14
14
  "source": "github",
15
15
  "repo": "haytamAroui/AZ-CLAUDE-COPILOT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "azclaude",
3
- "version": "0.4.22",
4
- "description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 33 commands, 9 auto-invoked skills, 15 specialized agents, 4 hooks, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 102-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
3
+ "version": "0.4.23",
4
+ "description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 34 commands, 9 auto-invoked skills, 15 specialized agents, 4 hooks, and a persistent memory system — in one command.\n\nKey features:\n• Memory across sessions — goals.md + checkpoints injected automatically before every session\n• Self-improving loop — /reflect fixes stale CLAUDE.md rules, /reflexes learns from tool-use patterns, /evolve creates agents from git evidence\n• Autonomous copilot mode — /copilot runs a three-tier team (orchestrator → problem-architect → milestone-builder) across sessions until the product ships\n• Spec-driven workflow — /constitute writes project rules, /spec writes structured ACs, /analyze detects plan drift and ghost milestones, /blueprint traces every milestone to a spec\n• Security layer — 102-rule environment scan (/sentinel), pre-write secret blocking, pre-ship credential audit\n• Progressive levels 0–10 — start with CLAUDE.md, grow into multi-agent pipelines and self-evolving environments\n• Zero dependencies — no npm packages, no external APIs, no vector databases. Plain markdown files and Claude Code's native architecture.\n• Smart install — npx azclaude-copilot@latest auto-detects first install vs upgrade vs verify. Context-aware onboarding shows the right next command for your project state.\n\nExample use cases:\n• /setup — scan an existing project, detect stack + domain + scale, fill CLAUDE.md, generate project-specific skills and agents automatically\n• /copilot \"Build a compliance SaaS with trilingual support\" — walk away, come back to working code across multiple sessions\n• /sentinel — run a scored security audit (0–100, grade A–F) across hooks, permissions, MCP servers, agent configs, and secrets\n• /evolve — detect gaps in the environment, generate new skills and agents from git co-change evidence, report score delta (e.g. 42/100 → 68/100)\n• /constitute — write your project's constitution (non-negotiables, architectural commitments, definition of done) — gates all future AI actions\n• /analyze — cross-artifact consistency check: ghost milestones, spec vs. code drift, unplanned commits\n• /reflect — find stale, missing, or contradicting rules in CLAUDE.md and propose exact fixes\n• /debate \"REST vs GraphQL for this project\" — adversarial evidence-based decision with order-independent scoring, logged to decisions.md",
5
5
  "author": {
6
6
  "name": "haytamAroui",
7
7
  "url": "https://github.com/haytamAroui"
package/README.md CHANGED
@@ -61,7 +61,7 @@ AZCLAUDE inverts this. **You start with almost nothing. The environment builds i
61
61
  npx azclaude-copilot@latest # one command. that's it.
62
62
  ```
63
63
 
64
- No agent files to write. No skills to configure. No prompt engineering. `npx azclaude-copilot` installs 33 commands, 4 hooks, memory structure, and a manifest. The rest is generated from your actual codebase as you work. Run the same command again later — it auto-detects whether to skip, install, or upgrade.
64
+ No agent files to write. No skills to configure. No prompt engineering. `npx azclaude-copilot` installs 34 commands, 4 hooks, memory structure, and a manifest. The rest is generated from your actual codebase as you work. Run the same command again later — it auto-detects whether to skip, install, or upgrade.
65
65
 
66
66
  **What the environment looks like across sessions:**
67
67
 
@@ -117,7 +117,7 @@ npx azclaude-copilot@latest
117
117
  ```
118
118
 
119
119
  That's it. One command, no flags. Auto-detects whether this is a fresh install or an upgrade:
120
- - **First time** → full install (33 commands, 4 hooks, 15 agents, 9 skills, memory, reflexes)
120
+ - **First time** → full install (34 commands, 4 hooks, 15 agents, 9 skills, memory, reflexes)
121
121
  - **Already installed, older version** → auto-upgrades everything to latest templates
122
122
  - **Already up to date** → verifies, no overwrites
123
123
 
@@ -129,7 +129,7 @@ npx azclaude-copilot@latest doctor # 32 checks — verify everything is wired
129
129
 
130
130
  ## What You Get
131
131
 
132
- **33 commands** · **9 auto-invoked skills** · **15 agents** · **4 hooks** · **memory across sessions** · **learned reflexes** · **self-evolving environment**
132
+ **34 commands** · **9 auto-invoked skills** · **15 agents** · **4 hooks** · **memory across sessions** · **learned reflexes** · **self-evolving environment**
133
133
 
134
134
  ```
135
135
  .claude/
@@ -807,11 +807,11 @@ Run `/level-up` at any time to see your current level and build the next one.
807
807
 
808
808
  ## Verified
809
809
 
810
- 1388 tests. Every template, command, capability, agent, hook, and CLI feature verified.
810
+ 1407 tests. Every template, command, capability, agent, hook, and CLI feature verified.
811
811
 
812
812
  ```bash
813
813
  bash tests/test-features.sh
814
- # Results: 1388 passed, 0 failed, 1388 total
814
+ # Results: 1407 passed, 0 failed, 1407 total
815
815
  ```
816
816
 
817
817
  ---
package/bin/cli.js CHANGED
@@ -8,7 +8,7 @@ const { execSync } = require('child_process');
8
8
 
9
9
  const TEMPLATE_DIR = path.join(__dirname, '..', 'templates');
10
10
  const CORE_COMMANDS = ['setup', 'fix', 'add', 'audit', 'test', 'blueprint', 'ship', 'pulse', 'explain', 'snapshot', 'persist'];
11
- const EXTENDED_COMMANDS = ['dream', 'refactor', 'doc', 'loop', 'migrate', 'deps', 'find', 'create', 'reflect', 'hookify', 'sentinel', 'clarify', 'spec', 'analyze', 'constitute', 'tasks', 'issues'];
11
+ const EXTENDED_COMMANDS = ['dream', 'refactor', 'doc', 'loop', 'migrate', 'deps', 'find', 'create', 'reflect', 'hookify', 'sentinel', 'clarify', 'spec', 'analyze', 'constitute', 'tasks', 'issues', 'driven'];
12
12
  const ADVANCED_COMMANDS = ['evolve', 'debate', 'level-up', 'copilot', 'reflexes'];
13
13
  const COMMANDS = [...CORE_COMMANDS, ...EXTENDED_COMMANDS, ...ADVANCED_COMMANDS];
14
14
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "azclaude-copilot",
3
- "version": "0.4.22",
4
- "description": "AI coding environment — 33 commands, 9 skills, 15 agents, memory, reflexes, evolution. Install: npx azclaude-copilot@latest, then open Claude Code.",
3
+ "version": "0.4.23",
4
+ "description": "AI coding environment — 34 commands, 9 skills, 15 agents, memory, reflexes, evolution. Install: npx azclaude-copilot@latest, then open Claude Code.",
5
5
  "bin": {
6
6
  "azclaude": "bin/cli.js",
7
7
  "azclaude-copilot": "bin/copilot.js"
@@ -39,6 +39,7 @@ Extended (load command file on use):
39
39
  - /analyze: cross-artifact consistency check (ghost milestones, spec vs. code drift)
40
40
  - /tasks: dependency graph + parallel wave groups from plan.md
41
41
  - /issues: convert plan.md milestones to GitHub Issues
42
+ - Standards: /driven → generates .claude/code-rules.md (coding contract for /add and /fix)
42
43
 
43
44
  Advanced (Level 5+):
44
45
  - /evolve · /debate · /level-up
@@ -52,4 +53,4 @@ When priorities conflict:
52
53
  3. {{PRIORITY_3}}
53
54
 
54
55
  ## Available Commands
55
- /dream · /setup · /fix · /add · /audit · /test · /blueprint · /evolve · /debate · /snapshot · /persist · /level-up · /ship · /pulse · /explain · /loop · /refactor · /doc · /migrate · /deps · /find · /create · /reflect · /hookify · /spec · /clarify · /analyze · /constitute · /tasks · /issues
56
+ /dream · /setup · /fix · /add · /audit · /test · /blueprint · /evolve · /debate · /snapshot · /persist · /level-up · /ship · /pulse · /explain · /loop · /refactor · /doc · /migrate · /deps · /find · /create · /reflect · /hookify · /spec · /clarify · /analyze · /constitute · /tasks · /issues · /driven
@@ -18,12 +18,15 @@ Load: shared/tdd.md + shared/completion-rule.md
18
18
 
19
19
  ---
20
20
 
21
- ## Pre-Flight: Constitution + Spec Check
21
+ ## Pre-Flight: Constitution + Code Rules + Spec Check
22
22
 
23
23
  ```bash
24
24
  # Check constitution
25
25
  [ -f .claude/constitution.md ] && echo "constitution=found" || echo "no constitution"
26
26
 
27
+ # Check coding contract
28
+ [ -f .claude/code-rules.md ] && echo "code-rules=found" || echo "no code-rules"
29
+
27
30
  # Check if $ARGUMENTS is a spec file
28
31
  [ -f "$ARGUMENTS" ] && grep -q "Acceptance Criteria" "$ARGUMENTS" && echo "spec-mode" || echo "inline-mode"
29
32
  ```
@@ -32,6 +35,10 @@ Load: shared/tdd.md + shared/completion-rule.md
32
35
  Read `## Non-Negotiables` and `## Required Patterns` before implementing.
33
36
  Keep these rules visible throughout Phases 2-4. Flag any implementation choice that would violate them.
34
37
 
38
+ **If code-rules found:**
39
+ Read `.claude/code-rules.md` — apply the relevant sections (language, framework, testing, naming) while implementing.
40
+ If a coding choice would violate a rule, flag it before writing the code — do not silently deviate.
41
+
35
42
  **If spec file provided** (e.g., `/add .claude/specs/02-payment.md`):
36
43
  - Skip Phase 1 clarification — the spec IS the clarification
37
44
  - Load acceptance criteria as the implementation checklist
@@ -0,0 +1,228 @@
1
+ ---
2
+ name: driven
3
+ description: >
4
+ Generate or update the project coding rules contract (.claude/code-rules.md).
5
+ Asks 6 questions about architecture, testing, code style, strictness, documentation,
6
+ and git conventions — then generates a precise DO/DO NOT rule file tailored to
7
+ the detected stack. Every /add and /fix reads this file before writing code.
8
+ Triggers on: "coding rules", "code rules", "set coding standards", "define standards",
9
+ "project standards", "how should we write code", "coding conventions", "code style",
10
+ "what are the rules", "driven development", "project coding contract", "style guide",
11
+ "coding contract", "define conventions", "set our rules", "project rules for code".
12
+ Do NOT trigger for: governance/ethics/security rules (use /constitute), security audit (use /sentinel).
13
+ argument-hint: "[blank to create | 'update' to modify a section | 'show' to print current rules]"
14
+ disable-model-invocation: true
15
+ allowed-tools: Read, Write, Bash, Glob, Grep
16
+ ---
17
+
18
+ # /driven — Build the Project Coding Contract
19
+
20
+ $ARGUMENTS
21
+
22
+ ---
23
+
24
+ ## Purpose
25
+
26
+ `.claude/code-rules.md` is the coding standards contract for this project.
27
+ It is written once, updated explicitly, and read by every `/add` and `/fix` before writing code.
28
+
29
+ **Precedence hierarchy — when conflicts arise:**
30
+ ```
31
+ constitution.md ← governance wins (security, architecture, forbidden deps)
32
+ code-rules.md ← style wins (syntax, naming, testing patterns, git format)
33
+ ```
34
+
35
+ If a rule in `code-rules.md` contradicts `constitution.md` — flag the conflict to the user. Never resolve silently.
36
+
37
+ ---
38
+
39
+ ## Step 1: Check Existing State
40
+
41
+ ```bash
42
+ # Check for existing rules
43
+ cat .claude/code-rules.md 2>/dev/null | head -8
44
+
45
+ # Read stack from CLAUDE.md
46
+ grep -i "stack:" CLAUDE.md 2>/dev/null | head -3
47
+ ```
48
+
49
+ **If $ARGUMENTS = "show":**
50
+ Print `.claude/code-rules.md` in full and stop.
51
+
52
+ **If $ARGUMENTS = "update":**
53
+ - Show current `.claude/code-rules.md`
54
+ - Use **AskUserQuestion**: "Which section to update? (architecture / testing / style / strictness / docs / git / naming)"
55
+ - Re-run only that section's interview question
56
+ - Overwrite only that section — leave the rest unchanged
57
+ - Show the diff and stop
58
+
59
+ **If `code-rules.md` exists and $ARGUMENTS is blank:**
60
+ Use **AskUserQuestion**: "`.claude/code-rules.md` already exists. Regenerate from scratch, or run `/driven update` to modify one section?"
61
+ - Regenerate → proceed to Step 2
62
+ - Update → switch to update flow above
63
+
64
+ **If no `code-rules.md`:** proceed to Step 2.
65
+
66
+ ---
67
+
68
+ ## Step 2: Detect Stack
69
+
70
+ Read `CLAUDE.md` Stack field. If empty or missing, run detection:
71
+
72
+ ```bash
73
+ [ -f package.json ] && node -e "const p=require('./package.json');const d={...p.dependencies,...p.devDependencies};console.log(Object.keys(d).join(' '))" 2>/dev/null | tr ' ' '\n' | grep -E "^react$|^next$|^express$|^fastify$|typescript" | head -5
74
+ [ -f pyproject.toml ] && echo "python=yes"
75
+ [ -f requirements.txt ] && echo "python=yes"
76
+ ```
77
+
78
+ State the detected stack before starting the interview. Example:
79
+ ```
80
+ Detected stack: React 19, TypeScript, Node/Express, PostgreSQL
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Step 3: Interview — 6 Questions
86
+
87
+ Use **AskUserQuestion** — one question at a time. Never ask all at once.
88
+ Every question includes a **Default** option. If selected, use the industry-standard for the detected stack and note it in the file header.
89
+
90
+ **Q1 — Architecture:**
91
+ "What architecture pattern should this project follow?
92
+ 1. Clean Architecture (layers: domain / use-cases / infrastructure)
93
+ 2. DDD — Domain-Driven Design (aggregates, value objects, bounded contexts)
94
+ 3. MVC (models / views / controllers)
95
+ 4. Feature-based (co-locate everything per feature)
96
+ 5. Hexagonal / Ports & Adapters
97
+ 6. Default (recommended for your stack)"
98
+
99
+ **Q2 — Testing:**
100
+ "What is the testing philosophy?
101
+ 1. TDD mandatory — write the failing test first, always
102
+ 2. TDD optional — follow existing signals (CLAUDE.md rule + test files present)
103
+ 3. Test-after — implement first, test after
104
+ 4. No tests
105
+ 5. Default"
106
+
107
+ **Q3 — Code style:**
108
+ "Functional, OOP, or mixed?
109
+ 1. Functional — prefer pure functions, avoid classes, immutable data
110
+ 2. OOP — class-based patterns, encapsulation, inheritance where appropriate
111
+ 3. Mixed — functions for business logic, classes for infrastructure/services
112
+ 4. Default"
113
+
114
+ **Q4 — Strictness:**
115
+ "How strict are the type/lint rules?
116
+ 1. Strict — no `any`, all types explicit, no lint suppressions
117
+ 2. Moderate — types where it matters, `any` allowed at boundaries
118
+ 3. Pragmatic — types at system boundaries only
119
+ 4. Default"
120
+
121
+ **Q5 — Documentation:**
122
+ "What documentation is required in code?
123
+ 1. JSDoc / docstrings on all public functions and classes
124
+ 2. Inline comments for complex logic only
125
+ 3. None
126
+ 4. Default"
127
+
128
+ **Q6 — Git commit format:**
129
+ "What commit message format?
130
+ 1. Conventional commits — feat/fix/docs/refactor/test/chore(scope): description
131
+ 2. Free-form — no enforced format
132
+ 3. Custom — I'll specify the format
133
+ 4. Default"
134
+
135
+ If user selects Custom on Q6 → ask one follow-up: "What is your commit format? (example format)"
136
+
137
+ ---
138
+
139
+ ## Step 4: Conflict Check
140
+
141
+ ```bash
142
+ [ -f .claude/constitution.md ] && echo "constitution=found" || echo "no constitution"
143
+ ```
144
+
145
+ If constitution found: read `## Non-Negotiables` and `## Required Patterns`.
146
+ Cross-check each interview answer against those sections.
147
+
148
+ If conflict found, state it before generating:
149
+ ```
150
+ CONFLICT DETECTED:
151
+ constitution.md requires: {X}
152
+ Your answer to Q{N}: {Y}
153
+
154
+ Resolve before continuing:
155
+ (a) Keep the constitutional rule — I'll override your Q{N} answer
156
+ (b) Update /constitute to allow {Y} — run /constitute after this
157
+ ```
158
+
159
+ Wait for user resolution before proceeding to Step 5.
160
+
161
+ ---
162
+
163
+ ## Step 5: Generate `.claude/code-rules.md`
164
+
165
+ Write the file using answers from Step 3:
166
+
167
+ ```markdown
168
+ # Code Rules — v1 (Generated {date})
169
+ # Stack: {detected stack}
170
+ # Architecture: {Q1} | Testing: {Q2} | Style: {Q3} | Strictness: {Q4}
171
+ # NOTE: These rules guide AI generation. Align your linters/CI to match.
172
+ # To update a section: /driven update | To regenerate: /driven
173
+
174
+ ---
175
+
176
+ ## Naming Conventions
177
+ {stack-specific — e.g., for TypeScript/React:}
178
+ - DO: variables and functions → camelCase
179
+ - DO: components and classes → PascalCase
180
+ - DO: constants → UPPER_SNAKE_CASE
181
+ - DO: database tables and columns → snake_case
182
+ - DO NOT: mix naming conventions within a layer
183
+
184
+ ## {Primary language — TypeScript / Python / etc.}
185
+ {DO / DO NOT rules matching Q4 strictness}
186
+ {Max 8 rules}
187
+
188
+ ## {Primary framework — React / Express / FastAPI / etc.}
189
+ {DO / DO NOT rules matching Q1 architecture + Q3 style}
190
+ {Max 8 rules}
191
+
192
+ ## Testing
193
+ {DO / DO NOT rules matching Q2 philosophy}
194
+ {Max 6 rules}
195
+
196
+ ## Documentation
197
+ {DO / DO NOT rules matching Q5}
198
+ {Max 4 rules}
199
+
200
+ ## Git
201
+ {DO / DO NOT rules matching Q6}
202
+ {Max 4 rules}
203
+ ```
204
+
205
+ Rules for generation:
206
+ - One rule per line. `DO:` or `DO NOT:` prefix only — no prose, no explanations.
207
+ - Maximum 8 rules per section. If more exist, keep the 8 highest-impact ones.
208
+ - Use the actual detected stack for section headings — not generic labels.
209
+ - Default answers: use the industry standard for the detected stack, note `# Default` in the header.
210
+
211
+ ---
212
+
213
+ ## Step 6: Confirm
214
+
215
+ Show:
216
+ ```
217
+ Code rules written: .claude/code-rules.md
218
+ Stack: {detected}
219
+ Sections: {N} — naming · {lang} · {framework} · testing · docs · git
220
+ Total rules: {count}
221
+ Architecture: {Q1} | Testing: {Q2} | Style: {Q3}
222
+
223
+ Every /add and /fix will now read this file before writing code.
224
+
225
+ Suggested commit (do not run — confirm first):
226
+ git add .claude/code-rules.md
227
+ git commit -m "chore: add project coding rules contract"
228
+ ```
@@ -14,16 +14,20 @@ Load: shared/tdd.md + shared/completion-rule.md before starting.
14
14
 
15
15
  ---
16
16
 
17
- ## Pre-Flight: Constitution Check
17
+ ## Pre-Flight: Constitution + Code Rules Check
18
18
 
19
19
  ```bash
20
20
  [ -f .claude/constitution.md ] && echo "constitution=found" || echo "no constitution"
21
+ [ -f .claude/code-rules.md ] && echo "code-rules=found" || echo "no code-rules"
21
22
  ```
22
23
 
23
- If found: read `## Non-Negotiables` before fixing.
24
+ If constitution found: read `## Non-Negotiables` before fixing.
24
25
  The fix must not violate a non-negotiable — a "fix" that breaks a project rule is not a fix.
25
26
  Flag any conflict explicitly before proceeding to Phase 1.
26
27
 
28
+ If code-rules found: read `.claude/code-rules.md`.
29
+ The fix must not introduce violations. If the bug itself was caused by a rule violation, note that in the root-cause checkpoint.
30
+
27
31
  ---
28
32
 
29
33
  ## Pre-Flight Analysis (intelligent-dispatch)