shuxueshuxue/Spexcode
Spec-driven orchestration for your coding agents.
What it solves
SpexCode addresses "spec drift," where AI coding agents modify source code faster than the documentation (specs) describing that code can be updated. This often leads to a state where the documentation no longer accurately describes the system's actual behavior.
How it works
SpexCode creates a Git-backed system where specifications are stored as Markdown files in a .spec/ directory. Each spec is "anchored" to specific files or functions in the code. By analyzing Git commits, SpexCode detects when a commit changes the code within an anchored range without updating the corresponding spec. This is identified as "anchor-drift."
To resolve drift, a user must either update the spec to match the code or explicitly acknowledge (ack) that the implementation change still satisfies the existing contract.
The system operates in three layers:
- L0 (Spec-Code Graph): The core binding between specs and code in Git.
- L1 (Agent Sessions): Isolated worktrees and branches for each agent, ensuring changes are tracked and linked to the specs they touch.
- L2 (Dashboard): A GUI for reviewing sessions and managing specs.
Who it’s for
Developers using AI coding agents (such as Claude Code or Codex) who want to maintain strict synchronization between their technical specifications and their implementation.
Highlights
- Deterministic Drift Detection: Uses Git history to compute exactly when a spec stopped describing the code.
- Git-Native: Stores no separate database; all drift and versioning data is derived from Git commits.
- Agent Isolation: Runs agents in separate branches and worktrees via tmux to prevent interference.
- Integration: Provides plugins for Claude Code and Codex, as well as a CLI and a dedicated dashboard.
- Enforcement: Can block commits via Git hooks if anchor-drift is detected.
Related
- Project
- Project
- Project
- Project