Context and Problem Statement
2.x introduces a doctrine layer that did not previously have an explicit ADR. We now have:
- Typed doctrine artifacts under
src/doctrine/(directives, tactics, styleguides, toolguides, schemas, mission assets). - A charter generation flow built from interview answers plus doctrine catalog selection.
- Runtime/template loading paths that resolve packaged doctrine mission assets as canonical defaults.
Without an ADR, these choices are hard to evaluate and easy to accidentally regress.
Decision Drivers
- Make doctrine behavior auditable and deterministic.
- Keep governance artifacts local-first and repository-native.
- Enforce schema-level quality gates for doctrine artifacts.
- Ensure charter generation references explicit doctrine selections.
Considered Options
- Keep doctrine behavior implicit in templates and command handlers.
- Store doctrine as typed, schema-validated repository artifacts and compile charter bundles from them (chosen).
- Move doctrine selection/generation to an external service.
Decision Outcome
Chosen option: Store doctrine as typed, schema-validated repository artifacts and compile charter bundles from them.
Decision Details
- Doctrine artifacts are first-class files under
src/doctrine/with schema contracts insrc/doctrine/schemas/. - Charter generation compiles interview inputs plus doctrine selections into
.kittify/charter/(charter.md, references, library files). - Runtime default mission/template assets resolve from doctrine package assets (
src/doctrine/missions/...) when project and global overrides are absent. - Doctrine integrity is tested with fixture schema tests and in-repo artifact compliance tests.
Consequences
Positive
- Governance behavior is explicit, versioned, and reviewable.
- Charter output is reproducible from interview + doctrine selection state.
- Doctrine changes are testable in CI before user-facing execution.
Negative
- Additional schema and test maintenance burden for doctrine artifacts.
- More files and concepts for contributors to understand.
Neutral
- Existing command UX is preserved while implementation becomes doctrine-backed.
Confirmation
This decision is validated when:
- Doctrine artifacts validate against schemas.
- Cross-artifact references resolve (for example directive
tactic_refs, tactic references, toolguide paths). - Charter generation produces deterministic bundles from the same inputs.
- Runtime/template resolution selects doctrine package defaults when higher-precedence tiers are absent.
More Information
Implementation references:
src/doctrine/schemas/*.schema.yamlsrc/doctrine/directives/test-first.directive.yamlsrc/doctrine/tactics/*.tactic.yamlsrc/doctrine/styleguides/**/*.styleguide.yamlsrc/doctrine/toolguides/*.toolguide.yamlsrc/specify_cli/charter/compiler.pysrc/specify_cli/cli/commands/charter.pysrc/specify_cli/runtime/home.pysrc/specify_cli/runtime/resolver.pytests/doctrine/test_schema_validation.pytests/doctrine/test_artifact_compliance.py