Skip to main content

CoDD: Coherence-Driven Development — cross-artifact change impact analysis

Project description

CoDD — Coherence-Driven Development

PyPI Python License Stars

日本語 | English | 中文

Write only functional requirements and constraints. CoDD generates the code, repairs the coherence, and verifies the result.


🌟 Why CoDD

"Write only functional requirements and constraints. Code is generated, repaired, and verified automatically."

Most "AI-assisted dev" tools focus on the generation side. CoDD focuses on the constraint side: the LLM is most useful when it has a precise picture of what must be true. CoDD ties every artifact (requirements → design → lexicon → source → tests → runtime) into a single DAG, drives an LLM repair loop against it, and surfaces what is structurally unrepairable — honestly.

With an enabled artifact contract, codd plan/generate/implement/verify judge completion by the artifacts actually produced, not by the command merely returning — a harness-level mechanism that lets even a weaker model stay on the north star.


🚀 Get started in 60 seconds

pip install codd-dev

# Greenfield: write requirements, walk away
codd greenfield --requirements docs/requirements/requirements.md

One command runs the whole unattended pipeline — init → elicit → plan → generate → implement → verify (auto-repair) → propagate → check — checkpointing after every unit (codd greenfield --resume picks up where it stopped, --ntfy-topic sends progress pings, --dry-run previews). The same pipeline ships as three vehicles so any setup can use it: a transparent shell composition (examples/greenfield_autopilot.sh), a Claude Code Agent Workflow template (examples/claude_workflows/codd-greenfield.js), and the codd-greenfield skill (codd skills install codd-greenfield --target both — works in Claude Code and Codex CLI).

Working inside an existing project instead:

codd init --suggest-lexicons --llm-enhanced    # AI picks the lexicons that fit
codd elicit                                    # AI finds gaps in your requirements
codd dag verify --auto-repair --max-attempts 10  # AI fixes coherence violations

Already shipping? Describe what you want fixed:

codd fix "login error messages are hard to understand"   # natural-language phenomenon mode

codd fix [PHENOMENON] is CoDD's second entry-point: state the desired change in plain words, CoDD locates the affected design docs via lexicon + semantic scoring and updates them with an LLM. From there the change flows design → implementation → tests → verify: Stage 4 deterministically resolves the affected implementation + test files from the DAG, makes an allowlist-confined LLM patch, and runs a verify gate (no new red DAG check + local tests pass) with targeted rollback (only files this run wrote are reverted) on failure. Opt out with --no-propagate-impl; add --propagate to also reconcile dependent design docs. --dry-run previews, --non-interactive runs in CI.


🎨 Visual flow

flowchart LR
    R["Requirements (.md)"] --> E["codd elicit"]
    E -->|gap findings| H{HITL: approve / reject}
    H -->|approve| L["project_lexicon.yaml + requirements TODOs"]
    H -->|reject| I["ignored_findings.yaml"]
    L --> V["codd dag verify --auto-repair"]
    V -->|violation| AR["LLM patch propose → apply"]
    AR --> V
    V -->|SUCCESS| D["✅ deploy gate passes"]
    AR -->|max attempts| P["PARTIAL_SUCCESS: unrepairable surfaced honestly"]

Brownfield path:

flowchart LR
    Code["Existing codebase"] --> X["codd extract"]
    X --> DIFF["codd diff (drift)"]
    DIFF --> EL["codd elicit (coverage gaps)"]
    EL --> H{HITL gate}
    H --> Apply["codd elicit apply"]
    Apply --> V["codd dag verify"]

✨ What it does

CoDD is one CLI organised in four layers. Pick what you need; the rest stays out of your way.

Core commands

