Archive notice: This page documents historical Spec Kitty behavior and is not the current 3.2 workflow. Start with Spec Kitty 3.2 for current docs.
2.x Doctrine and Charter
The charter is the single authoritative governance document for your project. It captures policy decisions -- testing standards, quality gates, branching rules, deployment constraints -- and feeds them into every workflow action. Agents never invent governance on the fly; they read what the charter says and comply.
In 2.x, the charter workflow is fully command-driven. You answer an interview, generate machine-readable config, and sync it whenever policy changes. The extracted config is injected into agent prompts automatically, so governance is enforced without manual intervention.
The 3-Layer Model
Governance is organized into three layers. Only the first is human-edited; the rest are derived.
| Layer | File | Edited By |
|---|---|---|
| 1. Charter | charter.md |
Human (via interview or direct edit) |
| 2. Extracted Config | governance.yaml, directives.yaml, metadata.yaml |
Auto-generated (never edit) |
| 3. Doctrine References | library/*.md |
Auto-generated (never edit) |
The flow is always top-down: edit the charter, then run sync to regenerate everything below it.
Doctrine Artifact Model
2.x doctrine artifacts are repository-native and typed:
- Directives:
src/doctrine/directives/*.directive.yaml - Tactics:
src/doctrine/tactics/*.tactic.yaml - Styleguides:
src/doctrine/styleguides/**/*.styleguide.yaml - Toolguides:
src/doctrine/toolguides/*.toolguide.yaml - Schemas:
src/doctrine/schemas/*.schema.yaml - Mission assets/templates:
src/doctrine/missions/**
Artifact integrity is enforced by:
tests/doctrine/test_schema_validation.pytests/doctrine/test_artifact_compliance.pytests/doctrine/test_tactic_compliance.py
The Interview-Generate-Sync Workflow
The typical governance workflow follows three steps:
- Interview -- answer questions about your project's policies (testing, deployment, quality gates). This produces
answers.yamland a draftcharter.md. - Generate -- derive machine-readable config (
governance.yaml,directives.yaml) and doctrine library files from the charter. This step is deterministic: same charter always produces the same output. - Sync -- after manually editing the charter, re-derive all config to pick up changes. The
metadata.yamlfile tracks the charter hash so drift detection can warn you when config is stale.
This cycle repeats whenever project policies evolve.
Charter Lifecycle
The charter flow is command-driven through five subcommands:
| Command | Purpose |
|---|---|
spec-kitty charter interview |
Capture policy decisions interactively (or --defaults for CI) |
spec-kitty charter generate |
Produce YAML config and doctrine library from the charter |
spec-kitty charter context --action <action> |
Inject governance into a workflow step (specify, plan, implement, review) |
spec-kitty charter status |
Show current sync state and detect drift |
spec-kitty charter sync |
Re-derive all config from the charter after manual edits |
The interview supports two profiles:
- minimal (8 questions) -- project intent, languages, testing, quality gates, review policy, performance targets, deployment constraints, and branching rules.
- comprehensive (11 questions) -- everything in minimal plus paradigm selection, doctrine references, and advanced tooling preferences.
Use --defaults for non-interactive bootstrapping or CI pipelines.
Charter Paths
Current bundle location:
| Path | Contents |
|---|---|
.kittify/charter/charter.md |
The authoritative policy document |
.kittify/charter/interview/answers.yaml |
Structured interview responses |
.kittify/charter/references.yaml |
Doctrine reference selections |
.kittify/charter/library/*.md |
Generated guidance documents |
Legacy compatibility is still handled for projects with older layout, but 2.x documentation treats .kittify/charter/ as canonical.
Available Directives and Paradigms
Directives are numbered project rules extracted from your charter. Each has:
- Severity --
error(blocks workflow) orwarning(advisory) - Action scope -- which workflow actions the directive applies to (e.g.,
implement,review)
Paradigms are higher-level development philosophies your charter can select:
- TEST_FIRST -- tests must be written before implementation code
- LIBRARY_FIRST -- prefer existing libraries over custom implementations
- DOCS_ADJACENT -- documentation lives alongside code, not in a separate tree
The charter interview prompts you to select paradigms; they are then embedded in the governance config and referenced during charter context.
Runtime Template Resolution
When resolving templates and mission assets, 2.x uses ordered precedence:
- Project override
- Project legacy location
- User-global mission-specific location
- User-global location
- Packaged doctrine mission defaults
Implementation references:
src/specify_cli/runtime/resolver.pysrc/specify_cli/runtime/home.py
Primary implementation:
src/specify_cli/cli/commands/charter.pysrc/specify_cli/charter/compiler.pysrc/specify_cli/charter/context.py
Learn More
- Step-by-step setup: How to Set Up Project Governance -- full walkthrough of interview, generate, and sync
- Agent management: How to Manage Agents -- configure which agents receive governance context
- Mission system: The Mission System Explained -- how governance integrates with mission workflows
- CLI reference: CLI Commands Reference -- complete
chartersubcommand details