azclaude-copilot 0.4.22 → 0.4.24
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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +5 -5
- package/bin/cli.js +1 -1
- package/package.json +2 -2
- package/templates/CLAUDE.md +2 -1
- package/templates/agents/milestone-builder.md +9 -5
- package/templates/commands/add.md +8 -1
- package/templates/commands/audit.md +7 -1
- package/templates/commands/blueprint.md +7 -1
- package/templates/commands/doc.md +12 -0
- package/templates/commands/driven.md +228 -0
- package/templates/commands/fix.md +6 -2
- package/templates/commands/refactor.md +7 -2
- package/templates/commands/setup.md +13 -2
- package/templates/commands/test.md +12 -0
|
@@ -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
|
|
12
|
-
"version": "0.4.
|
|
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.
|
|
4
|
-
"description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs
|
|
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
|
|
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 (
|
|
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
|
-
**
|
|
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
|
-
|
|
810
|
+
1421 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:
|
|
814
|
+
# Results: 1421 passed, 0 failed, 1421 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.
|
|
4
|
-
"description": "AI coding environment —
|
|
3
|
+
"version": "0.4.24",
|
|
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"
|
package/templates/CLAUDE.md
CHANGED
|
@@ -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
|
|
@@ -40,15 +40,19 @@ If any item is missing → ask orchestrator before proceeding.
|
|
|
40
40
|
|
|
41
41
|
Read every file in the pre-read list. Order matters:
|
|
42
42
|
1. `.claude/constitution.md` — non-negotiables (if present — read FIRST, constraints before code)
|
|
43
|
-
2.
|
|
44
|
-
3.
|
|
45
|
-
4. Related
|
|
46
|
-
5.
|
|
47
|
-
6.
|
|
43
|
+
2. `.claude/code-rules.md` — coding standards contract (if present — read SECOND, style rules before code)
|
|
44
|
+
3. Schema / config files (structural constraints)
|
|
45
|
+
4. Related source files (existing patterns to match)
|
|
46
|
+
5. Related test files (test framework + naming conventions)
|
|
47
|
+
6. patterns.md entries for this area
|
|
48
|
+
7. antipatterns.md entries for this area
|
|
48
49
|
|
|
49
50
|
If constitution.md exists: keep its Non-Negotiables visible throughout implementation.
|
|
50
51
|
Flag any implementation choice that would violate them BEFORE writing — do not discover violations after the fact.
|
|
51
52
|
|
|
53
|
+
If code-rules.md exists: apply the relevant sections (naming, language, framework, testing) throughout implementation.
|
|
54
|
+
Flag any implementation choice that would violate a rule BEFORE writing the code.
|
|
55
|
+
|
|
52
56
|
Do NOT skip pre-reads. Context-blind implementation is the most common failure mode.
|
|
53
57
|
|
|
54
58
|
---
|
|
@@ -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
|
|
@@ -121,8 +121,14 @@ Report violations only — no code quality feedback until spec is clean.
|
|
|
121
121
|
If unavailable or empty: skip — proceed to manual checks.
|
|
122
122
|
If returns results: include errors and warnings in the report.
|
|
123
123
|
|
|
124
|
+
```bash
|
|
125
|
+
[ -f .claude/code-rules.md ] && echo "code-rules=found" || echo "no code-rules"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**If code-rules found:** read `.claude/code-rules.md` — use it as the primary convention checklist for this step (naming, style, testing, git). It overrides generic CLAUDE.md conventions for style questions.
|
|
129
|
+
|
|
124
130
|
Check:
|
|
125
|
-
- Follows project conventions from CLAUDE.md
|
|
131
|
+
- Follows project conventions from CLAUDE.md (and code-rules.md if present)
|
|
126
132
|
- No security anti-patterns (see shared/security.md)
|
|
127
133
|
- If developer domain: tests exist for new behavior (TDD Iron Law)
|
|
128
134
|
- Minimum necessary complexity — no over-engineering
|
|
@@ -101,11 +101,12 @@ State the risk level. If risk = high → recommend `EnterWorktree` during implem
|
|
|
101
101
|
|
|
102
102
|
---
|
|
103
103
|
|
|
104
|
-
## Step 3b: Constitution Check + Task Graph
|
|
104
|
+
## Step 3b: Constitution + Code Rules Check + Task Graph
|
|
105
105
|
|
|
106
106
|
After writing the plan (Step 3), check:
|
|
107
107
|
```bash
|
|
108
108
|
[ -f .claude/constitution.md ] && echo "constitution=found" || echo "no constitution"
|
|
109
|
+
[ -f .claude/code-rules.md ] && echo "code-rules=found" || echo "no code-rules"
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
If constitution found → scan plan steps against non-negotiables:
|
|
@@ -113,6 +114,11 @@ If constitution found → scan plan steps against non-negotiables:
|
|
|
113
114
|
- Flag any plan step that could violate a rule
|
|
114
115
|
- Add a note to flagged steps: `⚠ Constitution check: may conflict with "{rule}" — verify before implementing`
|
|
115
116
|
|
|
117
|
+
If code-rules found → read `## Architecture` section:
|
|
118
|
+
- The plan must respect the declared architecture pattern (Clean Architecture / DDD / MVC / etc.)
|
|
119
|
+
- If a plan step would introduce a pattern that conflicts with the architecture rule — flag it
|
|
120
|
+
- Add note: `⚠ Code rules: this step should follow {architecture pattern} — verify approach before implementing`
|
|
121
|
+
|
|
116
122
|
Then run `/tasks` to show dependency waves:
|
|
117
123
|
```
|
|
118
124
|
Next: Run /tasks to see which plan steps can run in parallel
|
|
@@ -16,6 +16,18 @@ $ARGUMENTS
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
+
## Pre-Flight: Code Rules Check
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
[ -f .claude/code-rules.md ] && echo "code-rules=found" || echo "no code-rules"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If code-rules found: read the `## Documentation` section.
|
|
26
|
+
It defines the required doc style (JSDoc on all public functions / inline comments only / none).
|
|
27
|
+
This overrides inferred style — code-rules is the authoritative answer for this project.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
19
31
|
## Phase 1: Detect Scope
|
|
20
32
|
|
|
21
33
|
If $ARGUMENTS is blank, use **AskUserQuestion**:
|
|
@@ -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)
|
|
@@ -18,16 +18,21 @@ Load: shared/completion-rule.md
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## Pre-Flight: Constitution Check
|
|
21
|
+
## Pre-Flight: Constitution + Code Rules Check
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
[ -f .claude/constitution.md ] && echo "constitution=found" || echo "no constitution"
|
|
25
|
+
[ -f .claude/code-rules.md ] && echo "code-rules=found" || echo "no code-rules"
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
If found: read `## Architectural Commitments` and `## Required Patterns`.
|
|
28
|
+
If constitution found: read `## Architectural Commitments` and `## Required Patterns`.
|
|
28
29
|
Refactoring often changes structure — ensure the refactor moves TOWARD required patterns, not away from them.
|
|
29
30
|
If the refactor would conflict with an architectural commitment → flag before starting Phase 1. Do not proceed silently.
|
|
30
31
|
|
|
32
|
+
If code-rules found: read `.claude/code-rules.md` — the refactor must move code TOWARD these rules, not away from them.
|
|
33
|
+
The style, naming, and architecture sections define the TARGET state. Use them as the direction of the refactor.
|
|
34
|
+
If the current code violates a rule, the refactor is an opportunity to fix it — note the correction explicitly.
|
|
35
|
+
|
|
31
36
|
---
|
|
32
37
|
|
|
33
38
|
## Pre-Flight Analysis (intelligent-dispatch)
|
|
@@ -185,6 +185,17 @@ If constitution missing:
|
|
|
185
185
|
Copilot checks this before every milestone implementation.
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
+
If no coding rules found:
|
|
189
|
+
```bash
|
|
190
|
+
[ -f .claude/code-rules.md ] && echo "code-rules=found" || echo "code-rules=missing"
|
|
191
|
+
```
|
|
192
|
+
```
|
|
193
|
+
· No coding rules contract found.
|
|
194
|
+
Run: /driven
|
|
195
|
+
Why: generates .claude/code-rules.md — your project's coding standards.
|
|
196
|
+
Every /add, /fix, /refactor, /audit, /test, /doc, /blueprint reads this before writing code.
|
|
197
|
+
```
|
|
198
|
+
|
|
188
199
|
If no specs found:
|
|
189
200
|
```
|
|
190
201
|
· No feature specs found.
|
|
@@ -193,9 +204,9 @@ If no specs found:
|
|
|
193
204
|
Spec-first workflow: /spec → /clarify → /blueprint → /copilot
|
|
194
205
|
```
|
|
195
206
|
|
|
196
|
-
If
|
|
207
|
+
If all three exist:
|
|
197
208
|
```
|
|
198
|
-
✓ Constitution and specs found. Ready for /copilot.
|
|
209
|
+
✓ Constitution, coding rules, and specs found. Ready for /copilot.
|
|
199
210
|
```
|
|
200
211
|
|
|
201
212
|
---
|
|
@@ -16,6 +16,18 @@ $ARGUMENTS
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
+
## Pre-Flight: Code Rules Check
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
[ -f .claude/code-rules.md ] && echo "code-rules=found" || echo "no code-rules"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If code-rules found: read the `## Testing` section before writing or interpreting any tests.
|
|
26
|
+
Apply: TDD philosophy (mandatory / optional / test-after), test naming convention, coverage targets.
|
|
27
|
+
If writing new tests: follow the naming pattern from code-rules, not generic conventions.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
19
31
|
## Step 1: IDE Diagnostics First
|
|
20
32
|
|
|
21
33
|
Use `mcp__ide__getDiagnostics` if available.
|