name: agent-constitution-creator version: 1.0.0 description: "Use when the user asks to create an agent constitution, define persistent agent identity, write agent.md, generate an agent governance spec, or add a constitution-grade agent to a multi-agent ecosystem. Produces deterministic agent.md constitutions with 22 required fields covering identity, authority, governance, quality, validation, and version control." argument-hint: agent-id [role-description] model: opus context: fork allowed-tools: - Read - Write - Edit - Glob - Grep
Agent Constitution Creator
Create deterministic agents/{id}/agent.md constitutions for multi-agent ecosystems. A valid constitution has exactly the 22 required field sections, traceable context, explicit authority boundaries, least-privilege tools, and a versioned completion contract.
When to Activate
Activate for requests such as:
- "create an agent constitution"
- "define agent identity"
- "write agent.md"
- "generate agent spec"
- "design agent governance"
- "add an agent for X" when the user needs persistent operating identity, tools, authority, and governance
Do not activate for lightweight Claude Code subagent metadata only. Route that request to agent-creator and explain the routing boundary.
Deterministic Contract
- Use
assets/agent-constitution-template.mdas the output skeleton. - Use
assets/agent-constitution-schema.jsonas the 22-field contract. - Use
assets/authority-policy.jsonbefore assigning tools, agents, memory rights, escalation targets, or autonomous decisions. - Run
scripts/validate_agent_constitution.pyon any generatedagent.mdbefore marking the work complete. - Never invent tools, peer agents, registries, memory keys, security checkpoints, APIs, or approval rights. If context is missing, ask for it or mark the field
[OPEN]. - Use a caller-provided
{{CONSTITUTION_DATE}}token for rendered templates; do not derive dates from wall-clock time inside the skill.
Required Inputs
Minimum context before generation:
- Agent id in kebab-case.
- Primary role or responsibility.
- Known peer agents or confirmation that none exist.
- Tool registry or explicit statement that no tools are available.
- Security, memory, and escalation constraints.
If any item is absent, enter interview mode and ask only for the missing fields. Do not produce agents/{id}/agent.md prematurely.
Context Harvest
- Search existing constitutions with
Glob agents/*/agent.md. - Read matching peer agent files to identify scope overlap and escalation paths.
- Read tool registry, security policy, memory policy, or project
AGENTS.mdwhen present. - Build a source map with
[EXPLICIT],[INFERRED], and[OPEN]tags. - If another agent's scope overlaps materially, stop generation and propose merge, split, or explicit mutual non-goals.
The 22 Fields
Identity:
- Mission
- Mandate
- Scope
Authority:
- Non-Goals
- Inputs
- Outputs
- Decision Rights
- Allowed Tools
- Forbidden Tools
Governance:
- Memory Policy
- Security Policy
- Orchestration Policy
- Delegation Rules
- Escalation Rules
- Tone / Output Style
Quality:
- Validation Discipline
- Meta-Cognition Protocol
- Failure Handling
- Completion Criteria
- KPIs
- Dependencies
- Version
Generation Rules
- Write to
agents/{id}/agent.mdonly when the user asks for a file update. Otherwise return the Markdown body. - The frontmatter must include
id,name,role, and semverversion. - Each required field must be a top-level Markdown heading and contain specific, non-placeholder content.
Decision Rightsmust separateAutonomousfromRequires approval.Allowed Toolsmust list only explicit names from the supplied registry. No wildcards, "all tools", or invented tools.Forbidden Toolsmust explicitly deny likely overreach such as network, shell, write, payment, deploy, or deletion powers when those are not in scope.Security Policymust cover CP1 input, CP2 prompt/instruction, and CP3 output validation.Escalation Rulesmust include trigger, target, and context.Failure Handlingmust include at least three rows with detection, response, and fallback.KPIsmust include at least three metrics with target and unit.Versionmust include current semver and change-control rule.
Output Template
Use assets/agent-constitution-template.md. Keep its 22 headings intact. Substitute only from user-provided or repo-observed context and retain [OPEN] where context is missing.
Validation Gate
Before delivery:
-
scripts/validate_agent_constitution.py --schema assets/agent-constitution-schema.json --constitution <agent.md>passes. - All 22 fields are present and non-empty.
- Frontmatter is valid and semver is present.
- No placeholder tokens,
TODO,TBD, wildcards, or "all tools" claims remain. - All tools are registry-backed and least privilege.
- Overlap, missing context, and conflicting authority are handled by clarification, not invention.
- Evidence tags distinguish
[EXPLICIT],[INFERRED], and[OPEN]claims.