CLI tool for managing Klondike Spec agent workflow artifacts
Project description
๐ด Klondike Spec CLI
The CLI that built itself โ A tool for managing AI agent workflows, created through the very methodology it implements.
๐ The Story: When AI Builds Its Own Tools
What happens when you ask an AI coding agent to build a tool for managing AI coding agents?
You get Klondike Spec CLI โ a project that went from concept to 100% feature completion in just 4 coding sessions, with the AI agent using the very methodology and artifacts the tool was designed to manage.
The Challenge
Modern AI coding agents like GitHub Copilot are powerful, but they face a fundamental limitation: context windows reset between sessions. Every new conversation starts fresh, losing the accumulated knowledge, decisions, and progress from previous work.
Anthropic's research on effective harnesses for long-running agents highlighted this challenge and inspired a solution: structured artifacts that bridge context windows.
The Solution: Klondike Spec
The Klondike Spec framework provides:
- ๐ A feature registry that prevents "victory declarations" (agents claiming completion prematurely)
- ๐ A progress log for session-to-session handoffs
- โ Verification evidence requirements before features can be marked complete
- ๐ Structured workflows that guide agents through complex, multi-session projects
๐ Python-First: Klondike Spec is currently optimized for Python development workflows, with built-in support for
uv,pytest,ruff, and modern Python tooling. The instructions and CI/CD patterns assume a Python project structure. Contributions to support other ecosystems are welcome!
The Meta-Journey
This CLI tool was built by an AI agent following the Klondike Spec methodology โ tracking its own features, managing its own sessions, and providing verification evidence for each completed feature. The dog ate its own dog food, and it was delicious.
40 features. 7 sessions. 142 tests. 100% verified.
โก Built with Pith: Agent-Native CLI Design
Klondike Spec CLI is powered by Pith โ a revolutionary CLI framework designed specifically for AI agents.
Unlike traditional CLI frameworks that prioritize human interaction patterns, Pith implements progressive discovery:
Tier 1: pith โ Overview of all commands
Tier 2: command โ Synopsis and usage
Tier 3: command --help โ Full documentation
AI agents can efficiently navigate the CLI surface, discovering exactly what they need without overwhelming context. Pith also supports:
- ๐ฏ Semantic intents โ Commands can be invoked by meaning, not just exact syntax
- ๐ Structured output โ JSON mode for programmatic integration
- ๐ง Schema export โ Full command structure for AI tooling
๐ค Multi-Agent Support
Klondike Spec CLI supports multiple AI coding agents with a pluggable adapter system.
Supported Agents
| Agent | Flag | Templates Created |
|---|---|---|
| GitHub Copilot (default) | --agent copilot |
.github/ directory with instructions, prompts, templates |
| Claude Code | --agent claude |
CLAUDE.md at root, .claude/ with settings and commands |
| Both | --agent all |
All templates for both agents |
Initialize with Your Preferred Agent
# Default: GitHub Copilot
klondike init my-project
# Claude Code
klondike init my-project --agent claude
# Both agents
klondike init my-project --agent all
# Add Claude to existing Copilot project
klondike upgrade --agent claude
Claude Code Integration
When using --agent claude, klondike creates:
your-project/
โโโ CLAUDE.md # Main instructions file (read by Claude Code)
โโโ .claude/
โโโ settings.json # Permission presets for klondike commands
โโโ commands/ # Custom slash commands
โโโ session-start.md
โโโ session-end.md
โโโ verify-feature.md
โโโ progress-report.md
โโโ add-features.md
โโโ recover-from-failure.md
Use the slash commands in Claude Code by typing /project:command-name.
๐ณ Isolated Worktree Sessions
One of Klondike's most powerful features is the ability to run AI agents in isolated git worktrees. This provides a safe sandbox where agents can make changes without affecting your main project until you're ready.
Why Worktrees?
- ๐ Isolation โ Changes are made in a separate directory, protecting your main branch
- ๐งช Experimentation โ Let the agent try risky changes without fear
- ๐ Parallel work โ Run multiple agent sessions simultaneously on different features
- โฉ๏ธ Easy rollback โ Just delete the worktree if things go wrong
Worktree Commands
# Start Copilot in an isolated worktree
klondike copilot start --worktree
# Focus on a specific feature (creates branch like klondike/f001-abc123)
klondike copilot start -w --feature F001
# Custom session name
klondike copilot start -w --name "refactor-auth"
# Auto-cleanup worktree when session ends
klondike copilot start -w --cleanup
# Apply changes back to main project after session (auto-cleans up)
klondike copilot start -w --apply
# Force cleanup worktrees with uncommitted changes
klondike copilot cleanup --force
# List all active worktree sessions
klondike copilot list
Worktree Directory Structure
Worktrees are created in a centralized location outside your project:
~/klondike-worktrees/
โโโ my-project/
โโโ .klondike-project # Marker linking to original project
โโโ f001-abc123/ # Worktree for feature F001
โ โโโ <full project copy>
โโโ refactor-auth-def456/ # Named worktree session
โโโ <full project copy>
The agent works in the worktree with a dedicated branch (klondike/f001-abc123), commits freely, and when done you can:
- Apply the changes with
--apply(automatically cleans up the worktree) - Cherry-pick specific commits
- Merge the branch manually
- Or just delete it with
klondike copilot cleanup --force
Note: When using
--apply, klondike automatically excludes.klondike/state files from the diff, so only your code changes are applied. The klondike state in the main project remains authoritative.
๐ Installation
Global Installation (Recommended)
Install klondike as a globally available command using uv or pipx:
# Using uv (fastest)
uv tool install klondike-spec-cli
# Using pipx
pipx install klondike-spec-cli
This makes the klondike command available system-wide, isolated from your project dependencies.
Project Dependency
Add to your project's dependencies:
# Using uv
uv add klondike-spec-cli
# Using pip
pip install klondike-spec-cli
๐ฏ Quick Start
Initialize Your Project
# Create .klondike directory and .github templates
klondike init my-awesome-project
# Include a link to your PRD for agent context
klondike init my-awesome-project --prd ./docs/prd.md
# Skip .github scaffolding if you already have it
klondike init my-awesome-project --skip-github
# See where you stand
klondike status
๐ Project: my-awesome-project v0.1.0
Completion: 0.0%
Progress: [โโโโโโโโโโโโโโโโโโโโ] 0.0%
โณ Not Started 0
๐ฏ Ready to add features!
Define Your Features
# Add features with acceptance criteria
klondike feature add -d "User authentication" -c core -p 1 \
--criteria "Login form works,Password validation,Session management"
klondike feature add -d "Dashboard UI" -c ui -p 2 \
--criteria "Responsive layout,Data visualization,Real-time updates"
# See your feature backlog
klondike feature list
Work Through Features
# Start a coding session
klondike session start --focus "F001 - User authentication"
# Mark what you're working on
klondike feature start F001
# When complete with evidence
klondike feature verify F001 --evidence "All tests pass, demo video recorded"
# End the session
klondike session end --summary "Auth complete" --completed "Login,Logout,Sessions"
Track Progress Across Sessions
# Check overall status (includes git info!)
klondike status
๐ Project: my-awesome-project v0.1.0
Completion: 50.0%
Progress: [โโโโโโโโโโโโโโโโโโโโ] 50.0%
โ
Verified 1
โณ Not Started 1
๐
Last Session: #1 (2025-12-07)
Focus: F001 - User authentication
๐ Git Status: โ
Clean (branch: main)
Recent commits:
abc123 2025-12-07 feat(auth): implement user login
๐ฏ Next Priority Features:
โณ Not started F002: Dashboard UI
๐ Complete Command Reference
Project Commands
| Command | Description |
|---|---|
klondike init [name] |
Initialize .klondike directory and agent templates |
klondike init --agent <name> |
Select agent: copilot (default), claude, or all |
klondike init --prd <path> |
Initialize with PRD link for agent context |
klondike init --skip-github |
Initialize without agent template scaffolding |
klondike init --upgrade |
Upgrade templates while preserving user data |
klondike init --force |
Wipe and reinitialize (requires confirmation) |
klondike upgrade |
Alias for init --upgrade - refresh templates |
klondike status |
Show project status, git info, and next priorities |
klondike validate |
Check artifact integrity and consistency |
klondike config |
View or set project configuration |
klondike progress |
Regenerate agent-progress.md from JSON |
klondike report |
Generate detailed status report |
klondike release [version] |
Automate version bumping and release tagging |
Feature Management
| Command | Description |
|---|---|
klondike feature add |
Add a new feature with description and criteria |
klondike feature list |
List features with optional status filter |
klondike feature show <id> |
Display full feature details |
klondike feature start <id> |
Mark feature as in-progress |
klondike feature verify <id> |
Mark as verified with evidence |
klondike feature block <id> |
Mark as blocked with reason |
klondike feature edit <id> |
Edit notes, criteria, priority |
Session Management
| Command | Description |
|---|---|
klondike session start |
Begin session (validates artifacts, shows status) |
klondike session end |
End session with summary and handoff notes |
AI Agent Integration
| Command | Description |
|---|---|
klondike copilot start |
Launch GitHub Copilot CLI with klondike context |
klondike copilot start --worktree |
Launch Copilot in an isolated git worktree |
klondike copilot start -w --feature F001 |
Worktree session focused on a specific feature |
klondike copilot list |
List active worktree sessions |
klondike copilot cleanup |
Remove all worktree sessions |
klondike mcp serve |
Start MCP server for AI agent integration |
klondike mcp install |
Generate MCP server config for VS Code |
klondike mcp config |
Output MCP configuration JSON |
Web UI
| Command | Description |
|---|---|
klondike serve |
Start web UI for project management |
klondike serve --port 3000 |
Use custom port |
klondike serve --host 0.0.0.0 |
Allow external connections |
klondike serve --open |
Auto-launch browser |
Import/Export
| Command | Description |
|---|---|
klondike import-features <file> |
Import features from YAML/JSON |
klondike export-features <file> |
Export features to YAML/JSON |
Shell Completion
# Bash
klondike completion bash >> ~/.bashrc
# Zsh
klondike completion zsh > ~/.zsh/completions/_klondike
# PowerShell
klondike completion powershell >> $PROFILE
๐ Project Structure
After running klondike init, your project will have:
With GitHub Copilot (default)
your-project/
โโโ .klondike/
โ โโโ features.json # ๐ Feature registry (source of truth)
โ โโโ agent-progress.json # ๐ Session log and handoffs
โ โโโ config.yaml # โ๏ธ CLI configuration
โโโ agent-progress.md # ๐ Generated human-readable progress
โโโ .github/
โโโ copilot-instructions.md # ๐ค Agent behavior rules
โโโ instructions/ # ๐ Workflow instruction files
โโโ prompts/ # ๐ฌ Reusable prompt templates
โโโ templates/ # ๐ Init scripts and schemas
With Claude Code (--agent claude)
your-project/
โโโ .klondike/ # Same as above
โโโ agent-progress.md
โโโ CLAUDE.md # ๐ค Main Claude instructions
โโโ .claude/
โโโ settings.json # โ๏ธ Permission presets
โโโ commands/ # ๐ฌ Custom slash commands
With Both (--agent all)
Both .github/ and .claude/ + CLAUDE.md are created.
Tip: Use
--skip-githubto skip agent template creation entirely.
๐ง Configuration
.klondike/config.yaml:
# Default category for new features
default_category: core
# Default priority (1=critical, 5=nice-to-have)
default_priority: 2
# Who verifies features
verified_by: coding-agent
# Where to generate the markdown progress file
progress_output_path: agent-progress.md
# Auto-regenerate markdown on changes
auto_regenerate_progress: true
# Link to PRD document for agent context (set via --prd or config command)
# prd_source: ./docs/prd.md
Managing Configuration
# View all configuration
klondike config
# View specific setting
klondike config prd_source
# Set PRD source
klondike config prd_source --set ./docs/requirements.md
# Clear PRD source
klondike config prd_source --set null
When prd_source is set, the PRD link appears prominently in agent-progress.md, ensuring all future coding sessions have access to the original requirements.
๐ค Integration with Klondike Spec Framework
This CLI is designed to work seamlessly with the Klondike Spec prompting framework for GitHub Copilot.
The framework provides:
- ๐ Copilot instructions that embed agent behavior rules
- ๐ฌ Slash commands (
/session-start,/session-end,/verify-feature) - ๐ Templates for consistent project structure
The CLI handles artifact manipulation. The framework guides agent behavior.
Together, they enable sophisticated multi-session agent workflows that maintain coherence across context window resets.
๐งช Development
# Clone and setup
git clone https://github.com/ThomasRohde/klondike-spec-cli.git
cd klondike-spec-cli
uv sync
# Run tests (142 tests)
uv run pytest -v
# Lint and type check
uv run ruff check .
uv run mypy src
# Build
uv build
Project Stats
- 40+ features โ all verified with evidence
- 167 tests โ comprehensive coverage
- 7 sessions โ iterative development
- 4500+ lines of well-structured Python
๐ด Why "Klondike"?
Like the classic card game, building complex software with AI agents requires patience, strategy, and careful arrangement of moving pieces. You can't just pile cards randomly โ you need structure, rules, and a clear view of your progress.
Klondike Spec provides that structure. The CLI gives you the tools to maintain it.
๐ License
MIT โ See LICENSE for details.
๐ Related Projects
- Klondike Spec โ The prompting framework for GitHub Copilot
- Pith โ Agent-native CLI framework with progressive discovery
Built with ๐ค by AI, for AI, verified by humans
"The best way to predict the future is to build the tools that build the future."
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file klondike_spec_cli-1.0.1.tar.gz.
File metadata
- Download URL: klondike_spec_cli-1.0.1.tar.gz
- Upload date:
- Size: 139.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29486886a8490ebab81f56171654b3780a8a7d940e2734332102b6360017e63a
|
|
| MD5 |
9ca673cfab7e03116f58bd399880457b
|
|
| BLAKE2b-256 |
9bf0b3dcedfc2ac6dd5edbf97bcd59ec01762d70afc4ac2da1c7b8b50f4813fc
|
Provenance
The following attestation bundles were made for klondike_spec_cli-1.0.1.tar.gz:
Publisher:
publish.yml on ThomasRohde/klondike-spec-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
klondike_spec_cli-1.0.1.tar.gz -
Subject digest:
29486886a8490ebab81f56171654b3780a8a7d940e2734332102b6360017e63a - Sigstore transparency entry: 776159005
- Sigstore integration time:
-
Permalink:
ThomasRohde/klondike-spec-cli@34f4471ed3d32e409c2ed3b63cc4ac317a07af5c -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/ThomasRohde
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@34f4471ed3d32e409c2ed3b63cc4ac317a07af5c -
Trigger Event:
push
-
Statement type:
File details
Details for the file klondike_spec_cli-1.0.1-py3-none-any.whl.
File metadata
- Download URL: klondike_spec_cli-1.0.1-py3-none-any.whl
- Upload date:
- Size: 158.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a01a5d15e8560ce1554f5c381e2dd21aa0fb02ace887d9911d76733c3886ffe5
|
|
| MD5 |
a94b46304e6c471158de39089ac67d9f
|
|
| BLAKE2b-256 |
835f48c7584196d96128b123803e2e29145e8cdf452c269aac6726e79aff58ca
|
Provenance
The following attestation bundles were made for klondike_spec_cli-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on ThomasRohde/klondike-spec-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
klondike_spec_cli-1.0.1-py3-none-any.whl -
Subject digest:
a01a5d15e8560ce1554f5c381e2dd21aa0fb02ace887d9911d76733c3886ffe5 - Sigstore transparency entry: 776159008
- Sigstore integration time:
-
Permalink:
ThomasRohde/klondike-spec-cli@34f4471ed3d32e409c2ed3b63cc4ac317a07af5c -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/ThomasRohde
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@34f4471ed3d32e409c2ed3b63cc4ac317a07af5c -
Trigger Event:
push
-
Statement type: