@dnaspec/cli
v1.1.3
Published
Learn the DNA. Generate the Specification. Build with Confidence.
Readme
DNASpec
Learn the DNA. Generate the Specification. Build with Confidence.
What it is
DNASpec is a repository-intelligence-driven specification platform. It learns the DNA of a codebase — its architecture, naming conventions, testing patterns, error handling, dependency style, and documentation practices — and uses that knowledge to generate specifications and orchestrate AI coding agents that produce implementations consistent with how the repository already works.
It is positioned at the intersection of static analysis, knowledge graph construction, AI-assisted specification, and developer tooling. It is not a code generator. It is not a linter. It is the layer that ensures AI agents understand the repository before they change it.
Core workflow
Repository Analysis
↓
Repository DNA Extraction
↓
Knowledge Graph Construction
↓
Impact Analysis
↓
Specification Generation
↓
Planning
↓
Agent Execution (external)
↓
Quality ValidationInstall
npm install -g @dnaspec/cliQuick start
dnaspec init
dnaspec analyze
dnaspec risk "add payment processing"
dnaspec spec "add payment processing" --feature payment --risk
dnaspec plan payment
dnaspec review payment
dnaspec implement paymentCore principles
- Repository First — every generated artifact reflects the actual repository
- Works with Existing Projects — brownfield support is a first-class concern, not an afterthought
- Works with New Projects — greenfield is equally supported
- Universal Language Support — no language-specific toolchain required in the target project
- Agent Agnostic — generates context for Claude Code, Cursor, Copilot, Windsurf, or any future agent
- Zero Repository Pollution — all DNASpec artifacts live under
.dnaspec/; source code, build files, and language configuration are never modified
Commands reference
| Command | Description |
| ----------------------------- | ------------------------------------------------------------------------------------- |
| dnaspec init | Initialise a .dnaspec/ workspace in the current repository |
| dnaspec analyze | Traverse the repo, extract Repository DNA, build the knowledge graph |
| dnaspec graph | Summarise or query the knowledge graph |
| dnaspec explain <entity> | Explain a file, class, or function and its relationships |
| dnaspec risk <description> | Compute impact and risk level for a proposed change |
| dnaspec spec <description> | Generate a specification document for a feature |
| dnaspec plan <feature> | Decompose a spec into a topologically ordered task plan |
| dnaspec review <feature> | Run quality gates against a spec and plan |
| dnaspec implement <feature> | Generate agent context package and write integration files |
| dnaspec run <description> | Orchestrate the full pipeline in one command (--llm, --no-infer, --package) |
| dnaspec agents sync | Write slash-command and MCP configuration for coding agents |
| dnaspec registry | Publish/pull cross-service API surfaces (publish, pull, list, diff, status) |
| dnaspec llm | Configure and test LLM providers (status, test, providers, mode) |
| dnaspec config | Show or set configuration values |
Agent integrations
DNASpec supports two equivalent integration paths for coding agents:
- Slash commands (zero setup): Run
dnaspec agents syncto inject workflow instructions into your agent's instruction file. Use/dna-run "add feature" --feature my-featureto invoke the full pipeline. - MCP server: Install
dnaspec-mcpfor native tool calls with structured JSON responses. Works with Claude Desktop, Cursor, and VS Code Copilot.
Supported agents: Claude Code, Cursor, GitHub Copilot, Windsurf.
Requirements
- Node.js >= 20.19.0
License
MIT — see LICENSE
Contributing
See CONTRIBUTING.md for how to run tests, submit PRs, and follow the code style.
