create-ccc-tutor 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 (106) hide show
  1. package/README.md +41 -0
  2. package/bin/cli.js +76 -0
  3. package/package.json +28 -0
  4. package/template/.claude/commands/abandon.md +7 -0
  5. package/template/.claude/commands/add-anti-flag.md +7 -0
  6. package/template/.claude/commands/add-constitution-clause.md +7 -0
  7. package/template/.claude/commands/audit-spec.md +7 -0
  8. package/template/.claude/commands/commit.md +7 -0
  9. package/template/.claude/commands/constitution-edit.md +7 -0
  10. package/template/.claude/commands/db-schema.md +7 -0
  11. package/template/.claude/commands/exam.md +66 -0
  12. package/template/.claude/commands/execution-plan.md +7 -0
  13. package/template/.claude/commands/feature-draft.md +7 -0
  14. package/template/.claude/commands/handoff.md +7 -0
  15. package/template/.claude/commands/implement.md +7 -0
  16. package/template/.claude/commands/init.md +7 -0
  17. package/template/.claude/commands/next.md +7 -0
  18. package/template/.claude/commands/offload.md +7 -0
  19. package/template/.claude/commands/pickup.md +7 -0
  20. package/template/.claude/commands/recall.md +7 -0
  21. package/template/.claude/commands/remember.md +7 -0
  22. package/template/.claude/commands/slide.md +87 -0
  23. package/template/.claude/commands/spec-finalize.md +7 -0
  24. package/template/.claude/commands/test-fix.md +7 -0
  25. package/template/.claude/commands/uninstall.md +7 -0
  26. package/template/.claude/settings.json +161 -0
  27. package/template/.claude-plugin/plugin.json +41 -0
  28. package/template/.codex/config.toml +24 -0
  29. package/template/.codex/hooks.json +4 -0
  30. package/template/.codex/install-skills.sh +18 -0
  31. package/template/.codex/skills/exam/SKILL.md +61 -0
  32. package/template/.codex/skills/slide/SKILL.md +69 -0
  33. package/template/.harness/agents/README.md +70 -0
  34. package/template/.harness/agents/_template/junior-agent-template.md +116 -0
  35. package/template/.harness/agents/backend-reviewer.md +153 -0
  36. package/template/.harness/agents/frontend-reviewer.md +158 -0
  37. package/template/.harness/agents/security-reviewer.md +148 -0
  38. package/template/.harness/agents/test-fixer.md +147 -0
  39. package/template/.harness/docs/doc-sync.md +29 -0
  40. package/template/.harness/docs/git-hygiene.md +56 -0
  41. package/template/.harness/docs/spec-model.md +47 -0
  42. package/template/.harness/docs/tool-map.md +120 -0
  43. package/template/.harness/docs/workflow.md +59 -0
  44. package/template/.harness/scripts/README.md +70 -0
  45. package/template/.harness/scripts/auditor-gate.sh +388 -0
  46. package/template/.harness/scripts/bootstrap-check.sh +103 -0
  47. package/template/.harness/scripts/budget-monitor.sh +223 -0
  48. package/template/.harness/scripts/check-prereqs.sh +165 -0
  49. package/template/.harness/scripts/checkpoint-recall.sh +136 -0
  50. package/template/.harness/scripts/checkpoint-write.sh +281 -0
  51. package/template/.harness/scripts/decision-log-append.sh +90 -0
  52. package/template/.harness/scripts/env-check.sh +286 -0
  53. package/template/.harness/scripts/format-edit.sh +80 -0
  54. package/template/.harness/scripts/lint-bans.sh +110 -0
  55. package/template/.harness/scripts/memory-archive.sh +129 -0
  56. package/template/.harness/scripts/memory-recall.sh +197 -0
  57. package/template/.harness/scripts/memory-snapshot.sh +124 -0
  58. package/template/.harness/scripts/post-migration.sh +58 -0
  59. package/template/.harness/scripts/precommit-cycles.sh +74 -0
  60. package/template/.harness/scripts/precommit-typecheck.sh +69 -0
  61. package/template/.harness/scripts/scratchpad-recall.sh +83 -0
  62. package/template/.harness/scripts/scratchpad-update.sh +39 -0
  63. package/template/.harness/scripts/standalone-bootstrap.md +443 -0
  64. package/template/.harness/skills/abandon/SKILL.md +157 -0
  65. package/template/.harness/skills/add-anti-flag/SKILL.md +205 -0
  66. package/template/.harness/skills/add-constitution-clause/SKILL.md +244 -0
  67. package/template/.harness/skills/audit-spec/SKILL.md +395 -0
  68. package/template/.harness/skills/commit/SKILL.md +270 -0
  69. package/template/.harness/skills/constitution-edit/SKILL.md +292 -0
  70. package/template/.harness/skills/db-schema/SKILL.md +145 -0
  71. package/template/.harness/skills/db-schema/references/methodology.md +202 -0
  72. package/template/.harness/skills/execution-plan/SKILL.md +346 -0
  73. package/template/.harness/skills/feature-draft/SKILL.md +426 -0
  74. package/template/.harness/skills/handoff/SKILL.md +211 -0
  75. package/template/.harness/skills/implement/SKILL.md +355 -0
  76. package/template/.harness/skills/init/SKILL.md +805 -0
  77. package/template/.harness/skills/next/SKILL.md +245 -0
  78. package/template/.harness/skills/offload/SKILL.md +134 -0
  79. package/template/.harness/skills/pickup/SKILL.md +213 -0
  80. package/template/.harness/skills/recall/SKILL.md +159 -0
  81. package/template/.harness/skills/remember/SKILL.md +205 -0
  82. package/template/.harness/skills/spec-finalize/SKILL.md +196 -0
  83. package/template/.harness/skills/test-fix/SKILL.md +363 -0
  84. package/template/.harness/skills/uninstall/SKILL.md +370 -0
  85. package/template/.harness/state/install.json +83 -0
  86. package/template/AGENTS.md +262 -0
  87. package/template/CCC_MAGI_LICENSE +201 -0
  88. package/template/CCC_MAGI_README.md +986 -0
  89. package/template/CLAUDE.md +658 -0
  90. package/template/codex.md +39 -0
  91. package/template/constitution.md +164 -0
  92. package/template/course/README.md +15 -0
  93. package/template/course/course_code(example)/exam/README.md +2 -0
  94. package/template/course/course_code(example)/slide/slide_example-1.pdf +40 -0
  95. package/template/course/course_code(example)/slide/slide_example-2.pdf +40 -0
  96. package/template/docs/features/slide-query-implementation.md +79 -0
  97. package/template/docs/features/slide-query.md +211 -0
  98. package/template/docs-harness/README.md +42 -0
  99. package/template/docs-harness/adoption-playbook.md +373 -0
  100. package/template/docs-harness/ccc-step1-driver-template.md +288 -0
  101. package/template/docs-harness/cli-configs-README.md +78 -0
  102. package/template/docs-harness/context-architecture-v2.md +249 -0
  103. package/template/docs-harness/design-spec.md +437 -0
  104. package/template/docs-harness/memory-layer.md +135 -0
  105. package/template/docs-harness/retrospective-notes.md +204 -0
  106. package/template/gitignore +106 -0
