Operational handbook translating the enduring principles in the constitution into day-to-day collaboration between human contributors and AI assistants. Keeps process lightweight while enabling traceability, consistency, and adaptive governance.
See: .specify/memory/constitution.md
- Follow hierarchy: constitution → agents.md → copilot-instructions → templates/scripts
- Choose the lightest responsible path (
Agentic → Full SDD) - Tools and AI assistants implement policy — they never define it
- At
/done, generate a feature diff summary via MCP and inject into PR
- Constitution – Foundational principles, quality & lifecycle gates
- agents.md – Operationalization & role boundaries
- copilot-instructions – Machine / tool execution rules (must not redefine policy)
- Templates, scripts, automation – Mechanical enforcement only
Conflict rule: Fix the lowest incorrect layer. Amend the constitution only when a true principle gap exists.
Canonical header to include in lower layers:
Implements constitution & agents.md. Does not introduce new governance.
| Category | Allowed | Not Allowed |
|---|---|---|
| Code generation | Implement scoped plan/spec tasks | Create new specs or change governance |
| File ops | Inside repo only | Writing outside workspace |
| External calls | Via approved MCP tools only | Raw HTTP to non-approved domains |
| Governance edits | Draft PRs referencing this file | Directly modify constitution/agents.md |
prototype/— Read-only design reference. Do not modify, review, lint, or flag any file under this directory. Seeprototype/CLAUDE.mdfor details.
| Phase | Purpose | Minimal Artifacts | Exit Criteria | Signal |
|---|---|---|---|---|
/spec |
Define WHAT & WHY | spec.md (Problem, Outcomes, Constraints) |
Open questions resolved or deferred | Phase: Spec label |
/plan |
Define HOW & risk handling | plan.md (Phases, Risks, Exit Criteria) |
Risks acknowledged; sequence approved | Phase: Plan label |
/implement |
Build & test | Code/tests referencing spec ID | Phase exit criteria met | Phase: Implement label |
/stabilize |
Hardening, docs, tuning | Added docs, tuning PRs | Quality & performance targets met | Phase: Stabilize label |
/done |
Close-out & measure | PR diff summary, metrics | Outcomes verified or pending | Phase: Done label |
Choose the lightest responsible path; escalate as uncertainty or risk increases. All coding work, including small fixes, runs through the Agentic path unless the scope demands Full SDD.
| Path | When to Use | Required Artifacts | Typical Triggers | Escalate If |
|---|---|---|---|---|
| Agentic Flow | Any scoped change up to ~400 LOC with known outcomes (including trivial fixes) | Inline mini-plan (PR or plan.md stub: Goal, Scope, Risks, Exit Criteria) |
Typo or guard clause corrections, internal API shifts, logic consolidation | Contract emerges, risk widens, churn > plan |
| Full SDD | Net-new capability, external contract, multi-sprint, high ambiguity | spec.md, plan.md before coding |
New aggregate, migration, security/privacy surface | >1 unresolved open question or unclear exit criteria |
Decision Rationale: Keeps small changes disciplined via Agentic mini-plans while preventing silent architectural drift on larger efforts.
Fallback Rule: If you discover a new domain concept or dependency assumption mid-way, pause → capture → promote the path before continuing.
- Identify conflict (e.g., tool behavior contradicts
agents.md). - Find the lowest divergent layer.
- Submit PR fixing that layer; link any higher-level ambiguity.
- If ambiguity touches principles → PR to amend constitution (
label: governance-change). - Record rationale in PR description (no separate decisions log required).
- Branch:
feat/NNN-slug(orfix/…,refactor/…when non-feature) - Commits: append
[NNN]for traceability if linked to a spec/plan/task ID - PR template includes: Spec ID, Phase, Summary, Risk Changes (Yes/No)
When a feature transitions to /done, the PR must include an authoritative feature diff summary, generated via the GitHub MCP server.
Creates a standardized closure artifact — lightweight, no new file — providing reviewers a narrative of what changed and residual risks.
Phase label → Phase: Done OR checklist exit criteria met.
- Compare base branch (default:
develop, override if branched from release). - Group changed files by category:
domain/,core/,maintests. - Note any risk mitigations added/dropped from
plan.md. - Map implemented tasks (if list existed); mark skipped/deferred.
- If measurable, record outcome metrics; else write
Metrics pending. - Replace PR description section between markers:
Feature Diff Summary (Spec NNN)
Base: develop
File Impact Category Files Notes domain 3 Added aggregate ProfileEngagement schema 1 Added user.engagementScore tests 7 Coverage for scoring logic Contract Deltas
GraphQL: +1 type, +1 field, 0 removals Events: +profile.engagement.calculated Migrations: 1 new table engagement_metrics
Risk & Mitigations
✅ Mitigated: inaccurate scoring (p95 <120 ms)
Outcomes vs Target
Goal: expose engagement metric in query Metric readiness: pending
AI/MCP Constraints
- Don’t invent metrics; if missing, mark explicitly.
- For large diffs, collapse file list and show top 5 changes.
- If an untracked external contract change appears, create/update spec + plan retroactively.
constitution > agents.md > copilot-instructions > templates/scripts Lower layers implement, never create, governance. Add new artifacts only when recurring pain justifies them.
| Date | Change | Author | Notes |
|---|---|---|---|
| 2025-10-30 | Initial lean version | (add on PR) | Bootstrap governance layer |
PRs touching this file or the constitution must carry label: governance-change
✅ End of agents.md