Search by

voku / agent-loop

voku

Keep coding-agent work moving: a local PHP 8.3+ CLI that holds each task to an approved Contract, deterministic validation and independent review, so 'done' needs evidence.

Package info

github.com/voku/agent-loop

pkg:composer/voku/agent-loop

Fund package maintenance!

voku

Statistics

Installs: 20 987

Dependents: 4

Suggesters: 0

Stars: 7

Open Issues: 11

0.21.6 2026-11-30 11:33 UTC

This package is auto-updated.

Last update: 2026-12-01 12:46:05 UTC


README

Build Status Latest Stable Version Total Downloads Monthly Downloads License PHP Version Require GitHub Stars

Your coding agent forgets the task, guesses the next step and says “done” without proof. Agent Loop replaces that with an approved Contract, one explicit next action at a time, and evidence before “done”.

You get:

  • Two commands and one rule. enter and finish each return exactly one next_action_kind (one of five values) and one next_action; the agent does what the last result says instead of inventing a phase order.
  • No edits before approval, no self-certified “done”. enter does not authorize mutation until a named human approves the exact Contract revision, and only finish reports completion: its close gates check validation, review and the Learning decision instead of taking the agent's word.
  • Local and provider-independent. A PHP CLI around the agent you already use (Codex, Claude Code, OpenCode, Copilot, Gemini CLI, Antigravity, Cursor). It never calls an LLM itself, never auto-commits, pushes or merges, and never invents approval.

The front door of the Agent Loop toolchain: one local CLI that composes the narrower packages into one governed workflow. Overview and demo: voku.github.io/agent_loop_demo.

Two commands

vendor/bin/agent-loop enter ABC-123 --format=json    # start or resume a task
# ... follow next_action_kind + next_action, do the work it authorizes ...
vendor/bin/agent-loop finish ABC-123 --format=json   # reconcile evidence, get the next step
# repeat until the result reports completion
next_action_kind What it means
command Execute it as written.
command_template Fill the model-owned placeholders from the request and repository evidence, then execute it.
host_work Implementation or model work in your coding host; next_action describes it and is not a command.
decision_required A genuine human-authority decision is needed first; show it to a human, never invent approval.
none Nothing further is required.

You do not memorize a phase order or rebuild a state machine in the prompt. See the lifecycle contract for the exact ownership model.

One real run, one human decision

A real bug in voku/email-check (task EMAIL-1), taken from composer require to a complete governed Run with Claude Code as the host. Abridged; exit codes and returned steps are the observed ones:

Step Exit next_action_kind next_action
enter (no Contract) 1 command_template agent-loop workflow plan EMAIL-1 --by <actor> …
workflow plan 0 decision_required agent-loop workflow approve EMAIL-1 --revision 1 --by <named-actor>
workflow approve (the one human decision) 0 — vendor/bin/agent-loop enter EMAIL-1
enter (approved) 0 command agent-loop pipeline status EMAIL-1 --format=json
pipeline stages: investigate, build, validation, two reviews, verify 0 host_work, command or command_template the next stage, then agent-loop finish EMAIL-1
finish 1 command_template … --reviewed-report-sha256 <sha256> --by <actor>
finish --learning findings_recorded … (refused: no validated Finding) 1 command_template the same Learning template
finish --learning follow_up_required … 0 none none

enter exited 1 until the task was ready for mutation, and finish exited 1 until the Run was complete; every non-zero exit came with the step that moved the task forward. The full table and transcript are in Your first governed task.

Start a repository

Requirements: PHP 8.3+ and Composer (or the Docker setup).

composer require --dev voku/agent-loop
vendor/bin/agent-loop init scaffold

Or create the tutorial board and task, then run the two commands against it:

vendor/bin/agent-loop init scaffold --demo
vendor/bin/agent-loop board card show DEMO-1
vendor/bin/agent-loop enter DEMO-1 --format=json

Project the package-owned skills and roles into your coding host, then check what the host still needs (--dry-run writes nothing):

vendor/bin/agent-loop init install-assets --agent=all --dry-run
vendor/bin/agent-loop init host-status --format=json

Then follow Your first governed task: one real bug taken from composer require to a complete governed Run, with every observed exit code and returned step.

Why deterministic?

Without it With Agent Loop
A new chat means reconstructing the task Approved task intent and progress survive the conversation
The agent decides what to do next from prose and memory The workflow exposes the current next step
“Looks good” can quietly become “done” Tests, analysis and review remain explicit evidence
Instructions keep growing forever Repeated objective lessons can become tests, static rules or other deterministic checks

More in Concepts: how it works, the convenience front doors (quick, repair, pipeline) and what Agent Loop deliberately does not do.

CLI namespaces

Use vendor/bin/agent-loop help or <namespace> help for the executable details; the CLI overview has examples.

edit          governed edit preparation and execution
board         Git-native work items
session       temporary working memory and validation evidence
map           repository structure and code navigation
recall        bounded task context and outcome logging
learn         findings, proposals, constraints and learning history
verify        cross-package consistency checks
workflow      durable governed workflow orchestration
board:verify  board-only consistency checks
memory        MEMORY.md validation and review
review        deterministic review helpers
init          repository setup and managed agent assets

Documentation

I want to… Read
Run my first governed task end to end Your first governed task
Know which decisions need a human Human authority
Brief my coding agent Coding-agent field guide
Pick a workflow or recovery path (quick, repair, pipeline) Workflow index
Understand the lifecycle and who owns what Lifecycle contract and Concepts
Set up Codex, Claude Code, Cursor or another host Agent assets and host integration
See the commands, or record a human Finding CLI overview
Understand the commit rules in Git hooks Git hooks
Use it in a TypeScript/JavaScript project Non-PHP projects
Run it without local PHP Docker setup
Know what becomes durable memory Learning and durable-memory boundary
Check pre-1.0 compatibility guarantees Compatibility and durable-state contract
See how it is tested on real issues Real-issue acceptance and first-party dogfood
Check third-party sources and licences Third-party notices
Browse everything Documentation index, CHANGELOG, AGENTS.md

Part of the Agent Loop toolchain

Each package owns one concern and can be used on its own. voku/agent-loop composes them into one governed workflow.

Package Owns
agent-loop Task Contracts, lifecycle, next actions, validation and review gates
agent-kanban Git-native Markdown board and card semantics
agent-session Per-task working memory, decisions and checkpoints
agent-map Read-only repository symbol maps and typed edit plans
agent-edit Transactional, verified application of edit plans
agent-graph Deterministic SQLite graph index and runtime
agent-recall-compiler Bounded task context (Recall) and prompt recipes
agent-learning Reviewable findings, proposals and durable guidance
agent-skills Portable engineering skills for coding agents
agent-ui Local server-rendered control plane for humans
agent-decision Experimental bounded, advisory-only decision helper
agent-dotfiles Shell dotfiles for non-interactive agent shells

You do not need to understand every package to use Agent Loop; each kind of information has one clear owner instead of one framework quietly owning everything. agent-loop-runner is a separate, optional execution plane for isolated coding-host runs.

Development

composer install
composer test
composer phpstan
composer ci

Never report a command as passed unless it actually ran and its exit code was observed. To find where a change belongs, see Find the right file; repository rules for contributors and agents live in AGENTS.md.

License

MIT. See LICENSE.