Command One-line summary
🚀 codd greenfield --requirements FILE Unattended autopilot: requirements in, system out. All gates auto-approved, checkpoint/resume via --resume, ntfy notify-only. Its building blocks (generate --all-waves, implement list-tasks, verify --repair-mode) also work standalone.
🎯 codd init --suggest-lexicons --llm-enhanced LLM scans code/docs, picks the right lexicon plug-ins.
🔍 codd elicit Finds specification holes against industry-standard lexicons.
🔄 codd diff Detects drift between requirements and actual implementation.
🛠️ codd dag verify --auto-repair Validates the full DAG; LLM proposes patches; loop until SUCCESS or MAX_ATTEMPTS.
🎯 codd fix / codd fix [PHENOMENON] Two modes — auto-detect CI failures, or describe a desired change in natural language; phenomenon mode flows design → implementation → tests → verify (opt out via --no-propagate-impl).
🧭 codd operations {derive,show,approve,apply} Detects requirement units anchored to no declared operation, has the AI propose operation_flow entries, and writes a proposal for human review — nothing reaches codd.yaml until approve + apply. Opt-in, non-destructive. (Legacy merge still works as a deprecated alias of apply.)
📜 codd contract {derive,show,apply,verify} V-model artifact contract. derive/apply are requirement-driven selection of which catalog artifacts a project declares per stage (derive detects the project's signals — requirement docs, design docs, lexicon, declared operation_flow, source dirs, test/e2e suites — and writes a reviewable proposal, never touching codd.yaml; apply merges it non-destructively and idempotently, --enable to turn the gate on). verify/gate are the completion side: with the contract enabled, a stage can't claim completion until its declared artifacts are produced/validate. show renders the catalog + this project's contract. Opt-in; absent/disabled contract = no-op. (Legacy suggest/adopt still work as deprecated aliases.)
🌐 codd brownfield Extract → diff → elicit pipeline for existing codebases.

Quality gates

Gate Purpose
🧪 codd verify --runtime Step 8 runtime smoke (DB up + dev server reachable + smoke HTTP + real-browser E2E + opt-in CRUD reflection via runtime.crud_flow_targets + action outcome coverage via runtime.action_outcome_targets). --runtime-skip opts out per category and records the reason.
📊 codd lexicon list/install/diff + codd coverage report Plug-in management + JSON / Markdown / self-contained HTML coverage matrices.
🛡️ CI gate .github/workflows/codd_coverage.yml template + codd coverage check exit code blocks coverage regressions on merge.

Skills & backends

Capability What it gives you
🔁 codd skills {install,list,remove} Distributes bundled skills (e.g. codd-evolve) to ~/.claude/skills/ and ~/.agents/skills/. --target {claude,codex,both}, --mode {symlink,copy}, idempotent + --force.
🪡 codd-evolve skill Brownfield conversational evolution. Walks requirements → design → lexicon → source → tests → verify → propagate → Step 8 runtime smoke from a single natural-language intent. Stop-and-ask gates for new lexicon terms, breaking changes, and 1:N UI topology.
Codex App Server backend (v2.20.0) Set codex_app_server.enabled: true in codd.yaml to route AI calls through a persistent JSON-RPC thread instead of subprocess. thread_strategy: per_session amortises codex cold-start across codd implement / codd verify --auto-repair / codd fix. Automatic subprocess fallback when the binary or socket is missing.

Lexicon plug-ins

38 industry-standard lexicons ship as opt-in coverage axes — Web (WCAG / OWASP / Web Vitals / WebAuthn / forms / SEO / PWA), Mobile (HIG / Material 3 / a11y / MASVS), Backend (REST / GraphQL / gRPC / events), Data (SQL / JSON Schema / event sourcing / governance), Ops (CI/CD / Kubernetes / Terraform / observability / DORA), Compliance (ISO 27001 / HIPAA / PCI DSS / GDPR / EU AI Act), Process (ISO 25010 / 29119 / DDD / 12-factor / i18n / model cards / API rate-limit), and Methodology (BABOK).


📊 Case study

Dogfooded against a Next.js + Prisma + PostgreSQL multi-tenant LMS (~30 design docs, 12 DB tables, RLS-enforced isolation): codd init --suggest-lexicons matched 9 of 10 manually-chosen lexicons, codd elicit surfaced 70 spec holes, codd dag verify --auto-repair drove 16 unrepairable violations down to PASS or amber-WARN with deploy allowed — without a single line of CoDD core change per project. Project-specific concerns live entirely in project_lexicon.yaml and codd_plugins/.


🧱 Generality Gate (three-layer architecture)

Layer Where stack-specific names live Examples
A — Core Nowhere. Zero react, django, Stripe, LMS literals. codd/elicit/, codd/dag/, codd/lexicon_cli/
B — Templates Generic placeholders only. codd/templates/*.j2, codd/templates/lexicon_schema.yaml
C — Plug-ins Free to name anything. codd_plugins/lexicons/*/, codd_plugins/stack_map.yaml

This is what lets one core work for Next.js, Django, FastAPI, Rails, Go services, mobile apps, ML model cards — and lets contributors add a lexicon without touching the core.


🧭 Roadmap

Up next:

  • App-Server-driven benchmark publication (P50 / P95 / P99 for subprocess vs JSON-RPC)
  • Lexicon plug-in marketplace

Past releases (v2.11.0 → v2.20.0) live in CHANGELOG.md with quality metrics.


🤝 Contributing

CoDD is shaped by:

  • @yohey-w — Maintainer / Architect
  • @Seika86 — Sprint regex insight (PR #11)
  • @v-kato — Brownfield reproduction reports (Issues #17 / #18 / #19 / #20 / #21 / #22)
  • @dev-komenzarsource_dirs bug reproduction (Issue #13)

Issues, PRs, and lexicon proposals are welcome — see Issues.


📚 Documentation

  • CHANGELOG.md — every release with quality metrics
  • docs/ — architecture notes
  • codd --help — full CLI reference

📦 Hook Integration

CoDD ships hook recipes for editor and Git workflows:

  • Claude Code PostToolUse hook recipe for running CoDD checks after file edits
  • Claude Code requirements-nudge recipe (claude_requirements_nudge.json) — prints an advisory "requirements changed → run codd greenfield --resume or codd check" when files under docs/requirements/ are edited (print-only; never auto-runs expensive pipelines)
  • Git pre-commit hook recipe for blocking commits when coherence checks fail

Recipes live under codd/hooks/recipes/.


License

MIT — see LICENSE.

Links


When code changes, CoDD traces the impact, detects violations, and produces evidence for merge decisions.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codd_dev-2.45.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codd_dev-2.45.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file codd_dev-2.45.0.tar.gz.

File metadata

  • Download URL: codd_dev-2.45.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codd_dev-2.45.0.tar.gz
Algorithm Hash digest
SHA256 87bc548b43d9659300e75cd85d3c4948e0620f12efa21db012500ee33df63f7a
MD5 ca94223e169b2442294abec8e1de498d
BLAKE2b-256 50948bc9e59696b0b54b52b48feeacfbc1d01a34e4aaf3e6540e658e0ce17b13

See more details on using hashes here.

File details

Details for the file codd_dev-2.45.0-py3-none-any.whl.

File metadata

  • Download URL: codd_dev-2.45.0-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codd_dev-2.45.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bb93fd7ec75474d2735311ae38a0fa129752547ededac7dda4809982f4e1940
MD5 fbb218a364993b2ab447c440600f6d90
BLAKE2b-256 74503a32d742de3d554635848892ad60567e4acdd65b771b210f7682b70456ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page