DEPRECATED: This document is outdated and references v1.x architecture (tmux, state.json, config.json). For current installation instructions, see the README.md. This file will be removed in a future release.
The easiest way to install Codev is through npm:
npm install -g @cluesmith/codevThis provides three CLI commands:
codev- Main CLI (init, adopt, doctor, update, tower)af- Agent-farm CLI for parallel developmentconsult- Multi-agent consultation tool
mkdir my-project && cd my-project
codev initcd existing-project
codev adoptcodev doctorWhen you install @cluesmith/codev, the package includes all framework files (protocols, roles, agents) as an embedded skeleton. This means:
-
Minimal project structure:
codev initandcodev adoptonly create:codev/specs/- Your feature specificationscodev/plans/- Your implementation planscodev/reviews/- Your reviews and lessons learnedcodev/projectlist.md- Project trackingCLAUDE.mdandAGENTS.md- AI agent instructions
-
Framework files provided at runtime: Protocols, roles, and templates are read from the installed npm package, not copied to your project. This keeps your project clean and makes updates seamless.
-
Local overrides supported: If you want to customize any framework file, simply create it in your local
codev/directory. Local files always take precedence:- To customize the consultant role: create
codev/roles/consultant.md - To modify SPIDER protocol: create
codev/protocols/spider/protocol.md - To add custom templates: create files in
codev/templates/
- To customize the consultant role: create
# Copy the default consultant role to your project for customization
mkdir -p codev/roles
cat $(npm root -g)/@cluesmith/codev/skeleton/roles/consultant.md > codev/roles/consultant.md
# Edit it to suit your needs
# The local version will now be used instead of the embedded oneThis section provides instructions for AI agents to manually install the Codev methodology framework. Most users should use npm install -g @cluesmith/codev instead.
- Context Drives Code - Context definitions flow from high-level specifications down to implementation details
- Human-AI Collaboration - Designed for seamless cooperation between developers and AI agents
- Evolving Methodology - The process itself evolves and improves with each project
When a user requests Codev installation, check if the consultation tools are available:
# Check if consult CLI is available
command -v consult >/dev/null && echo "✓ consult CLI available" || echo "✗ consult CLI not found"Note: The consult CLI is installed with npm install -g @cluesmith/codev. Multi-agent consultation requires at least one of: claude, gemini-cli, or codex.
IMPORTANT: All Codev files go INSIDE a codev/ directory, not in the project root!
# Clone codev repository to temporary directory
TEMP_DIR=$(mktemp -d)
git clone --depth 1 https://github.com/ansari-project/codev.git "$TEMP_DIR"
# Copy skeleton structure to your project
mkdir -p codev
cp -r "$TEMP_DIR/codev-skeleton/"* ./codev/
# Detect if Claude Code is available and install agents to appropriate location
if command -v claude &> /dev/null; then
# Claude Code detected - install agents to .claude/agents/
mkdir -p .claude/agents
cp -r "$TEMP_DIR/codev-skeleton/agents/"* ./.claude/agents/ 2>/dev/null || true
echo "✓ Agents installed to .claude/agents/ (Claude Code detected)"
else
# Non-Claude Code environment - agents already in codev/agents/ from skeleton
echo "✓ Agents installed to codev/agents/ (universal location)"
fi
# Create required directories (ensures they exist even if skeleton is incomplete)
mkdir -p codev/specs
mkdir -p codev/plans
# Clean up
rm -rf "$TEMP_DIR"Directory Structure Should Be:
project-root/
├── .ruler/ # Optional: Ruler-managed agent configs
│ ├── codev.md # Codev-specific instructions (if using Ruler)
│ └── ruler.toml # Ruler configuration
├── codev/ # All Codev files go here!
│ ├── protocols/ # Protocol definitions
│ ├── projectlist.md # Master project tracking
│ ├── specs/ # Specifications
│ ├── plans/ # Implementation plans
│ ├── reviews/ # Reviews and lessons learned
│ └── resources/ # Reference materials and documentation
├── .claude/ # Claude Code-specific directory (if using Claude Code)
│ └── agents/ # Custom project agents
├── AGENTS.md # Universal AI agent instructions (if NOT using Claude Code)
├── CLAUDE.md # Claude Code-specific instructions (if using Claude Code)
└── [project files] # Your actual code
Note:
- Agent configuration file is either
CLAUDE.md(Claude Code) ORAGENTS.md(other tools), not both - Custom project agents can be placed in
.claude/agents/(Claude Code) orcodev/agents/(other tools)
The entire codev/protocols/ directory is copied with all available protocols. The active protocol is selected by modifying the agent configuration files to reference the appropriate protocol path:
- For Ruler users: Modify
.ruler/codev.mdand runnpx @intellectronica/ruler apply - For direct management: Modify
CLAUDE.md(Claude Code) orAGENTS.md(other tools)
Available protocols:
codev/protocols/spider/- Full SPIDER with multi-agent consultationcodev/protocols/tick/- Fast autonomous implementation for simple taskscodev/protocols/experiment/- Disciplined experimentation for research and prototyping
IMPORTANT: Check if the user is using Ruler for agent configuration management first!
AGENTS.md follows the AGENTS.md standard for cross-tool compatibility (Cursor, GitHub Copilot, etc.), while CLAUDE.md provides native support for Claude Code.
# Check if Ruler is in use
if [ -d ".ruler" ] && [ -f ".ruler/ruler.toml" ]; then
echo "Ruler detected. Adding Codev instructions via .ruler/codev.md..."
# Create .ruler/codev.md with Codev-specific instructions
# Run ruler apply to regenerate all tool-specific configs
npx @intellectronica/ruler apply
echo "✓ Codev instructions added to .ruler/codev.md and distributed via ruler"
else
# No Ruler - use single-file approach based on detected environment
echo "No Ruler detected. Using direct agent configuration..."
# Detect environment and set target file
if command -v claude &> /dev/null; then
TARGET_FILE="CLAUDE.md"
echo "Claude Code detected - using CLAUDE.md"
else
TARGET_FILE="AGENTS.md"
echo "Other AI tool detected - using AGENTS.md"
fi
# Check if target file exists
if [ -f "$TARGET_FILE" ]; then
echo "Agent configuration file ($TARGET_FILE) exists. Updating to include Codev references..."
# APPEND Codev-specific instructions to existing file
else
# Ask user for permission
echo "No $TARGET_FILE found. May I create it? [y/n]"
# If yes, create the appropriate file with Codev structure
# Note: No template exists in skeleton - AI should create appropriate one based on project context
fi
fiContent to add (same for both approaches):
For Ruler users, create .ruler/codev.md with this content.
For direct management, AGENTS.md and CLAUDE.md should contain identical content - AGENTS.md follows the AGENTS.md standard for cross-tool compatibility (Cursor, GitHub Copilot, etc.), while CLAUDE.md provides native support for Claude Code.
When updating existing files, add these sections:
## Codev Methodology
This project uses the Codev context-driven development methodology.
### Active Protocol
- Protocol: SPIDER
- Location: codev/protocols/spider/protocol.md
### Directory Structure
- Specifications: codev/specs/
- Plans: codev/plans/
- Reviews: codev/reviews/
- Resources: codev/resources/
See codev/protocols/spider/protocol.md for full protocol details.Key sections to verify:
- For Ruler users: Ensure content in
.ruler/codev.mdis correct before runningnpx @intellectronica/ruler apply - For direct management (CLAUDE.md or AGENTS.md):
- Active protocol path
- Consultation guidelines (if using SPIDER)
- File naming conventions (####-descriptive-name.md)
Run the Doctor Command:
The easiest way to verify your installation is to run:
codev doctorThis checks:
- Core dependencies: Node.js, git (with versions)
- AI CLI dependencies: Claude Code, Gemini CLI, Codex CLI (at least one required)
If any required dependencies are missing, the doctor will show install instructions.
Quick Codev Structure Verification:
# 1. Verify codev/ directory exists
test -d codev && echo "✓ codev/ directory exists" || echo "✗ FAIL: codev/ directory missing"
# 2. Verify required subdirectories
test -d codev/protocols/spider && echo "✓ SPIDER protocol exists" || echo "✗ FAIL: SPIDER protocol missing"
test -d codev/protocols/tick && echo "✓ TICK protocol exists" || echo "✗ FAIL: TICK protocol missing"
test -d codev/specs && echo "✓ specs/ directory exists" || echo "✗ FAIL: specs/ directory missing"
# 3. Verify agents are installed in appropriate location
if command -v claude &> /dev/null; then
test -d .claude/agents && echo "✓ .claude/agents/ directory exists (Claude Code)" || echo "✗ FAIL: .claude/agents/ directory missing"
else
test -d codev/agents && echo "✓ codev/agents/ directory exists (universal)" || echo "✗ FAIL: codev/agents/ directory missing"
fi
# 4. Verify protocol is readable
test -r codev/protocols/spider/protocol.md && echo "✓ protocol.md is readable" || echo "✗ FAIL: Cannot read protocol.md"
# 5. Verify agent configuration exists and references codev
# Check for Ruler first, then fall back to single-file detection
if [ -d ".ruler" ] && [ -f ".ruler/ruler.toml" ]; then
test -f .ruler/codev.md && echo "✓ .ruler/codev.md exists (Ruler setup)" || echo "✗ FAIL: .ruler/codev.md missing"
grep -q "codev" .ruler/codev.md && echo "✓ .ruler/codev.md references codev" || echo "✗ FAIL: .ruler/codev.md missing codev references"
elif command -v claude &> /dev/null; then
test -f CLAUDE.md && echo "✓ CLAUDE.md exists (Claude Code)" || echo "✗ FAIL: CLAUDE.md missing"
grep -q "codev" CLAUDE.md && echo "✓ CLAUDE.md references codev" || echo "✗ FAIL: CLAUDE.md missing codev references"
else
test -f AGENTS.md && echo "✓ AGENTS.md exists (universal)" || echo "✗ FAIL: AGENTS.md missing"
grep -q "codev" AGENTS.md && echo "✓ AGENTS.md references codev" || echo "✗ FAIL: AGENTS.md missing codev references"
fiDetailed Structure Check:
# View complete directory structure
find codev -type d -maxdepth 2 | sort
# Expected output:
# codev/
# codev/plans
# codev/protocols
# codev/protocols/spider
# codev/protocols/tick
# codev/reviews
# codev/resources
# codev/specs
# Verify protocol content
cat codev/protocols/spider/protocol.md | head -20After installation, guide the user:
Note for future changes: To modify the active protocol or other agent instructions:
- Ruler users: Edit
.ruler/codev.mdand runnpx @intellectronica/ruler apply - Direct management: Edit both
AGENTS.mdandCLAUDE.md(keep them synchronized)
-
First Specification: "What would you like to build first? I can help create a specification using the SPIDER protocol."
-
Explain the Flow:
- Build in phases using the IDE loop:
- Implement: Build the code
- Defend: Write comprehensive tests
- Evaluate: Verify requirements are met
- Each phase follows: Specification → Plan → IDE Loop → Review
- Build in phases using the IDE loop:
-
Document Naming: Always use ####-descriptive-name.md format
-
Git Integration:
- Each stage gets one pull request
- Phases can have multiple commits
- User approval required before PRs
Q: User wants multi-agent consultation but consult CLI isn't working
- Try: "Let me verify the consult CLI and its dependencies are installed:
codev doctor" - Fallback: "You can run SPIDER with 'without consultation' to skip multi-agent reviews"
Q: User has existing codev directory
- If upgrading from a previous codev version, see MIGRATION-1.0.md for upgrade instructions
- Ask: "You have an existing codev/ directory. Should I:"
- "Upgrade to v1.0.x (preserves your specs, plans, and reviews)"
- "Back it up and reinstall"
- "Keep existing setup"
Q: User wants a different protocol name
- Protocols can be renamed, just ensure:
- Directory name matches references in agent configuration file (AGENTS.md or CLAUDE.md)
- All templates are present
- manifest.yaml is updated
| Feature | SPIDER | TICK | EXPERIMENT |
|---|---|---|---|
| Multi-agent consultation | ✓ (GPT-5 + Gemini Pro) | ✗ | ✗ |
| Prerequisites | consult CLI | None | None |
| Specification reviews | Multi-agent external | Minimal | N/A |
| Plan reviews | Multi-agent external | Minimal | N/A |
| Implementation reviews | Multi-agent per phase | Post-implementation | Results-focused |
| Best for | Production features | Small tasks / amendments | Research & prototyping |
| Speed | Thorough | Fast | Flexible |
| Output | Spec + Plan + Review | Spec + Plan + Review | notes.md per experiment |
Note: To skip multi-agent consultation in SPIDER, say "without consultation" when starting work.
Codev includes an AI-assisted command for importing protocol improvements from other codev projects.
Usage:
# Import from local directory
codev import /path/to/other-project
# Import from GitHub
codev import github:owner/repo
codev import https://github.com/owner/repoHow it works:
- Fetches the source codev/ directory (local path or GitHub clone)
- Spawns an interactive Claude session with source and target context
- Claude analyzes differences and recommends imports
- You interactively approve/reject each suggested change
- Claude makes approved edits to your local codev/ files
Focus areas:
- Protocol improvements (new phases, better documentation)
- Lessons learned from other projects
- Architectural patterns and documentation structure
- New protocols not in your installation
Requirements:
- Claude CLI (
npm install -g @anthropic-ai/claude-code) - git (for GitHub imports)
For projects with parallelizable components, Codev includes the Architect-Builder pattern for running multiple AI agents simultaneously.
After installing @cluesmith/codev via npm, ensure these dependencies are installed:
- Node.js 18+ (includes node-pty for terminal sessions)
- git 2.5+ (with worktree support)
Check with:
codev doctorThe architect-builder tools are available globally via the af command after installing @cluesmith/codev:
# Ensure .builders/ and .agent-farm/ are in your .gitignore
echo ".builders/" >> .gitignore
echo ".agent-farm/" >> .gitignore
# Verify the agent-farm CLI is available
af --helpCreate codev/config.json to customize commands:
{
"shell": {
"architect": "claude --model opus",
"builder": "claude --model sonnet",
"shell": "bash"
},
"templates": {
"dir": "codev/templates"
},
"roles": {
"dir": "codev/roles"
}
}Override via CLI:
af workspace start --architect-cmd "claude --model opus"
af spawn 3 --protocol spir --builder-cmd "claude"# Start the workspace
af workspace start
# Spawn a builder for a spec
af spawn 3 --protocol spir
# Check status of all builders
af status
# Open a utility shell
af shell
# Open a file in annotation viewer
af open src/auth/login.ts
# Clean up a builder (checks for uncommitted changes first)
af cleanup --project 0003
# Force cleanup (WARNING: may lose uncommitted work)
af cleanup --project 0003 --force
# Stop the workspace and all builders
af workspace stop
# Manage port allocations (for multi-project support)
af ports list
af ports cleanup- Architect (you + primary AI) creates specs and plans
- Builders (autonomous AI agents) implement specs in isolated git worktrees
- Each builder runs in a persistent terminal session (shellper process + node-pty) with web terminal access
- Review comments are stored directly in files using
// REVIEW:syntax - Builders create PRs when complete; architect reviews and merges
- Multi-project support: Each project gets its own port block (4200-4299, 4300-4399, etc.)
- Safe cleanup: Refuses to delete worktrees with uncommitted changes unless
--forceis used - Orphan detection: Automatically cleans up stale sessions on startup
- Configurable commands: Customize architect, builder, and shell commands via
config.json
.agent-farm/state.json- Runtime state (builders, ports, processes)~/.agent-farm/ports.json- Global port registry (for multi-project support)codev/config.json- Project configurationcodev/templates/- Dashboard and annotation HTML templatescodev/roles/- Architect and builder role prompts
See codev/specs/0002-architect-builder.md for full documentation.
- The goal is THREE documents per feature (spec, plan, review)
- Each stage gets one pull request
- Phases can have multiple commits within the PR
- User approval required before creating PRs
- Context drives development