@@ -0,0 +1,986 @@
1
+ # CCC-MAGI
2
+
3
+ > **An AI-coding harness that turns vibe coding into a maintainable project.**
4
+ > Cross-model audit on every change · plain-language specs · persistent memory across sessions · 7-position MAGI AI team · 20 natural-language skills · drop-in to any codebase.
5
+
6
+ **Read in your language**: **English** (this section) · [简体中文](#ccc-magi-中文版)
7
+
8
+ ---
9
+
10
+ ## What CCC-MAGI is, in one paragraph
11
+
12
+ When you let an AI write code, the AI is happy to give you 1000 lines of plausible-looking work in five minutes. Three weeks later, you can't tell which lines were carefully designed and which were guessed. You can't tell if the spec in your head still matches the code on disk. You can't tell which "fix" actually fixed anything. **CCC-MAGI is the harness that fixes this.** It sits in your project, talks to your AI CLI (Claude Code, Codex, etc.), and forces every change through a workflow: write a plain-language spec, get it audited by a *different* model, plan the files, implement, run tests, smoke-test by hand, commit. The discipline that a senior engineer would impose, but never has to be remembered — the harness enforces it mechanically.
13
+
14
+ It works the same way whether you're a hobbyist building your first side project, a solo professional shipping a SaaS, or a small team trying to keep three contributors' AI-generated code from contradicting each other.
15
+
16
+ ---
17
+
18
+ ## Who CCC-MAGI is for
19
+
20
+ | If you are... | What CCC-MAGI gives you |
21
+ |---|---|
22
+ | **Vibe-coding beginner** — you discovered Claude Code last month and your project is starting to feel like a haunted house | A safety net. Specs get written before code. A second AI reviews every change. You can't accidentally commit a 1000-line "improvement" without a smoke test. |
23
+ | **Creator who wants something stable** — you can read code but you're not a full-time engineer | Engineering discipline that doesn't depend on you remembering it. The hooks fire automatically; the constitution enforces project identity even after compaction. |
24
+ | **Solo professional** — you ship for a living and want AI to multiply you, not bury you | Cross-model audit (Claude × Codex) cancels single-model bias. Persistent memory means "what did we decide about auth last month" is one question, not a code-archaeology dig. |
25
+ | **Team of 2-5 doing vibe coding** — multiple contributors, shared codebase, AI everywhere | A shared constitution every teammate's AI reads first. Conventions stay aligned. Bug fixes have mandatory failing tests. Plan files are deleted at commit. |
26
+ | **Brownfield project that has outgrown casual AI use** — you have working code but no spec discipline | `/audit-spec` reverse-engineers the current code into a spec, then surfaces the deltas between what you *think* it does and what it *actually* does. Brownfield onboarding is a first-class path, not an afterthought. |
27
+
28
+ If you fit any of the above, you're the audience.
29
+
30
+ ---
31
+
32
+ ## Why it exists
33
+
34
+ Most AI-coding harnesses (BMAD, SpecKit, OpenSpec, etc.) are excellent but ship project-coupled — BMAD assumes React Native, SpecKit assumes GitHub Issues, etc. You can't lift their conventions into a Python backend or a Swift app.
35
+
36
+ CCC-MAGI extracts the universal mechanics — the parts that work regardless of language, framework, or team size — and packages them as a slot-driven template:
37
+
38
+ - **Cross-model audit** as a load-bearing invariant (not an optional layer)
39
+ - **Two-file feature spec model** (CEO domain in plain language; manager domain with tech detail in EARS notation)
40
+ - **Lane-aware workflow** (full / stability-fix / trivial — same flow, different gate intensity)
41
+ - **Three-tier persistent memory** (working scratchpad / 30-day recall / archive) — survives `/clear`, compaction, days off
42
+ - **MAGI 7-position AI team** (Core / Verdict / Planner / Programmer / Tester / Reviewer / Archivist) — clearly named roles, clear authority
43
+ - **Mechanical junior reviewers** (rules cite source docs, never invent rules)
44
+ - **Real-human smoke test as a contract** (AI's "done" doesn't count — Constitution § 1.4)
45
+ - **Spec-and-code drift detection** (`/audit-spec` reverse-engineers reality, surfaces deltas)
46
+ - **Natural-language interface** (you don't memorize slash commands — say what you want, the AI translates)
47
+
48
+ All of it filled in for **your** project's specifics via a one-time `/init` (5 questions in Simple mode, 16 in Pro mode).
49
+
50
+ ---
51
+
52
+ ## What it feels like in use
53
+
54
+ CCC-MAGI is **conversational, not CLI-driven**. You almost never type slash commands. Example dialogue:
55
+
56
+ ```
57
+ You: "I want to build a user login feature"
58
+
59
+ MAGI Core: "Got it — I'll start Stage 1 (spec draft). First, let me
60
+ paraphrase what I heard..."
61
+ (silently invokes /feature-draft user-login)
62
+ (walks paraphrase + 8 edge-case categories with live progress: 🔍 4/8)
63
+ (writes docs/features/user-login.md)
64
+
65
+ MAGI Core: "✅ Spec is ready. You can:
66
+ 👉 'continue' — I'll run the final audit
67
+ 👉 'show me' — read the spec aloud
68
+ 👉 'change X' — redo with new input
69
+ 👉 'drop it' — abandon the feature"
70
+
71
+ You: "continue"
72
+
73
+ MAGI Core: "Calling MAGI Verdict (Codex) for cross-model audit..."
74
+ (verdict PASS, risk 3)
75
+ "Stage 2 done. Design the database (Stage 3) or jump straight
76
+ to execution plan (Stage 4)?"
77
+
78
+ You: "continue"
79
+
80
+ MAGI Core: "This touches user tables, so Stage 3 first..."
81
+ (writes migration, audited)
82
+ "Stage 3 done. Move to execution plan?"
83
+
84
+ You: "continue"
85
+
86
+ MAGI Core: (writes per-file plan, surfaces in Claude Code's TodoWrite sidebar)
87
+ "📋 Plan written — 8 files to change. Quick sanity check:
88
+ 👉 'OK' — start coding
89
+ 👉 'change X' — modify plan"
90
+
91
+ You: "OK"
92
+
93
+ MAGI Core: (Stage 5: implements, TodoWrite ticks live ▶→✅ per file)
94
+ "✅ Stage 5 done. Move to tests?"
95
+
96
+ (...all the way through Stage 8 commit — never a slash command typed...)
97
+ ```
98
+
99
+ **Natural-language trigger table**: see `CLAUDE.md § MAGI Core's Natural-Language Intent Translation` for the full "you say X → I do Y" cheat-sheet.
100
+ **Sole exception**: Stage 7 (CEO manual smoke test) is **never** auto-invoked — the constitution requires a human verify with their own hands.
101
+
102
+ ---
103
+
104
+ ## Key features (the complete current list)
105
+
106
+ ### Workflow & quality gates
107
+
108
+ - **9-stage workflow**: draft → finalize → schema (optional) → plan → implement → test → smoke → commit → watch
109
+ - **3 lanes**: full (new feature) / stability-fix (bug fix with mandatory failing test) / trivial (<20 LOC)
110
+ - **Cross-model audit** at every gate (Claude ↔ Codex by default; single-model fresh-context fallback)
111
+ - **EARS notation** for functional requirements in the manager spec — directly mappable to test assertions
112
+ - **CEO smoke test** mandated by Constitution § 1.4 — AI cannot mark "done" without human verification
113
+ - **Spec-vs-reality drift detection** via `/audit-spec` (fresh-context subagent re-derives the spec from code)
114
+
115
+ ### MAGI 7-position AI team
116
+
117
+ A clearly named team with clearly assigned authority:
118
+
119
+ - **MAGI Core** — orchestrator (your primary CLI). Talks to you, dispatches the workflow
120
+ - **MAGI Verdict** — cross-model auditor (default: Codex). Independent judgment authority — not under MAGI Core's chain of command
121
+ - **MAGI Planner / Programmer / Tester** — MAGI Core in matching workflow stage (mode switch, not separate processes)
122
+ - **MAGI Reviewer** — mechanical junior reviewers (backend / frontend / security / test-fixer). Cite rules, never invent
123
+ - **MAGI Archivist** — memory hook services (SessionStart / PreCompaction)
124
+
125
+ ### 20 natural-language skills
126
+
127
+ You usually trigger these by saying what you want, not by typing slash commands:
128
+
129
+ | Skill | What it does |
130
+ |---|---|
131
+ | `/init` | First-time project configuration — Simple (5 questions, ~3 min) or Pro mode (16 questions, ~15 min) |
132
+ | `/feature-draft` | Stage 1 (new feature) — paraphrase intent + 8 edge-case categories + spec |
133
+ | `/audit-spec` | Stage 1 (audit existing code) — fresh subagent reverse-engineers as-built spec |
134
+ | `/spec-finalize` | Stage 2 — auditor cross-checks integration consistency |
135
+ | `/db-schema` | Stage 3 — schema design (skip if no backend) |
136
+ | `/execution-plan` | Stage 4 — per-file checklist + plan-time audit |
137
+ | `/implement` | Stage 5 — junior reviewers (mechanical) + cross-model audit |
138
+ | `/test-fix` | Stage 6 — test-fixer subagent + legitimacy audit |
139
+ | `/commit` | Stage 8 — Conventional Commits + plan-file deletion |
140
+ | `/next` | Workflow wayfinder — "where am I, what should I do?" |
141
+ | `/pickup` | Resume in-progress feature across sessions / devices / days |
142
+ | `/abandon` | Mark feature dead, archive checkpoint |
143
+ | `/handoff` | Generate rich 5-slot session snapshot at ~95% context budget |
144
+ | `/offload` | Spawn fresh-context subagent for a sub-task at ~75% budget |
145
+ | `/recall` | JIT memory fetch (manifest → body on demand) |
146
+ | `/remember` | Save an observation / decision / failure for future sessions |
147
+ | `/constitution-edit` | Edit Section 2 / Section 3 of constitution.md (with Sync Impact Report) |
148
+ | `/add-constitution-clause` | Add a project-wide red line to Section 3 |
149
+ | `/add-anti-flag` | Suppress an auditor false positive in AGENTS.md |
150
+ | `/uninstall` | Clean removal (with optional restore of prior harness) |
151
+
152
+ ### Three-tier persistent memory
153
+
154
+ Cross-session memory survives `/clear`, compaction, multi-day breaks:
155
+
156
+ | Tier | Location | Purpose | At SessionStart |
157
+ |---|---|---|---|
158
+ | **1 — Working** | `.harness/state/scratchpad.md` | Current objective / last+next step / blockers (≤500 tokens, rewritten every turn) | ✅ Always read |
159
+ | **2 — Recall** | `.harness/memory/sessions/recall/*.jsonl` | Last 30 days of decisions / failures / snapshots | ✅ Manifest only (~500–1000 tokens), bodies on demand |
160
+ | **3 — Archive** | `.harness/memory/sessions/archive/<YYYY-MM>.jsonl` | Older entries, cold storage | ❌ Only via `/recall --deep <query>` |
161
+
162
+ Bounded SessionStart cost (~1–1.5K tokens regardless of project age). Hard caps prevent "fetch everything to be safe" drift.
163
+
164
+ ### Locale-aware UX (i18n)
165
+
166
+ The harness detects your OS locale at session start. Internal files stay in English (token-efficient, model-friendly); user-facing prompts, menus, status reports translate automatically to `zh_CN` / `zh_TW` / `ja_JP` / `ko_KR` / other locales. Code identifiers, file paths, frontmatter never translated.
167
+
168
+ ### Three-section constitution that survives harness upgrades
169
+
170
+ `constitution.md` has three layered sections:
171
+
172
+ - **Section 1 — Universal Core** (harness-guaranteed, never editable by `/constitution-edit`): cross-model audit, data ownership, CEO final authority, mandatory smoke test, spec-reality sync
173
+ - **Section 2 — Project Identity** (filled by `/init`): tech stack, scale target, primary concern, out-of-scope, edge-case categories, etc.
174
+ - **Section 3 — Project Red Lines** (grown over time via `/add-constitution-clause`): your accumulated absolute rules
175
+
176
+ When you upgrade CCC-MAGI, Section 1 may change (carefully, with migration notes); Section 2 and 3 are yours and are preserved verbatim.
177
+
178
+ ### Tested CLI matrix
179
+
180
+ | Primary CLI | Auditor | Status |
181
+ |---|---|---|
182
+ | Claude Code | Codex CLI | ✅ **Tier 1** (end-to-end tested) |
183
+ | Codex CLI | Claude Code | ✅ **Tier 1** (roles reversed) |
184
+ | Single CLI (fallback) | Same model, fresh context | ⚠️ Tier 2 — works, but bias-cancellation weakens |
185
+ | Cursor / Cline / Aider / Gemini | Whatever's installed | ⚠️ Tier 3 — skills work as docs; hooks may not fire |
186
+
187
+ ---
188
+
189
+ ## Platform support
190
+
191
+ | Platform | Installer (`npx`) | CCC-MAGI hooks | Status |
192
+ |---|---|---|---|
193
+ | macOS (Apple Silicon / Intel) | ✅ native | ✅ all hooks fire | **Tier 1** — fully tested |
194
+ | Linux (Ubuntu / Debian / RHEL / Fedora / Arch) | ✅ native | ✅ all hooks fire | **Tier 1** — fully tested |
195
+ | Windows 10/11 + WSL2 (Ubuntu) | ✅ via WSL | ✅ all hooks fire | **Tier 1** — same as Linux |
196
+ | Windows 10/11 + Git for Windows, from Git Bash | ✅ native | ✅ all hooks fire | **Tier 1** — full support |
197
+ | Windows 10/11 + Git for Windows, from PowerShell/cmd | ✅ auto-detects Git Bash (v0.10.2+) | ⚠️ hooks need Claude Code launched from Git Bash | **Tier 2** — install works, hooks limited |
198
+ | Windows 10/11 without Git for Windows | ❌ installer guides you to install it | ❌ | **Tier 3** — `winget install Git.Git` and retry |
199
+
200
+ **Recommendation by user type:**
201
+
202
+ - **macOS / Linux**: just install and go.
203
+ - **Windows (no Linux background)**: install Git for Windows (free, includes bash) — `winget install Git.Git`. Then you can run `npx create-ccc-magi@latest` from PowerShell, cmd, OR Git Bash — bash is auto-discovered. For full hooks support, launch Claude Code from Git Bash.
204
+ - **Windows with Linux comfort**: WSL2 + Ubuntu — `wsl --install -d Ubuntu`. Full Linux parity.
205
+
206
+ CCC-MAGI inherits its platform matrix from Claude Code itself. Anywhere Claude Code runs, CCC-MAGI can run, provided a POSIX shell is reachable for hook execution.
207
+
208
+ ---
209
+
210
+ ## Step 0: Install prerequisites (5-10 min, one-time)
211
+
212
+ Before you run `npx create-ccc-magi@latest`, install these on your machine. **The installer fails fast if any hard prereq is missing** — better to install them up front than to hit errors mid-install.
213
+
214
+ ### What you need
215
+
216
+ | Tool | Why | Hard prereq? |
217
+ |---|---|---|
218
+ | **git** | clone CCC-MAGI from GitHub; harness uses git for checkpoints | ✅ required |
219
+ | **bash 3.2+** | run install-into.sh and harness hooks | ✅ required (macOS/Linux native; Windows via Git for Windows) |
220
+ | **jq** | JSON parsing in hooks + auditor verdict handling | ✅ required (`install-into.sh` fails fast if missing) |
221
+ | **Node.js ≥ 18** | for `npx` itself | ✅ required |
222
+ | **Claude Code** OR **Codex CLI** | the AI you'll actually talk to | ✅ at least one (both = Tier 1 cross-model audit) |
223
+
224
+ ### macOS
225
+
226
+ ```bash
227
+ # 1. Homebrew (skip if you already have it)
228
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
229
+
230
+ # 2. git (most Macs have it; if not, brew fixes it)
231
+ brew install git
232
+
233
+ # 3. jq + Node.js
234
+ brew install jq node
235
+
236
+ # 4. Claude Code (primary CLI)
237
+ npm install -g @anthropic-ai/claude-code
238
+
239
+ # 5. Codex CLI (recommended auditor for Tier 1 cross-model audit)
240
+ npm install -g @openai/codex
241
+ ```
242
+
243
+ ### Windows 10/11 (PowerShell)
244
+
245
+ ```powershell
246
+ # 1. Git for Windows (includes bash that v0.10.2+ installer auto-discovers)
247
+ winget install Git.Git
248
+
249
+ # 2. jq
250
+ winget install jqlang.jq
251
+
252
+ # 3. Node.js LTS
253
+ winget install OpenJS.NodeJS.LTS
254
+
255
+ # 4. Claude Code
256
+ npm install -g @anthropic-ai/claude-code
257
+
258
+ # 5. Codex CLI (optional but recommended)
259
+ npm install -g @openai/codex
260
+ ```
261
+
262
+ **Important**: after install, **close and re-open PowerShell** so the new PATH entries take effect.
263
+
264
+ ### Linux (Ubuntu / Debian)
265
+
266
+ ```bash
267
+ sudo apt update
268
+ sudo apt install -y git jq nodejs npm
269
+ sudo npm install -g @anthropic-ai/claude-code
270
+ sudo npm install -g @openai/codex # optional
271
+ ```
272
+
273
+ For RHEL / Fedora / Arch: swap `apt install` for `yum install` / `dnf install` / `pacman -S` accordingly.
274
+
275
+ ### Mainland China tips
276
+
277
+ - **npm slow / timeout?** Switch to Taobao mirror:
278
+ ```bash
279
+ npm config set registry https://registry.npmmirror.com
280
+ ```
281
+ - **GitHub clone slow / timing out?** You'll likely need a VPN. CCC-MAGI's installer clones from GitHub, so reliable GitHub access is required.
282
+ - **Claude Code / Codex CLI login** may require VPN depending on your account type / region.
283
+
284
+ ### Verify everything is ready
285
+
286
+ ```bash
287
+ git --version # any
288
+ jq --version # 1.5+
289
+ node --version # v18+
290
+ claude --version # any (if Claude Code installed)
291
+ codex --version # any (if Codex CLI installed)
292
+ ```
293
+
294
+ If all print versions without "command not found", you're ready for `npx create-ccc-magi@latest`.
295
+
296
+ > After install, the harness's Phase 1 environment check (`.harness/scripts/env-check.sh`) runs on your first chat with Claude Code, confirming everything is wired up correctly.
297
+
298
+ ---
299
+
300
+ ## Quick start
301
+
302
+ ### Path A — Via npx installer (recommended)
303
+
304
+ ```bash
305
+ cd /path/to/your/project
306
+ npx create-ccc-magi@latest
307
+ ```
308
+
309
+ This downloads the harness, places files in canonical locations, sets script permissions, and tells you to open your AI CLI. Use `--dry-run` to preview without writing anything, or `--force` to overwrite existing CCC-MAGI files.
310
+
311
+ Then open Claude Code:
312
+
313
+ ```bash
314
+ claude
315
+ ```
316
+
317
+ Claude reads `CLAUDE.md`, sees the **Bootstrap Status Check** block at the top, sees `.harness/state/install.json` doesn't exist → reads `.harness/scripts/standalone-bootstrap.md` → walks you through detection of any existing harness configs + 3-option menu + `/init` configuration.
318
+
319
+ ### Path B — Manual install (advanced)
320
+
321
+ If you need full control over file placement:
322
+
323
+ ```bash
324
+ cd /path/to/your/project
325
+ git clone https://github.com/Ericcccccc777/CCC-MAGI.git .ccc-magi-temp
326
+ cd .ccc-magi-temp
327
+
328
+ # Move root files
329
+ mv constitution.md CLAUDE.md AGENTS.md ../
330
+
331
+ # Move directories to .harness/ subpaths
332
+ mkdir -p ../.harness
333
+ mv skills agents scripts ../.harness/
334
+
335
+ # Move CLI configs
336
+ mkdir -p ../.claude ../.codex
337
+ mv cli-configs/claude/settings.json ../.claude/
338
+ mv cli-configs/codex/config.toml cli-configs/codex/hooks.json ../.codex/
339
+
340
+ # Move docs and metadata
341
+ mv docs-harness ../
342
+ mv cli-configs/README.md ../docs-harness/cli-configs-README.md
343
+ mv .gitignore ../ # if you don't already have one
344
+ mv README.md ../CCC_MAGI_README.md
345
+ mv LICENSE ../CCC_MAGI_LICENSE
346
+
347
+ # Clean up + permissions
348
+ cd ..
349
+ rm -rf .ccc-magi-temp
350
+ chmod +x .harness/scripts/*.sh
351
+ ```
352
+
353
+ Then open Claude Code as in Path A.
354
+
355
+ > **Strongly recommend Path A unless you have a specific reason.** The npx installer does exactly this layout for you and adds safety checks.
356
+
357
+ ### Path C — Via CCC (Claude Code Controller)
358
+
359
+ If you use CCC as your desktop session manager:
360
+
361
+ 1. Open CCC, "new session", select your project folder
362
+ 2. Click the "Harness" button in the session view
363
+ 3. Click "Environment Detection" → confirm token usage warning
364
+ 4. CCC handles everything (terminal spawn + driver injection + git pull + `/init` invocation)
365
+
366
+ See `docs-harness/ccc-step1-driver-template.md` for the CCC integration spec.
367
+
368
+ ### Path D — Via Anthropic Plugin Marketplace (when available)
369
+
370
+ CCC-MAGI includes a `.claude-plugin/plugin.json` manifest. Once submitted to and accepted by the Anthropic `claude-community` marketplace:
371
+
372
+ ```bash
373
+ /plugin marketplace add anthropics/claude-plugins-community
374
+ /plugin install @claude-community/ccc-magi
375
+ ```
376
+
377
+ **Note**: plugin-only installation ships skills + commands; the full project-level harness (constitution.md, `.harness/state/`, slot rendering) still requires `install-into.sh` or `npx create-ccc-magi`.
378
+
379
+ ---
380
+
381
+ ## Team collaboration & git policy
382
+
383
+ CCC-MAGI ships a careful split between team-shared and personal files. The shipped `.gitignore` already encodes this — you usually don't have to think about it.
384
+
385
+ **Committed (visible in repo, every teammate sees the same):**
386
+
387
+ - `constitution.md` — project identity
388
+ - `CLAUDE.md` + `AGENTS.md` — workflow + AI tool context
389
+ - `.harness/skills/` + `.harness/agents/` + `.harness/scripts/` — the harness machinery
390
+ - `.harness/state/install.json` — answers to the onboarding questions
391
+ - `.harness/memory/conventions.md` — long-form project conventions
392
+ - `.claude/settings.json` + `.codex/config.toml` — hook wiring
393
+
394
+ **Gitignored (yours alone, never shared):**
395
+
396
+ - `.harness/memory/observations.jsonl` + `.harness/memory/decision-log.md` — your AI session notes
397
+ - `.harness/audits/` + `.harness/state/auditor-approvals/` — runtime verdict logs
398
+ - `.harness/state/workflow-checkpoints/` — your session progress cards
399
+ - `.harness/state/shipped-hashes.json` — install-time hash registry
400
+
401
+ **Why this split** — Cline / Spec-Kit / BMAD / Continue / Roo all commit their harness files wholesale, leading to merge conflicts every time someone re-installs at a different version. Aider gitignores everything, losing team alignment. CCC-MAGI's middle path: commit the **identity + tools + rules**, gitignore the **session + verdicts + progress**.
402
+
403
+ ---
404
+
405
+ ## What CCC-MAGI is NOT
406
+
407
+ - **Not a build system.** It orchestrates conversation, audit, and commit gates. It does not replace `npm run build`, `make`, or your CI pipeline.
408
+ - **Not a project boilerplate.** Tech stack, file structure, and code conventions are yours.
409
+ - **Not an enterprise governance suite (yet).** No RBAC, no audit-log signing, no compliance attestations. Those are on the enterprise roadmap, not in v0.9.
410
+ - **Not a substitute for engineering judgment.** Every rule (except 5 Universal Core items) can be overridden by you with reasoning recorded.
411
+
412
+ ---
413
+
414
+ ## Documentation map
415
+
416
+ | File | Purpose |
417
+ |---|---|
418
+ | `README.md` (this file) | What CCC-MAGI is, who it's for, how to install |
419
+ | `constitution.md` | Project identity (filled by `/init`) + 5 universal core items |
420
+ | `CLAUDE.md` | Workflow rules, lane definitions, doc-in-sync, tool map |
421
+ | `AGENTS.md` | Universal project context (AGENTS.md ecosystem standard) + auditor (MAGI) brief + anti-flag rules |
422
+ | `docs-harness/README.md` | Index of the framework's own design docs |
423
+ | `docs-harness/design-spec.md` | Architectural rationale |
424
+ | `docs-harness/adoption-playbook.md` | Step-by-step install guide (greenfield + brownfield + standalone + CCC paths) |
425
+ | `docs-harness/context-architecture-v2.md` | 3-tier memory + budget management design |
426
+ | `docs-harness/memory-layer.md` | Persistent memory implementation |
427
+ | `docs-harness/retrospective-notes.md` | Generalized LLM-workflow patterns worth carrying forward |
428
+ | `docs-harness/ccc-step1-driver-template.md` | Integration template for the CCC Step 1 driver |
429
+
430
+ ---
431
+
432
+ ## Roadmap
433
+
434
+ ### v0.9 (current — dogfooded)
435
+
436
+ - All 20 skills shipped
437
+ - 3-tier memory architecture (Tier 1 scratchpad + Tier 2 recall + Tier 3 archive)
438
+ - MAGI 7-position team
439
+ - Simple / Pro onboarding modes
440
+ - Session resume via workflow checkpoints
441
+ - Claude Code + Codex CLI Tier-1 tested
442
+ - Anthropic plugin marketplace manifest ready (submission pending)
443
+
444
+ ### v1.0 (next — small-team collaboration polish)
445
+
446
+ - Team-aware decision log (multi-author attribution)
447
+ - Conflict-aware checkpoint merging (when two teammates resume the same feature on different machines)
448
+ - Per-teammate audit-history visibility
449
+ - Shared "team convention" memory tier (cross-developer recall)
450
+ - Team onboarding flow (`/init --join-team` reads existing project constitution and skips identity questions)
451
+
452
+ ### v1.x — enterprise multi-user (in development)
453
+
454
+ - RBAC for skill invocation (e.g., only Tech Leads can run `/constitution-edit`)
455
+ - Signed audit logs (tamper-evident verdict history)
456
+ - Compliance attestation hooks (SOC 2 / ISO 27001 friendly)
457
+ - Centralized harness-version policy (org-wide pinning, controlled rollout)
458
+ - Observability layer: token / cost / gate-pass-rate dashboard
459
+ - Cross-project memory federation (with project-scoped redaction)
460
+
461
+ ### Beyond
462
+
463
+ - Parallel agents + worktree isolation
464
+ - Tech-stack starter presets (Next.js / Django / Go / Rust / Swift / Kotlin)
465
+ - AGENTS.md root-of-truth mode (Linux Foundation standard compat)
466
+ - Plugin marketplace integration (post-acceptance)
467
+
468
+ ---
469
+
470
+ ## Status
471
+
472
+ **v0.9.0** — feature-complete MVP, dogfooded internally, undergoing pre-1.0 stabilization. Standalone install path fully functional. Tested end-to-end on macOS + Claude Code + Codex CLI. Suitable for solo and small-team adoption; enterprise multi-user features are in the v1.x track.
473
+
474
+ ---
475
+
476
+ ## License
477
+
478
+ Apache License 2.0 — see [`LICENSE`](./LICENSE).
479
+
480
+ ---
481
+
482
+ ## Contributing
483
+
484
+ This is a young project. PRs welcome especially for:
485
+
486
+ - Tech-stack-specific anti-flag rule starter packs (Next.js, Django, Go, Rust, Swift, Kotlin)
487
+ - Junior reviewer plugin examples for non-frontend domains (CI/CD, IaC, infrastructure)
488
+ - CCC bundled Step 1 driver implementation (CCC team)
489
+ - Translation of user-facing prompts beyond `zh-Hans` / `en` / `ko` / `ja`
490
+ - Tested adapters for Cursor / Cline / Aider / Gemini CLI
491
+
492
+ Repo: <https://github.com/Ericcccccc777/CCC-MAGI>
493
+
494
+ ---
495
+ ---
496
+
497
+ # CCC-MAGI (中文版)
498
+
499
+ > **一个让 vibe coding 变成可维护项目的 AI 编程框架。**
500
+ > 每次改动跨模型审计 · 大白话需求文档 · 持久化跨会话记忆 · 7 位 MAGI AI 团队 · 20 个自然语言技能 · 任意代码仓库即装即用。
501
+
502
+ **切换语言**: [English](#ccc-magi) · **简体中文** (当前)
503
+
504
+ ---
505
+
506
+ ## 一段话讲清楚 CCC-MAGI 是什么
507
+
508
+ 让 AI 写代码很爽 —— 5 分钟出 1000 行看着挺像样的东西。三周后你已经分不清哪些是认真设计的、哪些是猜的;分不清你脑子里的需求还和硬盘上的代码对得上;分不清哪个"修复"真的修复了。**CCC-MAGI 就是来解决这件事的框架。** 它装进你的项目里,跟你的 AI CLI(Claude Code、Codex 等)对话,把每一次改动强制走完整流程:写大白话需求 → 让**不同模型**审一遍 → 列文件计划 → 实现 → 跑测试 → 人肉冒烟测试 → 提交。一位资深工程师该有的纪律,不需要你记 —— 框架机械地执行。
509
+
510
+ 不管你是搭第一个副业项目的新手、独立专业开发者、还是 3-5 人的小团队希望多个贡献者的 AI 代码别互相打架,工作方式完全一样。
511
+
512
+ ---
513
+
514
+ ## 谁应该用 CCC-MAGI
515
+
516
+ | 如果你是... | CCC-MAGI 提供给你 |
517
+ |---|---|
518
+ | **Vibe coding 新手** —— 上个月刚发现 Claude Code,项目开始像一栋鬼屋 | 安全网。代码之前先有需求文档;每次改动有第二个 AI 复审;不会一不小心提交 1000 行没冒烟测试的"优化" |
519
+ | **想做稳定项目的创作者** —— 读得懂代码但不是全职工程师 | 不依赖你记忆的工程纪律。Hook 自动触发;宪法在 compaction 后依然守住项目身份 |
520
+ | **个人专业开发者** —— 靠出货吃饭,想让 AI 放大你而不是埋葬你 | 跨模型审计(Claude × Codex)抵消单模型偏见。持久化记忆 = "上个月 auth 模块我们怎么定的"是一个问题,不是一次代码考古 |
521
+ | **2-5 人的小团队搞 vibe coding** —— 多个贡献者,共享代码库,到处都是 AI | 一份共享宪法,所有人的 AI 都先读它。约定保持一致。Bug 修复必须先有失败测试。计划文件在提交时自动删除 |
522
+ | **已经长出规模的小项目** —— 有能跑的代码,但没需求纪律 | `/audit-spec` 反向把当前代码逆推成需求文档,然后摆出"你以为它做什么" vs "它实际做什么"的差异。Brownfield 上手是一等公民流程,不是事后补丁 |
523
+
524
+ 只要你属于以上任一类,你就是目标人群。
525
+
526
+ ---
527
+
528
+ ## 为什么有 CCC-MAGI
529
+
530
+ 主流 AI 编程框架(BMAD、SpecKit、OpenSpec 等)都很好,但**和项目深度绑定** —— BMAD 假设 React Native;SpecKit 假设你用 GitHub Issues。这些约定搬不进 Python 后端或 Swift app。
531
+
532
+ CCC-MAGI 抽取的是**通用机制** —— 跟语言、框架、团队规模无关的那部分 —— 并以 slot 驱动模板的形式打包:
533
+
534
+ - **跨模型审计**作为承重的不变量(不是可选层)
535
+ - **两文件需求模型**(CEO 域用大白话;管理者域用 EARS 语法 + 技术细节)
536
+ - **三 lane 工作流**(full / stability-fix / trivial —— 同一流程,不同 gate 强度)
537
+ - **三层持久化记忆**(工作笔记 / 30 天 recall / 归档)—— 跨 `/clear`、compaction、几天休息后依然在
538
+ - **MAGI 7 位 AI 团队**(Core / Verdict / Planner / Programmer / Tester / Reviewer / Archivist)—— 角色清楚、职权清楚
539
+ - **机械化的初级评审**(规则引用源文档,从不自创)
540
+ - **人类冒烟测试作为契约**(AI 说的"完成"不算 —— 宪法 § 1.4)
541
+ - **Spec / 代码漂移检测**(`/audit-spec` 反向把现实推回需求,呈现 delta)
542
+ - **自然语言入口**(不用记斜杠命令 —— 说你想要啥,AI 自己翻译)
543
+
544
+ 所有这些通过一次性 `/init` 填入**你**项目的具体值(Simple 模式 5 个问题,Pro 模式 16 个问题)。
545
+
546
+ ---
547
+
548
+ ## 实际使用体感
549
+
550
+ CCC-MAGI **以对话为主,不是命令行式的**。你几乎不需要敲斜杠命令。示例对话:
551
+
552
+ ```
553
+ 你: 「我想做一个用户登录功能」
554
+
555
+ MAGI Core: 「好的,我来启动 Stage 1(起草需求)。先复述我理解到的...」
556
+ (静默调用 /feature-draft user-login)
557
+ (走完 paraphrase + 8 类 edge case,实时进度:🔍 4/8)
558
+ (写出 docs/features/user-login.md)
559
+
560
+ MAGI Core: 「✅ 需求写好了。可以做:
561
+ 👉 「继续」 —— 我做最终审查
562
+ 👉 「看一下」 —— 把需求念给你听
563
+ 👉 「改一下 X」 —— 重做
564
+ 👉 「放弃」」
565
+
566
+ 你: 「继续」
567
+
568
+ MAGI Core: 「调 MAGI Verdict(Codex)做跨模型审计...」
569
+ (verdict PASS, risk 3)
570
+ 「Stage 2 完成。要做数据库设计(Stage 3)还是直接做执行计划(Stage 4)?」
571
+
572
+ 你: 「继续」
573
+
574
+ MAGI Core: 「这个功能涉及用户表,先做 Stage 3...」
575
+ (写出 migration,被审计通过)
576
+ 「Stage 3 完成。要继续做执行计划吗?」
577
+
578
+ 你: 「继续」
579
+
580
+ MAGI Core: (写出每文件计划,在 Claude Code 的 TodoWrite 侧栏显示)
581
+ 「📋 计划写好了,要改 8 个文件。快速过一下:
582
+ 👉 「OK」 —— 开始编程
583
+ 👉 「改一下 X」 —— 修改计划」
584
+
585
+ 你: 「OK」
586
+
587
+ MAGI Core: (Stage 5:实现,TodoWrite 逐文件 ▶ → ✅)
588
+ 「✅ Stage 5 完成。要继续做测试吗?」
589
+
590
+ (...一直到 Stage 8 commit,全程没敲过一个斜杠命令...)
591
+ ```
592
+
593
+ **自然语言触发器速查表**:见 `CLAUDE.md § MAGI Core's Natural-Language Intent Translation`。
594
+ **唯一例外**:Stage 7(CEO 手工冒烟测试)**永远不会**被 AI 自动跑 —— 宪法要求人类亲自验证。
595
+
596
+ ---
597
+
598
+ ## 核心功能(完整当前列表)
599
+
600
+ ### 工作流 & 质量 gate
601
+
602
+ - **9 个 stage**:起草 → 终稿 → 数据库(可选)→ 计划 → 实现 → 测试 → 冒烟 → 提交 → 观察
603
+ - **3 个 lane**:full(新功能)/ stability-fix(必须先写失败测试的 bug 修)/ trivial(< 20 行)
604
+ - **跨模型审计**在每个 gate 触发(默认 Claude ↔ Codex;单模型 fresh-context 兜底)
605
+ - **EARS 语法**用于管理者文档的功能需求 —— 可直接映射成测试断言
606
+ - **CEO 冒烟测试**由宪法 § 1.4 强制 —— AI 不能在没有人类验证的情况下标记"完成"
607
+ - **Spec vs 现实漂移检测**通过 `/audit-spec`(fresh-context 子 agent 从代码反推需求)
608
+
609
+ ### MAGI 7 位 AI 团队
610
+
611
+ 清晰命名、清晰职权的团队:
612
+
613
+ - **MAGI Core** —— 编排者(你的主 CLI)。跟你对话,调度工作流
614
+ - **MAGI Verdict** —— 跨模型审计员(默认 Codex)。独立判决权 —— 不在 MAGI Core 指挥链下
615
+ - **MAGI Planner / Programmer / Tester** —— 对应 stage 的 MAGI Core(模式切换,不是独立进程)
616
+ - **MAGI Reviewer** —— 机械化的初级评审(backend / frontend / security / test-fixer)。引规则,不自创
617
+ - **MAGI Archivist** —— 记忆 hook 服务(SessionStart / PreCompaction)
618
+
619
+ ### 20 个自然语言 skill
620
+
621
+ 通常你只说意图,不用敲斜杠:
622
+
623
+ | Skill | 作用 |
624
+ |---|---|
625
+ | `/init` | 首次配置 —— Simple(5 问,约 3 分钟)或 Pro 模式(16 问,约 15 分钟) |
626
+ | `/feature-draft` | Stage 1(新功能)—— paraphrase + 8 类 edge case + 写需求 |
627
+ | `/audit-spec` | Stage 1(审现有代码)—— fresh-context 子 agent 反推 as-built 需求 |
628
+ | `/spec-finalize` | Stage 2 —— auditor 交叉检查集成一致性 |
629
+ | `/db-schema` | Stage 3 —— 数据库设计(无后端跳过) |
630
+ | `/execution-plan` | Stage 4 —— 每文件 checklist + 计划阶段审计 |
631
+ | `/implement` | Stage 5 —— 初级评审(机械化)+ 跨模型审计 |
632
+ | `/test-fix` | Stage 6 —— test-fixer 子 agent + 合法性审计 |
633
+ | `/commit` | Stage 8 —— Conventional Commits + 计划文件删除 |
634
+ | `/next` | 工作流定位器 —— "我在哪?下一步该干啥?" |
635
+ | `/pickup` | 跨 session / 跨设备 / 跨天接续在进 feature |
636
+ | `/abandon` | 标记 feature 死亡,归档 checkpoint |
637
+ | `/handoff` | 约 95% context 预算时生成丰富的 5 槽 session 快照 |
638
+ | `/offload` | 约 75% 预算时 spawn fresh-context 子 agent 做子任务 |
639
+ | `/recall` | 按需取记忆(manifest → 按需取 body) |
640
+ | `/remember` | 保存 observation / 决策 / 失败给未来 session |
641
+ | `/constitution-edit` | 编辑 constitution.md 的 Section 2 / 3(带 Sync Impact Report) |
642
+ | `/add-constitution-clause` | 给 Section 3 加项目级红线 |
643
+ | `/add-anti-flag` | 抑制 auditor 假阳性(写进 AGENTS.md) |
644
+ | `/uninstall` | 干净卸载(可选恢复先前 harness) |
645
+
646
+ ### 三层持久化记忆
647
+
648
+ 跨 session 记忆能扛 `/clear`、compaction、多天休息:
649
+
650
+ | 层级 | 位置 | 用途 | SessionStart 加载 |
651
+ |---|---|---|---|
652
+ | **1 — 工作** | `.harness/state/scratchpad.md` | 当前目标 / 上一步 + 下一步 / 阻塞(≤500 token,每轮重写) | ✅ 始终读取 |
653
+ | **2 — Recall** | `.harness/memory/sessions/recall/*.jsonl` | 最近 30 天的决策 / 失败 / 快照 | ✅ 仅 manifest(约 500-1000 token),body 按需 |
654
+ | **3 — Archive** | `.harness/memory/sessions/archive/<YYYY-MM>.jsonl` | 更早的条目,冷存储 | ❌ 仅通过 `/recall --deep <query>` |
655
+
656
+ SessionStart 成本有界(约 1-1.5K token,不随项目年龄增长)。硬上限阻止 "保险起见拉全部" 的漂移。
657
+
658
+ ### Locale 感知 UX(i18n)
659
+
660
+ 框架在 session 启动时检测 OS locale。内部文件保持英文(token 友好、模型友好);用户面对的提示、菜单、状态报告自动翻译到 `zh_CN` / `zh_TW` / `ja_JP` / `ko_KR` / 其他 locale。代码标识符、文件路径、frontmatter 永不翻译。
661
+
662
+ ### 三段式宪法(跨 harness 升级保留)
663
+
664
+ `constitution.md` 三层结构:
665
+
666
+ - **Section 1 —— 通用核心**(harness 保证,`/constitution-edit` 不可改):跨模型审计、数据归属、CEO 最终权威、强制冒烟测试、spec/现实同步
667
+ - **Section 2 —— 项目身份**(`/init` 填):技术栈、规模目标、首要关注点、out-of-scope、edge case 分类等
668
+ - **Section 3 —— 项目红线**(通过 `/add-constitution-clause` 增长):你逐步累积的绝对规则
669
+
670
+ 升级 CCC-MAGI 时,Section 1 可能变(小心带迁移说明);Section 2 和 3 是你的,原样保留。
671
+
672
+ ### 已测 CLI 矩阵
673
+
674
+ | 主 CLI | 审计员 | 状态 |
675
+ |---|---|---|
676
+ | Claude Code | Codex CLI | ✅ **Tier 1**(端到端测试) |
677
+ | Codex CLI | Claude Code | ✅ **Tier 1**(角色互换) |
678
+ | 单 CLI 兜底 | 同模型 fresh context | ⚠️ Tier 2 —— 能跑,但去偏弱 |
679
+ | Cursor / Cline / Aider / Gemini | 看本机有啥 | ⚠️ Tier 3 —— skill 当文档用;hook 可能不触发 |
680
+
681
+ ---
682
+
683
+ ## 平台支持
684
+
685
+ | 平台 | 安装器(`npx`) | CCC-MAGI hook | 状态 |
686
+ |---|---|---|---|
687
+ | macOS(Apple Silicon / Intel) | ✅ 原生 | ✅ 所有 hook 触发 | **Tier 1** —— 充分测试 |
688
+ | Linux(Ubuntu / Debian / RHEL / Fedora / Arch) | ✅ 原生 | ✅ 所有 hook 触发 | **Tier 1** —— 充分测试 |
689
+ | Windows 10/11 + WSL2(Ubuntu) | ✅ 通过 WSL | ✅ 所有 hook 触发 | **Tier 1** —— 同 Linux |
690
+ | Windows 10/11 + Git for Windows,从 Git Bash 启动 | ✅ 原生 | ✅ 所有 hook 触发 | **Tier 1** —— 完整支持 |
691
+ | Windows 10/11 + Git for Windows,从 PowerShell/cmd 启动 | ✅ 自动检测 Git Bash(v0.10.2+) | ⚠️ hook 需从 Git Bash 启动 Claude Code | **Tier 2** —— 装能装,hook 受限 |
692
+ | Windows 10/11 未装 Git for Windows | ❌ 安装器会引导你装 | ❌ | **Tier 3** —— `winget install Git.Git` 后重试 |
693
+
694
+ **按用户类型推荐:**
695
+
696
+ - **macOS / Linux**:装上就用
697
+ - **Windows(无 Linux 背景)**:装 Git for Windows(免费,含 bash)—— `winget install Git.Git`。装好后 PowerShell / cmd / Git Bash 都能跑 `npx create-ccc-magi@latest`,bash 自动发现。如果要 hook 完整工作,从 Git Bash 启动 Claude Code
698
+ - **Windows(有 Linux 经验)**:WSL2 + Ubuntu —— `wsl --install -d Ubuntu`,完整 Linux parity
699
+
700
+ CCC-MAGI 继承 Claude Code 的平台矩阵。只要 Claude Code 能跑、有可达的 POSIX shell,CCC-MAGI 就能跑。
701
+
702
+ ---
703
+
704
+ ## 第 0 步:环境准备(5-10 分钟,一次性)
705
+
706
+ 在跑 `npx create-ccc-magi@latest` **之前**,先把下面这些装好。**任何硬依赖缺失,installer 会立刻报错退出** —— 提前装好比中途撞错好得多。
707
+
708
+ ### 你需要装的东西
709
+
710
+ | 工具 | 用途 | 硬依赖? |
711
+ |---|---|---|
712
+ | **git** | 从 GitHub 拉 CCC-MAGI;harness 用 git 做 checkpoint | ✅ 必须 |
713
+ | **bash 3.2+** | 跑 install-into.sh + harness hooks | ✅ 必须(macOS/Linux 原生;Windows 装 Git for Windows 自带) |
714
+ | **jq** | hook 里解析 JSON + 处理审计 verdict | ✅ 必须(`install-into.sh` 缺它直接报错退出) |
715
+ | **Node.js ≥ 18** | `npx` 自己需要 | ✅ 必须 |
716
+ | **Claude Code** 或 **Codex CLI** | 你实际对话的 AI | ✅ 至少装一个(两个都装 = Tier 1 跨模型审计) |
717
+
718
+ ### macOS
719
+
720
+ ```bash
721
+ # 1. Homebrew(已装可跳过)
722
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
723
+
724
+ # 2. git(多数 Mac 已有;没有的话 brew 装)
725
+ brew install git
726
+
727
+ # 3. jq + Node.js
728
+ brew install jq node
729
+
730
+ # 4. Claude Code(主 CLI)
731
+ npm install -g @anthropic-ai/claude-code
732
+
733
+ # 5. Codex CLI(推荐 —— 跟 Claude 配对做跨模型审计 Tier 1)
734
+ npm install -g @openai/codex
735
+ ```
736
+
737
+ ### Windows 10/11(PowerShell 跑)
738
+
739
+ ```powershell
740
+ # 1. Git for Windows(含 bash,v0.10.2+ installer 会自动找到)
741
+ winget install Git.Git
742
+
743
+ # 2. jq
744
+ winget install jqlang.jq
745
+
746
+ # 3. Node.js LTS
747
+ winget install OpenJS.NodeJS.LTS
748
+
749
+ # 4. Claude Code
750
+ npm install -g @anthropic-ai/claude-code
751
+
752
+ # 5. Codex CLI(可选但推荐)
753
+ npm install -g @openai/codex
754
+ ```
755
+
756
+ **重要**:装完后**关掉 PowerShell 再打开**,新的 PATH 才生效。
757
+
758
+ ### Linux(Ubuntu / Debian)
759
+
760
+ ```bash
761
+ sudo apt update
762
+ sudo apt install -y git jq nodejs npm
763
+ sudo npm install -g @anthropic-ai/claude-code
764
+ sudo npm install -g @openai/codex # 可选
765
+ ```
766
+
767
+ RHEL / Fedora / Arch:把 `apt install` 换成 `yum install` / `dnf install` / `pacman -S`。
768
+
769
+ ### 中国大陆用户提示
770
+
771
+ - **npm 慢或超时?** 切换淘宝镜像:
772
+ ```bash
773
+ npm config set registry https://registry.npmmirror.com
774
+ ```
775
+ - **GitHub clone 慢或超时?** 大概率需要 VPN。CCC-MAGI 的 installer 是从 GitHub clone 的,所以必须能稳定访问 GitHub
776
+ - **Claude Code / Codex CLI 登录**可能需要 VPN,看你账号类型 / 地区
777
+
778
+ ### 验证准备就绪
779
+
780
+ ```bash
781
+ git --version # 任何版本
782
+ jq --version # 1.5+
783
+ node --version # v18+
784
+ claude --version # 任何(如果装了 Claude Code)
785
+ codex --version # 任何(如果装了 Codex CLI)
786
+ ```
787
+
788
+ 如果上面 5 条都正常打印版本(没有 "command not found"),就可以跑 `npx create-ccc-magi@latest` 了。
789
+
790
+ > 装完 CCC-MAGI 后,第一次跟 Claude Code 对话时,harness 的 Phase 1 环境检查(`.harness/scripts/env-check.sh`)会自动跑一遍,确认所有依赖都正确连上。
791
+
792
+ ---
793
+
794
+ ## 快速开始
795
+
796
+ ### 路径 A —— 通过 npx 安装器(推荐)
797
+
798
+ ```bash
799
+ cd /path/to/your/project
800
+ npx create-ccc-magi@latest
801
+ ```
802
+
803
+ 会下载框架、把文件放到规范位置、设置脚本权限、提示你打开 AI CLI。`--dry-run` 预览;`--force` 覆盖现有 CCC-MAGI 文件。
804
+
805
+ 然后打开 Claude Code:
806
+
807
+ ```bash
808
+ claude
809
+ ```
810
+
811
+ Claude 读 `CLAUDE.md`,看到顶部的 **Bootstrap Status Check** 块,发现 `.harness/state/install.json` 不存在 → 读 `.harness/scripts/standalone-bootstrap.md` → 引导你检测现有 harness 配置 + 3 选项菜单 + `/init` 配置。
812
+
813
+ ### 路径 B —— 手动安装(进阶)
814
+
815
+ 需要完全控制文件位置时:
816
+
817
+ ```bash
818
+ cd /path/to/your/project
819
+ git clone https://github.com/Ericcccccc777/CCC-MAGI.git .ccc-magi-temp
820
+ cd .ccc-magi-temp
821
+
822
+ # 顶层文件
823
+ mv constitution.md CLAUDE.md AGENTS.md ../
824
+
825
+ # 目录到 .harness/
826
+ mkdir -p ../.harness
827
+ mv skills agents scripts ../.harness/
828
+
829
+ # CLI 配置
830
+ mkdir -p ../.claude ../.codex
831
+ mv cli-configs/claude/settings.json ../.claude/
832
+ mv cli-configs/codex/config.toml cli-configs/codex/hooks.json ../.codex/
833
+
834
+ # 文档和元数据
835
+ mv docs-harness ../
836
+ mv cli-configs/README.md ../docs-harness/cli-configs-README.md
837
+ mv .gitignore ../ # 如果已有自己的,需手动合并
838
+ mv README.md ../CCC_MAGI_README.md
839
+ mv LICENSE ../CCC_MAGI_LICENSE
840
+
841
+ # 清理 + 权限
842
+ cd ..
843
+ rm -rf .ccc-magi-temp
844
+ chmod +x .harness/scripts/*.sh
845
+ ```
846
+
847
+ 然后按路径 A 打开 Claude Code。
848
+
849
+ > **强烈建议用路径 A,除非有特殊原因**。npx 安装器做的就是上面这套布局,并加了安全检查。
850
+
851
+ ### 路径 C —— 通过 CCC(Claude Code Controller)
852
+
853
+ 如果你用 CCC 作为桌面 session 管理器:
854
+
855
+ 1. 打开 CCC,"new session",选你的项目文件夹
856
+ 2. session 视图里点 "Harness" 按钮
857
+ 3. 点 "Environment Detection" → 确认 token 使用警告
858
+ 4. CCC 全权处理(终端 spawn + driver 注入 + git pull + `/init` 调用)
859
+
860
+ 集成规范见 `docs-harness/ccc-step1-driver-template.md`。
861
+
862
+ ### 路径 D —— 通过 Anthropic Plugin Marketplace(可用时)
863
+
864
+ CCC-MAGI 自带 `.claude-plugin/plugin.json` manifest。一旦被 Anthropic `claude-community` marketplace 接受:
865
+
866
+ ```bash
867
+ /plugin marketplace add anthropics/claude-plugins-community
868
+ /plugin install @claude-community/ccc-magi
869
+ ```
870
+
871
+ **注意**:plugin-only 安装只交付 skill + command;完整的项目级 harness(constitution.md、`.harness/state/`、slot 渲染)仍需 `install-into.sh` 或 `npx create-ccc-magi`。
872
+
873
+ ---
874
+
875
+ ## 团队协作 & git 策略
876
+
877
+ CCC-MAGI 仔细划分了 team-shared 和个人文件。出厂的 `.gitignore` 已编码这套策略 —— 你通常不用想。
878
+
879
+ **进 git(仓库里可见,所有队友看到一样):**
880
+
881
+ - `constitution.md` —— 项目身份
882
+ - `CLAUDE.md` + `AGENTS.md` —— 工作流 + AI 工具 context
883
+ - `.harness/skills/` + `.harness/agents/` + `.harness/scripts/` —— 框架机器
884
+ - `.harness/state/install.json` —— 入职问题的答案
885
+ - `.harness/memory/conventions.md` —— 长文项目约定
886
+ - `.claude/settings.json` + `.codex/config.toml` —— hook 接线
887
+
888
+ **.gitignore(只属于你,从不共享):**
889
+
890
+ - `.harness/memory/observations.jsonl` + `.harness/memory/decision-log.md` —— 你的 AI session 笔记
891
+ - `.harness/audits/` + `.harness/state/auditor-approvals/` —— 运行时审计判决日志
892
+ - `.harness/state/workflow-checkpoints/` —— 你的 session 进度卡
893
+ - `.harness/state/shipped-hashes.json` —— 安装时哈希注册表
894
+
895
+ **为何如此划分** —— Cline / Spec-Kit / BMAD / Continue / Roo 把 harness 文件一股脑全提交,导致每次有人在不同版本重装就出 merge 冲突。Aider 全 gitignore,丢了团队对齐。CCC-MAGI 走中间路:**身份 + 工具 + 规则**进 git,**session + 判决 + 进度**进 gitignore。
896
+
897
+ ---
898
+
899
+ ## CCC-MAGI 不是什么
900
+
901
+ - **不是构建系统**。它编排对话、审计、提交 gate;不替代 `npm run build`、`make` 或 CI pipeline
902
+ - **不是项目脚手架**。技术栈、文件结构、代码约定是你的
903
+ - **暂时不是企业治理套件**。无 RBAC、无审计日志签名、无合规证明 —— 这些在企业 roadmap 上,v0.9 没有
904
+ - **不是工程判断的替代品**。除 5 条 Universal Core 外,所有规则都可被你 override(带理由记录)
905
+
906
+ ---
907
+
908
+ ## 文档地图
909
+
910
+ | 文件 | 用途 |
911
+ |---|---|
912
+ | `README.md`(本文) | CCC-MAGI 是什么、谁该用、怎么装 |
913
+ | `constitution.md` | 项目身份(`/init` 填)+ 5 条通用核心 |
914
+ | `CLAUDE.md` | 工作流规则、lane 定义、doc 同步、工具地图 |
915
+ | `AGENTS.md` | 通用项目 context(AGENTS.md 生态标准)+ auditor (MAGI) 简报 + 反假阳性规则 |
916
+ | `docs-harness/README.md` | 框架自身设计文档索引 |
917
+ | `docs-harness/design-spec.md` | 架构理由 |
918
+ | `docs-harness/adoption-playbook.md` | 安装详细流程(greenfield + brownfield + standalone + CCC 各路径) |
919
+ | `docs-harness/context-architecture-v2.md` | 三层记忆 + 预算管理设计 |
920
+ | `docs-harness/memory-layer.md` | 持久化记忆实现 |
921
+ | `docs-harness/retrospective-notes.md` | 可复用的 LLM 工作流通用模式 |
922
+ | `docs-harness/ccc-step1-driver-template.md` | CCC Step 1 driver 集成模板 |
923
+
924
+ ---
925
+
926
+ ## Roadmap
927
+
928
+ ### v0.9(当前 —— 已 dogfood)
929
+
930
+ - 20 个 skill 全部交付
931
+ - 三层记忆架构(Tier 1 scratchpad + Tier 2 recall + Tier 3 archive)
932
+ - MAGI 7 位团队
933
+ - Simple / Pro 入职模式
934
+ - 通过 workflow checkpoint 实现 session 恢复
935
+ - Claude Code + Codex CLI Tier-1 测试
936
+ - Anthropic plugin marketplace manifest 就绪(待提交)
937
+
938
+ ### v1.0(下一版 —— 小团队协作优化)
939
+
940
+ - 团队感知决策日志(多作者归属)
941
+ - 冲突感知的 checkpoint 合并(两个队友在不同机器接同一 feature 时)
942
+ - 队友间审计历史可见性
943
+ - 共享"团队约定"记忆层(跨开发者 recall)
944
+ - 团队入职流程(`/init --join-team` 读已有项目宪法,跳过身份问题)
945
+
946
+ ### v1.x —— 企业多人(开发中)
947
+
948
+ - 技能调用 RBAC(例如只有 Tech Lead 能跑 `/constitution-edit`)
949
+ - 签名审计日志(防篡改的判决历史)
950
+ - 合规证明 hook(SOC 2 / ISO 27001 友好)
951
+ - 集中化 harness 版本策略(组织级 pin、受控发布)
952
+ - 可观测性层:token / 成本 / gate 通过率 dashboard
953
+ - 跨项目记忆联邦(带项目级脱敏)
954
+
955
+ ### 更远
956
+
957
+ - 并行 agent + worktree 隔离
958
+ - 技术栈起步预设(Next.js / Django / Go / Rust / Swift / Kotlin)
959
+ - AGENTS.md root-of-truth 模式(Linux Foundation 标准兼容)
960
+ - Plugin marketplace 集成(被接受后)
961
+
962
+ ---
963
+
964
+ ## 当前状态
965
+
966
+ **v0.9.0** —— 功能完整的 MVP,内部 dogfooded,正在 1.0 前稳定化。Standalone 安装路径完全可用。在 macOS + Claude Code + Codex CLI 上端到端测试。适合个人和小团队采用;企业多人功能在 v1.x 轨道上。
967
+
968
+ ---
969
+
970
+ ## License
971
+
972
+ Apache License 2.0 —— 见 [`LICENSE`](./LICENSE)。
973
+
974
+ ---
975
+
976
+ ## 贡献
977
+
978
+ 这是一个年轻项目。特别欢迎 PR:
979
+
980
+ - 技术栈相关的反假阳性规则起步包(Next.js、Django、Go、Rust、Swift、Kotlin)
981
+ - 非前端领域的初级评审插件示例(CI/CD、IaC、基础设施)
982
+ - CCC 捆绑的 Step 1 driver 实现(CCC 团队)
983
+ - `zh-Hans` / `en` / `ko` / `ja` 以外的用户面向提示翻译
984
+ - Cursor / Cline / Aider / Gemini CLI 的测试适配器
985
+
986
+ 仓库:<https://github.com/Ericcccccc777/CCC-MAGI>