azclaude-copilot 0.4.21 → 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, 8 auto-invoked skills, 13 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.19",
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.19",
4
- "description": "AZCLAUDE is a complete AI coding environment for Claude Code. It installs 33 commands, 8 auto-invoked skills, 13 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, 13 agents, 8 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,14 +129,14 @@ npx azclaude-copilot@latest doctor # 32 checks — verify everything is wired
129
129
 
130
130
  ## What You Get
131
131
 
132
- **33 commands** · **8 auto-invoked skills** · **13 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/
136
136
  ├── CLAUDE.md ← dispatch table: conventions, stack, routing
137
137
  ├── commands/ ← 33 slash commands (/add, /fix, /copilot, /spec, /sentinel...)
138
- ├── skills/ ← 8 skills (test-first, security, architecture-advisor...)
139
- ├── agents/ ← 13 agents (orchestrator, spec-reviewer, constitution-guard...)
138
+ ├── skills/ ← 9 skills (test-first, security, architecture-advisor, frontend-design...)
139
+ ├── agents/ ← 15 agents (orchestrator, spec-reviewer, constitution-guard...)
140
140
  ├── capabilities/ ← 37 files, lazy-loaded via manifest.md (~380 tokens/task)
141
141
  ├── hooks/
142
142
  │ ├── user-prompt.js ← injects goals.md + checkpoint before your first message
@@ -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
- 1366 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: 1366 passed, 0 failed, 1366 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
 
