azclaude-copilot 0.1.0

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.
Files changed (108) hide show
  1. package/.claude-plugin/marketplace.json +27 -0
  2. package/.claude-plugin/plugin.json +17 -0
  3. package/LICENSE +21 -0
  4. package/README.md +477 -0
  5. package/bin/cli.js +1027 -0
  6. package/bin/copilot.js +228 -0
  7. package/hooks/README.md +3 -0
  8. package/hooks/hooks.json +40 -0
  9. package/package.json +41 -0
  10. package/templates/CLAUDE.md +51 -0
  11. package/templates/agents/cc-cli-integrator.md +104 -0
  12. package/templates/agents/cc-template-author.md +109 -0
  13. package/templates/agents/cc-test-maintainer.md +101 -0
  14. package/templates/agents/code-reviewer.md +136 -0
  15. package/templates/agents/loop-controller.md +118 -0
  16. package/templates/agents/orchestrator-init.md +196 -0
  17. package/templates/agents/test-writer.md +129 -0
  18. package/templates/capabilities/evolution/cycle2-knowledge.md +87 -0
  19. package/templates/capabilities/evolution/cycle3-topology.md +128 -0
  20. package/templates/capabilities/evolution/detect.md +103 -0
  21. package/templates/capabilities/evolution/evaluate.md +90 -0
  22. package/templates/capabilities/evolution/generate.md +123 -0
  23. package/templates/capabilities/evolution/re-derivation.md +77 -0
  24. package/templates/capabilities/intelligence/debate.md +104 -0
  25. package/templates/capabilities/intelligence/elo.md +122 -0
  26. package/templates/capabilities/intelligence/experiment.md +86 -0
  27. package/templates/capabilities/intelligence/opro.md +84 -0
  28. package/templates/capabilities/intelligence/pipeline.md +149 -0
  29. package/templates/capabilities/level-builders/level1-claudemd.md +52 -0
  30. package/templates/capabilities/level-builders/level2-mcp.md +58 -0
  31. package/templates/capabilities/level-builders/level3-skills.md +276 -0
  32. package/templates/capabilities/level-builders/level4-memory.md +72 -0
  33. package/templates/capabilities/level-builders/level5-agents.md +123 -0
  34. package/templates/capabilities/level-builders/level6-hooks.md +119 -0
  35. package/templates/capabilities/level-builders/level7-extmcp.md +60 -0
  36. package/templates/capabilities/level-builders/level8-orchestrated.md +98 -0
  37. package/templates/capabilities/manifest.md +58 -0
  38. package/templates/capabilities/shared/5-layer-agent.md +206 -0
  39. package/templates/capabilities/shared/completion-rule.md +44 -0
  40. package/templates/capabilities/shared/context-artifacts.md +96 -0
  41. package/templates/capabilities/shared/domain-advisor-generator.md +205 -0
  42. package/templates/capabilities/shared/friction-log.md +43 -0
  43. package/templates/capabilities/shared/multi-cli-paths.md +56 -0
  44. package/templates/capabilities/shared/native-tools.md +199 -0
  45. package/templates/capabilities/shared/plan-tracker.md +69 -0
  46. package/templates/capabilities/shared/pressure-test.md +88 -0
  47. package/templates/capabilities/shared/quality-check.md +83 -0
  48. package/templates/capabilities/shared/reflexes.md +159 -0
  49. package/templates/capabilities/shared/review-reception.md +70 -0
  50. package/templates/capabilities/shared/security.md +174 -0
  51. package/templates/capabilities/shared/semantic-boundary-check.md +140 -0
  52. package/templates/capabilities/shared/session-rhythm.md +42 -0
  53. package/templates/capabilities/shared/tdd.md +54 -0
  54. package/templates/capabilities/shared/vocabulary-transform.md +63 -0
  55. package/templates/commands/add.md +152 -0
  56. package/templates/commands/audit.md +123 -0
  57. package/templates/commands/blueprint.md +115 -0
  58. package/templates/commands/copilot.md +157 -0
  59. package/templates/commands/create.md +156 -0
  60. package/templates/commands/debate.md +75 -0
  61. package/templates/commands/deps.md +112 -0
  62. package/templates/commands/doc.md +100 -0
  63. package/templates/commands/dream.md +120 -0
  64. package/templates/commands/evolve.md +170 -0
  65. package/templates/commands/explain.md +25 -0
  66. package/templates/commands/find.md +100 -0
  67. package/templates/commands/fix.md +122 -0
  68. package/templates/commands/hookify.md +100 -0
  69. package/templates/commands/level-up.md +48 -0
  70. package/templates/commands/loop.md +62 -0
  71. package/templates/commands/migrate.md +119 -0
  72. package/templates/commands/persist.md +73 -0
  73. package/templates/commands/pulse.md +87 -0
  74. package/templates/commands/refactor.md +97 -0
  75. package/templates/commands/reflect.md +107 -0
  76. package/templates/commands/reflexes.md +141 -0
  77. package/templates/commands/setup.md +97 -0
  78. package/templates/commands/ship.md +131 -0
  79. package/templates/commands/snapshot.md +70 -0
  80. package/templates/commands/test.md +86 -0
  81. package/templates/hooks/post-tool-use.js +175 -0
  82. package/templates/hooks/stop.js +85 -0
  83. package/templates/hooks/user-prompt.js +96 -0
  84. package/templates/scripts/env-scan.sh +46 -0
  85. package/templates/scripts/import-graph.sh +88 -0
  86. package/templates/scripts/validate-boundaries.sh +180 -0
  87. package/templates/skills/agent-creator/SKILL.md +91 -0
  88. package/templates/skills/agent-creator/examples/sample-agent.md +80 -0
  89. package/templates/skills/agent-creator/references/agent-engineering-guide.md +596 -0
  90. package/templates/skills/agent-creator/references/quality-checklist.md +42 -0
  91. package/templates/skills/agent-creator/scripts/scaffold.sh +144 -0
  92. package/templates/skills/architecture-advisor/SKILL.md +92 -0
  93. package/templates/skills/architecture-advisor/references/database-decisions.md +61 -0
  94. package/templates/skills/architecture-advisor/references/decision-matrices.md +122 -0
  95. package/templates/skills/architecture-advisor/references/rendering-decisions.md +39 -0
  96. package/templates/skills/architecture-advisor/scripts/detect-scale.sh +67 -0
  97. package/templates/skills/debate/SKILL.md +36 -0
  98. package/templates/skills/debate/references/acemad-protocol.md +72 -0
  99. package/templates/skills/env-scanner/SKILL.md +41 -0
  100. package/templates/skills/security/SKILL.md +44 -0
  101. package/templates/skills/security/references/security-details.md +48 -0
  102. package/templates/skills/session-guard/SKILL.md +33 -0
  103. package/templates/skills/skill-creator/SKILL.md +82 -0
  104. package/templates/skills/skill-creator/examples/sample-skill.md +74 -0
  105. package/templates/skills/skill-creator/references/quality-checklist.md +36 -0
  106. package/templates/skills/skill-creator/references/skill-engineering-guide.md +365 -0
  107. package/templates/skills/skill-creator/scripts/scaffold.sh +75 -0
  108. package/templates/skills/test-first/SKILL.md +41 -0
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "azclaude-marketplace",
3
+ "description": "AZCLAUDE — The operating system for Claude Code",
4
+ "owner": {
5
+ "name": "haytamAroui",
6
+ "url": "https://github.com/haytamAroui"
7
+ },
8
+ "plugins": [
9
+ {
10
+ "name": "azclaude",
11
+ "description": "The operating system for Claude Code. Memory, auto-tracking, agents, skills, intelligence, evolution — orchestrating Claude Code's native architecture. Zero external dependencies. One command to set up.",
12
+ "version": "1.0.0",
13
+ "source": {
14
+ "source": "github",
15
+ "repo": "haytamAroui/AZ-CLAUDE",
16
+ "ref": "main"
17
+ },
18
+ "author": {
19
+ "name": "haytamAroui",
20
+ "url": "https://github.com/haytamAroui"
21
+ },
22
+ "homepage": "https://github.com/haytamAroui/AZ-CLAUDE",
23
+ "license": "MIT",
24
+ "keywords": ["memory", "setup", "agents", "commands", "hooks", "domain-aware"]
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "azclaude",
3
+ "version": "1.0.0",
4
+ "description": "The operating system for Claude Code. Memory, auto-tracking, agents, skills, intelligence, evolution — orchestrating Claude Code's native architecture. Zero external dependencies. One command to set up.",
5
+ "author": {
6
+ "name": "haytamAroui",
7
+ "url": "https://github.com/haytamAroui"
8
+ },
9
+ "homepage": "https://github.com/haytamAroui/AZ-CLAUDE/blob/main/DOCS.md",
10
+ "repository": "https://github.com/haytamAroui/AZ-CLAUDE",
11
+ "license": "MIT",
12
+ "keywords": ["memory", "setup", "agents", "commands", "context", "lazy-loading", "hooks", "domain-aware"],
13
+ "commands": "./templates/commands/",
14
+ "skills": "./templates/skills/",
15
+ "agents": "./templates/agents/",
16
+ "hooks": "./hooks/hooks.json"
17
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 haytamAroui
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,477 @@
1
+ <p align="center">
2
+ <h1 align="center">AZCLAUDE COPILOT</h1>
3
+ <p align="center"><strong>Describe a product once. Walk away. Come back to a deployed app with full git history.</strong></p>
4
+ <p align="center">
5
+ <a href="https://www.npmjs.com/package/azclaude-copilot"><img src="https://img.shields.io/npm/v/azclaude-copilot.svg" alt="npm version"></a>
6
+ <a href="https://github.com/haytamAroui/AZ-CLAUDE-COPILOT/actions"><img src="https://img.shields.io/badge/tests-1002%20passing-brightgreen" alt="tests"></a>
7
+ <a href="https://github.com/haytamAroui/AZ-CLAUDE-COPILOT/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license"></a>
8
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D16-brightgreen" alt="node version"></a>
9
+ </p>
10
+ <p align="center">
11
+ <a href="#one-command">One Command</a> ·
12
+ <a href="#how-it-works">How It Works</a> ·
13
+ <a href="#the-pipeline">Pipeline</a> ·
14
+ <a href="#evidence-based-intelligence">Intelligence</a> ·
15
+ <a href="#memory-system">Memory</a> ·
16
+ <a href="#all-26-commands">Commands</a> ·
17
+ <a href="DOCS.md">Full Docs</a>
18
+ </p>
19
+ </p>
20
+
21
+ ---
22
+
23
+ ## The Problem
24
+
25
+ Every AI coding tool makes you the project manager. You prompt, review, approve, prompt again. You are the bottleneck. Context resets every session. Agents don't learn. Nothing accumulates.
26
+
27
+ **AZCLAUDE Copilot removes you from the loop entirely.**
28
+
29
+ ```
30
+ Input: "Build EU AI Act compliance SaaS with trilingual support"
31
+ Output: Deployed product with full git history, evolved agents, copilot-report.md
32
+
33
+ Human input after first message: ZERO
34
+ ```
35
+
36
+ ---
37
+
38
+ ## One Command
39
+
40
+ ```bash
41
+ npx azclaude-copilot . "EU AI Act compliance SaaS. Free deterministic
42
+ classification terminal. Paid 30-question assessment with PDF report.
43
+ FastAPI backend. Next.js frontend. Supabase. Trilingual EN/FR/NL. Stripe."
44
+ ```
45
+
46
+ Walk away. Come back to:
47
+ - Full git history (one commit per milestone)
48
+ - Deployed product
49
+ - `copilot-report.md` with everything that was built
50
+ - Evolved environment with project-specific agents and learned reflexes
51
+
52
+ Resume anytime: `npx azclaude-copilot .`
53
+
54
+ ---
55
+
56
+ ## How It Works
57
+
58
+ Three layers. The runner is dumb. The brain is smart. The environment accumulates.
59
+
60
+ ```
61
+ +-----------------------------------------------------------+
62
+ | LAYER 1: THE RUNNER (bin/copilot.js) |
63
+ | Node.js. Stateless. Dumb on purpose. |
64
+ | Restarts Claude Code sessions until COPILOT_COMPLETE. |
65
+ | Reads nothing. Decides nothing. Just loops. |
66
+ +-----------------------------------------------------------+
67
+ | LAYER 2: THE BRAIN (AZCLAUDE inside each session) |
68
+ | Reads goals.md, plan.md, checkpoint, patterns, |
69
+ | blockers, decisions, reflexes, context artifacts |
70
+ | Decides what to do next. Builds. Tests. Commits. |
71
+ | Updates all state files before session ends. |
72
+ +-----------------------------------------------------------+
73
+ | LAYER 3: THE ENVIRONMENT (accumulates across sessions) |
74
+ | Project agents emerge from git evidence (/evolve) |
75
+ | Reflexes learned from tool-use observations |
76
+ | Skills created when patterns repeat |
77
+ | Conventions solidify in CLAUDE.md |
78
+ | The environment gets smarter every session. |
79
+ +-----------------------------------------------------------+
80
+ ```
81
+
82
+ Runner loops. AZCLAUDE accumulates. Claude thinks.
83
+
84
+ ---
85
+
86
+ ## The Pipeline
87
+
88
+ Every command detects copilot mode automatically (`[ -f .claude/copilot-intent.md ]`) and skips human interaction -- no approval gates, no prompts, no pauses.
89
+
90
+ ```
91
+ Session 1: /dream -> /blueprint -> /add M1 -> /add M2 -> /add M3 -> /snapshot
92
+ Session 2: /evolve -> /add M4 -> /add M5 -> /add M6 -> /snapshot
93
+ Session 3: /evolve -> /add M7 -> /add M8 -> /add M9 -> /snapshot
94
+ Session 4: /evolve -> /audit -> /ship -> COPILOT_COMPLETE
95
+ ```
96
+
97
+ ### Per Milestone
98
+
99
+ 1. Read milestone from `plan.md` (description, expected files, dependencies)
100
+ 2. Implement using `/add` (follows `patterns.md`, reads context artifacts, uses project agents)
101
+ 3. Run tests -- fix if failing (2 attempts max)
102
+ 4. If still failing -- log to `blockers.md`, skip, continue
103
+ 5. Commit: `{type}: {what} -- {why}`
104
+ 6. Push + update `plan.md` status to `done`
105
+ 7. `/snapshot` (compaction protection)
106
+
107
+ ### Self-Healing
108
+
109
+ When builds fail:
110
+ - Re-read error, check `antipatterns.md`, try alternative approach
111
+ - Record failure to `antipatterns.md` (every failure teaches the environment)
112
+ - Record success to `patterns.md`
113
+ - If stuck, `/debate` finds alternative approach from blocker context
114
+
115
+ ### Blocker Recovery
116
+
117
+ After all non-blocked milestones complete:
118
+ - Retry blocked milestones with full project context now available
119
+ - Often unblocked by later work
120
+ - If still stuck, `/debate` evaluates; if no solution, mark `skipped`
121
+
122
+ ---
123
+
124
+ ## What Makes It Different
125
+
126
+ | Feature | Claude Code | Ralph Loop | Lovable | Cursor | AZCLAUDE Copilot |
127
+ |---------|------------|------------|---------|--------|-----------------|
128
+ | Autonomous loop | -- | Yes | -- | -- | Yes |
129
+ | Memory across sessions | -- | Git only | -- | -- | Goals + checkpoints + patterns + reflexes |
130
+ | Self-evolving agents | -- | -- | -- | -- | Yes (from git evidence) |
131
+ | Learned reflexes | -- | -- | -- | -- | Yes (confidence-scored) |
132
+ | Convention enforcement | -- | -- | -- | -- | Yes (CLAUDE.md + patterns.md) |
133
+ | Architecture advisor | -- | -- | -- | -- | Yes (8 decision matrices) |
134
+ | Domain advisor generation | -- | -- | -- | -- | Yes (7 domains) |
135
+ | Context artifact discovery | -- | -- | -- | -- | Yes (schemas, specs, configs) |
136
+ | Any stack | Yes | Yes | Next.js only | Yes | Yes |
137
+ | You own the code | Yes | Yes | -- | Yes | Yes |
138
+ | Zero dependencies | Yes | Yes | -- | -- | Yes (0 in package.json) |
139
+ | Deploy included | -- | -- | Yes | -- | Yes |
140
+
141
+ ---
142
+
143
+ ## Evidence-Based Intelligence
144
+
145
+ ### Reflexes -- Learned Behavioral Patterns
146
+
147
+ AZCLAUDE observes tool-use patterns across sessions and extracts atomic behaviors called reflexes. Each reflex is confidence-scored, domain-tagged, and evidence-backed.
148
+
149
+ ```yaml
150
+ id: grep-before-edit
151
+ trigger: "when modifying code files"
152
+ action: "Search with Grep first, confirm with Read, then Edit"
153
+ confidence: 0.7 # 0.3 tentative -> 0.9 certain
154
+ evidence_count: 8
155
+ ```
156
+
157
+ - PostToolUse hook captures observations to `observations.jsonl` automatically
158
+ - 3+ occurrences of a pattern creates a reflex
159
+ - Confidence decays at -0.02/week without observation (stale patterns auto-prune)
160
+ - Strong reflex clusters evolve into skills or agents via `/evolve`
161
+ - Global scope promotion when seen in 2+ projects with confidence >= 0.8
162
+
163
+ ### Architecture Advisor -- 8 Decision Matrices
164
+
165
+ Auto-fires on architecture decisions. Claude knows every framework; this skill guides **when to use which** based on project scale (SMALL/MEDIUM/LARGE):
166
+
167
+ | Decision area | Example guidance |
168
+ |--------------|-----------------|
169
+ | Architecture | SMALL: flat modules. MEDIUM: modular monolith. LARGE: monolith + targeted microservices |
170
+ | Database | SMALL: SQLite. MEDIUM+: PostgreSQL. Cache: Redis. Search: Postgres FTS first |
171
+ | Rendering | Marketing: SSG. Dashboards: SSR. Admin: SPA. Products: ISR |
172
+ | Testing | MVP: test-after critical paths. MEDIUM: TDD for business logic. LARGE: full TDD |
173
+ | API design | Internal: tRPC. Public: REST. Mobile: GraphQL. Real-time: WebSocket/SSE |
174
+ | State mgmt | Simple: useState. Server data: TanStack Query. Complex: Zustand. Workflows: XState |
175
+ | Deployment | MVP: Vercel/Railway. Scale: AWS/GCP with IaC |
176
+ | Auth | Small: Clerk/Supabase. Large: Auth0/Keycloak |
177
+
178
+ Every recommendation includes the **threshold where it changes** and the **anti-pattern** to avoid.
179
+
180
+ ### Domain Advisor Generator -- 7 Non-Tech Domains
181
+
182
+ When `/dream` detects a non-developer domain, it auto-generates a domain-specific advisor skill with decision matrices, best practices, and anti-patterns:
183
+
184
+ | Domain | Generated decisions |
185
+ |--------|-------------------|
186
+ | Compliance | Regulation mapping, evidence strategy, assessment approach, documentation depth |
187
+ | Marketing | Channel strategy, funnel design, pricing model, KPI focus by revenue stage |
188
+ | Finance | Data model (event-sourced), calculation precision (integer-cents), reconciliation |
189
+ | Medical | Data standard (FHIR vs HL7), privacy model (HIPAA vs GDPR), terminology |
190
+ | Research | Literature scope, methodology, experiment design, statistical rigor |
191
+ | Legal | Contract structure, clause tracking, jurisdiction, risk classification |
192
+ | Logistics | Routing, inventory model, tracking granularity |
193
+
194
+ ### Agent Emergence
195
+
196
+ Copilot starts with **zero project agents**. They emerge from the work.
197
+
198
+ ```
199
+ Session 1 (milestones 1-3):
200
+ 0 project agents. Build basic structure.
201
+ Git: 3 commits touching fastapi/, next/, supabase/
202
+
203
+ Session 2 (milestones 4-6):
204
+ /evolve reads git log
205
+ 15 files in fastapi/ -> creates cc-fastapi agent
206
+ 8 files in next/ with i18n patterns -> creates cc-frontend-i18n agent
207
+ 2 agents, both from real code patterns
208
+
209
+ Session 3 (milestones 7-9):
210
+ Compliance logic repeating across 6 files -> creates cc-compliance-engine agent
211
+ 3 project agents, all from evidence
212
+ Environment specialized for THIS project
213
+
214
+ Session 4:
215
+ Full evolved environment. /audit -> /ship -> deploy. COPILOT_COMPLETE
216
+ ```
217
+
218
+ System agents (code-reviewer, test-writer, orchestrator-init) run the framework. Project agents emerge from the work. Two separate layers.
219
+
220
+ ### Context Artifacts
221
+
222
+ Before implementing any feature, AZCLAUDE scans for non-code knowledge that informs implementation:
223
+
224
+ | Type | Examples | Why it matters |
225
+ |------|---------|---------------|
226
+ | Database schemas | schema.sql, prisma/schema.prisma | Know table structure before writing queries |
227
+ | API specs | openapi.yaml, swagger.json, .proto files | Know endpoints before building integrations |
228
+ | Infra configs | terraform/, docker-compose.yml | Know deployment constraints before architecture decisions |
229
+ | Architecture docs | docs/architecture.md, ADRs | Know design decisions before proposing changes |
230
+ | Domain knowledge | knowledge/, business rules | Know domain constraints before implementing logic |
231
+
232
+ Artifact discovery runs automatically in copilot mode. `/evolve` checks for stale references.
233
+
234
+ ---
235
+
236
+ ## All 26 Commands
237
+
238
+ ### Build and Ship
239
+
240
+ | Command | What it does |
241
+ |---------|-------------|
242
+ | `/copilot` | Autonomous milestone execution. Plan, build, test, commit, evolve, ship. Zero human input. |
243
+ | `/dream` | Idea to full project scaffold. Rules, memory, skills, agents -- built level by level. |
244
+ | `/setup` | Analyze existing project. Detect domain + stack + scale. Build environment. |
245
+ | `/add` | Add a feature. In copilot mode: uses milestone spec directly. |
246
+ | `/fix` | REPRODUCE, INVESTIGATE, HYPOTHESIZE, FIX -- show passing tests. |
247
+ | `/audit` | Spec-first review (read-only). In copilot mode: reviews against copilot-intent.md. |
248
+ | `/test` | IDE diagnostics, framework detection, exit-code gate, failure classification. |
249
+ | `/blueprint` | Read-only analysis. Structured plan.md with milestones. In copilot mode: skips approval. |
250
+ | `/ship` | Tests, secrets scan, commit, push. In copilot mode: auto-deploys. |
251
+ | `/refactor` | Restructure safely. Tests before + after. Worktree isolation for risky changes. |
252
+ | `/doc` | Generate docs from code. Matches existing style. |
253
+ | `/migrate` | Upgrade deps/frameworks. Researches breaking changes. |
254
+ | `/deps` | Audit: outdated, vulnerable, unused packages. |
255
+
256
+ ### Think and Improve
257
+
258
+ | Command | What it does |
259
+ |---------|-------------|
260
+ | `/debate` | Adversarial debate with evidence scoring (AceMAD protocol). Order-independent, length-independent. |
261
+ | `/evolve` | Scan for gaps, generate fixes, quality-gate them. Create agents from evidence. 3 cycles. |
262
+ | `/reflexes` | View/analyze learned behavioral patterns. Confidence scoring. Promote to global scope. |
263
+ | `/level-up` | Show current level (0-10), build the next one. |
264
+ | `/find` | Search across commands, ~/shared-skills/, capabilities. |
265
+ | `/create` | Build a new command with frontmatter and tests. |
266
+ | `/reflect` | Self-improve CLAUDE.md from conversation friction. |
267
+ | `/hookify` | Generate hooks from friction patterns. 5 hook types. |
268
+
269
+ ### Memory and Session
270
+
271
+ | Command | What it does |
272
+ |---------|-------------|
273
+ | `/snapshot` | Mid-session snapshot: WHY + decisions + what's next. |
274
+ | `/persist` | End-of-session: goals, friction log, session summary. |
275
+ | `/pulse` | Health check + recent changes + current level. |
276
+ | `/explain` | Code or error to plain language. |
277
+ | `/loop` | Repeat any command on an interval via CronCreate. |
278
+
279
+ ---
280
+
281
+ ## 8 Skills (Auto-Invoked)
282
+
283
+ Skills fire automatically based on context -- no slash command needed.
284
+
285
+ | Skill | Triggers on |
286
+ |-------|------------|
287
+ | session-guard | Session start, context reset, idle detection |
288
+ | test-first | Writing/fixing code in TDD projects |
289
+ | env-scanner | Project setup, stack detection |
290
+ | debate | Decisions, trade-offs, comparisons |
291
+ | security | Credentials, auth, payments, secrets |
292
+ | skill-creator | "Create a skill", repeated workflows |
293
+ | agent-creator | "Create an agent", agent boundaries |
294
+ | architecture-advisor | Architecture decisions, which pattern/DB/framework for this project size |
295
+
296
+ Each skill has: `SKILL.md` (lean workflow), `references/` (deep content), `scripts/` (deterministic detection).
297
+
298
+ ---
299
+
300
+ ## Memory System
301
+
302
+ Three layers work silently. Context compaction stops being a problem.
303
+
304
+ ```
305
+ +--------------------------------------------------------------+
306
+ | AUTOMATIC LAYER |
307
+ | (zero user input required) |
308
+ | |
309
+ | PostToolUse hook --> goals.md --> UserPromptSubmit |
310
+ | (fires on every edit) (rolling ledger) (injects before |
311
+ | your message) |
312
+ | |
313
+ | Stop hook --> migrates "In progress" to "Done" |
314
+ +--------------------------------------------------------------+
315
+ | MANUAL LAYER |
316
+ | (user triggers when ready) |
317
+ | |
318
+ | /snapshot --> checkpoints/{timestamp}.md |
319
+ | (WHY you made decisions -- every 15-20 turns) |
320
+ | |
321
+ | /persist --> sessions/{date}-{topic}.md |
322
+ | (full session narrative -- before closing) |
323
+ +--------------------------------------------------------------+
324
+ ```
325
+
326
+ | Layer | Mechanism | Survives compaction | Automatic |
327
+ |-------|-----------|-------------------|-----------|
328
+ | File breadcrumb | PostToolUse -> goals.md | Yes -- WHERE + WHAT changed | Yes, every edit |
329
+ | Reasoning snapshot | /snapshot -> checkpoints/ | Yes -- WHY decisions were made | Manual, every 15-20 turns |
330
+ | Session narrative | /persist -> sessions/ | Yes -- full summary + next actions | Manual, before closing |
331
+
332
+ `UserPromptSubmit` hook injects `goals.md` + latest checkpoint before every message. Token cost: ~500 tokens fixed, regardless of project history length.
333
+
334
+ ---
335
+
336
+ ## Security
337
+
338
+ Zero dependencies in `package.json`. The only external binary is `claude` CLI (installed separately). This eliminates supply-chain risk entirely.
339
+
340
+ ### 6 Security Layers
341
+
342
+ 1. **Hook integrity** -- SHA-256 hash verified on every run
343
+ 2. **Command injection protection** -- shell metacharacters rejected in file paths
344
+ 3. **Prompt injection defense** -- suspicious patterns stripped from context injection (`curl|bash`, `ignore previous instructions`, base64 blocks)
345
+ 4. **Skill checksums** -- portable skills SHA-256 hashed, imports fail if tampered
346
+ 5. **Credential auditing** -- `/ship` blocks on `.env`, API keys, tokens before any git push
347
+ 6. **Agent scoping** -- review agents read-only (`EnterPlanMode`), experiments in isolated worktrees
348
+
349
+ ### Hook Profiles
350
+
351
+ Control hook behavior via environment variable:
352
+
353
+ ```bash
354
+ AZCLAUDE_HOOK_PROFILE=minimal claude # goals.md tracking only
355
+ AZCLAUDE_HOOK_PROFILE=standard claude # all features (default)
356
+ AZCLAUDE_HOOK_PROFILE=strict claude # all features + extra validation
357
+ ```
358
+
359
+ ### Doctor Audit
360
+
361
+ ```bash
362
+ npx azclaude doctor # 32 checks: hooks, settings, commands, memory
363
+ npx azclaude doctor --audit # efficiency + security score
364
+ ```
365
+
366
+ See [SECURITY.md](SECURITY.md) for full details including known limitations and copilot-mode mitigations.
367
+
368
+ ---
369
+
370
+ ## Installation
371
+
372
+ ### Install the AZCLAUDE environment
373
+
374
+ ```bash
375
+ npx azclaude
376
+ ```
377
+
378
+ Works with Claude Code, Gemini CLI, Codex, OpenCode, and Cursor. Auto-detects your CLI and installs to the correct paths.
379
+
380
+ ### Run /setup inside your project
381
+
382
+ ```bash
383
+ /setup
384
+ ```
385
+
386
+ ### Verify
387
+
388
+ ```bash
389
+ npx azclaude doctor
390
+ ```
391
+
392
+ ### Run Copilot (autonomous mode)
393
+
394
+ ```bash
395
+ # New project -- describe and walk away
396
+ npx azclaude-copilot . "Build a REST API with auth and Stripe"
397
+
398
+ # From intent file
399
+ npx azclaude-copilot . intent.md
400
+
401
+ # With session limit
402
+ npx azclaude-copilot . "my app" 30
403
+
404
+ # Resume (reads existing plan.md)
405
+ npx azclaude-copilot .
406
+ ```
407
+
408
+ ### Exit Conditions
409
+
410
+ | Condition | Exit code |
411
+ |-----------|-----------|
412
+ | `COPILOT_COMPLETE` in goals.md | 0 -- product shipped |
413
+ | Max sessions reached (default: 20) | 1 -- resume with `npx azclaude-copilot .` |
414
+ | All milestones blocked | 1 -- needs human intervention |
415
+
416
+ ---
417
+
418
+ ## Project Structure
419
+
420
+ ```
421
+ azclaude-copilot/
422
+ ├── bin/
423
+ │ ├── cli.js <- installer, doctor, demo
424
+ │ └── copilot.js <- autonomous runner (Node.js, cross-platform)
425
+ ├── templates/
426
+ │ ├── CLAUDE.md <- dispatch table template
427
+ │ ├── hooks/ <- pure Node.js, cross-platform
428
+ │ │ ├── user-prompt.js <- injects goals.md + checkpoint at session start
429
+ │ │ ├── post-tool-use.js <- writes file + diff stat on every edit
430
+ │ │ └── stop.js <- migrates In progress -> Done
431
+ │ ├── agents/ (7) <- system + project agents
432
+ │ ├── capabilities/ <- 36 files, lazy-loaded via manifest.md
433
+ │ ├── commands/ (26) <- all 26 commands including /copilot, /reflexes
434
+ │ ├── skills/ (8) <- auto-invoked SKILL.md files + architecture-advisor
435
+ │ └── scripts/env-scan.sh
436
+ ├── ROADMAP.md <- 5-phase build spec
437
+ ├── DOCS.md <- full user guide
438
+ ├── SECURITY.md <- security policy + architecture
439
+ ├── tests/
440
+ │ └── test-features.sh ← 1035 tests
441
+ ```
442
+
443
+ ---
444
+
445
+ ## State Files
446
+
447
+ The runner is stateless. These files ARE the state.
448
+
449
+ | File | Written by | Read by | Purpose |
450
+ |------|-----------|---------|---------|
451
+ | `.claude/copilot-intent.md` | Runner | /dream, /copilot | Original product description |
452
+ | `.claude/plan.md` | /blueprint | /copilot, /add | Milestone tracker with status |
453
+ | `.claude/memory/goals.md` | Hooks | Every session start | File breadcrumbs + session state |
454
+ | `.claude/memory/checkpoints/*` | /snapshot | Every session start | Reasoning snapshots |
455
+ | `.claude/memory/patterns.md` | /evolve, agents | Agents, /add | What works |
456
+ | `.claude/memory/antipatterns.md` | /evolve, agents | Agents, /add | What broke |
457
+ | `.claude/memory/decisions.md` | /debate | Agents | Architecture choices |
458
+ | `.claude/memory/blockers.md` | /copilot | /copilot, /debate | What's stuck and why |
459
+ | `.claude/memory/reflexes/` | /reflexes, hooks | /evolve, agents | Learned behavioral patterns |
460
+ | `.claude/copilot-report.md` | /copilot | Human | Final summary |
461
+
462
+ ---
463
+
464
+ ## Verified
465
+
466
+ 1035 tests. Every template, command, capability, agent, and CLI feature verified.
467
+
468
+ ```bash
469
+ bash tests/test-features.sh
470
+ # Results: 1035 passed, 0 failed, 1035 total
471
+ ```
472
+
473
+ ---
474
+
475
+ ## License
476
+
477
+ MIT -- [haytamAroui](https://github.com/haytamAroui)