doyaken-cli
Doyaken is a workflow automation framework for Claude Code. It takes a ticket number, creates an isolated worktree, and drives the full lifecycle — plan, implement, review, commit, PR, merge — through a phase loop that won't let the agent stop until the work actually passes quality gates.
dk 342
One command. Worktree created, ticket context loaded, autonomous lifecycle started.
The loop
The core idea is simple: Claude Code has a Stop hook. Every time the agent tries to finish, doyaken intercepts it and injects a phase-specific audit prompt. The agent can't exit the current phase until the audit criteria are satisfied.
This is what makes it autonomous rather than just a prompt library. Without the loop, Claude will plan something, implement half of it, and tell you it's done. With the loop, it plans, you approve, it implements, self-reviews, fixes its own findings, runs quality gates, retries on failure, commits, opens the PR, monitors CI, addresses review comments, and closes the ticket — because at every step, the Stop hook asks "did you actually finish this phase?" and if the answer is no, the agent keeps going.
Each phase has its own audit criteria:
- Plan — did the user approve an approach? Are tasks written?
- Implement — did every task pass self-review with zero findings? Did quality gates pass?
- Verify & Commit — did format, lint, typecheck, and tests all pass? Are commits pushed?
- PR — is the PR created and tracker updated?
- Complete — did CI pass? Are review comments addressed? Is the ticket closed?
Stall detection prevents infinite loops. If the agent makes no progress for five minutes across three consecutive iterations, doyaken escalates rather than burning tokens.
Worktree isolation
Every ticket gets its own git worktree in .doyaken/worktrees/. Work on multiple tickets in parallel without branch switching or stash juggling. dkls lists active worktrees, dkrm removes them, dkclean prunes stale ones.
Guard system
A set of markdown-defined guards that run before every Bash, Edit, and Write tool call. Built-in guards block destructive commands, sensitive file modifications, and hardcoded secrets. Project-specific guards are generated during dk init based on your codebase. Guards use Python regex with a 2-second timeout per pattern to prevent ReDoS.
Self-review
Implementation includes a two-perspective review loop. First, the implementing agent walks all changed files checking correctness, design, and consistency. Then an independent self-reviewer agent — adversarial, read-only, running on a separate model — performs a 10-pass semantic review covering correctness, security, performance, testing, and more. Findings are confidence-scored 0–100; only those above 50 surface. The loop continues until there are zero findings.
Codebase-agnostic
Install once globally, use on any project. dk init analyses your codebase with Claude Code and generates quality gate configs, coding convention rules, and project-specific guards. It discovers your format, lint, typecheck, and test commands rather than prescribing specific tools. Shell scripts and Python stdlib only — no runtime dependencies.
Skills
Eleven slash commands, each a standalone skill that also works independently outside the full lifecycle:
| Skill | Purpose |
|---|---|
/doyaken | Full lifecycle orchestrator |
/dkplan | Multi-approach planning from ticket context |
/dkimplement | TDD implementation with self-review |
/dkreview | Deterministic + semantic code review |
/dkverify | Discover and run quality gates |
/dkcommit | Atomic conventional commits |
/dkpr | PR creation with tracker updates |
/dkwatchci | CI monitoring loop |
/dkwatchreviews | Review comment monitoring loop |
/dkcomplete | Final verification and ticket closure |
/dkloop | Prompt loop for ad-hoc tasks |
Stack
Zsh for the CLI, Bash for hooks and shared libraries, Python 3 stdlib for guard evaluation. No npm packages, no pip dependencies. Integrates with Linear and GitHub Issues for ticket tracking.