Development Guide
Prerequisites
- Git: Required for cloning the repository
- Node.js 20+: Required for SPT Orchestrator
- Go 1.24+: Required for the CLI
- Docker: Required for local DevPod or containerized setup
- DevPod (Optional): For cloud development environments
Environment Setup
Quick Start (Coder - Recommended)
Install spt CLI:
bashgo install github.com/smartpointstech/spt/cli/cmd/sptx@latestInitialize and create workspace:
bashspt init # Enter URL: https://coder.smartpoints.tech # Enter token: <your-session-token> spt up my-workspaceConnect:
bashspt ssh my-workspace # Or use VS Code: coder open my-workspace
Quick Start (DevPod)
Install DevPod:
- macOS:
brew install loft-sh/devpod/devpod - Windows:
choco install devpod - Linux:
curl -L -o devpod "https://github.com/loft-sh/devpod/releases/latest/download/devpod-linux-amd64" && sudo install devpod /usr/local/bin
- macOS:
Launch Workspace:
bashdevpod up https://github.com/smartpointstech/spt --ide vscode
GitHub Codespaces
Create a new Codespace from the repository
Run the setup script:
bashcd scripts/bootstrap && ./setup.shConnect to tmux:
tmux attach -t workspace
Local Setup (macOS/Linux)
Clone the repository:
bashgit clone https://github.com/smartpointstech/spt.git cd spt/scripts/bootstrapRun the setup script:
- macOS:
./macos.sh - Linux:
./linux.sh
- macOS:
Attach to the workspace:
tmux attach -t workspace
Development Workflow (SPT Flow)
Session Start Protocol
Every development session should follow this sequence:
bash
# 1. Check Beads memory from previous sessions
bd-ready
# 2. Index codebase if needed
gnx-analyze
# 3. Create worktree for isolated work (if parallel execution)
wt-add feature-name
# 4. Start development
rf-swarm "your task description"3-Tier Memory Usage
Tier 1: Beads (Cross-Session)
bash
bd-ready # Load previous session context
bd-add "Decision: Use JWT for auth" # Store decisions
bd-search "auth" # Recall past decisions
bd-list # View all stored beadsTier 2: Native Tasks (Session)
Automatic within Claude Code. No explicit commands needed.
Tier 3: SptDB (Semantic)
bash
mem-store "key" "value" # Store semantic memory
mem-search "query" # Semantic retrieval
mem-stats # Memory statisticsGitNexus Workflow
Before modifying shared code:
bash
# Check blast radius
gnx-blast src/auth/handler.go
# View dependencies
gnx-deps src/auth/handler.go
# Get structural context
gnx-context src/auth/handler.goRule: If blast radius > 5 files, pause and consult before proceeding.
Worktree Isolation
For parallel agent work:
bash
# Create isolated worktree
wt-add feature-auth
# Work in the worktree
cd ../.worktrees/feature-auth
# When done, merge and cleanup
git checkout main
git merge feature-auth
wt-remove feature-authTmux Workspace
The environment uses tmux with 4 pre-configured windows:
| Window | Name | Purpose |
|---|---|---|
| 0 | Claude-1 | Main workspace |
| 1 | Claude-2 | Secondary workspace |
| 2 | Claude-Monitor | Usage tracking |
| 3 | htop | System monitor |
Commands:
- Switch windows:
Ctrl+bthen0-3 - Detach:
Ctrl+bthend - Reattach:
tmux attach -t workspace
Common Commands
SPT Core (rf-*)
bash
rf "your request" # Direct SPT command
rf-swarm "build feature" # Swarm with context
rf-hive "complex task" # Hive-mind with context
rf-mesh "coordinated work" # Mesh topology
rf-doctor # Auto-fix issues
rf-plugins # List installed pluginsBeads Memory (bd-*)
bash
bd-ready # Session start
bd-add "note" # Store note
bd-search "query" # Search notes
bd-list # List allGitNexus (gnx-*)
bash
gnx-analyze # Index codebase
gnx-blast <file> # Check impact
gnx-deps <file> # Show dependencies
gnx-context <file> # Get contextWorktrees (wt-*)
bash
wt-add <name> # Create worktree
wt-list # List worktrees
wt-remove <name> # Remove worktree
wt-clean # Prune staleQE (sqe-*)
bash
sqe-generate # Generate tests
sqe-gate # Run QE gateOpenSpec (os-*)
bash
os init # Initialize specs
os generate # Generate from specsTesting
Unit Tests
bash
# Go CLI tests
cd cli && go test ./...
# With coverage
cd cli && go test -coverprofile=coverage.out ./...Integration Tests
bash
# Run Playwright tests
npx playwright test
# With UI
npx playwright test --uiQE Gate
bash
# Run full QE gate (TDD, coverage, security)
sqe-gateBuilding
Go CLI
bash
cd cli
go build -o sptx ./cmd/sptxDocker Image
bash
cd infra/images/coder-base
docker build -t coder-base:local .Full Build Verification
bash
# Run from repo root
cd cli && go build ./cmd/... && cd ..
bash -n scripts/bootstrap/setup.sh
bash -n scripts/generate-claude-md.shCode Organization
spt/
├── agents/ # 600+ AI agents
├── cli/ # Go CLI
│ ├── cmd/sptx/ # Entry point
│ ├── internal/coder/ # Coder API client
│ ├── internal/config/ # Configuration
│ └── internal/ssh/ # SSH handling
├── infra/ # Infrastructure
│ ├── images/ # Docker images
│ └── terraform/ # Coder templates
├── scripts/
│ ├── bootstrap/ # Setup scripts
│ │ └── setup.sh # Main setup (SPT Orchestrator)
│ └── generate-claude-md.sh
├── docs/ # Documentation
├── .spt/ # SPT configuration
│ ├── config.yaml # Topology
│ └── plugins/ # 6 plugins
└── .beads/ # Cross-session memoryBoot Sequence
When a workspace starts, the following happens:
- System prerequisites installed (build-essential, python3, git, curl, jq)
- Node.js 20+ installed or verified
- Claude Code installed
- SPT Orchestrator initialized (
sptx init) - SPT MCP registered with Claude Code
- SPT doctor runs auto-fixes
- 6 plugins installed:
- Agentic QE
- Code Intelligence
- Test Intelligence
- Perf Optimizer
- Teammate Plugin
- Gastown Bridge
- UI UX Pro Max skill installed
- GitNexus installed and workspace indexed
- Beads initialized for cross-session memory
- Agent Teams enabled (
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) - Workspace directories created
- Statusline Pro v4.0 configured
- Aliases loaded (50+ rf-, bd-, gnx-, wt-, mem-*, etc.)
Troubleshooting
Node.js Version
bash
# Check version (must be 20+)
node --version
# Update via nvm
nvm install 20 && nvm use 20SPT Issues
bash
# Run doctor
sptx doctor --fix
# Reinitialize
sptx initMemory Not Persisting
bash
# Check Beads initialization
ls -la .beads/
# Reinitialize
bd initAliases Not Working
bash
# Reload shell config
source ~/.bashrc # or ~/.zshrc
# Check aliases exist
alias | grep rf-Go CLI Build Fails
bash
# Update dependencies
cd cli && go mod tidy
# Clean and rebuild
cd cli && go clean && go build ./cmd/...