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,205 @@
1
+ ---
2
+ name: add-anti-flag
3
+ description: Append an anti-flag rule to AGENTS.md so the auditor stops flagging a project-specific convention as a false positive. Use when an audit produced a finding that's actually a deliberate project decision (not a bug). Trigger when the user invokes /add-anti-flag, says "this is a false positive don't flag", "add an anti-flag rule", "auditor is wrong about X", or similar suppress-the-finding intent.
4
+ allowed-tools: Read, Edit, Bash(date:*), Bash(grep:*)
5
+ argument-hint: <text describing the convention being flagged incorrectly>
6
+ ---
7
+
8
+ # /add-anti-flag
9
+
10
+ Grow the L2 anti-flag rules in `AGENTS.md` over time. Each new rule tells the auditor (MAGI / `{{auditor_model}}`) that a specific project-specific convention LOOKS like an issue but is deliberately how this project does it — don't flag it as a finding.
11
+
12
+ > *Companion to `/add-constitution-clause`. Anti-flag rules are area-level conventions; red lines are project-wide identity. Most "this is fine, stop flagging it" content belongs here, not in the constitution.*
13
+
14
+ ## Language Awareness
15
+
16
+ This skill's instructions are in English. When you talk to the user (asking the criteria questions, proposing the rule, confirming), use the user's OS locale language. See `CLAUDE.md § Language Awareness`. The text written INTO `AGENTS.md` stays verbatim per what the user approves; do not translate user-entered convention content.
17
+
18
+ ## What this skill produces
19
+
20
+ A modified `AGENTS.md` with one new anti-flag bullet appended to the `## Anti-flag rules — do NOT flag these as issues` section. The `### Architecture posture (default, applies to all projects)` sub-section stays untouched.
21
+
22
+ ---
23
+
24
+ ## Step 0 — Pre-flight
25
+
26
+ 1. Verify `AGENTS.md` exists at project root. If missing, fail with:
27
+
28
+ ```
29
+ AGENTS.md not found — run /init first.
30
+ ```
31
+
32
+ Halt the skill.
33
+
34
+ 2. Read `AGENTS.md` fully (Read tool).
35
+
36
+ 3. Locate the anti-flag rules section. Look for either:
37
+
38
+ - The `{{anti_flag_rules}}` placeholder (early project, no anti-flag rules yet), OR
39
+ - Already-rendered bullet rules under `## Anti-flag rules — do NOT flag these as issues` and before `### Architecture posture (default, applies to all projects)`.
40
+
41
+ If neither is present, surface the issue and halt — the AGENTS.md structure has been edited beyond what this skill can safely modify.
42
+
43
+ ---
44
+
45
+ ## Step 1 — Understand the convention
46
+
47
+ 1. Parse `$ARGUMENTS` as the convention description.
48
+
49
+ 2. If `$ARGUMENTS` is empty, ask:
50
+
51
+ ```
52
+ What convention is the auditor incorrectly flagging? Describe:
53
+ - What X is (the correct pattern in THIS project)
54
+ - What Y is (the alternative the auditor keeps suggesting)
55
+ - Why X is right for this project
56
+ ```
57
+
58
+ **Wait for user response before continuing.**
59
+
60
+ ---
61
+
62
+ ## Step 2 — Validate this is actually project-specific
63
+
64
+ Anti-flag rules are for **project-specific conventions** that look universally wrong but are actually right for this project. Walk the user through the 3 criteria:
65
+
66
+ ```
67
+ Before adding, confirm:
68
+
69
+ 1. Is this convention SPECIFIC to this project, not a universal best
70
+ practice that just happens to be ignored here?
71
+ (If it's a universal best practice, the auditor is right; fix the code,
72
+ don't suppress the warning.)
73
+ Example fail: "Don't flag missing try/catch" (universal best practice — fix the code)
74
+ Example pass: "Don't suggest TypeScript — this project deliberately stays
75
+ plain JS for zero-build static deploy"
76
+
77
+ 2. Is the auditor's suggestion (Y) actually WRONG for this project,
78
+ not just suboptimal?
79
+ (If Y is also OK, just slightly preferred elsewhere, don't add a rule —
80
+ the auditor's advisory is fine to ignore case-by-case.)
81
+ Example fail: "Don't suggest extracting helper functions" (Y is fine,
82
+ just not always needed — case-by-case judgment is OK)
83
+ Example pass: "Don't suggest CDN libs — every JS file must be in this
84
+ repo, no external deps allowed"
85
+
86
+ 3. Does this rule have a documented reason that future-you will agree
87
+ with in 6 months?
88
+ (Reason should be a constraint or trade-off, not a passing whim.)
89
+
90
+ Does your proposed anti-flag rule meet all three criteria?
91
+ [y] yes — proceed
92
+ [n] no — reconsider; cancel
93
+ [explain] help me judge
94
+
95
+ Wait for user response before continuing.
96
+ ```
97
+
98
+ Branch:
99
+
100
+ - `[y]` → proceed to Step 3.
101
+ - `[n]` → abort silently; write nothing.
102
+ - `[explain]` → ask which criterion the user is unsure about, walk through it with them, then re-present y/n. Loop until `[y]` or `[n]`.
103
+
104
+ ---
105
+
106
+ ## Step 3 — Format the rule
107
+
108
+ Use the default anti-flag rule format per AGENTS.md's template:
109
+
110
+ ```markdown
111
+ - **<X> is correct, <Y> is BANNED.**
112
+ Don't suggest switching to Y. (Reason: <why this project chose X>)
113
+ ```
114
+
115
+ Propose the formatted rule to the user with their content filled in:
116
+
117
+ ```
118
+ Proposed anti-flag rule to append to AGENTS.md:
119
+
120
+ - **<convention X> is correct, <alternative Y> is BANNED.**
121
+ Don't suggest switching to Y. (Reason: <reason>)
122
+
123
+ Approve?
124
+ [a] approve as proposed
125
+ [b] modify (tell me what to change)
126
+ [c] cancel
127
+
128
+ Wait for user response before continuing.
129
+ ```
130
+
131
+ Branch:
132
+
133
+ - `[a]` → proceed to Step 4.
134
+ - `[b]` → accept user revisions to X, Y, or Reason; re-show the proposal; loop until `[a]` or `[c]`.
135
+ - `[c]` → abort silently; write nothing.
136
+
137
+ ---
138
+
139
+ ## Step 4 — Apply edit
140
+
141
+ Use the Edit tool to append the new rule to the anti-flag section in `AGENTS.md`.
142
+
143
+ Placement rules:
144
+
145
+ - If the `{{anti_flag_rules}}` placeholder is still present in the section → **replace** the placeholder with the new rule (becomes the first rule).
146
+ - If `{{anti_flag_rules}}` has already been replaced with rendered content (one or more bulleted rules) → **append** the new rule after the last existing rule, maintaining the bulleted list format. Place the new rule consistently AFTER existing user-added rules.
147
+
148
+ Do NOT touch:
149
+
150
+ - The `### Architecture posture (default, applies to all projects)` sub-section — that's the stack-agnostic default, shipped with the harness and not user-grown.
151
+ - Any other part of `AGENTS.md` (the auditor identity preamble, `## Your role`, `## Doc-in-sync verification`, `## Verdict output`, etc.).
152
+
153
+ This skill writes to the anti-flag bullet list ONLY.
154
+
155
+ ---
156
+
157
+ ## Step 5 — Wrap up
158
+
159
+ Display to the user (in their locale):
160
+
161
+ ```
162
+ ✓ Anti-flag rule appended to AGENTS.md.
163
+
164
+ The auditor (MAGI / {{auditor_model}}) will skip this finding in future audits.
165
+
166
+ - <X> is correct, <Y> is BANNED.
167
+
168
+ If a future audit still flags this, two reasons:
169
+ 1. The rule wording doesn't catch the pattern — refine via re-running /add-anti-flag with clearer X/Y/Reason
170
+ 2. The flagged code doesn't match the rule's convention — the finding may be valid
171
+
172
+ Commit when ready (use /commit).
173
+ ```
174
+
175
+ ---
176
+
177
+ ## Rules
178
+
179
+ - **Never bypass the 3-criteria validation** (Step 2). Universal best practices and case-by-case advisories don't belong in anti-flag rules.
180
+ - **Never edit the Architecture posture sub-section.** It is stack-agnostic default content shipped with the harness; user-added rules go in the upper anti-flag list.
181
+ - **Never commit or push from this skill.** Edits land as working-tree changes. The user commits via `/commit` when ready.
182
+ - **Never touch other parts of `AGENTS.md`** beyond the anti-flag bullet list. Identity preamble, role, verdict schema, etc. are out of scope.
183
+ - **Never translate user-entered convention content.** Write verbatim what the user approved at Step 3.
184
+
185
+ ---
186
+
187
+ ## Trust contract
188
+
189
+ - This skill modifies **exactly one file**: `AGENTS.md`.
190
+ - It writes to the anti-flag bullet list section only; Architecture posture and all other sections stay untouched.
191
+ - If the user cancels at any confirmation step, nothing is written.
192
+ - The skill makes no assumptions about which audits produced the finding — it captures the convention the user describes, no investigation of past audits.
193
+
194
+ ---
195
+
196
+ ## Completion criteria
197
+
198
+ `/add-anti-flag` is complete when:
199
+
200
+ - Step 0 has run (pre-flight checks pass; anti-flag section located)
201
+ - Step 1 has captured the convention description
202
+ - Step 2 has been answered `[y]` (or cancelled — in which case nothing else runs)
203
+ - Step 3 has been approved by the user (or cancelled)
204
+ - Step 4 has appended the new rule to the anti-flag bullet list
205
+ - Step 5 has displayed the wrap-up message
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: add-constitution-clause
3
+ description: Append a new project-specific red line to constitution.md § Section 3. Use when the user wants to add a project-wide, absolute, identity-changing rule. The skill validates the rule meets the 3 promotion criteria (project-wide / absolute / identity-changing) and refuses to add area-specific or contextual rules. Trigger when the user invokes /add-constitution-clause, says "add a red line", "add a project rule", "promote this to constitution", or similar identity-rule intent.
4
+ allowed-tools: Read, Edit, Bash(date:*), Bash(grep:*)
5
+ argument-hint: <text of the new red line>
6
+ ---
7
+
8
+ # /add-constitution-clause
9
+
10
+ Append a new project-specific red line to `constitution.md § Section 3 — Project-specific red lines`. Smaller surface than `/constitution-edit` (which also handles Section 2 and the slot registry); this skill only writes to Section 3.
11
+
12
+ > *Spec-Kit-pattern audit trail. The Sync Impact Report turns ad-hoc constitution edits into versioned, semver-bumped, auditable changes.*
13
+
14
+ ## Language Awareness
15
+
16
+ This skill's instructions are in English. When you talk to the user (asking the criteria questions, proposing the clause, confirming), use the user's OS locale language. See `CLAUDE.md § Language Awareness`. The text written INTO `constitution.md` stays verbatim per what the user approves; do not translate user-entered content.
17
+
18
+ ## What this skill produces
19
+
20
+ A modified `constitution.md` with:
21
+
22
+ 1. A new numbered clause appended to Section 3 (Project-specific red lines).
23
+ 2. A Sync Impact Report HTML comment regenerated at the top of the file documenting the new clause.
24
+
25
+ ---
26
+
27
+ ## Step 0 — Pre-flight
28
+
29
+ 1. Verify `constitution.md` exists at project root:
30
+
31
+ ```bash
32
+ test -f constitution.md
33
+ ```
34
+
35
+ If missing, fail with the message:
36
+
37
+ ```
38
+ constitution.md not found — run /init first.
39
+ ```
40
+
41
+ Halt the skill.
42
+
43
+ 2. Read `constitution.md` fully (Read tool).
44
+
45
+ 3. Extract the current version from any existing Sync Impact Report block at the top:
46
+
47
+ ```bash
48
+ grep -m1 -oE 'Version: [0-9]+\.[0-9]+\.[0-9]+ →' constitution.md
49
+ ```
50
+
51
+ If no Sync Impact Report block exists, treat the current state as `1.0.0`.
52
+
53
+ ---
54
+
55
+ ## Step 1 — Understand the rule
56
+
57
+ 1. Parse `$ARGUMENTS` as the proposed red line text.
58
+
59
+ 2. If `$ARGUMENTS` is empty, ask:
60
+
61
+ ```
62
+ What's the red line you want to add? Describe the constraint in one or two sentences.
63
+ ```
64
+
65
+ **Wait for user response before continuing.**
66
+
67
+ ---
68
+
69
+ ## Step 2 — Validate against the 3 promotion criteria
70
+
71
+ The constitution.md § Section 3 prelude lists 3 promotion criteria. A rule should only be promoted to Section 3 if it meets ALL THREE:
72
+
73
+ - Project-wide scope (NOT area-specific)
74
+ - Absolute (no exceptions, no lane override)
75
+ - Identity-changing (violating it makes this no longer this project)
76
+
77
+ Walk the user through these checks. Display:
78
+
79
+ ```
80
+ Before adding to Section 3, confirm this rule meets all THREE criteria:
81
+
82
+ 1. PROJECT-WIDE SCOPE — does this rule apply across the whole project?
83
+ (Area-specific rules belong in rule sources or scoped CLAUDE.md, not here.)
84
+ Example fail: "All React components must use TypeScript" (area-specific to frontend)
85
+ Example pass: "PII must never be sent to client without RLS gating" (project-wide)
86
+
87
+ 2. ABSOLUTE — does this rule admit ZERO exceptions?
88
+ (Rules with lane overrides or "unless X" carve-outs belong in operating
89
+ principles, not red lines.)
90
+ Example fail: "Tests required, except trivial-lane" (has lane exception)
91
+ Example pass: "No third-party trackers in production" (absolute)
92
+
93
+ 3. IDENTITY-CHANGING — would violating this rule mean this is no longer
94
+ THIS project?
95
+ (Rules that are merely "preferences" or "best practices" don't qualify.)
96
+ Example fail: "Use 2-space indent" (style preference, not identity)
97
+ Example pass: "No user data leaves the EU" (identity for an EU-only product)
98
+
99
+ Does your proposed rule meet ALL three criteria?
100
+ [y] yes — proceed
101
+ [n] no — let me reconsider; cancel this skill
102
+ [explain] tell me which criterion(ia) you're unsure about, I'll help judge
103
+
104
+ Wait for user response before continuing.
105
+ ```
106
+
107
+ Branch:
108
+
109
+ - `[y]` → proceed to Step 3.
110
+ - `[n]` → abort silently; write nothing.
111
+ - `[explain]` → ask which criterion the user is unsure about, walk through it with them in plain language, then re-present the y/n choice. Loop until `[y]` or `[n]`.
112
+
113
+ ---
114
+
115
+ ## Step 3 — Format the clause
116
+
117
+ Format the user's text as a numbered Section 3 clause. Convention:
118
+
119
+ ```markdown
120
+ ### N. <short title in title case>
121
+
122
+ <one-paragraph rule statement>
123
+ ```
124
+
125
+ Where `N` is the next available number in Section 3. Read `constitution.md` to find the highest existing clause number under `## Section 3 — Project-specific red lines` (look for `### N.` headings); increment by 1. If Section 3 has no existing clauses yet (still holds the `{{project_red_lines}}` placeholder or is empty after the prelude), use `N = 1`.
126
+
127
+ Propose a short title in title case derived from the rule text (Tech Lead chooses a reasonable phrase). Show the formatted version to the user:
128
+
129
+ ```
130
+ Proposed clause to append to Section 3:
131
+
132
+ ### <N>. <title>
133
+
134
+ <text>
135
+
136
+ Approve?
137
+ [a] approve as proposed
138
+ [b] modify (tell me what to change)
139
+ [c] cancel
140
+
141
+ Wait for user response before continuing.
142
+ ```
143
+
144
+ Branch:
145
+
146
+ - `[a]` → proceed to Step 4.
147
+ - `[b]` → accept user revisions to title and/or body; re-show the proposal; loop until `[a]` or `[c]`.
148
+ - `[c]` → abort silently; write nothing.
149
+
150
+ ---
151
+
152
+ ## Step 4 — Apply edit
153
+
154
+ Use the Edit tool to append the new clause to `## Section 3 — Project-specific red lines` in `constitution.md`.
155
+
156
+ Placement rules:
157
+
158
+ - If the `{{project_red_lines}}` placeholder is still present in Section 3 (early project, Section 3 has no clauses yet), **replace** the placeholder with the new clause.
159
+ - If `{{project_red_lines}}` has already been replaced with rendered content (one or more `### N.` clauses), **append** the new clause AFTER the last existing clause.
160
+
161
+ Do NOT touch:
162
+
163
+ - The Section 3 prelude (the `> Starts empty…` blockquote and the 3-criteria bullet list).
164
+ - Section 1 (Universal Core) — harness-guaranteed, read-only.
165
+ - Section 2 (Project Identity) — out of scope for this skill (use `/constitution-edit` for Section 2 changes).
166
+ - The slot registry HTML comment.
167
+
168
+ ---
169
+
170
+ ## Step 5 — Generate Sync Impact Report
171
+
172
+ Identical machinery to `/constitution-edit`. Compute bump = MINOR (this skill always adds new content). Compute new version from old (`X.Y.Z` → `X.(Y+1).0`).
173
+
174
+ Build the report block. Use `date -u +%Y-%m-%dT%H:%M:%SZ` for the timestamp:
175
+
176
+ ```html
177
+ <!-- Sync Impact Report
178
+ Version: <old> → <new> (MINOR — add Section 3 clause #N: <title>)
179
+ Modified items:
180
+ - Section 3 — added clause #N: <title>
181
+ Templates needing update:
182
+ - <any files referencing {{project_red_lines}}>
183
+ Generated: <ISO 8601 UTC>
184
+ -->
185
+ ```
186
+
187
+ If no other files reference `{{project_red_lines}}`, write `Templates needing update:` followed by ` - N/A`.
188
+
189
+ Placement:
190
+
191
+ - If an existing Sync Impact Report block already lives at the top of `constitution.md` (immediately after the title heading), **REPLACE** it with the new block. Only one block lives in the file at a time — `git log` is the audit trail.
192
+ - Otherwise, **INSERT** the new block immediately after the title line (`# <project> — Constitution`) and before the next content.
193
+
194
+ ---
195
+
196
+ ## Step 6 — Wrap up
197
+
198
+ Display to the user (in their locale):
199
+
200
+ ```
201
+ ✓ Constitution updated to version <new>.
202
+
203
+ New clause #N appended to Section 3:
204
+ "<title>"
205
+
206
+ Sync Impact Report regenerated at top of constitution.md.
207
+
208
+ Next steps:
209
+ 1. Commit when ready (use /commit).
210
+ 2. If this clause has implications for existing code, audit with /audit-spec.
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Rules
216
+
217
+ - **Never edit Section 1 or Section 2.** Use `/constitution-edit` for Section 2 changes; Section 1 is harness-guaranteed and cannot be edited by any skill.
218
+ - **Never skip the 3-criteria validation in Step 2.** A rule that fails any one of project-wide / absolute / identity-changing belongs elsewhere (operating principles, rule sources, anti-flag rules), not in Section 3.
219
+ - **Never commit or push from this skill.** Edits land as working-tree changes. The user commits via `/commit` when ready.
220
+ - **Always regenerate the Sync Impact Report** (consistency with `/constitution-edit` — Section 3 edits are versioned changes).
221
+ - **Never translate user-entered clause content.** Write verbatim what the user approved at Step 3.
222
+
223
+ ---
224
+
225
+ ## Trust contract
226
+
227
+ - This skill modifies **exactly one file**: `constitution.md`.
228
+ - It only writes to Section 3 and the Sync Impact Report block; Sections 1, 2, the slot registry, and the prelude of Section 3 stay untouched.
229
+ - If the user cancels at any confirmation step, nothing is written.
230
+ - The Sync Impact Report is always regenerated fresh — only one block at a time in the file.
231
+
232
+ ---
233
+
234
+ ## Completion criteria
235
+
236
+ `/add-constitution-clause` is complete when:
237
+
238
+ - Step 0 has run (pre-flight checks pass)
239
+ - Step 1 has captured the proposed rule text
240
+ - Step 2 has been answered `[y]` (or cancelled — in which case nothing else runs)
241
+ - Step 3 has been approved by the user (or cancelled)
242
+ - Step 4 has appended the new clause to Section 3
243
+ - Step 5 has regenerated the Sync Impact Report at the top of `constitution.md`
244
+ - Step 6 has displayed the wrap-up message