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,395 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit-spec
|
|
3
|
+
description: This skill should be used when starting an audit of an existing feature. It is Stage 1 in audit mode of the dual-mode feature workflow. The CEO walks the same intent rounds as new-feature mode (paraphrase + {{edge_case_categories}} sweep + auditor external review) to produce the *intended* spec, THEN a fresh general-purpose subagent (clean context, MCP access if configured) reads the codebase + live state and produces an as-built reading; Main Claude diffs intent vs as-built and surfaces deltas; the CEO decides each delta. Output is the two-file model (CEO + implementation) plus a Section 9 delta list that becomes Stage 3+ work. Trigger when the user invokes /audit-spec, says "check if the spec matches reality", "audit the existing feature X", "verify the auth feature", "fresh as-built review", "check what the [feature] code actually does", or wants to reverse-engineer an existing implementation.
|
|
4
|
+
argument-hint: [feature-name]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /audit-spec
|
|
8
|
+
|
|
9
|
+
Drive Stage 1 of the workflow in **audit mode**: produce a finalized canonical spec for an existing feature, plus a delta list that drives Stage 3+ work to bring the code into alignment.
|
|
10
|
+
|
|
11
|
+
The output is the same **two-file model** as new-feature mode:
|
|
12
|
+
|
|
13
|
+
- `{{spec_dir}}<name>.md` — CEO domain. Plain language, no tech terms. Section 9 (Delta) is populated with deltas the CEO chose to act on.
|
|
14
|
+
- `{{implementation_dir}}<name>-implementation.md` — manager domain. Tech detail, when the feature warrants it.
|
|
15
|
+
|
|
16
|
+
Plus a frozen as-built snapshot at `.harness/audits/<name>-as-built-<YYYY-MM-DD>.md` that records what the code did at audit time.
|
|
17
|
+
|
|
18
|
+
## Why this flow
|
|
19
|
+
|
|
20
|
+
Audit mode lands on the same finalized two-file spec as new-feature mode, but it adds an extra reconciliation phase between intent and code. Without it, you have two failure modes:
|
|
21
|
+
|
|
22
|
+
- **Intent-only** (skip code) — spec ships with drift unaddressed; the bug surfaces at Stage 7 smoke test or post-launch.
|
|
23
|
+
- **Code-only** (skip intent rounds) — spec inherits whatever drift the code already has; the audit anchors on a stale implementation.
|
|
24
|
+
|
|
25
|
+
So the flow is **intent first, code second, reconcile third**. CEO intent grounds the spec; fresh-context code analysis surfaces deltas; CEO decides each delta.
|
|
26
|
+
|
|
27
|
+
Three layers of independence remove implementer-grades-own-work bias from the audit:
|
|
28
|
+
|
|
29
|
+
1. **Conversation-level** (paraphrase + edge-case sweep) for intent — same as new-feature mode.
|
|
30
|
+
2. **Context-level** (fresh subagent reading code + live state) for as-built — the subagent has no prior conversation, no anchoring on the existing canonical spec.
|
|
31
|
+
3. **Model-level** (auditor) twice — once on the consensus intent spec, once optionally on the as-built reading.
|
|
32
|
+
|
|
33
|
+
## Authoritative sources
|
|
34
|
+
|
|
35
|
+
1. **Root `CLAUDE.md`** — workflow modes, two-file model, lane definitions
|
|
36
|
+
2. **`constitution.md`** — Universal Core + project identity, both shape the intended behavior
|
|
37
|
+
3. **`{{rule_sources}}`** — any scoped rule docs that constrain this feature
|
|
38
|
+
4. **The code surface** — discovered in Step 6, read in Step 7
|
|
39
|
+
|
|
40
|
+
The intent rounds (Steps 1–5) **must not** read the existing canonical spec or any policy doc that describes the feature's intended behavior. Those represent prior intent, not necessarily the right intent today; we want the CEO to re-state intent freshly.
|
|
41
|
+
|
|
42
|
+
The as-built subagent (Step 7) **must not** read `{{spec_dir}}<feature>.md` or any other policy doc. It documents reality, not intent.
|
|
43
|
+
|
|
44
|
+
## Invocation
|
|
45
|
+
|
|
46
|
+
- Typical: `/audit-spec <feature-name>` (e.g., `/audit-spec auth`)
|
|
47
|
+
- `$ARGUMENTS` identifies the feature being audited.
|
|
48
|
+
|
|
49
|
+
If `$ARGUMENTS` is missing, ask. Do not guess.
|
|
50
|
+
|
|
51
|
+
## Pre-stage check
|
|
52
|
+
|
|
53
|
+
Before Step 1:
|
|
54
|
+
|
|
55
|
+
1. `git status` — clean? If uncommitted changes exist, surface them and ask.
|
|
56
|
+
2. Existing `{{spec_dir}}<name>.md` — if it exists, note its date and Status. We do not read it during intent rounds, but we'll diff against it at the end.
|
|
57
|
+
3. State recap to user: "Pre-stage clear. Lane: Full workflow (audit). Intent rounds first; then code analysis; then delta reconciliation. Anything to adjust before we start?"
|
|
58
|
+
|
|
59
|
+
Do not proceed without an explicit go-ahead.
|
|
60
|
+
|
|
61
|
+
## Steps 1–5 — Intent rounds (same shape as new-feature mode)
|
|
62
|
+
|
|
63
|
+
Run the new-feature-mode flow exactly as described in `feature-draft` SKILL.md, with one twist: do not read the existing `{{spec_dir}}<feature>.md` even if it exists.
|
|
64
|
+
|
|
65
|
+
- **Step 1 — CEO happy path + paraphrase.** What does the CEO believe the feature should do? Plain language, no tech terms.
|
|
66
|
+
- **Step 2 — Edge-case round.** Walk all applicable categories from `{{edge_case_categories}}`. 3–5 questions per category; CEO decides each behavior.
|
|
67
|
+
- **Step 3 — Write spec v1.** Use the same template as new-feature mode. Write to `{{spec_dir}}<feature>.md` with Status: `DRAFT (audit, intent phase) <YYYY-MM-DD>`. Section 9 ("Code vs spec delta") is left empty for now — populated at Step 9.
|
|
68
|
+
- **Step 4 — Auditor external review on the intent spec.** Same gate as new-feature mode, with the spec-tuned adversarial preset:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
AUDITOR_GATE_PRESET=adversarial-spec \
|
|
72
|
+
AUDITOR_GATE_TARGET_LABEL="<feature> Stage 1 audit intent spec" \
|
|
73
|
+
bash .harness/scripts/auditor-gate.sh review <feature> 1-audit-intent \
|
|
74
|
+
"Review this Stage 1 (audit-mode, intent phase) spec for the `<feature>` feature. Main Claude and CEO have just walked an edge-case round through {{edge_case_categories}} to capture *intended* behavior; the code itself has not yet been read. Your job is the external-model layer on intent. Beyond the preset's spec attack surface, also weigh: subtle scenarios within the categories the CEO and Main Claude missed; concerns outside the configured categories (domain-specific norms per constitution.md Section 2 — Project Identity; cross-feature implications); spec-internal contradictions. Do NOT flag: anything that requires reading the codebase to evaluate (that's the next phase); writing style; section ordering; suggestions to extend scope. Stay in plain-language territory; the spec is intentionally tech-term-free." \
|
|
75
|
+
{{spec_dir}}<feature>.md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- **Step 5 — Iterate to consensus.** Same shape as new-feature Step 5: surface auditor findings, CEO chooses accept/reject/defer per item, update spec, re-run the gate. Stage 1 intent phase is finalized when the auditor returns no new BLOCKING/STRONG and the CEO declares "OK on intent — let's read the code."
|
|
79
|
+
|
|
80
|
+
At this point the spec is the **intended** state. Status line still reads `DRAFT (audit, intent phase) <date>` — not yet finalized.
|
|
81
|
+
|
|
82
|
+
## Step 6 — Spawn discovery subagent (code surface)
|
|
83
|
+
|
|
84
|
+
Spawn a fresh `general-purpose` subagent via the Task tool. Give it this prompt:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
You are doing Stage 1 (audit mode, code-discovery phase) for the `<feature>` feature.
|
|
88
|
+
Your context starts fresh. You have no prior conversation about this feature.
|
|
89
|
+
|
|
90
|
+
DO NOT read any of these:
|
|
91
|
+
- {{spec_dir}}<feature>.md
|
|
92
|
+
- {{implementation_dir}}<feature>-implementation.md
|
|
93
|
+
- any other {{spec_dir}}*.md
|
|
94
|
+
- any policy doc from {{rule_sources}} describing this feature
|
|
95
|
+
|
|
96
|
+
Those represent intent. We want the as-built read to describe reality independently.
|
|
97
|
+
|
|
98
|
+
Your task: produce a candidate path list of files / folders that constitute the
|
|
99
|
+
audit surface for `<feature>`. Discovery rules:
|
|
100
|
+
|
|
101
|
+
1. ALWAYS include `{{feature_folder_pattern}}<feature>/**` (recursive).
|
|
102
|
+
|
|
103
|
+
2. CROSS-FEATURE IMPORTS — grep for files outside `{{feature_folder_pattern}}<feature>/`
|
|
104
|
+
that import from this feature's public surface. They use the feature's surface;
|
|
105
|
+
they may belong in the audit.
|
|
106
|
+
|
|
107
|
+
3. BACKEND FUNCTION NAME MATCHES — if `{{backend_code_paths}}` is configured,
|
|
108
|
+
list backend functions / endpoints whose names match the feature's keywords.
|
|
109
|
+
Justify why each belongs.
|
|
110
|
+
|
|
111
|
+
4. MIGRATION MATCHES — if `{{migration_dir}}` is configured: migrations whose
|
|
112
|
+
filename or content references the feature's primary tables (use `grep -l`).
|
|
113
|
+
|
|
114
|
+
5. ENTRY-POINT / ROUTE MATCHES — any router / entry files referencing this feature's screens.
|
|
115
|
+
|
|
116
|
+
6. RELATED-FEATURE FOLDERS — adjacent feature folders that share concerns by name;
|
|
117
|
+
tag as "related-feature candidate, user may scope in or out."
|
|
118
|
+
|
|
119
|
+
7. LIVE BACKEND PROBES (if the project has a configured database MCP or equivalent
|
|
120
|
+
read-only access):
|
|
121
|
+
- List tables + columns
|
|
122
|
+
- List deployed functions / endpoints
|
|
123
|
+
- List applied migrations
|
|
124
|
+
- For auth-shaped features: note auth-provider config (rate limits, OTP TTL,
|
|
125
|
+
MFA flags) — these aren't visible in code but matter for reality.
|
|
126
|
+
|
|
127
|
+
Return a structured path list with one-line rationale per path:
|
|
128
|
+
|
|
129
|
+
[Path] — [why included] — [confidence: certain | likely | candidate]
|
|
130
|
+
|
|
131
|
+
Group by category (feature folder / cross-feature consumers / backend functions
|
|
132
|
+
/ migrations / routes / related-feature candidates / live-state notes).
|
|
133
|
+
|
|
134
|
+
Do not write the as-built yet. Do not read the existing canonical spec. Just
|
|
135
|
+
return the candidate surface list.
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Surface the subagent's path list verbatim to the CEO. Get explicit confirmation:
|
|
139
|
+
|
|
140
|
+
> "The discovery subagent suggests this surface. Anything to add, remove, or reclassify (especially related-feature candidates)?"
|
|
141
|
+
|
|
142
|
+
Wait for confirmation. Do not proceed with an unverified path list.
|
|
143
|
+
|
|
144
|
+
## Step 7 — Spawn as-built subagent (write the as-built)
|
|
145
|
+
|
|
146
|
+
Spawn a **fresh** `general-purpose` subagent (separate from the discovery one) with the confirmed path list, the discovery subagent's MCP findings, and instructions to write the as-built. Use this prompt:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Confirmed audit surface:
|
|
150
|
+
- <path 1> — <rationale>
|
|
151
|
+
- <path 2> — <rationale>
|
|
152
|
+
- ...
|
|
153
|
+
|
|
154
|
+
Live-state probes already gathered:
|
|
155
|
+
- <e.g., "Auth provider sms_otp_exp = 180s, MFA TOTP enroll/verify both false">
|
|
156
|
+
|
|
157
|
+
Now produce the as-built reading.
|
|
158
|
+
|
|
159
|
+
Read every file on the confirmed list. Use the configured backend MCP (if any)
|
|
160
|
+
to verify live state (column types, deployed function versions, access-control
|
|
161
|
+
policies, etc.). Cite file:line for every documented behavior.
|
|
162
|
+
|
|
163
|
+
Output as a single markdown document using this template:
|
|
164
|
+
|
|
165
|
+
# Feature: <feature> (As-built)
|
|
166
|
+
## Status: AS-BUILT DRAFT <YYYY-MM-DD>
|
|
167
|
+
## Summary
|
|
168
|
+
## User stories
|
|
169
|
+
Phrase as "As a <role>, I can <action> because <code path>." Cite file:line.
|
|
170
|
+
## Scope
|
|
171
|
+
### In scope ### Out of scope (boundaries)
|
|
172
|
+
## UI surface
|
|
173
|
+
## Data requirements
|
|
174
|
+
Tables, RPCs, functions exercised. Cite migration file:line and
|
|
175
|
+
function file:line. Include client-side caches. MCP confirmations noted.
|
|
176
|
+
## Access and permissions
|
|
177
|
+
Auth state requirements, access-control policies, function JWT verification,
|
|
178
|
+
service-role usage. Cite file:line.
|
|
179
|
+
## External dependencies
|
|
180
|
+
## Live config
|
|
181
|
+
Anything from MCP probes that affects behavior but isn't in the repo.
|
|
182
|
+
## i18n
|
|
183
|
+
String keys present in code; spot-check coverage across {{supported_locales}}.
|
|
184
|
+
## Error and empty states
|
|
185
|
+
## Rate limiting / abuse defenses
|
|
186
|
+
## Behaviors not fitting the template (anomalies / drift / extras)
|
|
187
|
+
Anything the code does that doesn't fit cleanly above. Be explicit:
|
|
188
|
+
"This exists at file:line; CEO may want to verify whether it should remain."
|
|
189
|
+
## Implementation map
|
|
190
|
+
File-by-file: what each file contributes. One short sentence per file.
|
|
191
|
+
|
|
192
|
+
For every documented behavior, cite file:line. If something is ambiguous from
|
|
193
|
+
reading the code (a flag, a magic constant, a branch whose intent isn't clear),
|
|
194
|
+
mark explicitly:
|
|
195
|
+
|
|
196
|
+
[AMBIGUOUS — code shows X at file:line; intent unclear from code alone]
|
|
197
|
+
|
|
198
|
+
If a section doesn't apply, mark `[NOT APPLICABLE]` with one sentence why.
|
|
199
|
+
|
|
200
|
+
Do NOT infer intent. If the code does Z, document Z exists; do not assume Z is
|
|
201
|
+
"supposed to" do anything beyond what's coded. Do not silently fill in what
|
|
202
|
+
you'd expect to find.
|
|
203
|
+
|
|
204
|
+
Write the file directly to `.harness/audits/<feature>-as-built-<YYYY-MM-DD>.md`.
|
|
205
|
+
Use today's date.
|
|
206
|
+
|
|
207
|
+
Return only a confirmation message ("As-built written to <path>") plus a
|
|
208
|
+
brief list of any [AMBIGUOUS] or [NOT APPLICABLE] markers placed.
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
When the subagent returns, verify the file was written and is non-empty.
|
|
212
|
+
|
|
213
|
+
## Step 8 — (Optional) Auditor review on the as-built
|
|
214
|
+
|
|
215
|
+
The load-bearing auditor pass is on the intent spec at Step 4. An additional pass on the as-built is recommended for large or complex features — it catches incorrect citations, missing user-facing behaviors, and code-vs-doc contradictions. CEO can opt in/out.
|
|
216
|
+
|
|
217
|
+
If running, use the code-shaped adversarial preset:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
AUDITOR_GATE_PRESET=adversarial \
|
|
221
|
+
AUDITOR_GATE_TARGET_LABEL="<feature> Stage 1 audit as-built reading" \
|
|
222
|
+
bash .harness/scripts/auditor-gate.sh review <feature> 1-audit-asbuilt \
|
|
223
|
+
"Review this as-built reading for the `<feature>` feature. The author was a fresh-context Main Claude subagent with backend MCP access; you have neither prior conversation nor MCP. Your job is to catch what same-model authorship may miss. Beyond the preset's attack surface, weigh: incorrect file:line citations; missing user-facing behaviors visible in the cited code but undocumented; unfounded assumptions ('this is gated on X' — is the gate actually enforced where claimed?); contradictions between the cited code and the as-built description. Do NOT flag: project-convention choices per {{anti_flag_rules}}, formatting, naming, or suggestions for additional sections beyond the template. Stay scoped to whether the as-built accurately describes what the cited code does." \
|
|
224
|
+
".harness/audits/<feature>-as-built-<date>.md"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Surface findings to the CEO, who decides whether the as-built needs corrections before Step 9.
|
|
228
|
+
|
|
229
|
+
## Step 9 — Diff: intent vs as-built
|
|
230
|
+
|
|
231
|
+
**Maximum 5 clarification questions.** If more than 5 ambiguities are surfaced by the audit, merge similar ones or drop low-priority ones to stay at or under 5. Asking many small questions creates user fatigue and produces lower-quality answers than asking few high-leverage ones.
|
|
232
|
+
|
|
233
|
+
If the audit truly surfaces >5 distinct material ambiguities, the spec is likely too broad — propose splitting it into multiple specs before continuing.
|
|
234
|
+
|
|
235
|
+
Now Main Claude reads BOTH:
|
|
236
|
+
|
|
237
|
+
- `{{spec_dir}}<feature>.md` (the intent spec, Status: DRAFT (audit, intent phase))
|
|
238
|
+
- `.harness/audits/<feature>-as-built-<date>.md` (the as-built)
|
|
239
|
+
|
|
240
|
+
Surface the diff to the CEO using this format:
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
Analysis complete. Comparing the intended spec with what the code does:
|
|
244
|
+
|
|
245
|
+
✅ Matching scenarios:
|
|
246
|
+
- 2.1, 2.2, 2.3
|
|
247
|
+
- 3.1, 3.2, 3.4
|
|
248
|
+
|
|
249
|
+
⚠️ Differences found (CEO decision needed):
|
|
250
|
+
|
|
251
|
+
Δ 1: [Scenario X — name in plain language]
|
|
252
|
+
Intent: A
|
|
253
|
+
Code: B
|
|
254
|
+
Which side wins?
|
|
255
|
+
|
|
256
|
+
Δ 2: [Scenario Y]
|
|
257
|
+
Intent: A
|
|
258
|
+
Code: missing entirely
|
|
259
|
+
Implement, or revise intent?
|
|
260
|
+
|
|
261
|
+
🆕 In code, not in intent:
|
|
262
|
+
- Code does X at file:line — not described in the intended spec
|
|
263
|
+
- Add to spec? Remove from code? Out of scope?
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
For each delta, ask the CEO to choose one of four resolutions:
|
|
267
|
+
|
|
268
|
+
- **a. Keep code, add to intent spec** — code is right, intent missed it
|
|
269
|
+
- **b. Keep intent, modify code** — intent is right, code is wrong (Stage 3+ work)
|
|
270
|
+
- **c. Both change** — neither side is right, define a new behavior (Stage 3+ work)
|
|
271
|
+
- **d. Out of scope** — defer; record as known limitation
|
|
272
|
+
|
|
273
|
+
**Wait for user response before continuing.**
|
|
274
|
+
|
|
275
|
+
## Step 10 — Integrate decisions into spec v2
|
|
276
|
+
|
|
277
|
+
For each delta:
|
|
278
|
+
|
|
279
|
+
- (a) — append the missing scenario to the appropriate section, classify [Required automated test] / [Smoke test only], add CEO-confirmed smoke procedure where applicable.
|
|
280
|
+
- (b), (c) — append to Section 9 (Code vs spec delta) with action item ("Stage 3+ work: scenario X.Y needs implementation change").
|
|
281
|
+
- (d) — append to Section 6 (Deferred / unresolved) with reason.
|
|
282
|
+
|
|
283
|
+
Update Status to `FINALIZED <YYYY-MM-DD>` once the integration is done.
|
|
284
|
+
|
|
285
|
+
## Step 11 — Optional: implementation file
|
|
286
|
+
|
|
287
|
+
If the feature warrants tech detail (routing, components, access-control policies, library decisions, i18n keys), produce `{{implementation_dir}}<feature>-implementation.md` based on the as-built reading. Same shape as new-feature mode. Skip for simple features.
|
|
288
|
+
|
|
289
|
+
**EARS notation in manager file**: When auditing a manager-domain `<name>-implementation.md` file, recognize EARS-formatted requirements (`WHEN [trigger] THE SYSTEM SHALL [response]`) as functional-requirement statements. Surface drift between EARS requirements and code — if a SHALL clause makes a claim that the code doesn't honor, that's a delta to flag.
|
|
290
|
+
|
|
291
|
+
If the manager file has prose-style functional requirements (no EARS), do NOT flag this as a defect — EARS is a v0.6+ convention and pre-existing files may not use it. But surface to the user as an advisory: "Manager file has N prose-style requirements; consider promoting to EARS for testability."
|
|
292
|
+
|
|
293
|
+
## Step 12 — Auditor final pass on integrated spec
|
|
294
|
+
|
|
295
|
+
After deltas are resolved, run a final auditor pass on the integrated CEO spec with the spec-tuned adversarial preset:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
AUDITOR_GATE_PRESET=adversarial-spec \
|
|
299
|
+
AUDITOR_GATE_TARGET_LABEL="<feature> Stage 1 audit finalized integrated spec" \
|
|
300
|
+
bash .harness/scripts/auditor-gate.sh review <feature> 1-audit-final \
|
|
301
|
+
"Review this finalized audit-mode spec. The intent phase has been auditor-reviewed already; this final pass is on the integrated spec after delta reconciliation with the as-built code reading. Beyond the preset's spec attack surface, focus on: contradictions introduced by the integration (e.g., a code-derived scenario added in section 3.X conflicts with happy path 2.Y); Section 9 deltas that should have been integrated into the main spec instead of left as a delta; missing scenarios surfaced by the as-built that didn't make it into either the spec or Section 9. Do NOT flag: writing style; section ordering; suggestions to extend scope; opinions on technical architecture (the spec is plain-language). Stay scoped to integration consistency." \
|
|
302
|
+
{{spec_dir}}<feature>.md
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Iterate as needed. Stage 1 audit is finalized when the auditor returns no new BLOCKING/STRONG and the CEO declares "OK, proceed."
|
|
306
|
+
|
|
307
|
+
## Step 13 — Hand off
|
|
308
|
+
|
|
309
|
+
Surface to the CEO:
|
|
310
|
+
|
|
311
|
+
- **CEO spec:** `{{spec_dir}}<feature>.md` (FINALIZED, Section 9 lists deltas to act on)
|
|
312
|
+
- **Implementation notes:** `{{implementation_dir}}<feature>-implementation.md` (if produced)
|
|
313
|
+
- **Frozen as-built snapshot:** `.harness/audits/<feature>-as-built-<date>.md` (record of code state at audit time; not maintained going forward)
|
|
314
|
+
- **Recommended next step:** "If Section 9 has any (b) or (c) deltas, run `/spec-finalize <feature>` then proceed to `/db-schema` (if schema affected AND `backend_db_type` is configured) or `/execution-plan` (if code-only) to bring the code into alignment. If Section 9 is empty, the audit served as a documentation pass and you can stop here."
|
|
315
|
+
|
|
316
|
+
## Trust contract
|
|
317
|
+
|
|
318
|
+
- **Intent rounds run before code reading.** Reverse the order and the CEO anchors on existing implementation drift.
|
|
319
|
+
- **The intent-phase subagent does not read existing specs.** Anchoring on a stale intent spec defeats the audit.
|
|
320
|
+
- **The as-built subagent does not read existing specs.** Anchoring on intent defeats the as-built reading.
|
|
321
|
+
- **Auditor on intent is unconditional** (Step 4). Auditor on as-built is optional but recommended for complex features.
|
|
322
|
+
- **CEO decides each delta.** Tech Lead presents options and reasoning; CEO chooses (a/b/c/d).
|
|
323
|
+
- **Section 9 is the bridge to Stage 3+ work.** A non-empty Section 9 means the audit produced action items.
|
|
324
|
+
|
|
325
|
+
## Anti-patterns the skill blocks
|
|
326
|
+
|
|
327
|
+
- **Reading the existing spec during intent rounds.** Intent rounds re-state intent; no anchoring.
|
|
328
|
+
- **Letting the as-built subagent see the canonical spec.** Same reason.
|
|
329
|
+
- **Skipping the auditor pass on the intent spec.** That pass is the cross-model audit invariant for Stage 1 (Constitution § 1).
|
|
330
|
+
- **Silently choosing a delta resolution.** Each (a/b/c/d) is CEO-confirmed.
|
|
331
|
+
- **Treating the as-built as the final spec.** It's a frozen snapshot; the CEO spec is canonical.
|
|
332
|
+
- **Cross-feature folder auto-inclusion.** Surface as a candidate; CEO decides scope.
|
|
333
|
+
|
|
334
|
+
## Completion criteria
|
|
335
|
+
|
|
336
|
+
Stage 1 in audit mode is complete when:
|
|
337
|
+
|
|
338
|
+
- `{{spec_dir}}<feature>.md` exists with `## Status: FINALIZED <YYYY-MM-DD>`, every section populated. The CEO spec does NOT carry test IDs — that index lives in the implementation file's "Scenario → automated test map" section. Audit-delta ledgers also live in the implementation file, never in the CEO spec.
|
|
339
|
+
- `{{implementation_dir}}<feature>-implementation.md` exists when warranted, or is explicitly skipped. When present, it carries (a) the audit-delta ledger that this skill produces and (b) the "Scenario → automated test map" section (may be empty / TBD if the feature has no automated tests yet; fills in at Stage 6).
|
|
340
|
+
- `.harness/audits/<feature>-as-built-<date>.md` exists as a frozen reference
|
|
341
|
+
- Every delta has an explicit CEO decision (a/b/c/d) recorded
|
|
342
|
+
- The auditor's final pass returned no new BLOCKING/STRONG findings
|
|
343
|
+
- CEO has declared "OK, proceed"
|
|
344
|
+
- The next step is `/spec-finalize <feature>` (formality), then `/db-schema` or `/execution-plan` if Section 9 has actionable deltas
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Checkpoint + decision-log integration (MAGI Archivist)
|
|
349
|
+
|
|
350
|
+
At successful completion, write the checkpoint with `mode: audit`:
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
.harness/scripts/checkpoint-write.sh \
|
|
354
|
+
--feature <feature-slug> \
|
|
355
|
+
--create-if-missing \
|
|
356
|
+
--mode audit \
|
|
357
|
+
--lane <full|stability-fix|trivial> \
|
|
358
|
+
--stage 2 \
|
|
359
|
+
--stage-complete 1 \
|
|
360
|
+
--artifact-spec docs/features/<feature-slug>.md \
|
|
361
|
+
--artifact-implementation docs/features/<feature-slug>-implementation.md
|
|
362
|
+
|
|
363
|
+
# Each accepted delta is a CEO decision worth logging:
|
|
364
|
+
.harness/scripts/decision-log-append.sh \
|
|
365
|
+
--feature <feature-slug> --stage 1 --by "CEO" \
|
|
366
|
+
--decision "<e.g. 'accept delta D-3 (login OTP timing changed to 60s)'>" \
|
|
367
|
+
--evidence ".harness/audits/<feature>-as-built-<date>.md"
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**MAGI Archivist requires this** for `/pickup` to know audit-mode features exist.
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Final message to CEO (natural-language, not slash-command)
|
|
375
|
+
|
|
376
|
+
After completing the audit-mode Stage 1, do NOT print "next step: /spec-finalize". Instead (in CEO's OS locale):
|
|
377
|
+
|
|
378
|
+
```
|
|
379
|
+
✅ <feature> 的现状审计完成
|
|
380
|
+
生成: docs/features/<feature>.md (canonical spec)
|
|
381
|
+
docs/features/<feature>-implementation.md (delta ledger)
|
|
382
|
+
.harness/audits/<feature>-as-built-<date>.md (frozen as-built snapshot)
|
|
383
|
+
接受的 deltas: N 个
|
|
384
|
+
推迟的 deltas: M 个
|
|
385
|
+
|
|
386
|
+
接下来可以:
|
|
387
|
+
👉 「继续」/「下一步」 — 我做最终审查 (Stage 2)
|
|
388
|
+
👉 「看 deltas」 — 我列出每个改动和你的决定
|
|
389
|
+
👉 「先去做某个 delta」+ 描述哪个 — 我开新功能流程处理这个 delta
|
|
390
|
+
👉 「先放着」 — 审计存档了,先做别的
|
|
391
|
+
|
|
392
|
+
(直接说你想做什么 — 我懂)
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
On "继续" → invoke `/spec-finalize <feature>` silently.
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commit
|
|
3
|
+
description: This skill should be used at stage 8 of the feature workflow, after the user has completed their smoke test (stage 7) and wants to commit the changes. It inspects the staged and unstaged diff, proposes a Conventional Commits message, and runs git commit — which in turn triggers the project's pre-commit hooks. Use this always for commits; do not commit freely without this skill. Trigger when the user invokes /commit, says "commit this", "ship it", "let's commit", or similar intent.
|
|
4
|
+
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git add:*), Bash(git commit:*), Bash(git log:*), Read
|
|
5
|
+
argument-hint: [optional-subject-override]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /commit
|
|
9
|
+
|
|
10
|
+
Drive stage 8 of the feature workflow: produce a Conventional Commits message and commit the changes. Hooks enforce quality gates.
|
|
11
|
+
|
|
12
|
+
> *Constitutional basis: Constitution § 5 (Spec and reality stay in sync) — the doc-in-sync check in Step 1 is the operational guard against spec drift at commit time. Constitution § 1 & § 4 — push to GitHub only after BOTH the CEO smoke test (Stage 7) and the auditor audit have passed.*
|
|
13
|
+
|
|
14
|
+
## Authoritative sources
|
|
15
|
+
|
|
16
|
+
1. **Conventional Commits** convention — `<type>(<scope>): <subject>` format
|
|
17
|
+
2. **The diff itself** — the single most important input
|
|
18
|
+
3. **Root `CLAUDE.md` § Doc-in-sync responsibility** — doc-in-sync rule
|
|
19
|
+
4. **CEO spec at `{{spec_dir}}<feature>.md`** — read when Step 1's doc-in-sync check needs to enumerate touched scenarios
|
|
20
|
+
|
|
21
|
+
## Current repo context
|
|
22
|
+
|
|
23
|
+
Inspect before proposing a message:
|
|
24
|
+
|
|
25
|
+
<git_status>
|
|
26
|
+
!`git status --short`
|
|
27
|
+
</git_status>
|
|
28
|
+
|
|
29
|
+
<git_diff_cached>
|
|
30
|
+
!`git diff --cached`
|
|
31
|
+
</git_diff_cached>
|
|
32
|
+
|
|
33
|
+
<git_diff_unstaged>
|
|
34
|
+
!`git diff`
|
|
35
|
+
</git_diff_unstaged>
|
|
36
|
+
|
|
37
|
+
<recent_commits>
|
|
38
|
+
!`git log -5 --oneline`
|
|
39
|
+
</recent_commits>
|
|
40
|
+
|
|
41
|
+
## Workflow
|
|
42
|
+
|
|
43
|
+
### Step 1 — Review what's being committed
|
|
44
|
+
|
|
45
|
+
Look at the output above.
|
|
46
|
+
|
|
47
|
+
- If there are **unstaged changes** that should be in this commit, ask the user whether to `git add` them. Do not stage blindly.
|
|
48
|
+
- If the **staged diff is empty**, stop. Nothing to commit. Report to the user.
|
|
49
|
+
- If the **staged diff mixes unrelated changes** (e.g., one feature's code + an unrelated doc fix), propose splitting into separate commits and wait for user direction.
|
|
50
|
+
- **Doc-in-sync check** (per root `CLAUDE.md` § Two-file feature spec model + § Doc-in-sync responsibility):
|
|
51
|
+
|
|
52
|
+
From `git diff --name-only` (cached + unstaged), identify touched feature surfaces using `{{feature_folder_pattern}}`. For backend-touching paths (`{{backend_code_paths}}`, if configured), map to the owning feature by name match; when ambiguous, ask the user.
|
|
53
|
+
|
|
54
|
+
For each touched feature `<X>`, decide which file the change demands updating:
|
|
55
|
+
|
|
56
|
+
- **User-visible behavior, data model, public API** → `{{spec_dir}}<X>.md` (CEO spec)
|
|
57
|
+
- **Internal tech detail only** (file split, library swap with same shape, store key rename) → `{{implementation_dir}}<X>-implementation.md`
|
|
58
|
+
|
|
59
|
+
Check whether the appropriate file is **also in the diff**. If NOT, surface to the user before proposing the commit message:
|
|
60
|
+
|
|
61
|
+
> "Doc-in-sync check: this commit touches `<feature>` code (paths: `<list>`) but neither `{{spec_dir}}<feature>.md` nor `{{implementation_dir}}<feature>-implementation.md` is in the diff. Per the doc-in-sync rule:
|
|
62
|
+
>
|
|
63
|
+
> - User-visible / data-model / API changes → CEO spec must update in same commit
|
|
64
|
+
> - Internal-only refactors → implementation notes must update if the file exists; exception otherwise
|
|
65
|
+
> - Stylistic / rename / formatting / behavior-preserving fixes → exception (no doc update needed)
|
|
66
|
+
>
|
|
67
|
+
> Which category does this commit fall into?
|
|
68
|
+
>
|
|
69
|
+
> - **Exception** → proceed (I'll note the category in the commit body if material)
|
|
70
|
+
> - **CEO spec needs update** → halt; you update the spec, re-stage, re-invoke `/commit`
|
|
71
|
+
> - **Implementation notes need update** → halt; you update the file, re-stage, re-invoke `/commit`
|
|
72
|
+
> - **Override with reason** → proceed and the reason goes in the commit body"
|
|
73
|
+
|
|
74
|
+
If user picks any "needs update" option, halt the skill cleanly. Do not proceed to Step 2.
|
|
75
|
+
|
|
76
|
+
If multiple features are touched at once, double-check that each owning spec covers what its feature now does, and that no _untouched_ spec is silently invalidated by a cross-feature change (e.g., feature X code adds a column to a shared table that feature Y's spec also references). Heuristic only; ask the user when uncertain.
|
|
77
|
+
|
|
78
|
+
**Do NOT skip this check.** It is the structural defense against spec drift, which Constitution § 5 mandates the harness prevent. The skill has no judgment authority to bypass it.
|
|
79
|
+
|
|
80
|
+
- **Plan file deletion check** (per root `CLAUDE.md` § Doc-in-sync responsibility / Plan files are transient): if `{{spec_dir}}<feature>-plan.md` exists for any feature touched by this commit and the implementation has landed, the plan file must be **deleted in this commit**. Surface to the user:
|
|
81
|
+
|
|
82
|
+
> "`{{spec_dir}}<feature>-plan.md` is still in the tree. Plan files are transient — they exist for Stage 4 → Stage 5 hand-off and are deleted at Stage 8. If this commit ships the implementation, the plan file should be deleted as part of it. Delete now and re-stage?"
|
|
83
|
+
|
|
84
|
+
Wait for confirmation. The skill stages the deletion if the user agrees.
|
|
85
|
+
|
|
86
|
+
### Step 2 — Derive the Conventional Commits message
|
|
87
|
+
|
|
88
|
+
Follow Conventional Commits:
|
|
89
|
+
|
|
90
|
+
- Format: `<type>(<scope>): <subject>`
|
|
91
|
+
- Types: `feat`, `fix`, `refactor`, `perf`, `test`, `docs`, `chore`, `style`
|
|
92
|
+
- `<scope>` is optional; use it when the change is clearly scoped to a feature or area
|
|
93
|
+
- `<subject>` is imperative, lowercase, no period
|
|
94
|
+
- If the user passed `$ARGUMENTS`, treat it as a subject override — honor it, but still pick the correct type/scope
|
|
95
|
+
|
|
96
|
+
Pick the type from what the diff actually does:
|
|
97
|
+
|
|
98
|
+
- New user-visible capability → `feat`
|
|
99
|
+
- Bug fix → `fix`
|
|
100
|
+
- Changes code shape without changing behavior → `refactor`
|
|
101
|
+
- Performance improvement only → `perf`
|
|
102
|
+
- Tests added/updated only → `test`
|
|
103
|
+
- Documentation only (including `CLAUDE.md`, `constitution.md`, scoped rule files) → `docs`
|
|
104
|
+
- Tooling, config, dependencies → `chore`
|
|
105
|
+
- Formatting only, no meaning change → `style`
|
|
106
|
+
|
|
107
|
+
**Body should reference affected scenario IDs.** When the commit changes user-visible behavior, list the scenarios from `{{spec_dir}}<feature>.md` it touches, by ID:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
feat(<feature>): <subject>
|
|
111
|
+
|
|
112
|
+
Affected scenarios:
|
|
113
|
+
- <feature> scenario 3.4 (<one-line behavior description> — fix)
|
|
114
|
+
- <feature> scenario 3.8 (<one-line behavior description> — new)
|
|
115
|
+
|
|
116
|
+
Doc-in-sync:
|
|
117
|
+
- {{spec_dir}}<feature>.md updated
|
|
118
|
+
- {{implementation_dir}}<feature>-implementation.md updated
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Why: months later when an error tracker regression points at a commit, `git blame` of the test that fails maps directly to a scenario ID, which maps directly to the CEO-spec section that defines the expected behavior. Trivial commits (typo, formatting) don't need this; behavior commits do.
|
|
122
|
+
|
|
123
|
+
### Step 3 — Propose, don't commit yet
|
|
124
|
+
|
|
125
|
+
Show the user:
|
|
126
|
+
|
|
127
|
+
- The type, scope, subject you chose (and a body, if the change warrants one)
|
|
128
|
+
- A one-line summary of what the diff actually does, so the user can sanity-check
|
|
129
|
+
|
|
130
|
+
Wait for user approval before running `git commit`.
|
|
131
|
+
|
|
132
|
+
**Wait for user response before continuing.**
|
|
133
|
+
|
|
134
|
+
### Step 4 — Commit
|
|
135
|
+
|
|
136
|
+
On approval, run:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
git commit -m "<type>(<scope>): <subject>"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Or, with a body:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
git commit -m "<subject line>" -m "<body>"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Step 5 — Hook results
|
|
149
|
+
|
|
150
|
+
Pre-commit hooks run automatically (see CLAUDE.md § Hooks):
|
|
151
|
+
|
|
152
|
+
- **Pre-commit typecheck** — blocks commit on type/syntax errors
|
|
153
|
+
- **Pre-commit lint bans** — blocks commit on anti-flag patterns (per `{{anti_flag_rules}}` in AGENTS.md)
|
|
154
|
+
- **Pre-commit cycles** — blocks commit if dependency cycles detected (only enabled when `dependency_flow` is non-empty)
|
|
155
|
+
|
|
156
|
+
If a hook blocks the commit:
|
|
157
|
+
|
|
158
|
+
1. Report the hook output to the user verbatim.
|
|
159
|
+
2. Offer to fix the specific issues the hook flagged.
|
|
160
|
+
3. Do not attempt to bypass the hook (`--no-verify`) unless the user explicitly instructs, with reason.
|
|
161
|
+
|
|
162
|
+
On successful commit, report the commit hash and one-line message.
|
|
163
|
+
|
|
164
|
+
### Step 6 — State cleanup
|
|
165
|
+
|
|
166
|
+
After a successful commit, clean up transient state files for this feature:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
rm -f .harness/state/auditor-approvals/<feature>-stage*.json
|
|
170
|
+
rm -f .harness/state/test-fix/<feature>-attempts.json
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Why: state files exist to gate Stages 2 / 3 / 4 / 5 / 6 in flight. Once the commit lands, the gates have served their purpose; leaving them around invites confusion in future work on the same feature ("did Stage 5 already approve, or is that an old approval?"). For trivial-change and stability-fix lanes, the relevant state files are typically absent — the cleanup is a no-op then.
|
|
174
|
+
|
|
175
|
+
If a feature was committed but the user wants to start a follow-up commit on the same feature without re-running stages, ask before cleanup.
|
|
176
|
+
|
|
177
|
+
### Step 7 — Push to GitHub (only after both gates passed)
|
|
178
|
+
|
|
179
|
+
Per Constitution § 1 & § 4, push to GitHub only after BOTH:
|
|
180
|
+
- Stage 7 CEO smoke test PASSED
|
|
181
|
+
- Stage 6 / Stage 5 auditor audit returned PASS, CONCERNS, or WAIVED (FAIL halts; CONCERNS advances but should be reviewed; WAIVED requires explicit `waiver_reason` and cannot have Universal Core blocking items)
|
|
182
|
+
|
|
183
|
+
If either failed for this change, **do not push**. Surface to the user: "Push withheld — Constitution § 4 requires CEO smoke test pass before push; please complete Stage 7 then re-invoke push."
|
|
184
|
+
|
|
185
|
+
On approval, push:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
git push
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Rules
|
|
192
|
+
|
|
193
|
+
- **Never use `--no-verify`** except on explicit user instruction with a stated reason.
|
|
194
|
+
- **Never commit without showing the proposed message first.** The user must see the message before it becomes history.
|
|
195
|
+
- **Never force-push, rebase, or rewrite history** from this skill. Out of scope.
|
|
196
|
+
- **Branching:** commit directly to `main` by default unless the project's commit convention says otherwise. Only use a feature branch if the user already has one checked out or explicitly asks.
|
|
197
|
+
- **Never squash multiple logically distinct changes into one commit.** If the diff mixes concerns, split it.
|
|
198
|
+
- **Never push to GitHub** if either Stage 7 (CEO smoke test) or the auditor audit has failed for this change. (Constitution § 1 & § 4.)
|
|
199
|
+
|
|
200
|
+
## Completion criteria
|
|
201
|
+
|
|
202
|
+
Stage 8 is complete when:
|
|
203
|
+
|
|
204
|
+
- A commit exists on the current branch with a message that matches Conventional Commits format
|
|
205
|
+
- All pre-commit hooks passed (or the user explicitly overrode them with a documented reason)
|
|
206
|
+
- The user has seen the resulting commit hash and message
|
|
207
|
+
- (If pushing) The push happened only after both the CEO smoke test and the auditor audit passed
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Checkpoint + decision-log integration (MAGI Archivist)
|
|
212
|
+
|
|
213
|
+
After the commit is created and (if applicable) pushed, **archive the checkpoint** — the feature is done, no more `/pickup` needed:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
.harness/scripts/checkpoint-write.sh \
|
|
217
|
+
--feature <feature-slug> \
|
|
218
|
+
--stage-complete 8 \
|
|
219
|
+
--archive
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
This moves `.harness/state/workflow-checkpoints/<feature>.json` → `.harness/state/workflow-checkpoints/_archived/<feature>-<timestamp>.json`. The archived file is gitignored but kept locally for audit / retrospective.
|
|
223
|
+
|
|
224
|
+
Log the commit decision:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
.harness/scripts/decision-log-append.sh \
|
|
228
|
+
--feature <feature-slug> --stage 8 --by "CEO" \
|
|
229
|
+
--decision "shipped <feature>" \
|
|
230
|
+
--evidence "$(git rev-parse --short HEAD)"
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
If you smoke-tested and decided NOT to ship (rollback / defer), do NOT archive — leave the checkpoint open so resume works:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
.harness/scripts/decision-log-append.sh \
|
|
237
|
+
--feature <feature-slug> --stage 7 --by "CEO" \
|
|
238
|
+
--decision "smoke test failed: <symptom>; reverting to Stage 5 to fix"
|
|
239
|
+
|
|
240
|
+
.harness/scripts/checkpoint-write.sh \
|
|
241
|
+
--feature <feature-slug> --stage 5
|
|
242
|
+
# (resets current_stage; preserves audit history + stages_completed)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Final message to CEO (natural-language, workflow complete)
|
|
248
|
+
|
|
249
|
+
After Stage 8 completes (commit created + pushed if applicable), display (in CEO's OS locale):
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
🎉 <feature> 已 ship!
|
|
253
|
+
Commit: <short-sha> "<commit message first line>"
|
|
254
|
+
Branch: <branch>
|
|
255
|
+
Push 状态: <推送到远端 origin/main / 仅本地 / N/A>
|
|
256
|
+
|
|
257
|
+
整个 9-stage 流程跑完了。MAGI 团队归位:
|
|
258
|
+
✅ MAGI Planner (Stage 1-2) - spec 完成
|
|
259
|
+
✅ MAGI Programmer (Stage 5) - 代码完成
|
|
260
|
+
✅ MAGI Tester (Stage 6) - 测试完成
|
|
261
|
+
✅ MAGI Verdict - 全 stage audit 通过
|
|
262
|
+
✅ MAGI Archivist - checkpoint 归档到 _archived/
|
|
263
|
+
|
|
264
|
+
接下来可以:
|
|
265
|
+
👉 「做下一个功能 X」 — 我启动新的 /feature-draft
|
|
266
|
+
👉 「看看下一步做啥」 — 我跑 /next 推荐
|
|
267
|
+
👉 「先休息」 — bye! 下次见 (我会自动 /pickup 帮你回到状态)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
This is the natural break point. No auto-progression — CEO chooses when to start the next workflow cycle.
|