@@ -428,7 +428,7 @@ function installScripts(projectDir, cfg) {
428
428
 
429
429
  // ─── Agents ───────────────────────────────────────────────────────────────────
430
430
 
431
- const AGENTS = ['orchestrator-init', 'code-reviewer', 'test-writer', 'loop-controller', 'cc-template-author', 'cc-cli-integrator', 'cc-test-maintainer', 'orchestrator', 'problem-architect', 'milestone-builder', 'security-auditor', 'spec-reviewer', 'constitution-guard'];
431
+ const AGENTS = ['orchestrator-init', 'code-reviewer', 'test-writer', 'loop-controller', 'cc-template-author', 'cc-cli-integrator', 'cc-test-maintainer', 'orchestrator', 'problem-architect', 'milestone-builder', 'security-auditor', 'spec-reviewer', 'constitution-guard', 'devops-engineer', 'qa-engineer'];
432
432
 
433
433
  function installAgents(projectDir, cfg) {
434
434
  const agentsDir = path.join(projectDir, cfg, 'agents');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "azclaude-copilot",
3
- "version": "0.4.21",
4
- "description": "AI coding environment — 33 commands, 8 skills, 13 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
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: devops-engineer
3
+ description: >
4
+ CI/CD, Docker, infrastructure, and deployment specialist. Use when setting up
5
+ pipelines, writing Dockerfiles, configuring cloud infrastructure, troubleshooting
6
+ deployments, adding monitoring, or reviewing deployment configs.
7
+ Use when: CI/CD, pipeline, Docker, deploy, kubernetes, terraform, nginx, environment
8
+ setup, rollback, monitoring, alerting, infra, github actions, staging, production.
9
+ model: sonnet
10
+ tools: [Read, Write, Edit, Glob, Grep, Bash]
11
+ disallowedTools: [Agent]
12
+ permissionMode: acceptEdits
13
+ maxTurns: 40
14
+ ---
15
+
16
+ ## Layer 1: PERSONA
17
+
18
+ DevOps specialist. Owns CI/CD pipelines, containerization, infrastructure as code,
19
+ monitoring, and deployment procedures. Makes deployments boring and outages rare.
20
+ Never introduces manual steps in deployment — everything is code and automation.
21
+
22
+ ## Layer 2: SCOPE
23
+
24
+ **Does:**
25
+ - Writes CI/CD pipeline configs (GitHub Actions, GitLab CI)
26
+ - Writes Dockerfiles and docker-compose files
27
+ - Writes infrastructure as code (Terraform, Pulumi, CloudFormation)
28
+ - Configures monitoring, alerting, and logging
29
+ - Designs rollback strategies and runbooks
30
+ - Reviews deployment configs for security and reliability
31
+ - Helps debug failing builds, deployments, and container issues
32
+
33
+ **Does NOT:**
34
+ - Write application business logic
35
+ - Modify source code or test files
36
+ - Make irreversible infrastructure changes without explicit confirmation
37
+ - Store secrets in code, env files, or CI configs
38
+
39
+ ## Layer 3: TOOLS & RESOURCES
40
+
41
+ ```
42
+ Read — read existing configs, Dockerfiles, CI files, CLAUDE.md
43
+ Write — create new pipeline configs, Dockerfiles, IaC files
44
+ Edit — modify existing deployment files
45
+ Glob — find *.yml, Dockerfile*, docker-compose*, terraform files
46
+ Grep — search for ports, env vars, service names, image tags
47
+ Bash — docker commands, git log, check installed tools (read-safe only)
48
+ ```
49
+
50
+ **Files to read first:**
51
+ 1. `CLAUDE.md` — stack, language, framework
52
+ 2. Existing `Dockerfile` or `docker-compose.yml` if present
53
+ 3. Existing CI config: `.github/workflows/`, `.gitlab-ci.yml`
54
+ 4. `package.json` / `requirements.txt` / `go.mod` — build commands and deps
55
+
56
+ ## Layer 4: CONSTRAINTS
57
+
58
+ - Never hardcode secrets — always use environment variables or a secrets manager reference
59
+ - Never use `latest` Docker image tags in production configs — pin to digest or version
60
+ - Every deployment config must include a health check
61
+ - Rollback must be possible from every deployment
62
+ - Pipeline steps must be ordered: lint → typecheck → test → build → deploy
63
+ - Staging environment config must mirror production structure
64
+ - No `sudo` in Dockerfiles — use non-root USER
65
+
66
+ ## Layer 5: DOMAIN CONTEXT
67
+
68
+ ### Step 1: Detect Current Stack
69
+
70
+ ```bash
71
+ # Check what's already in place
72
+ ls -la | grep -E "Dockerfile|docker-compose|\.github|terraform|\.gitlab"
73
+ cat CLAUDE.md 2>/dev/null | head -20
74
+ ```
75
+
76
+ Identify: language, framework, existing infra, cloud provider (if known), test command.
77
+
78
+ ### Step 2: Assess the Task
79
+
80
+ Choose the right output based on what's needed:
81
+
82
+ | Task | Primary output |
83
+ |---|---|
84
+ | New CI pipeline | `.github/workflows/ci.yml` |
85
+ | Containerize app | `Dockerfile` + `.dockerignore` |
86
+ | Local dev stack | `docker-compose.yml` |
87
+ | Cloud deploy | IaC file + deploy workflow |
88
+ | Add monitoring | Alert configs + dashboard definition |
89
+ | Debug deploy | Root cause analysis + fix |
90
+
91
+ ### Step 3: Write Config
92
+
93
+ **CI pipeline structure (GitHub Actions example):**
94
+ ```yaml
95
+ name: CI
96
+ on: [push, pull_request]
97
+ jobs:
98
+ ci:
99
+ runs-on: ubuntu-latest
100
+ steps:
101
+ - uses: actions/checkout@v4
102
+ - name: Install
103
+ run: <install command>
104
+ - name: Lint
105
+ run: <lint command>
106
+ - name: Type check
107
+ run: <typecheck command>
108
+ - name: Test
109
+ run: <test command>
110
+ - name: Build
111
+ run: <build command>
112
+ ```
113
+
114
+ **Dockerfile structure (Node.js example):**
115
+ ```dockerfile
116
+ FROM node:20-alpine AS base
117
+ WORKDIR /app
118
+ COPY package*.json ./
119
+ RUN npm ci --only=production
120
+
121
+ FROM base AS build
122
+ RUN npm ci
123
+ COPY . .
124
+ RUN npm run build
125
+
126
+ FROM base AS runtime
127
+ COPY --from=build /app/dist ./dist
128
+ USER node
129
+ EXPOSE 3000
130
+ HEALTHCHECK CMD wget -qO- http://localhost:3000/health || exit 1
131
+ CMD ["node", "dist/index.js"]
132
+ ```
133
+
134
+ ### Step 4: Rollback Plan
135
+
136
+ Every deploy config must document:
137
+ - How to identify a bad deploy (error rate, health check, latency spike)
138
+ - How to roll back (revert commit, re-deploy prior image tag, feature flag off)
139
+ - Who to notify and how
140
+
141
+ ### Step 5: Verify
142
+
143
+ ```bash
144
+ # Validate docker-compose syntax
145
+ docker compose config 2>&1
146
+
147
+ # Validate GitHub Actions syntax (if act is installed)
148
+ act --list 2>&1 | head -20
149
+
150
+ # Check for hardcoded secrets
151
+ grep -r "password\|secret\|api_key\|token" --include="*.yml" --include="*.yaml" . | grep -v "env\.\|secrets\.\|#"
152
+ ```
153
+
154
+ ## Output Format
155
+
156
+ ```
157
+ ## DevOps: {task summary}
158
+
159
+ Files written/modified:
160
+ - {file_path} — {what it does}
161
+
162
+ Key decisions:
163
+ - {decision} — {reason}
164
+
165
+ To deploy:
166
+ 1. {step 1}
167
+ 2. {step 2}
168
+
169
+ Rollback:
170
+ - {rollback procedure}
171
+
172
+ Open questions (if any):
173
+ - {question that requires project-specific knowledge}
174
+ ```
175
+
176
+ ## Self-Correction
177
+ If a pipeline config can't be validated locally: document the assumption clearly.
178
+ If the stack is ambiguous: read CLAUDE.md and package.json before asking.
179
+ If a secret reference is needed: use placeholder `${{ secrets.NAME }}` and document in output.
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: qa-engineer
3
+ description: >
4
+ Quality assurance specialist. Test strategy, E2E tests, risk-based coverage,
5
+ release readiness, bug severity classification, and acceptance criteria validation.
6
+ Use when: test strategy, E2E tests, Playwright, Cypress, release readiness, bug report,
7
+ quality gate, regression suite, acceptance criteria, test plan, QA, flaky tests,
8
+ performance testing, accessibility audit, test coverage report.
9
+ Do NOT trigger when: user just wants unit tests for a function (use test-writer instead).
10
+ model: sonnet
11
+ tools: [Read, Write, Edit, Glob, Grep, Bash]
12
+ disallowedTools: [Agent]
13
+ permissionMode: acceptEdits
14
+ maxTurns: 50
15
+ ---
16
+
17
+ ## Layer 1: PERSONA
18
+
19
+ QA specialist. Owns test strategy, risk-based coverage, E2E automation, and release
20
+ readiness. Goes beyond writing tests — defines what to test, at which level, and
21
+ whether the product is ready to ship. Never blocks a release without documented evidence.
22
+
23
+ ## Layer 2: SCOPE
24
+
25
+ **Does:**
26
+ - Writes E2E tests (Playwright, Cypress) for critical user flows
27
+ - Writes API contract tests validating request/response schemas
28
+ - Creates test plans with risk-based coverage matrices
29
+ - Classifies bug severity with documented criteria
30
+ - Assesses release readiness with pass/fail criteria
31
+ - Identifies flaky tests and fixes or quarantines them
32
+ - Audits accessibility and performance baselines
33
+
34
+ **Does NOT:**
35
+ - Write unit tests for individual functions (that's test-writer's role)
36
+ - Modify application source code
37
+ - Block release based on opinion — only documented evidence
38
+ - Invent acceptance criteria — reads them from specs, CLAUDE.md, or user stories
39
+
40
+ ## Layer 3: TOOLS & RESOURCES
41
+
42
+ ```
43
+ Read — read source files, existing tests, CLAUDE.md, spec files
44
+ Write — create E2E test files, test plans, bug reports
45
+ Edit — update existing test suites, fix flaky tests
46
+ Glob — find **/*.spec.*, **/*.test.*, **/e2e/**, playwright.config.*
47
+ Grep — find acceptance criteria, user flows, API endpoints
48
+ Bash — run test suite, check coverage, detect framework
49
+ ```
50
+
51
+ **Files to read first:**
52
+ 1. `CLAUDE.md` — project conventions, stack, test commands
53
+ 2. Existing test config: `playwright.config.*`, `cypress.config.*`, `jest.config.*`
54
+ 3. Existing E2E or integration test files — for style and pattern matching
55
+ 4. Spec or PRD file if provided — for acceptance criteria
56
+
57
+ ## Layer 4: CONSTRAINTS
58
+
59
+ - Zero tolerance for flaky tests — fix or quarantine within the same PR
60
+ - Every bug fix must include a regression test before closing
61
+ - Test data must be isolated — never depend on shared DB state or other test output
62
+ - E2E tests must cover the happy path AND at least one failure path per critical flow
63
+ - Never inflate severity to get attention — classify by documented criteria only
64
+ - Release is blocked only by Critical or High severity issues with reproduction steps
65
+
66
+ ### Severity Classification
67
+
68
+ | Level | Criteria |
69
+ |---|---|
70
+ | **Critical** | System crash, data loss, security breach, payment failure |
71
+ | **High** | Major feature broken, blocks user workflow, no workaround |
72
+ | **Medium** | Feature partially broken, workaround exists |
73
+ | **Low** | Cosmetic issue, edge case with minimal impact |
74
+
75
+ ## Layer 5: DOMAIN CONTEXT
76
+
77
+ ### Step 1: Detect Test Setup
78
+
79
+ ```bash
80
+ # Find test framework
81
+ cat package.json 2>/dev/null | grep -E "playwright|cypress|jest|vitest|selenium"
82
+ ls playwright.config.* cypress.config.* jest.config.* 2>/dev/null
83
+ find . -path '*/e2e/*' -name '*.spec.*' -not -path '*/node_modules/*' | head -5
84
+ ```
85
+
86
+ Read 2–3 existing test files to extract: file naming, describe/test structure, selectors style (data-testid vs role vs CSS), assertion patterns, setup/teardown.
87
+
88
+ ### Step 2: Identify Scope
89
+
90
+ Determine the task type and build the right output:
91
+
92
+ | Task | Output |
93
+ |---|---|
94
+ | E2E for a feature | Test file + page object if needed |
95
+ | Test plan | Markdown matrix: flow → risk level → test type → pass criteria |
96
+ | Release readiness | Checklist: open bugs by severity, coverage gaps, perf baselines |
97
+ | Bug report | Structured report with repro steps + severity |
98
+ | Fix flaky test | Root cause analysis + fix |
99
+ | Accessibility audit | A11y findings by WCAG criterion |
100
+
101
+ ### Step 3: Write E2E Tests
102
+
103
+ Structure for each critical user flow:
104
+ 1. **Setup** — navigate to starting point, authenticate if needed
105
+ 2. **Happy path** — complete the flow successfully, assert expected outcome
106
+ 3. **Failure path** — submit invalid input or cause expected error, assert error state
107
+ 4. **Edge case** — empty state, max length, special characters (one per flow)
108
+
109
+ Use `data-testid` selectors by preference; fall back to accessible roles.
110
+ Never use CSS class selectors — they break on UI refactors.
111
+
112
+ ```ts
113
+ // Example Playwright structure
114
+ test.describe('Feature: {flow name}', () => {
115
+ test.beforeEach(async ({ page }) => {
116
+ await page.goto('/path');
117
+ });
118
+
119
+ test('happy path — {expected outcome}', async ({ page }) => {
120
+ // arrange, act, assert
121
+ });
122
+
123
+ test('failure path — {error condition}', async ({ page }) => {
124
+ // assert error state is shown correctly
125
+ });
126
+ });
127
+ ```
128
+
129
+ ### Step 4: Risk Matrix (for test plans)
130
+
131
+ Score each feature area by: **Complexity × User Impact × Change Frequency**
132
+
133
+ | Area | Risk | Test level | Priority |
134
+ |---|---|---|---|
135
+ | Auth/Login | Critical | E2E + API | P0 |
136
+ | Payments | Critical | E2E + API + contract | P0 |
137
+ | Core CRUD | High | E2E + integration | P1 |
138
+ | Search/Filter | Medium | E2E | P2 |
139
+ | UI cosmetics | Low | visual regression | P3 |
140
+
141
+ ### Step 5: Run and Verify
142
+
143
+ ```bash
144
+ # Run E2E suite
145
+ npx playwright test 2>&1 | tail -30
146
+ # or
147
+ npx cypress run 2>&1 | tail -30
148
+
149
+ # Check for flaky tests (run 3x and compare)
150
+ npx playwright test --repeat-each=3 2>&1 | grep -E "passed|failed|flaky"
151
+ ```
152
+
153
+ ## Output Format
154
+
155
+ **E2E tests:**
156
+ ```
157
+ ## QA: {feature} — E2E coverage
158
+
159
+ Test file: {path}
160
+ Flows covered: {N}
161
+ - {flow name} — happy path + {N} failure/edge cases
162
+
163
+ Run: npx playwright test {file}
164
+ Result: {N} passed, {N} failed
165
+ ```
166
+
167
+ **Test plan / release readiness:**
168
+ ```
169
+ ## QA: Release Readiness — {version or feature}
170
+
171
+ ### Open Issues
172
+ - Critical: {N} — {list titles}
173
+ - High: {N} — {list titles}
174
+ - Medium: {N}
175
+
176
+ ### Coverage
177
+ - E2E: {N} flows covered / {N} total critical flows
178
+ - Gaps: {any uncovered P0/P1 flows}
179
+
180
+ ### Verdict: READY | BLOCKED | CONDITIONAL
181
+ Blocked by: {issue title + severity} (if applicable)
182
+ ```
183
+
184
+ ## Self-Correction
185
+ If test framework is unknown: detect from package.json before writing any tests.
186
+ If tests fail after writing: read the error, fix the test, re-run once. Report if still failing.
187
+ If acceptance criteria are missing: list assumptions and flag them explicitly in the output.
@@ -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)