Cadence

A stack-agnostic, self-improving AI development framework as a Claude Code plugin.

View the Project on GitHub nik190799/cadence

Architecture

Cadence is structured as four layers with a fifth concept (the retrospective loop) that wires them together.

The four layers

Layer 1 — Patterns

docs/PATTERNS.md is your codebase’s source of truth on how things are done. Every rule in it cites an ADR (Architecture Decision Record) in docs/ADR/. ADRs use the Nygard format: Status, Context, Decision, Consequences.

When a teammate (human or agent) writes new code, this is what they align to. When they violate it, the Reviewer cites the section.

Layer 2 — Process

Three documents:

Layer 3 — Automated gates

Mechanical, ungaslightable enforcement. Driven by cadence.yaml:

commands:
  format: ["prettier --check ."]
  lint:   ["eslint ."]
  test:   ["npm test"]
boundaries:
  - where: "src/features/**"
    forbidden: ["src/data/sources/**"]
    reason: "Features must read via narrow providers"

scripts/verify.{sh,ps1} orchestrates format → lint → boundary check → test. tool/check_boundaries.py is language-agnostic — it scans import/require/include/use/from lines for forbidden path patterns and works across stacks via line-pattern matching.

Layer 4 — Launch

TEAM_LAUNCH_TEMPLATE.md is the prompt that kicks off a team run. It has placeholders for feature description, requirements, acceptance criteria, and out-of-scope. /cadence-launch <feature> fills the placeholders interactively and optionally spawns the four subagents defined in ROLE_SPECS.md.

The retrospective loop

After every team run, the Reviewer subagent walks a structured table:

Field Example
What happened “Feature engineer used write-then-reread for list mutations”
Auto-catchable? “No — judgment call”
Rule existed? “No”
Proposed fix “Write ADR-NNNN + update PATTERNS.md §4”
Fix layer “Layer 1 (Patterns)”

Each finding maps to exactly one of the four fix layers. The Reviewer prefers higher numbers descending into lower — if Layer 3 (automation) can catch it, automate; only fall back to docs (Layer 1) or process (Layer 2) when automation can’t. Layer 4 (launch ambiguity) is the last resort because launch prompts drift across runs.

The Lead (the human) approves or defers each proposed fix. Approved fixes land immediately as new ADRs, PATTERNS sections, boundary rules, or DoD lines. Every change is logged in FRAMEWORK_CHANGELOG.md.

Why this layout

How this maps to industry standards