ai-constitution
$
npx mdskill add arcasilesgroup/ai-engineering/ai-constitution``` /ai-constitution generate # interview + write CONSTITUTION.md from scratch /ai-constitution update # change a single section (Mission, Prohibitions, etc.) /ai-constitution amend # formal amendment with version bump + audit event ```
SKILL.md
.github/skills/ai-constitutionView on GitHub ↗
---
name: ai-constitution
description: Interviews the operator to produce a project-identity CONSTITUTION.md (Mission / Stakeholders / Vocabulary / Prohibitions / Compliance gates / Anti-goals / Boundaries / Escalation / Language / Lifecycle phase). Trigger for 'set up the constitution', 'define project identity', 'who is this project for', 'what does this project never do', 'amend the constitution'. Not for AI-behaviour rules — those live in CANONICAL.md / AGENTS.md. Not for spec governance; use /ai-governance instead.
effort: mid
argument-hint: "[generate|update|amend]"
mode: agent
model_tier: sonnet
mirror_family: copilot-skills
generated_by: ai-eng sync
canonical_source: .claude/skills/ai-constitution/SKILL.md
edit_policy: generated-do-not-edit
---
# Constitution
## Quick start
```
/ai-constitution generate # interview + write CONSTITUTION.md from scratch
/ai-constitution update # change a single section (Mission, Prohibitions, etc.)
/ai-constitution amend # formal amendment with version bump + audit event
```
## Workflow
Apply §10.6 (SDD) — every CONSTITUTION.md write is traceable to a spec
decision (D-131-04 anchored this rewrite). Apply §10.4 (DRY) — project
identity lives ONCE in CONSTITUTION.md; AI-behaviour content lives in
CANONICAL.md. The two never overlap.
1. **Auto-detect** — read `.ai-engineering/manifest.yml`, package files
(`pyproject.toml` / `package.json` / `Cargo.toml`) to seed the
interview with project name, stack, version.
2. **Read existing** — if `CONSTITUTION.md` exists, load it and show
the operator the diff BEFORE any overwrite. NEVER overwrite without
diff + explicit confirm (R-131-03 mitigation).
3. **Interview the 10 sections** — see "Interview" below.
4. **Write** — emit `CONSTITUTION.md` using the 10-section skeleton.
Refuse to write any AI-behaviour / engineering-principle header —
those belong to CANONICAL.md; CONSTITUTION owns project identity
only: Think Before Coding, Simplicity First, Surgical Changes,
Goal-Driven Execution, Plan-Mode Default, Subagent Strategy,
Self-Improvement Loop, Demand Elegance, Autonomous Bug Fixing,
KISS, YAGNI, SOLID, DRY, TDD, SDD, Clean Code, Hexagonal
Architecture. (Framework dev repo: the canonical list lives at
`tools/skill_lint/checks/md_mirror.py:FORBIDDEN_CONSTITUTION_HEADERS`.)
5. **Rotate** — when `update` or `amend` replaces operator-authored
content, copy the pre-write body to
`.ai-engineering/specs/_history-constitution-<YYYY-MM-DD>.md` so
the prior identity is recoverable.
6. **Verify + record** — confirm inline that the file you just wrote
carries only the 10 project-identity sections and none of the
AI-behaviour headers from Step 4 (re-read `CONSTITUTION.md`; do NOT
shell out to `skill_lint` — that is a framework-dev mirror-parity
gate whose module is absent on a consumer's bare `python3` and which
false-fails on the `.codex`/`.github` mirror surfaces a consuming
project legitimately lacks). The `/ai-constitution` run is already
audited automatically as a `skill_invoked` event by the
UserPromptSubmit hook — no manual emit is required. If a distinct
marker is wanted, emit a `framework_event` `kind=framework_operation`
(`operation=constitution_update`, `component: ai-constitution`,
`detail: {version, sections_changed, mode}`); it chains into the
standard audit pipeline. **Fail-open**: never block the
`CONSTITUTION.md` write on a verification or audit failure.
## Interview
| Section | Question |
|---------|----------|
| Mission | What does this project do, and what does it never do? |
| Stakeholders | Who relies on this project? Who pays the cost when it breaks? |
| Vocabulary | What domain terms must every contributor use precisely? |
| Prohibitions | What must the AI / contributors NEVER do? |
| Compliance gates | What pipelines / audits / certifications gate releases? |
| Anti-goals | What use cases are explicitly out of scope (and why)? |
| Boundaries | Which surfaces are framework-owned vs team-owned? |
| Escalation | Who is paged when prohibitions / gates fail? |
| Language | Project natural language for docs / commits. |
| Lifecycle phase | greenfield · stabilising · mature · sunset. |
## Examples
### Example 1 — first install, no prior CONSTITUTION
User: "set up the constitution for this project"
```
/ai-constitution generate
```
Interviews the 10 sections, seeds defaults from `manifest.yml`, writes
`CONSTITUTION.md` v1.0.0 with the ratified date stamped. The run is
audited automatically as a `skill_invoked` event.
### Example 2 — formal amendment with version bump
User: "amend the constitution to add 'no LLM-generated production
secrets' to prohibitions"
```
/ai-constitution amend
```
Loads the existing body, presents the diff for the Prohibitions
section, applies the amendment, bumps the minor version, records the
amendment row in the governance footer, rotates the pre-amendment
body into `_history-constitution-<date>.md`.
## Integration
Called by: `ai-eng install` (governance phase), `/ai-start` (cold-load
identity context). Reads: `manifest.yml`, package files, existing
`CONSTITUTION.md`, `decision-store.json`. Writes: `CONSTITUTION.md`,
`_history-constitution-<date>.md` (when rotating). CI-guarded
(framework dev repo only) by
`tools/skill_lint/checks/md_mirror.py:check_constitution_clean` — any
AI-behaviour header fails that gate; consumer projects rely on the
inline Step 6 self-check. Consumed by: every skill at Step 0. See also: `/ai-governance` (compliance against the
constitution), CANONICAL.md (AI-behaviour layer — never written by
this skill).
$ARGUMENTS
More from arcasilesgroup/ai-engineering
- ai-adviseProactive governance advisor — checks standards, decisions, and quality trends during development. Always advisory, NEVER blocks. Three modes: `advise` (post-edit), `gate` (pre-dispatch), `drift` (on-demand decision audit). Trigger for 'governance check', 'advise on this change', 'check for drift', 'is this aligned with active decisions', 'shift-left advisory'. Not for blocking gates — use /ai-verify. Not for narrative code review — use /ai-review.
- ai-analyze-permissionsUse when Claude Code keeps asking to approve commands you have already approved, when settings.local.json has grown large, or when you want to consolidate permission grants into wildcard patterns. Trigger for 'too many permission prompts', 'clean up permissions', 'audit my settings', 'consolidate allow rules'. Claude Code only — not available in GitHub Copilot, Antigravity, or Codex.
- ai-animationDesigns motion, transitions, and micro-interactions for UI components: spring animations, gestures, easing, staggers — taste-driven detail compounding. Trigger for 'animate this', 'add transitions', 'micro-interactions for', 'gesture design', 'swipe to dismiss', 'easing for this', 'stagger the'. Not for design systems; use /ai-design instead. Not for visual art; use /ai-visual instead. Not for testing animation code; use /ai-test instead.
- ai-autopilotDelivers large multi-concern specs and backlog runs autonomously: decomposes specs into sub-specs (or normalizes work items into a backlog DAG), deep-plans with parallel agents, builds a dependency DAG, implements in waves, runs a single final quality loop with one bounded quality-remediation pass (verify+guard+review on full changeset), delivers via PR. Trigger for 'implement spec-NNN end to end', 'autopilot this', 'autonomous delivery', 'decompose and ship', 'run the backlog', 'execute these GitHub issues', 'process the sprint backlog'. Invocation is the approval gate. Not for small or single-concern tasks; use /ai-build instead. Not for ambiguous requirements; use /ai-brainstorm first.
- ai-boardOperates the project board (GitHub Projects v2 or Azure DevOps): discovers configuration after install (fields, state mappings, process templates) and syncs work-item state at lifecycle transitions. Trigger for 'set up the board', 'configure our ADO board', 'discover board fields', 'move this issue to in-review', 'update the board', 'mark as in progress', 'sync the work item state'. Two subcommands: `discover` (post-install configuration write) and `sync` (lifecycle state transitions). Auto-invoked via `sync` by /ai-brainstorm, /ai-build, and /ai-pr; fail-open. Not for backlog execution; use /ai-autopilot --backlog instead.
- ai-brainstormForces rigorous design interrogation BEFORE any code: explores approaches, surfaces ambiguity, gathers evidence, produces an approved spec that becomes the contract for /ai-plan. Trigger for 'lets add X', 'how should we handle Y', 'whats the best approach', 'I am thinking about', 'what should we build for'. Not for existing approved specs; use /ai-plan instead. Not for execution; use /ai-build instead.
- ai-branch-cleanupCleans branches safely: switches to the default branch, prunes merged and squash-merged branches, syncs to remote, sweeps stale specs, rotates `.ai-engineering/runtime/` per retention policy. Trigger for 'tidy up', 'tidy branches', 'sync to main', 'delete old branches', 'start fresh', 'rotate runtime'. Auto-invoked by /ai-pr after merge. Not for committing changes; use /ai-commit instead. Not for code-level dead-code removal; use /ai-simplify instead.
- ai-buildCanonical implementation gateway: reads approved plan.md, resolves stack from manifest, deterministic-routes each task to its adapter, dispatches the build agent in an isolated worktree, runs TDD self-validation per task, then a single final quality loop with one bounded quality-remediation pass on the full changeset before /ai-pr. Trigger for 'go', 'start building', 'execute the plan', 'implement it', 'lets do this', 'build the plan', 'resume', 'continue'. Not without an approved plan; run /ai-plan first. Not for multi-concern specs needing decomposition; use /ai-autopilot instead. Not for a single function or subcomponent; use /ai-code.
- ai-codeWrites production code that satisfies stack-context standards on the first pass: interface-first design, backward-compatibility checks, lightweight self-review. Trigger for 'implement this', 'write the code for', 'add X to Y', 'build this function', 'make this work'. Not for tests; use /ai-test instead. Not for debugging; use /ai-debug instead. Not for refactoring; use /ai-simplify instead. Not for executing an approved plan end-to-end; use /ai-build (the gateway).
- ai-commitRuns the governed commit pipeline: auto-branches from protected, stages selectively, formats and lints, scans for secrets, gates docs, composes a conventional message, pushes. Trigger for 'commit my changes', 'save my work', 'push this to remote', 'stage these files', 'ship it'. Not for opening a PR; use /ai-pr instead. Not for branch hygiene; use /ai-branch-cleanup instead.