Spec-first, vendor-agnostic control plane for agent-driven software development
Features • Quick Start • Documentation • Architecture • Contributing
Kroker enables engineering teams to design, execute, and govern LLM-powered development workflows without surrendering control to any single model, vendor, or proprietary toolchain.
┌─────────────────────────────────────────────────────────────┐
│ Kroker: Agent Execution with Governance │
├─────────────────────────────────────────────────────────────┤
│ │
│ Spec → Isolated Worktree → Agent Runs → Gates Pass │
│ │ │
│ └─→ Bundle (Provenance) │
│ │
└─────────────────────────────────────────────────────────────┘
Agent-driven development introduces process fragility—unreproducible runs, unchecked code changes, and no provenance for decisions. Kroker solves this by wrapping every agent run in:
- Isolated git worktrees - Every run executes in isolation, no risk to your main branch
- Configurable quality gates - Tests, linters, security scans must pass before changes surface
- Cryptographic provenance - Complete audit trail with replayable run artifacts
- Vendor independence - Works with Claude Code, OpenCode, Copilot CLI, or custom tools
macOS (Homebrew)
brew tap Kit-Kroker/homebrew-kroker
brew install krokermacOS/Linux (Go)
go install github.com/Kit-Kroker/Kroker/cmd/kroker@latestmacOS/Linux/Windows (Direct Download)
- Download from GitHub Releases
- Extract and add to
$PATH
# Verify installation
kroker --version
# Generate a spec using AI
kroker spec generate "add redis caching to user service"
# Create a spec interactively
kroker spec create
# Lint a spec
kroker spec lint sdd-spec.yaml
# Run an agent with gates
kroker run sdd-spec.yaml --agent claude-code
# View the diff from a completed run
kroker view <run-id>
# Launch interactive TUI
kroker tuiAfter running an agent, you can view the changes made using the kroker view command:
# View the diff from a completed run
kroker view <run-id>
# View with color disabled (for piping to files)
kroker view <run-id> --no-color > diff.patch
# View in system pager (for large diffs)
kroker view <run-id> --pagerView Command Features:
- Colorized output - Additions in green, deletions in red, hunk headers in cyan
- No-color mode - Disable ANSI codes for piping to files or scripts
- Pager support - Use
lessormorefor viewing large diffs comfortably - Graceful error handling - Clear messages for missing runs or empty diffs
After running an agent, you can export changes in two formats:
Export just the code changes as a patch file for manual review or application:
# Export patch from a completed run (default filename: sdd-<run-id>.patch)
kroker export <run-id>
# Export to custom location
kroker export <run-id> --output /tmp/my-changes.patch
# Export with -o shorthand
kroker export <run-id> -o changes.patchApplying Patch:
# Review patch file
cat sdd-<run-id>.patch
# Apply patch to your codebase
git apply sdd-<run-id>.patch
# Check what changed
git statusAfter reviewing changes from a successful run, you can apply them directly to your working directory using the kroker accept command:
# Accept changes from a completed run
$ kroker accept kroker-20260131-143055-feature-1
Output:
Validating run kroker-20260131-143055-feature-1 for acceptance...
Loading diff from run bundle...
Detecting conflicts...
Applying patch...
Changes applied successfully:
Files modified: 3
Lines added: 15
Lines deleted: 5
Next steps:
1. Review changes: git diff
2. Commit changes: git commit
3. Or use 'kroker accept <run-id> --commit' (Story 5.2)Automatically create a git commit with run metadata and verification trailers when accepting changes:
# Accept changes and create commit in one step
$ kroker accept kroker-20260131-143055-feature-1 --commit
Output:
Validating run kroker-20260131-143055-feature-1 for acceptance...
Loading diff from run bundle...
Detecting conflicts...
Applying patch...
Changes applied successfully:
Files modified: 3
Lines added: 15
Lines deleted: 5
Extracting spec hash from run bundle...
Generating commit message with run metadata...
Commit created: abc1234def56789
Files committed: 3Commit Message Format:
The generated commit message follows this structure:
[kroker] Run Summary
Run Description (from spec.yaml)
kroker-run-id: kroker-20260131-143055-feature-1
kroker-spec-hash: a1b2c3d4e5f6
Signed-off-by: kroker <kroker-20260131-143055-feature-1>
Commit Flags:
--commit- Create a git commit after applying changes (default: false)--amend- Amend the previous commit instead of creating new one (default: false)--no-verify- Skip git pre-commit and commit-msg hooks (default: false)
Verification Trailers (FR27):
Each auto-created commit includes:
kroker-run-id- The run identifier for traceabilitykroker-spec-hash- First 12 characters of the spec's SHA-256 hashSigned-off-by- Kroker signature with run ID
FR26 Compliance:
The commit automatically squashes all applied changes into a single git commit, providing clean history.
Preview what would be applied without making any actual changes:
# Preview changes without applying
$ kroker accept kroker-20260131-143055-feature-1 --dry-run
Output:
Dry run complete (no changes applied):
Files that would be modified: 3
Lines added: 15
Lines deleted: 5Bypass working directory checks when you know it's safe:
# Force accept (bypass working directory check)
$ kroker accept kroker-20260131-143055-feature-1 --force
Note: Use --force carefully - it bypasses safety checks but will still
reject merge conflicts which are always unsafe.Show detailed output during acceptance:
$ kroker accept kroker-20260131-143055-feature-1 --verbose
Output:
Validating run kroker-20260131-143055-feature-1...
✓ Run bundle exists: .kroker/runs/kroker-20260131-143055-feature-1
✓ Diff file exists: changes.diff
✓ Event log is intact
✓ Working directory is clean
Loading diff from run bundle...
✓ Parsed 3 file changes
✓ Additions: 15, Deletions: 5
Detecting conflicts...
✓ No merge conflicts detected
Applying patch...
✓ Backup created: /tmp/kroker-backup-1738317455
✓ Patch check passed
✓ Applied patch with 3-way merge
✓ Files modified: internal/accept/apply.go, cmd/kroker/accept.go, README.md
Verifying application...
✓ All files from diff were applied
✓ No rejected files
✓ No merge conflicts introduced
✓ Cleanup: Backup removed
Changes applied successfully!
Note: Gate validation and scope checking are partially implemented in current version.
Full gate/scope validation will be added in future releases.# Attempt to accept a run that failed gates
$ kroker accept kroker-20260131-120000-feature-2
Error: Run kroker-20260131-120000-feature-2 is not eligible for acceptance:
- Run status is Failed, only Success runs can be accepted
- Required gate 'tests' failed# Attempt to accept with conflicts
$ kroker accept kroker-20260131-143055-feature-1
Error: Cannot accept: blocking conflicts detected
- Merge conflict markers found in: src/main.go
Fix merge conflicts before accepting, or use '--force' to bypass (unsafe for merge conflicts).Accept Command Features:
- Validation - Only runs that completed successfully and passed all gates can be accepted
- Conflict detection - Checks for uncommitted changes, local modifications, and merge conflicts
- Dry-run mode - Preview what would be applied without making changes
- Safe patching - Uses
git apply --3wayfor reliable patch application - Automatic rollback - If patch application fails, automatically restores from backup
- Event logging - All acceptance operations are logged for audit trail
- Verbose output - Detailed progress information for troubleshooting
Acceptance Requirements:
- Run must have completed successfully (status = Success)
- All required quality gates must have passed
- No unhandled scope violations (or violations were overridden with logged reason)
- Working directory should be clean (use
--forceto bypass this check)
Next Steps After Accepting:
- Review the applied changes:
git diff - Commit the changes:
git commit -m "Description of changes" - Push to remote:
git push
TUI Integration:
You can also accept runs directly from the Kroker TUI by pressing a when a successful run is selected. The TUI provides the same validation and conflict detection with an interactive confirmation dialog.
Export the entire run bundle including all artifacts for sharing or archival:
# Export bundle from a completed run (default filename: sdd-bundle-<run-id>.tar.gz)
kroker export <run-id> --format bundle
# Export bundle to custom location
kroker export <run-id> --format bundle --output /tmp/my-bundle.tar.gz
# Export bundle with -o shorthand
kroker export <run-id> --format bundle -o bundle.tar.gzExtracting Bundle:
# Review bundle file
tar -tzf sdd-bundle-<run-id>.tar.gz
# Extract bundle contents
tar -xzf sdd-bundle-<run-id>.tar.gz
# Navigate to extracted run
cd <run-id>
# View spec, events, diff, etc.
lsExport Command Features:
- Standard patch format - Compatible with
git apply(unified diff format) - Bundle format - Complete run bundle with spec, events, diff, and gates (tar.gz archive)
- Custom output path - Specify where to save the export file
- Format selection - Choose between patch (default) and bundle formats
- Git apply compatible - Generated patches can be applied to any git repository
Patch Format Details:
- Uses standard unified diff format (compatible with
git diff --unified) - Can be applied with
git apply,patch, or other diff tools - Includes complete context for hunk application
- Suitable for code review and manual application workflows
Bundle Format Details:
- Standard tar.gz archive format (compatible with tar, gzip, gunzip, 7-Zip, WinRAR)
- Contains complete run bundle directory with all artifacts
- Preserves directory structure and file permissions
- Includes spec.yaml, events.jsonl, changes.diff, agent.log, gates/, and metadata.json
- Suitable for sharing full context, archival, and transfer between systems
Kroker provides a terminal user interface (TUI) for interactive run monitoring and project management. Launch it with:
# Launch the TUI
kroker tuiTUI Features:
- Real-time log streaming - Watch agent output live as it happens in the main view
- Run status indicators - Visual status icons (🟡 pending, 🔵 running, ✅ success, ❌ failed, ⚪ cancelled)
- Automatic refresh - Run list updates every 2 seconds to show current status
- Manual refresh - Press
Rto manually refresh the run list - Log buffer preservation - Logs persist after run completion for review
- Scope-aware file tree - Tag files as in-scope or out-of-scope for the active spec
- Syntax-highlighted preview - Read files with line numbers and language detection
- Filter modes - All files, in-scope only, or modified files from git status
- Embedded shell - Run commands without leaving the TUI
- Autocomplete + history - Tab suggestions and up/down history navigation
- Visual blocks - Commands and output grouped with exit status and timing
- Header - Workspace, git, and time context
- Sidebar - View navigation (Dashboard, Specs, Runs, Files, Agents, Git, Tasks, Settings)
- Main View - Details, previews, and live logs
- Inspector - Context detail panel on wide terminals
- Terminal Panel - Toggleable bottom panel for command execution
- Footer - Status messages and keyboard hints
Global Shortcuts:
1–8- Switch between Dashboard, Specs, Runs, Files, Agents, Git, Tasks, SettingsTab/Shift+Tab- Cycle focus between sidebar, main, inspector, terminal`- Toggle the terminal panelCtrl+P- Open project setup modala- Accept selected successful runs- Stop the active runqorCtrl+c- Quit the TUI
Runs View:
j/kor↑/↓- Navigate runsEnter- Select a run and view detailsr- Filter active runs (or open recovery for failed run)f- Filter failed runs/- Search/filter runsR- Manually refresh the run list
Log View (active run):
j/↓- Scroll down one linek/↑- Scroll up one lined/Ctrl+d- Scroll down one pageu/Ctrl+u- Scroll up one pageg- Jump to top of logsG- Jump to bottom of logsf- Toggle auto-scroll (follow new lines)
Terminal Panel:
Enter- Execute commandTab- Cycle autocomplete suggestions↑/↓- Navigate command historyCtrl+C- Interrupt running commandPgUp/PgDnorj/k- Scroll terminal output
- Adapts to terminal resize automatically
- Sidebar collapses to icon-only under 100 columns
- Inspector hides on narrower terminals
- Graceful degradation on smaller terminals
- Terminal size: 80x24 (minimum)
- Colors: 256-color terminal recommended (graceful degradation otherwise)
- Ring buffer with 1000-line capacity for logs
- Memory usage stays bounded (~100KB per log buffer)
- Old log lines automatically evicted when capacity is reached
Bundle Use Cases:
- Sharing with colleagues - Send complete context including spec and events
- Archival - Save full run artifacts for future reference
- Transfer between systems - Move runs between machines or environments
- Debugging - Provide complete reproducible context for troubleshooting
- No vendor lock-in - Switch between Claude Code, OpenCode, Copilot CLI, or custom tools
- Single binary - No runtime dependencies, no cloud services required
- Your tools, your rules - Bring your own agent tools and quality gates
- Quality gates - Run tests, linters, security scans before accepting changes
- Scope control - Restrict which files agents can modify with glob patterns
- Audit trail - Append-only event log tracks every action
- Run bundles - Complete artifacts containing spec, agent output, gates, and diffs
- Cryptographic hashing - Tamper-proof provenance for every run
- Replay capability - Understand what happened and why
- TUI interface - Terminal UI with split-panes, keyboard navigation, real-time progress
- CLI commands - Scriptable commands for automation and CI/CD integration
- Clear error messages - Actionable guidance when things go wrong
version: 1
name: add-user-authentication
description: Add JWT-based authentication to API
agent:
tool: claude-code
prompt: |
Add JWT-based authentication to the user API.
- Create middleware for token validation
- Add login/logout endpoints
- Update existing routes to require auth
scope:
allowed_paths:
- "internal/auth/**"
- "internal/api/**"
forbidden_paths:
- "internal/config/**"
- "**/test/**"
gates:
- name: tests
command: go test ./...
timeout: 5m
- name: lint
command: golangci-lint run
timeout: 2m
- name: security
command: gosec ./...
timeout: 1m|
Go 1.23+ |
Git Worktrees |
YAML Specs |
| Library | Purpose | Version |
|---|---|---|
| Cobra | CLI framework | 1.8.0 |
| Bubble Tea | Terminal UI | 1.3.4 |
| Lipgloss | Terminal styling | 1.1.0 |
| Viper | Configuration | 1.18.0 |
| Playwright | E2E testing | 1.49.0 |
See ARCHITECTURE.md for detailed technical information.
Kroker uses a layered architecture with isolated execution environments
flowchart LR
Spec[Spec YAML] --> Worktree[Git Worktree]
Worktree --> Agent[Agent Tool]
Agent --> Gates[Quality Gates]
Gates --> Bundle[Run Bundle]
Bundle --> Review[Review/Export]
Full documentation is available at https://maksim.github.io/kroker (update with your actual URL).
- TODO App Tutorial - Build a complete TODO application step-by-step
- Getting Started
- User Guide
- Developer Guide
- CLI Reference
Kroker is under active development. Current status:
| Component | Status |
|---|---|
| Config System | ✅ Complete |
| Spec Management | ✅ Complete |
| Worktree Isolation | ✅ Complete |
| Agent Orchestration | ✅ Complete |
| Run Bundles | ✅ Complete |
| TUI Interface | 🟡 In Progress |
| Gates Execution | 🟡 In Progress |
See docs/index.md for detailed implementation status.
Contributions are welcome! Please see our Contributing Guide for:
- Code style guidelines
- Development setup
- Testing requirements
- Pull request process
Run agent-driven hotfixes in isolated worktrees with quality gates, ensuring nothing breaks before merging.
Local-first tool that works with any agent, no API keys to manage, no cloud dependencies.
Constrained templates prevent mistakes by restricting which files can be modified.
Run bundles provide complete context, making code reviews faster and more thorough.
Kroker has comprehensive test coverage:
- Unit Tests - >80% code coverage target
- Integration Tests - Cross-component workflow validation
- E2E Tests - Full user journey testing with Playwright
# Run all tests
make test-all
# Run by test type
go test ./... # Unit tests
go test ./tests/integration/... # Integration tests
cd tests && npm run test:e2e:p1 # E2E tests (P0-P1)See TESTING.md for comprehensive testing documentation.
Current version: v0.0.1 (Initial Release)
| Component | Status |
|---|---|
| Config System | ✅ Complete |
| Spec Management | ✅ Complete |
| Worktree Isolation | ✅ Complete |
| Agent Orchestration | ✅ Complete |
| Run Bundles | ✅ Complete |
| TUI Interface | 🟡 In Progress |
| Gates Execution | 🟡 In Progress |
See CHANGELOG.md for version history and docs/index.md for detailed implementation status.
MIT License - see LICENSE for details
- Documentation: https://maksim.github.io/kroker
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with ❤️ by Maksim