agentleFS
Ericcccccc777Ericcccccc777/CCC-MAGI/skills/constitution-edit/SKILL.md

constitution-edit

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Edit the project constitution.md and update its Sync Impact Report. Use when the user wants to add, modify, or remove a principle in Section 2 (Project Identity), Section 3 (Project Red Lines), or the slot registry. CANNOT modify Section 1 (Universal Core) — those are harness-guaranteed invariants that no edit can remove. Generates a versioned Sync Impact Report at the top of constitution.md. Trigger when the user invokes /constitution-edit, says "edit the constitution", "add a red line", "update project identity", or similar intent.

  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only one Sync Impact Report block lives in the file at a time — the most recent one.

    line 37
  2. Very specific:

    If multiple changes apply in one /constitution-edit invocation, take the highest applicable bump.

    line 45
  3. Very specific:

    If no prior Sync Impact Report block exists in constitution.md, treat the current state as version 1.0.0.

    line 47
  4. Very specific:

    Verify constitution.md exists at project root:

    line 53
  5. Distinctive:

    If missing, fail with the message:

    line 59
  6. Very specific:

    Read constitution.md fully (Read tool).

    line 67
  7. Very specific:

    If no Sync Impact Report block exists, treat the current state as 1.0.0.

    line 75
  8. Very specific:

    If $ARGUMENTS is empty, ask the user:

    line 83
  9. Very specific:

    Use the Edit tool to apply the approved change from Step 2 to constitution.md.

    line 168
  10. Very specific:

    If a slot was added or changed: search for {{<slot_name>}} references across the running scope (the harness installation root — typically …

    line 176
  11. Distinctive:

    If no affected templates can be confidently identified, list:

    line 192
  12. Very specific:

    If an existing Sync Impact Report block already lives at the top of constitution.md (immediately after the title heading), REPLACE it with …

    line 225
  13. Very specific:

    Use the Edit tool. After writing, read back and show the top 30 lines of constitution.md to the user for visual confirmation.

    line 229
  14. Distinctive:

    If no templates were detected, omit the "Affected templates" list and replace with:

    line 251
  15. Distinctive:

    If the user cancels at Step 2, nothing is written.

    line 275

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/constitution-edit

Edit constitution.md Section 2 (Project Identity), Section 3 (Project Red Lines), or the slot registry, and prepend a versioned Sync Impact Report HTML comment that documents the change.

Spec-Kit-pattern audit trail. The Sync Impact Report turns ad-hoc constitution edits into versioned, semver-bumped, auditable changes — without burdening the file with full history (that's what git log is for).

Language Awareness

This skill's instructions are in English. When you talk to the user (proposing the change, asking for confirmations, summarizing results), 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.

What this skill produces

A modified constitution.md with:

  1. The approved edit applied to Section 2, Section 3, or the slot registry.
  2. A Sync Impact Report HTML comment prepended at the top of the file, immediately after the title heading and before the existing file-description comment. Format:
<!-- Sync Impact Report
Version: <old> → <new> (<MAJOR|MINOR|PATCH> — <short description>)
Modified items:
  - <section name> — <what changed>
  - <section name> — <what changed>
Templates needing update:
  - <file path> — <status: ✅ updated / ⚠ pending review / N/A>
Generated: <ISO 8601 UTC timestamp>
-->

Only one Sync Impact Report block lives in the file at a time — the most recent one. Prior versions live in git log.

Semver rules

  • MAJOR — removes or substantively changes a principle that was already in Section 2 / Section 3 / slot registry
  • MINOR — adds a new principle to Section 2 / Section 3, or adds a new slot to the registry
  • PATCH — wording / clarification / typo / non-semantic refactor

If multiple changes apply in one /constitution-edit invocation, take the highest applicable bump.

If no prior Sync Impact Report block exists in constitution.md, treat the current state as version 1.0.0.


Step 0 — Pre-flight

  1. Verify constitution.md exists at project root:

    test -f constitution.md

    If missing, fail with the message:

    constitution.md not found — run /init first.

    Halt the skill.

  2. Read constitution.md fully (Read tool).
  3. Extract the current version from any existing Sync Impact Report block at the top:

    grep -m1 -oE 'Version: [0-9]+\.[0-9]+\.[0-9]+ →' constitution.md

    If no Sync Impact Report block exists, treat the current state as 1.0.0.


Step 1 — Understand the change

  1. Parse $ARGUMENTS as the change description (free text from the user).
  2. If $ARGUMENTS is empty, ask the user:

    What do you want to change in the constitution? Examples:
      - "add a red line about no third-party trackers"
      - "reword the audience to mention enterprises"
      - "add a slot for retry-policy"

    Wait for user response before continuing.

  3. Identify which section(s) the change will affect:

    • Section 1 (Universal Core) → REJECT with the message below and halt:

      /constitution-edit cannot modify Section 1 (Universal Core). These are harness-guaranteed invariants that no project edit can remove. If you want to ADD a new project-level red line, use Section 3 instead.
      
      If you genuinely need a constitutional change at the harness level, modify outcome/constitution.md directly in the harness source — but understand that doing so changes the harness itself, not your project.
    • Section 2 (Project Identity) → proceed
    • Section 3 (Project Red Lines) → proceed
    • Slot registry (the HTML comment block at the top of constitution.md) → proceed

Step 2 — Propose the edit

  1. Based on the change description, propose the EXACT text to add / modify / remove.
  2. Format the proposal as a diff-style preview, in the user's locale:

    Proposed change to <section>:
    
    <diff-style preview: -old / +new>
    
    Type:
      [a] approve as proposed
      [b] modify (tell me what to change)
      [c] cancel
  3. Wait for user response before continuing.

    • [a] → proceed to Step 3
    • [b] → accept the user's revisions; re-show the proposal; loop until [a] or [c]
    • [c] → abort silently; write nothing

Step 3 — Determine semver bump

Auto-detect the bump type from the approved change:

Change shapeProposed bump
Adding new content (new principle / new slot)MINOR
Removing existing contentMAJOR
Substantively rewording existing content (meaning changes)MAJOR
Typo / clarification / non-semantic rewordingPATCH

Show to the user:

Bump type: <type>. Override?
  [Enter] accept
  [m] major
  [n] minor
  [p] patch

Wait for user response before continuing.

Compute the new version from the old one (X.Y.Z):

  • MAJOR → (X+1).0.0
  • MINOR → X.(Y+1).0
  • PATCH → X.Y.(Z+1)

Step 4 — Apply the edit

Use the Edit tool to apply the approved change from Step 2 to constitution.md. This is the content edit only; the Sync Impact Report block is prepended later in Step 7.


Step 5 — Detect affected templates

For each affected slot or principle, identify downstream files that may need review:

  1. If a slot was added or changed: search for {{<slot_name>}} references across the running scope (the harness installation root — typically the project root containing constitution.md, CLAUDE.md, AGENTS.md, and .harness/):

    grep -rln "{{<slot_name>}}" .

    Capture matching file paths.

  2. If a Section 2 or Section 3 principle was added: identify SKILL.md files that consume constitution rules. Heuristic — any SKILL.md referencing constitution.md in its body:

    grep -rln "constitution.md" .harness/skills/ 2>/dev/null

    Mark them as needing review.

If no affected templates can be confidently identified, list:

(none detected — review SKILL.md files manually if change is structural)

Step 6 — Generate Sync Impact Report block

Build the report block. Use date -u +%Y-%m-%dT%H:%M:%SZ for the timestamp:

<!-- Sync Impact Report
Version: <old> → <new> (<bump> — <one-line description>)
Modified items:
  - <section> — <what changed>
Templates needing update:
  - <file path> — <status>
Generated: <ISO 8601 UTC timestamp>
-->

Status values for "Templates needing update":

  • ✅ updated — only used if the skill itself edited the template (this skill does NOT auto-edit templates; reserved for future use)
  • ⚠ pending review — default for any detected template
  • N/A — no templates affected

Step 7 — Prepend to constitution.md

  1. 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. Do not preserve historic blocks in the file — git log is the audit trail.
  2. Otherwise, INSERT the new block immediately after the title line (# <project> — Constitution) and before the next content (typically the existing file-description HTML comment).

Use the Edit tool. After writing, read back and show the top 30 lines of constitution.md to the user for visual confirmation.


Step 8 — Wrap up

Display to the user (in their locale):

✓ Constitution updated to version <new>.

Sync Impact Report prepended to constitution.md.

Affected templates (if any) marked ⚠ pending review:
  - <file1>
  - <file2>

Next steps:
  1. Review and update marked templates as needed.
  2. Commit when ready (use /commit).

If no templates were detected, omit the "Affected templates" list and replace with:

No downstream templates detected as affected.

Rules / Anti-patterns

  • Never edit Section 1 (Universal Core) — reject at Step 1 with the explicit message.
  • Never auto-edit downstream templates — only mark them ⚠ for human review. Auto-modification risks silent corruption.
  • Never skip the user confirmation at Step 2 — the proposed edit must be approved before it lands.
  • Never preserve historic Sync Impact Report blocks in constitution.md — exactly one block always; git log carries the history.
  • Never run git commit or git push from this skill — edits land as working-tree changes. The user commits via /commit when ready.
  • Never translate user-entered constitution content — write verbatim what the user approved at Step 2.

Trust contract

  • This skill modifies exactly one file: constitution.md.
  • It never reads, modifies, or deletes any other project file (it MAY read SKILL.md files in Step 5 detection, but does not write to them).
  • Section 1 of constitution.md is treated as read-only by this skill.
  • If the user cancels at Step 2, nothing is written.
  • The Sync Impact Report is always prepended fresh — only one block at a time in the file.

Completion criteria

/constitution-edit is complete when:

  • Step 0 has run (pre-flight checks pass)
  • Step 1 has run (change identified and section confirmed; Section 1 attempts rejected)
  • Step 2 has been approved by the user (or cancelled — in which case nothing else runs)
  • Step 3 has determined the new semver version
  • Step 4 has applied the content edit
  • Step 5 has detected affected templates (or determined none)
  • Step 6 has built the Sync Impact Report block
  • Step 7 has prepended the block to constitution.md and shown the result to the user
  • Step 8 has displayed the wrap-up message

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.