CDD(宪法驱动开发) 是一个专为AI辅助开发设计的方法论和工具集。它通过"宪法"(一套明确的规则和约束)来指导AI代理进行软件开发,确保代码质量和项目可持续性。
CDD is a lightweight T0-T3 documentation-governance skill for Codex. It helps
projects scaffold a governance memory bank, diagnose authority and routing
gaps, and validate current-truth, execution, and archive boundaries.
CDD does not own editor configuration, runtime integration, agent execution,
session persistence, analytics, or product implementation.
The operating rules are defined in SKILL.md. For the authority
model, Decision Ladder, and practical examples, see
the T0-T3 practical guide.
Install the minimal runtime dependency:
python -m pip install -r requirements.txt
Run the scripts directly from this repository. --project defaults to the
current directory.
python scripts/scaffold_t0_t3.py --project <path> [--force] [--json]
python scripts/diagnose_t0_t3.py --project <path> [--json]
python scripts/validate_t0_t3.py --project <path> [--json]
scaffold_t0_t3.py is the only write entry. It creates missing managed--force is supplied. It refuses todiagnose_t0_t3.py is read-only and reports T0, T1, Support, T2, T3, andvalidate_t0_t3.py is read-only and checks structure, support closure, T2Exit codes are 0 for success, 1 for governance or validation failure, and
2 for command-line usage errors. With --json, stdout contains exactly one
versioned JSON object.
There is no installed Python package, global cdd command, or
python -m cdd entrypoint.
Clone the repository into the Codex skills directory:
git clone https://github.com/wsman/Constitution-Driven-Development-Skill.git `
"$HOME/.codex/skills/cdd"
The skill remains automatically discoverable through its SKILL.md
frontmatter.
python -m pip install -r requirements-test.txt
$env:PYTHONUTF8 = '1'
$env:PYTEST_DISABLE_PLUGIN_AUTOLOAD = '1'
python -m pytest -q tests
The regression suite covers the public CLI, scaffolding idempotence, malformed
governance input, support closure, T3 authority leakage, and the
impact-proportional blocking scenarios.
.
|-- SKILL.md
|-- README.md
|-- scripts/
|-- references/
|-- assets/templates/
`-- tests/