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.
- package/README.md +41 -0
- package/bin/cli.js +76 -0
- package/package.json +28 -0
- package/template/.claude/commands/abandon.md +7 -0
- package/template/.claude/commands/add-anti-flag.md +7 -0
- package/template/.claude/commands/add-constitution-clause.md +7 -0
- package/template/.claude/commands/audit-spec.md +7 -0
- package/template/.claude/commands/commit.md +7 -0
- package/template/.claude/commands/constitution-edit.md +7 -0
- package/template/.claude/commands/db-schema.md +7 -0
- package/template/.claude/commands/exam.md +66 -0
- package/template/.claude/commands/execution-plan.md +7 -0
- package/template/.claude/commands/feature-draft.md +7 -0
- package/template/.claude/commands/handoff.md +7 -0
- package/template/.claude/commands/implement.md +7 -0
- package/template/.claude/commands/init.md +7 -0
- package/template/.claude/commands/next.md +7 -0
- package/template/.claude/commands/offload.md +7 -0
- package/template/.claude/commands/pickup.md +7 -0
- package/template/.claude/commands/recall.md +7 -0
- package/template/.claude/commands/remember.md +7 -0
- package/template/.claude/commands/slide.md +87 -0
- package/template/.claude/commands/spec-finalize.md +7 -0
- package/template/.claude/commands/test-fix.md +7 -0
- package/template/.claude/commands/uninstall.md +7 -0
- package/template/.claude/settings.json +161 -0
- package/template/.claude-plugin/plugin.json +41 -0
- package/template/.codex/config.toml +24 -0
- package/template/.codex/hooks.json +4 -0
- package/template/.codex/install-skills.sh +18 -0
- package/template/.codex/skills/exam/SKILL.md +61 -0
- package/template/.codex/skills/slide/SKILL.md +69 -0
- package/template/.harness/agents/README.md +70 -0
- package/template/.harness/agents/_template/junior-agent-template.md +116 -0
- package/template/.harness/agents/backend-reviewer.md +153 -0
- package/template/.harness/agents/frontend-reviewer.md +158 -0
- package/template/.harness/agents/security-reviewer.md +148 -0
- package/template/.harness/agents/test-fixer.md +147 -0
- package/template/.harness/docs/doc-sync.md +29 -0
- package/template/.harness/docs/git-hygiene.md +56 -0
- package/template/.harness/docs/spec-model.md +47 -0
- package/template/.harness/docs/tool-map.md +120 -0
- package/template/.harness/docs/workflow.md +59 -0
- package/template/.harness/scripts/README.md +70 -0
- package/template/.harness/scripts/auditor-gate.sh +388 -0
- package/template/.harness/scripts/bootstrap-check.sh +103 -0
- package/template/.harness/scripts/budget-monitor.sh +223 -0
- package/template/.harness/scripts/check-prereqs.sh +165 -0
- package/template/.harness/scripts/checkpoint-recall.sh +136 -0
- package/template/.harness/scripts/checkpoint-write.sh +281 -0
- package/template/.harness/scripts/decision-log-append.sh +90 -0
- package/template/.harness/scripts/env-check.sh +286 -0
- package/template/.harness/scripts/format-edit.sh +80 -0
- package/template/.harness/scripts/lint-bans.sh +110 -0
- package/template/.harness/scripts/memory-archive.sh +129 -0
- package/template/.harness/scripts/memory-recall.sh +197 -0
- package/template/.harness/scripts/memory-snapshot.sh +124 -0
- package/template/.harness/scripts/post-migration.sh +58 -0
- package/template/.harness/scripts/precommit-cycles.sh +74 -0
- package/template/.harness/scripts/precommit-typecheck.sh +69 -0
- package/template/.harness/scripts/scratchpad-recall.sh +83 -0
- package/template/.harness/scripts/scratchpad-update.sh +39 -0
- package/template/.harness/scripts/standalone-bootstrap.md +443 -0
- package/template/.harness/skills/abandon/SKILL.md +157 -0
- package/template/.harness/skills/add-anti-flag/SKILL.md +205 -0
- package/template/.harness/skills/add-constitution-clause/SKILL.md +244 -0
- package/template/.harness/skills/audit-spec/SKILL.md +395 -0
- package/template/.harness/skills/commit/SKILL.md +270 -0
- package/template/.harness/skills/constitution-edit/SKILL.md +292 -0
- package/template/.harness/skills/db-schema/SKILL.md +145 -0
- package/template/.harness/skills/db-schema/references/methodology.md +202 -0
- package/template/.harness/skills/execution-plan/SKILL.md +346 -0
- package/template/.harness/skills/feature-draft/SKILL.md +426 -0
- package/template/.harness/skills/handoff/SKILL.md +211 -0
- package/template/.harness/skills/implement/SKILL.md +355 -0
- package/template/.harness/skills/init/SKILL.md +805 -0
- package/template/.harness/skills/next/SKILL.md +245 -0
- package/template/.harness/skills/offload/SKILL.md +134 -0
- package/template/.harness/skills/pickup/SKILL.md +213 -0
- package/template/.harness/skills/recall/SKILL.md +159 -0
- package/template/.harness/skills/remember/SKILL.md +205 -0
- package/template/.harness/skills/spec-finalize/SKILL.md +196 -0
- package/template/.harness/skills/test-fix/SKILL.md +363 -0
- package/template/.harness/skills/uninstall/SKILL.md +370 -0
- package/template/.harness/state/install.json +83 -0
- package/template/AGENTS.md +262 -0
- package/template/CCC_MAGI_LICENSE +201 -0
- package/template/CCC_MAGI_README.md +986 -0
- package/template/CLAUDE.md +658 -0
- package/template/codex.md +39 -0
- package/template/constitution.md +164 -0
- package/template/course/README.md +15 -0
- package/template/course/course_code(example)/exam/README.md +2 -0
- package/template/course/course_code(example)/slide/slide_example-1.pdf +40 -0
- package/template/course/course_code(example)/slide/slide_example-2.pdf +40 -0
- package/template/docs/features/slide-query-implementation.md +79 -0
- package/template/docs/features/slide-query.md +211 -0
- package/template/docs-harness/README.md +42 -0
- package/template/docs-harness/adoption-playbook.md +373 -0
- package/template/docs-harness/ccc-step1-driver-template.md +288 -0
- package/template/docs-harness/cli-configs-README.md +78 -0
- package/template/docs-harness/context-architecture-v2.md +249 -0
- package/template/docs-harness/design-spec.md +437 -0
- package/template/docs-harness/memory-layer.md +135 -0
- package/template/docs-harness/retrospective-notes.md +204 -0
- package/template/gitignore +106 -0
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
# Standalone Bootstrap Driver
|
|
2
|
+
|
|
3
|
+
**You are an AI assistant reading this file because the host project has CCC-MAGI files present but `.harness/state/install.json` does not yet exist.** This means the user cloned CCC-MAGI from GitHub but has not yet run the configuration flow.
|
|
4
|
+
|
|
5
|
+
Your task: walk the user through the bootstrap. Follow the steps **literally** — do not improvise, do not skip steps, do not change the menu options.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Language Awareness
|
|
10
|
+
|
|
11
|
+
This driver is written in English (more stable + token-efficient for AI). When you actually TALK to the user, talk in their OS locale's language. See `CLAUDE.md § Language Awareness` for the full detection + translation rule (run `locale` or read `$LANG`; default English on failure).
|
|
12
|
+
|
|
13
|
+
The user-facing menus and prompts in this driver are templates — translate them to the user's locale when displaying. The two completion markers (`✓ Task complete, close terminal` / `✗ Task cancelled, close terminal`) are byte-exact and NEVER translated.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Mode detection
|
|
18
|
+
|
|
19
|
+
This driver covers the **standalone path** (user is NOT running through CCC). The flow is nearly identical to the CCC-bundled Step 1 driver, with two differences:
|
|
20
|
+
|
|
21
|
+
1. There is no CCC GUI to render output into — you talk to the user in the CLI directly.
|
|
22
|
+
2. After completion, you do NOT need to close a terminal — you continue working in the same CLI session.
|
|
23
|
+
|
|
24
|
+
If you can tell from the environment that you ARE running inside CCC (e.g., env var `CCC_SESSION_ID` is set, or stdout is being scraped by CCC), use the **CCC-bundled** Step 1 driver instead — CCC ships its own which is similar but emits the `✓ Task complete, close terminal` marker at the end. This file is for standalone use.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step A — Scan for existing harness configurations
|
|
29
|
+
|
|
30
|
+
Look around the project root. You're looking for **anything that looks like AI workflow / agent / rule configuration**, not just canonical files.
|
|
31
|
+
|
|
32
|
+
### Layer 1 — Known harness markers (high confidence)
|
|
33
|
+
|
|
34
|
+
Check existence (directories or files):
|
|
35
|
+
|
|
36
|
+
- `.bmad-core/` `.bmad/` `bmad-method/` — BMAD-METHOD
|
|
37
|
+
- `.speckit/` `speckit.yml` `speckit.yaml` — GitHub SpecKit
|
|
38
|
+
- `.openspec/` — OpenSpec
|
|
39
|
+
- `.superpowers/` — Superpowers
|
|
40
|
+
- `.ruflo/` `.claude-flow/` — Claude-Flow / Ruflo
|
|
41
|
+
- `.cursorrules` `.cursor/rules/` — Cursor Rules
|
|
42
|
+
- `.clinerules` `.clinerules/` — Cline Rules
|
|
43
|
+
- `.windsurfrules` — Windsurf Rules
|
|
44
|
+
- `.aider.conf.yml` — Aider
|
|
45
|
+
- `.github/copilot-instructions.md` — GitHub Copilot
|
|
46
|
+
|
|
47
|
+
### Layer 2 — Canonical AI config files (case-insensitive)
|
|
48
|
+
|
|
49
|
+
The user's filesystem may be case-insensitive (macOS default) — match these regardless of case:
|
|
50
|
+
|
|
51
|
+
- `CLAUDE.md` / `claude.md` / `Claude.md`
|
|
52
|
+
- `AGENTS.md` / `agents.md` / `Agents.md`
|
|
53
|
+
- `AGENT.md` / `agent.md` / `Agent.md` (singular variant)
|
|
54
|
+
|
|
55
|
+
### Layer 3 — AI-shaped directories (open them, list `.md` files inside)
|
|
56
|
+
|
|
57
|
+
For each of these, if the directory exists, list every `.md` file inside (one level deep is enough):
|
|
58
|
+
|
|
59
|
+
- `agent/` `agents/`
|
|
60
|
+
- `ai/`
|
|
61
|
+
- `prompts/` `prompt/`
|
|
62
|
+
- `skills/` `skill/`
|
|
63
|
+
- `rules/` `ai-rules/`
|
|
64
|
+
- `instructions/`
|
|
65
|
+
- `harness/`
|
|
66
|
+
- `workflow/` `workflows/`
|
|
67
|
+
|
|
68
|
+
### Layer 4 — Suspicious markdown at project root
|
|
69
|
+
|
|
70
|
+
Any `*.md` file at project root that is NOT one of the obviously-unrelated names below:
|
|
71
|
+
|
|
72
|
+
- Exclude: `README.md`, `LICENSE.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`, `NOTES.md` (if it's just personal notes)
|
|
73
|
+
- Exclude ALSO: any file in the "Layer 5 — CCC-MAGI owned" list below (don't double-flag)
|
|
74
|
+
|
|
75
|
+
For each remaining candidate, **read the first 80 lines** and judge:
|
|
76
|
+
|
|
77
|
+
- Does it contain AI-workflow keywords like "agent", "workflow", "spec", "harness", "Claude", "AI", "prompt", "stage", "step", "skill", "rule"?
|
|
78
|
+
- Is it structured like instructions (numbered steps, sections like "When invoked", "Authoritative sources", "Workflow")?
|
|
79
|
+
- Or is it just narrative prose / documentation / notes?
|
|
80
|
+
|
|
81
|
+
### Layer 5 — CCC-MAGI owned (NEVER flag these as "harness to handle")
|
|
82
|
+
|
|
83
|
+
These files / directories are **part of CCC-MAGI itself** OR were created BY CCC-MAGI. They are NOT user harness configs. Always filter them out of the "candidate" list and surface them separately in a 🟢 informational section.
|
|
84
|
+
|
|
85
|
+
**Files we install** (identifiable by name + signature):
|
|
86
|
+
|
|
87
|
+
| Path | Signature to confirm it's ours |
|
|
88
|
+
|------|--------------------------------|
|
|
89
|
+
| `constitution.md` (case-insensitive) | Contains string `SLOT REGISTRY` near top |
|
|
90
|
+
| `CLAUDE.md` (case-insensitive) | Contains string `Bootstrap Status Check` |
|
|
91
|
+
| `AGENTS.md` (case-insensitive) | Contains string `Auditor Instructions (for MAGI / Codex)` |
|
|
92
|
+
| `CCC_MAGI_README.md` | Renamed by our installer; presence is sufficient |
|
|
93
|
+
| `CCC_MAGI_LICENSE` | Same |
|
|
94
|
+
| `.gitignore` | Contains string `.harness/state/auditor-approvals/` if installed by us; if user already had one and we merged, treat as theirs |
|
|
95
|
+
|
|
96
|
+
**Directories we install** (presence alone confirms ours):
|
|
97
|
+
|
|
98
|
+
| Directory | Notes |
|
|
99
|
+
|-----------|-------|
|
|
100
|
+
| `.harness/` | Our state + skills + agents + scripts |
|
|
101
|
+
| `.claude/` | Our settings.json (Claude Code config) |
|
|
102
|
+
| `.codex/` | Our config.toml + hooks.json (Codex CLI config) |
|
|
103
|
+
| `docs-harness/` | Our framework design docs |
|
|
104
|
+
|
|
105
|
+
**Backup files we created during install** (special category — see Layer 6):
|
|
106
|
+
|
|
107
|
+
| Pattern | What it is |
|
|
108
|
+
|---------|------------|
|
|
109
|
+
| `*.pre-ccc-magi` | A backup of a USER file that existed before we installed. The CONTENT is the user's; the FILENAME is ours. Surface these in the 🟡 "your original files (backed up)" section instead of either harness category. |
|
|
110
|
+
| `*.pre-ccc-magi.<timestamp>` | Same, but a timestamped variant created when a primary backup name was already taken (e.g., re-install). |
|
|
111
|
+
|
|
112
|
+
**Verification step**: for any file matching a name in the table above, if its signature is also present, mark it 🟢 (ours, do not handle). If a file has the name but signature does NOT match (e.g., user happened to have their own file called `constitution.md` with different content), it falls back to one of the other layers (probably Layer 4 — suspicious markdown).
|
|
113
|
+
|
|
114
|
+
### Layer 6 — User's original files backed up by us
|
|
115
|
+
|
|
116
|
+
Distinct from Layers 1-4 (other harnesses) and Layer 5 (CCC-MAGI self): any file matching `*.pre-ccc-magi` (or `*.pre-ccc-magi.<timestamp>`) is the USER's original file content, preserved automatically when we installed our load-bearing files. These should be surfaced to the user in a dedicated 🟡 section so they understand what those files are (and can decide whether to view / restore / delete them).
|
|
117
|
+
|
|
118
|
+
Do NOT include these in the 3-option menu set (Step C). The 3-option menu is for "what to do with the user's prior harness configs"; the backups are already preserved and need no archive/delete action. If the user later wants to restore one, that's a manual step.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Step B — Present findings and confirm
|
|
123
|
+
|
|
124
|
+
Show the user a structured summary in **plain language**. Use a numbered list. Group by confidence level using emoji prefixes.
|
|
125
|
+
|
|
126
|
+
Template (display IN USER'S LOCALE — translate when showing):
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
I scanned your project. Here's what I found, grouped by whether you need to decide on it:
|
|
130
|
+
|
|
131
|
+
═══════════════════════════════════════════════════════════════
|
|
132
|
+
ITEMS NEEDING YOUR DECISION (numbered = possible harness configs)
|
|
133
|
+
═══════════════════════════════════════════════════════════════
|
|
134
|
+
|
|
135
|
+
📕 Known harness (high confidence):
|
|
136
|
+
1. <path> — <reason: matched <known-marker>>
|
|
137
|
+
2. ...
|
|
138
|
+
|
|
139
|
+
📗 Looks like harness config (medium confidence — I read the contents):
|
|
140
|
+
3. <path> — <reason: contains <keywords>; structured like <pattern>>
|
|
141
|
+
4. ...
|
|
142
|
+
|
|
143
|
+
📘 Suspicious markdown at project root (low confidence — please confirm):
|
|
144
|
+
5. <path> — <reason: mentioned <keywords> a few times but content looks like <type>>
|
|
145
|
+
|
|
146
|
+
═══════════════════════════════════════════════════════════════
|
|
147
|
+
INFORMATIONAL ONLY (not asking you about these)
|
|
148
|
+
═══════════════════════════════════════════════════════════════
|
|
149
|
+
|
|
150
|
+
✅ Confirmed unrelated (won't ask):
|
|
151
|
+
- README.md, LICENSE.md (standard project docs)
|
|
152
|
+
|
|
153
|
+
🟢 CCC-MAGI itself (won't ask — these came with the install):
|
|
154
|
+
- constitution.md (contains SLOT REGISTRY signature)
|
|
155
|
+
- CLAUDE.md (contains Bootstrap Status Check signature)
|
|
156
|
+
- AGENTS.md (contains Auditor Instructions section signature)
|
|
157
|
+
- .harness/, .claude/, .codex/, docs-harness/
|
|
158
|
+
- CCC_MAGI_README.md, CCC_MAGI_LICENSE
|
|
159
|
+
|
|
160
|
+
🟡 Backups of your original files (won't ask — your content was auto-backed-up):
|
|
161
|
+
- CLAUDE.md.pre-ccc-magi ← contains your original claude.md content
|
|
162
|
+
- (any other .pre-ccc-magi files)
|
|
163
|
+
|
|
164
|
+
Note: when CCC-MAGI was installed, we overwrote your CLAUDE.md / AGENTS.md /
|
|
165
|
+
constitution.md files and auto-backed-up your originals with the .pre-ccc-magi
|
|
166
|
+
suffix. To view your original content: `cat CLAUDE.md.pre-ccc-magi`.
|
|
167
|
+
To remove the backups when you no longer need them: `rm` manually.
|
|
168
|
+
Bootstrap will NOT touch these files.
|
|
169
|
+
|
|
170
|
+
═══════════════════════════════════════════════════════════════
|
|
171
|
+
|
|
172
|
+
Please tell me which items are NOT actually harness configs.
|
|
173
|
+
Input numbers separated by spaces (example: "3 5").
|
|
174
|
+
Or:
|
|
175
|
+
- Type "all" to confirm all numbered items ARE harness configs
|
|
176
|
+
- Type "none" to confirm none of them are harness → skip Steps C/D, jump to Step E (ask whether to start /init Step 2 configuration)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Important**: 🟢 and 🟡 items are NOT in the numbered list — the user cannot make decisions about them; they're informational only. Numbered options apply ONLY to 📕 / 📗 / 📘 categories.
|
|
180
|
+
|
|
181
|
+
Wait for user response.
|
|
182
|
+
|
|
183
|
+
After response, **re-list the updated set** (only the ones still classified as harness):
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
Updated harness file list:
|
|
187
|
+
1. <path>
|
|
188
|
+
2. <path>
|
|
189
|
+
...
|
|
190
|
+
|
|
191
|
+
Anything missing or incorrect in this list?
|
|
192
|
+
- If nothing's missing, type "done"
|
|
193
|
+
- Otherwise, describe (e.g., "3 is not harness", "missed my-rules/internal.md")
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Loop this confirmation until user says "done".** Do not advance to Step C until the user has explicitly confirmed the list.
|
|
197
|
+
|
|
198
|
+
### Special case: empty confirmed set
|
|
199
|
+
|
|
200
|
+
If after the user's responses the confirmed-harness list is **empty** (user marked all candidates as "not harness", or said "none" upfront), there is nothing to archive or delete. **Skip Step C and Step D entirely; jump directly to Step E** (invoke /init for Step 2 configuration).
|
|
201
|
+
|
|
202
|
+
Acknowledge this to the user before jumping (display in user's locale):
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
You confirmed there are no existing harness configs to handle.
|
|
206
|
+
Proceeding directly to Step 2 — CCC-MAGI configuration.
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Then proceed to Step E.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Step C — Present 3-option menu
|
|
214
|
+
|
|
215
|
+
After user says "done" **AND the confirmed set is non-empty**, present this menu (display in user's locale):
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
How would you like to handle these harness files?
|
|
219
|
+
|
|
220
|
+
[1] Take over + archive (recommended ★)
|
|
221
|
+
→ Create old_version_harness/ at project root
|
|
222
|
+
→ Move the confirmed files/dirs into it
|
|
223
|
+
→ Then start CCC-MAGI configuration (/init flow)
|
|
224
|
+
→ Lowest risk: your old files are preserved and reviewable anytime
|
|
225
|
+
|
|
226
|
+
[2] Take over + delete
|
|
227
|
+
→ Permanently delete the confirmed files/dirs
|
|
228
|
+
→ CCC-MAGI takes over the project
|
|
229
|
+
→ Warning: deletion is not recoverable
|
|
230
|
+
|
|
231
|
+
[3] Skip CCC-MAGI this session
|
|
232
|
+
→ For this conversation only, treat CCC-MAGI as not present and continue with the user's request
|
|
233
|
+
→ On the next CLI session, this prompt will appear again (until the user picks 1/2 or removes CCC-MAGI files manually)
|
|
234
|
+
|
|
235
|
+
Please enter 1 / 2 / 3:
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Wait for user response.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Step D — Execute the chosen option
|
|
243
|
+
|
|
244
|
+
### If user picks 1 (Take over + archive)
|
|
245
|
+
|
|
246
|
+
1. Confirm with user one more time (display in user's locale):
|
|
247
|
+
```
|
|
248
|
+
About to run:
|
|
249
|
+
mkdir old_version_harness
|
|
250
|
+
mv <file-1> old_version_harness/
|
|
251
|
+
mv <file-2> old_version_harness/
|
|
252
|
+
...
|
|
253
|
+
|
|
254
|
+
Confirm? (yes / no)
|
|
255
|
+
```
|
|
256
|
+
2. If `yes`:
|
|
257
|
+
- Use the `Bash` tool to create `old_version_harness/` and move each confirmed file/dir into it.
|
|
258
|
+
- Write `old_version_harness/README.md` documenting what was moved (file list, date, reason).
|
|
259
|
+
3. Proceed to Step E.
|
|
260
|
+
|
|
261
|
+
### If user picks 2 (Take over + delete)
|
|
262
|
+
|
|
263
|
+
1. **Show an explicit warning + require typed confirmation** (display in user's locale):
|
|
264
|
+
```
|
|
265
|
+
⚠️ You are about to permanently delete the following files / dirs:
|
|
266
|
+
• <path-1>
|
|
267
|
+
• <path-2>
|
|
268
|
+
...
|
|
269
|
+
|
|
270
|
+
This cannot be undone (unless you have a git commit to restore from).
|
|
271
|
+
|
|
272
|
+
To continue, type uppercase "DELETE" exactly (case-sensitive):
|
|
273
|
+
```
|
|
274
|
+
2. If user types exactly `DELETE` (untranslated — accept the literal English word as the safety phrase, even if conversing in another language):
|
|
275
|
+
- Use the `Bash` tool to `rm -rf` each confirmed file/dir.
|
|
276
|
+
3. If user types anything else:
|
|
277
|
+
- Abort the delete action; fall back to the 3-option menu.
|
|
278
|
+
4. Proceed to Step E.
|
|
279
|
+
|
|
280
|
+
### If user picks 3 (Skip this session)
|
|
281
|
+
|
|
282
|
+
1. Acknowledge (display in user's locale):
|
|
283
|
+
```
|
|
284
|
+
OK, this session won't use CCC-MAGI.
|
|
285
|
+
I'll proceed with your requests normally.
|
|
286
|
+
|
|
287
|
+
Note: the CCC-MAGI files are still in your project (.harness/, constitution.md, etc.).
|
|
288
|
+
On your next CLI session, I'll ask again whether you want to install.
|
|
289
|
+
To stop being prompted, manually delete the CCC-MAGI files from your project.
|
|
290
|
+
```
|
|
291
|
+
2. **Stop running this bootstrap driver.**
|
|
292
|
+
3. Continue the conversation normally — respond to whatever the user actually wants to do.
|
|
293
|
+
4. **Do NOT invoke any `.harness/skills/*` skills this session.** Treat them as not present.
|
|
294
|
+
5. **Do NOT write `.harness/state/install.json`** — leave it absent so next session re-prompts.
|
|
295
|
+
6. **Do NOT output the success marker** — the user is staying in the same CLI session for actual work, so no terminal-close signal is needed in standalone mode.
|
|
296
|
+
|
|
297
|
+
### If user picks anything else
|
|
298
|
+
|
|
299
|
+
Repeat the 3-option menu. Do not improvise variants.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Step E — Phase 1: Environment check
|
|
304
|
+
|
|
305
|
+
**Reached if**: user picked 1 or 2 in Step C, OR confirmed-set was empty (Step B special case).
|
|
306
|
+
|
|
307
|
+
Before filling project-specific values, verify the environment has the required dependencies (jq, git, at least one AI CLI). This is the "Phase 1" of the new two-phase bootstrap.
|
|
308
|
+
|
|
309
|
+
1. Check if Phase 1 was already done:
|
|
310
|
+
```bash
|
|
311
|
+
test -f .harness/state/env-check.json
|
|
312
|
+
```
|
|
313
|
+
- If exists → Phase 1 already passed in a previous session; skip to Step F.
|
|
314
|
+
- If missing → continue to step 2 below.
|
|
315
|
+
|
|
316
|
+
2. Run the environment detector via Bash tool:
|
|
317
|
+
```bash
|
|
318
|
+
.harness/scripts/env-check.sh
|
|
319
|
+
```
|
|
320
|
+
It outputs JSON with `required` (jq/git status), `ai_clis` (claude/codex/gemini presence), `tier` (recommended config), and `blockers` (missing required deps).
|
|
321
|
+
|
|
322
|
+
3. Surface findings to the user (in their OS locale). Example output:
|
|
323
|
+
```
|
|
324
|
+
Phase 1 — Environment check
|
|
325
|
+
|
|
326
|
+
Required dependencies:
|
|
327
|
+
✅ git installed (2.39.5)
|
|
328
|
+
❌ jq not installed ← blocker
|
|
329
|
+
|
|
330
|
+
AI CLIs:
|
|
331
|
+
✅ claude installed → Tier 1 candidate
|
|
332
|
+
✅ codex installed → Tier 1 candidate (cross-model audit available)
|
|
333
|
+
⚪ gemini not installed (optional)
|
|
334
|
+
|
|
335
|
+
Recommendation: Tier 1 — Claude writes, Codex audits
|
|
336
|
+
|
|
337
|
+
Need to install: jq
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
4. For each missing required dep (only jq is a true blocker — git must exist), present install options from the script's `jq_install_hints` field. Conversational, not error-out:
|
|
341
|
+
```
|
|
342
|
+
How to install jq?
|
|
343
|
+
[a] brew install jq (Homebrew detected — recommended, ~10s)
|
|
344
|
+
[b] download vendored jq binary to .harness/bin/jq (no sudo, ~5s)
|
|
345
|
+
[c] manual: I'll give you the command, you run it
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
5. Execute user's choice via Bash tool:
|
|
349
|
+
- **[a] brew**: run `brew install jq`, wait for completion, re-run env-check.sh to verify.
|
|
350
|
+
- **[b] vendored**: run `.harness/scripts/env-check.sh --install-jq-vendored` (downloads to `.harness/bin/jq`, updates PATH automatically next time). Verify.
|
|
351
|
+
- **[c] manual**: print command, wait for user to run it themselves, then re-run env-check.sh when they say done.
|
|
352
|
+
|
|
353
|
+
6. When `env-check.sh` shows `"all_required_ok": true`, finalize:
|
|
354
|
+
```bash
|
|
355
|
+
.harness/scripts/env-check.sh --finalize
|
|
356
|
+
```
|
|
357
|
+
This writes `.harness/state/env-check.json` and marks Phase 1 complete. **Proceed immediately to Step F (Phase 2)** — do NOT ask the user "ready for next phase?", just continue (UX should feel like one continuous flow).
|
|
358
|
+
|
|
359
|
+
## Step F — Phase 2: Project deployment (/init)
|
|
360
|
+
|
|
361
|
+
The environment is verified; now fill project-specific values (L0 slots in `constitution.md`). This is the `/init` skill.
|
|
362
|
+
|
|
363
|
+
1. Tell the user (display in user's locale; pick the line matching the path that led here):
|
|
364
|
+
```
|
|
365
|
+
✓ Phase 1 complete (environment verified, tier: <X>).
|
|
366
|
+
|
|
367
|
+
Phase 2: project deployment — answering questions to configure your project's constitution.
|
|
368
|
+
|
|
369
|
+
Pick mode:
|
|
370
|
+
[1] Simple — 5 questions, ~3 minutes (smart defaults for the other 11)
|
|
371
|
+
[2] Pro — 16 questions, ~15 minutes (full identity contract)
|
|
372
|
+
|
|
373
|
+
You can upgrade Simple → Pro anytime later by saying "升级到专业版" / "upgrade to pro".
|
|
374
|
+
|
|
375
|
+
Choose, or say 'later' to defer this phase (bootstrap will re-fire next session).
|
|
376
|
+
```
|
|
377
|
+
2. **If user picks [1] Simple or [2] Pro**: invoke the `/init` skill (`.harness/skills/init/SKILL.md`) with the matching `--simple` or `--pro` flag. The /init skill handles L0 question flow, slot rendering, validation, and writes `install.json`.
|
|
378
|
+
3. **If user says 'later' / no**: do nothing further this session. Surface this explicit notice (display in user's locale):
|
|
379
|
+
```
|
|
380
|
+
OK, project deployment (/init) skipped this session.
|
|
381
|
+
|
|
382
|
+
⚠️ Status: Phase 1 (environment check) was completed and saved. Phase 2 (project deployment)
|
|
383
|
+
was NOT completed.
|
|
384
|
+
|
|
385
|
+
What happens next time:
|
|
386
|
+
• The hook will fire and inject a shorter prompt (skipping the environment check since
|
|
387
|
+
it's already passed) asking ONLY about Phase 2.
|
|
388
|
+
• This is faster than starting from scratch — you've already passed the heavy part.
|
|
389
|
+
|
|
390
|
+
If you've decided against CCC-MAGI for good, manually delete .harness/ and constitution.md.
|
|
391
|
+
```
|
|
392
|
+
4. **If user says skip**: treat exactly like Step C option 3 — decline CCC-MAGI for this session. This branch is most relevant when Step E was reached via Step B's empty-confirmed-set jump (the user never saw the Step C menu and now wants to back out). Acknowledge (display in user's locale):
|
|
393
|
+
```
|
|
394
|
+
OK, this session won't use CCC-MAGI.
|
|
395
|
+
I'll proceed with your requests normally.
|
|
396
|
+
|
|
397
|
+
Note: the CCC-MAGI files are still in your project (.harness/, constitution.md, etc.).
|
|
398
|
+
On your next CLI session, I'll ask again whether you want to install.
|
|
399
|
+
To stop being prompted, manually delete the CCC-MAGI files from your project.
|
|
400
|
+
```
|
|
401
|
+
- **Stop running this bootstrap driver.**
|
|
402
|
+
- Continue the conversation normally — respond to whatever the user actually wants to do.
|
|
403
|
+
- **Do NOT invoke any `.harness/skills/*` skills this session.** Treat them as not present.
|
|
404
|
+
- **Do NOT write `.harness/state/install.json`** — leave it absent so next session re-prompts.
|
|
405
|
+
- **Do NOT output the success marker** — the user is staying in the same CLI session for actual work, so no terminal-close signal is needed in standalone mode.
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## Completion criteria
|
|
410
|
+
|
|
411
|
+
The bootstrap is complete when ONE of the following is true:
|
|
412
|
+
|
|
413
|
+
1. User picked option 3 → conversation continues without harness this session
|
|
414
|
+
2. User picked option 1 or 2 AND user declined Step E → environment is cleaned but config not yet filled (next session: bootstrap sees no install.json → re-prompts; CLAUDE.md still has bootstrap block)
|
|
415
|
+
3. User picked option 1 or 2 AND completed `/init` → `install.json` exists → fully configured
|
|
416
|
+
|
|
417
|
+
For case 3 only, output the completion marker on its own line:
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
✓ Task complete, close terminal
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
This marker is for CCC's terminal monitor. In standalone mode CCC isn't watching, but emitting the marker is harmless and keeps the two modes uniform.
|
|
424
|
+
|
|
425
|
+
---
|
|
426
|
+
|
|
427
|
+
## Rules you MUST follow
|
|
428
|
+
|
|
429
|
+
- **Never skip the user-confirmation loops.** Steps B and C require explicit user input each time.
|
|
430
|
+
- **Never delete files in option 1.** Option 1 = move (mv), not delete (rm). Files go to `old_version_harness/`.
|
|
431
|
+
- **Never execute option 2 without the typed "DELETE" confirmation.** Anything other than exact `DELETE` aborts.
|
|
432
|
+
- **Never write `install.json` if the user picked option 3.** The whole point of option 3 is that the user can re-decide next session.
|
|
433
|
+
- **Never invoke `.harness/skills/*` skills under option 3.** Pretend they don't exist for this session.
|
|
434
|
+
- **Never improvise the 3-option menu text.** Show exactly the wording above so behavior is predictable.
|
|
435
|
+
- **Never advance past Step B without user typing "done".** No silent advance.
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## What this file is NOT
|
|
440
|
+
|
|
441
|
+
- This is NOT the `/init` skill. /init is a separate skill at `.harness/skills/init/SKILL.md` that handles L0 question flow. This bootstrap calls /init as the final step (under options 1/2).
|
|
442
|
+
- This is NOT the CCC-bundled Step 1 driver. CCC ships its own driver in its app bundle. The two drivers are nearly identical in content but differ in completion behavior (CCC closes terminal; standalone continues working in the same CLI).
|
|
443
|
+
- This is NOT for re-configuration. If the user wants to change project identity after installation, they use `/constitution-edit`. If they want to start over completely, they delete `.harness/state/install.json` and re-run this bootstrap.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: abandon
|
|
3
|
+
description: |
|
|
4
|
+
Mark an in-progress feature as abandoned. Archives the checkpoint to `_archived/<feature>-abandoned-<timestamp>.json`, logs the decision to decision-log.md, and optionally archives related artifact files (spec / implementation / plan). Does NOT touch git or source code — that's CEO's job (git revert, branch delete, etc.).
|
|
5
|
+
|
|
6
|
+
Trigger when the user:
|
|
7
|
+
- Invokes `/abandon <feature-slug>` or `/abandon` (resolves to current branch's feature)
|
|
8
|
+
- Says "drop user-login, we're not doing it" / "放弃 user-login 这个功能" / "user-login 작업을 중단"
|
|
9
|
+
- Says "remove the checkpoint for X" / "forget about the X feature"
|
|
10
|
+
argument-hint: <feature-slug> [--archive-artifacts] [--force]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# /abandon
|
|
14
|
+
|
|
15
|
+
> **MAGI position**: Operated by **MAGI Archivist**. Archivist's job is final-state record-keeping — when a feature dies, Archivist files the paperwork.
|
|
16
|
+
|
|
17
|
+
> *Constitutional basis: Stage 7 (CEO smoke test) of `CLAUDE.md § Workflow` empowers CEO to reject a feature outright. `/abandon` is the formal record of that rejection — without it, stale checkpoints accumulate and `/pickup --list` becomes noise.*
|
|
18
|
+
|
|
19
|
+
## When to use
|
|
20
|
+
|
|
21
|
+
Three legitimate scenarios:
|
|
22
|
+
|
|
23
|
+
1. **CEO rejects the feature post-spec** — after Stage 1 paraphrase + edge cases, CEO realizes the feature shouldn't exist. Abandon before any code is written.
|
|
24
|
+
2. **Smoke test fails irrecoverably** — after Stage 7, CEO decides the feature is fundamentally wrong. Abandon, do not `/commit`.
|
|
25
|
+
3. **Cleanup of dormant features** — `/pickup --list` shows a feature you started 3 months ago and never finished. If you're not going back, abandon it to clear the slot.
|
|
26
|
+
|
|
27
|
+
**Do NOT use `/abandon` for**:
|
|
28
|
+
- Temporary pauses (just close Claude — checkpoint persists)
|
|
29
|
+
- "Done shipped" features (`/commit` handles those via `--archive`)
|
|
30
|
+
- Renaming a feature (use `/feature-draft <new-name>` then `/abandon <old-name>`)
|
|
31
|
+
|
|
32
|
+
## What it does
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
─── /abandon user-login ───────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
📂 Found checkpoint: .harness/state/workflow-checkpoints/user-login.json
|
|
38
|
+
Stage: 5 (3/8 files done)
|
|
39
|
+
Started: 2026-03-15 (73 days ago)
|
|
40
|
+
Last activity: 2026-04-02 (54 days ago)
|
|
41
|
+
|
|
42
|
+
⚠️ Abandoning will:
|
|
43
|
+
✓ Move checkpoint → .harness/state/workflow-checkpoints/_archived/
|
|
44
|
+
✓ Log "abandoned" entry to .harness/memory/decision-log.md
|
|
45
|
+
|
|
46
|
+
Optional (use --archive-artifacts to enable):
|
|
47
|
+
◯ Move docs/features/user-login.md → docs/features/_abandoned/
|
|
48
|
+
◯ Move docs/features/user-login-implementation.md → docs/features/_abandoned/
|
|
49
|
+
◯ Move docs/features/user-login-plan.md → docs/features/_abandoned/
|
|
50
|
+
|
|
51
|
+
This does NOT touch:
|
|
52
|
+
✗ git history (use git revert / git branch -D yourself)
|
|
53
|
+
✗ Source code that was already implemented (use git checkout or git reset)
|
|
54
|
+
✗ Database migrations (run a rollback migration yourself)
|
|
55
|
+
|
|
56
|
+
Reason for abandoning? (required for decision-log)
|
|
57
|
+
>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
After user enters reason, MAGI Archivist:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# 1. Archive the checkpoint
|
|
64
|
+
.harness/scripts/checkpoint-write.sh \
|
|
65
|
+
--feature user-login \
|
|
66
|
+
--archive
|
|
67
|
+
|
|
68
|
+
# Rename archived file to mark as abandoned (not completed)
|
|
69
|
+
mv .harness/state/workflow-checkpoints/_archived/user-login-*.json \
|
|
70
|
+
.harness/state/workflow-checkpoints/_archived/user-login-abandoned-$(date -u +%Y%m%dT%H%M%SZ).json
|
|
71
|
+
|
|
72
|
+
# 2. Log decision
|
|
73
|
+
.harness/scripts/decision-log-append.sh \
|
|
74
|
+
--feature user-login --stage abandon --by "CEO" \
|
|
75
|
+
--decision "abandoned: <user's reason>" \
|
|
76
|
+
--evidence "$(git rev-parse --short HEAD 2>/dev/null || echo 'no-git')"
|
|
77
|
+
|
|
78
|
+
# 3. (if --archive-artifacts) Move artifact files
|
|
79
|
+
if [ "$ARCHIVE_ARTIFACTS" = "true" ]; then
|
|
80
|
+
mkdir -p docs/features/_abandoned
|
|
81
|
+
for artifact in docs/features/user-login.md docs/features/user-login-implementation.md docs/features/user-login-plan.md; do
|
|
82
|
+
[ -f "$artifact" ] && mv "$artifact" docs/features/_abandoned/
|
|
83
|
+
done
|
|
84
|
+
fi
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Final report to CEO:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
✓ Feature 'user-login' abandoned.
|
|
91
|
+
Checkpoint archived: .harness/state/workflow-checkpoints/_archived/user-login-abandoned-20260528T034512Z.json
|
|
92
|
+
Decision logged.
|
|
93
|
+
Artifact files: kept in place (use --archive-artifacts to move)
|
|
94
|
+
|
|
95
|
+
Don't forget:
|
|
96
|
+
• Delete git branch: git branch -D feature/user-login
|
|
97
|
+
• Revert unfinished code: git checkout main -- src/auth/
|
|
98
|
+
• Run any rollback migrations needed
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Behaviors
|
|
102
|
+
|
|
103
|
+
### No-args mode
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
/abandon
|
|
107
|
+
```
|
|
108
|
+
- Reads current git branch, derives feature slug
|
|
109
|
+
- If no checkpoint matches → tells user *"No checkpoint to abandon on this branch."*
|
|
110
|
+
|
|
111
|
+
### Force mode
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
/abandon user-login --force
|
|
115
|
+
```
|
|
116
|
+
- Skips the confirmation prompt
|
|
117
|
+
- Still requires a reason (will use `"(no reason given)"` if none provided in subsequent interaction)
|
|
118
|
+
- Use for scripting / programmatic cleanup
|
|
119
|
+
|
|
120
|
+
### Artifact archive mode
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
/abandon user-login --archive-artifacts
|
|
124
|
+
```
|
|
125
|
+
- Moves `docs/features/user-login*.md` to `docs/features/_abandoned/`
|
|
126
|
+
- Useful when the spec was misguided and shouldn't be confused with future correct specs
|
|
127
|
+
- Default OFF — most users prefer to keep spec for reference / future reuse
|
|
128
|
+
|
|
129
|
+
## Recovery (if you abandon by accident)
|
|
130
|
+
|
|
131
|
+
Within the same git session, an abandoned checkpoint is fully recoverable:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Find the archived checkpoint
|
|
135
|
+
ls -t .harness/state/workflow-checkpoints/_archived/user-login-abandoned-*.json | head -1
|
|
136
|
+
|
|
137
|
+
# Move it back
|
|
138
|
+
mv .harness/state/workflow-checkpoints/_archived/user-login-abandoned-<ts>.json \
|
|
139
|
+
.harness/state/workflow-checkpoints/user-login.json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The artifact files (if `--archive-artifacts` was used) can be moved back from `docs/features/_abandoned/` the same way.
|
|
143
|
+
|
|
144
|
+
## Failure modes
|
|
145
|
+
|
|
146
|
+
| Symptom | Cause | Fix |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| "No checkpoint found for `<feature>`" | Never had one OR already abandoned | Check `_archived/`; nothing to do |
|
|
149
|
+
| "Branch doesn't match feature slug" | You're on `main` or unrelated branch | Provide `--feature` explicitly: `/abandon user-login` |
|
|
150
|
+
| "decision-log-append failed" | `.harness/memory/` perms issue or jq missing | Fix perms or `brew install jq` |
|
|
151
|
+
|
|
152
|
+
## Completion criteria
|
|
153
|
+
|
|
154
|
+
- Checkpoint file moved to `_archived/` directory
|
|
155
|
+
- Decision-log entry written with CEO's reason
|
|
156
|
+
- Reason was captured (not silently abandoned)
|
|
157
|
+
- Final report displayed showing what happened + what user still needs to do (git, migrations)
|