devflow-loop

A command that runs a development workflow from start to finish and waits until all required backend checks pass.

In plain words
What is it for?
It is for coordinating planning, execution, review, approvals, required skills, and other flow states until the backend flow gate is green.
Why use it?
It prevents the session from ending while the workflow is still in an unfinished or invalid state.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/klausfreiberufler/devflow-mcp/devflow-loop
Clone the repo
git clone --depth 1 https://github.com/KlausFreiberufler/devflow-mcp
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,770 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00011 $0.02770
Opus 5 $0.00005 $0.01385
Sonnet 5 $0.00002 $0.00554
Haiku 4.5 $0.00001 $0.00277

Measured yesterday against content hash 1e52f2ffceb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

devflow-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/devflow-loop.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

devflow-loop

Run the active flow end-to-end without leaving the session. The Stop-Hook (DF-405) holds you in until the backend's flowGate service confirms every condition is green. Discipline-tokens are emitted explicitly per state, and knowledge-resolution is callable in review (DF-408) so the pending_drafts_resolved gate never traps you in a catch-22.

This command is the orchestrator. It does NOT replace the per-state skills (devflow-planning, devflow-executing, devflow-reviewing, …) — it sequences them.

Foundation it relies on

  • DF-405 — Stop-Hook returns exit 2 + precise stderr-reinject if you try to end the session in a non-wait state. This makes the loop self-correcting.
  • DF-323pre-flow-update-self-approval.js hook surfaces required-skills automatically on every flow_update attempt.
  • DF-408KNOWLEDGE_RESOLUTION_TOOLS (knowledge_draft_accept/reject, knowledge_check_resolve, intent_resolve) callable in approval + review. No backward-transition workaround needed.
  • pipelineOrchestrator.HARDCODED_REQUIRED_SKILLS — single source of truth for which discipline-tokens each transition needs.

Argument Resolution

  • $1 is optional flowId. Resolve:
    • Starts with DF- → use as-is
    • Purely numeric (e.g. 214) → prefix DF- (DF-214)
    • Otherwise → pass through (assume full flow id like 1779181904709-l4pfwtyvu)
    • If missing → read .devflow-active in the repo root and use its flowId field
  • --max-iterations N → integer, default 40
  • --verify "<shell-cmd>" → shell command to run before review. Its stdout/stderr is captured into testingInstructions field. If absent, use the project's verify script if it exists in package.json, otherwise skip and note in testingInstructions that verification was manual.

Iron Laws

  • Only use real MCP tools. devflow_init, flow_get, flow_update, devflow_token_emit, devflow_tokens_list, knowledge_check_flow, knowledge_check_resolve, knowledge_draft_create, knowledge_draft_accept, knowledge_draft_reject, task_create, task_update, task_list, planning_context, wiki_get_briefing, pending_work, flow_upload. Never invent tool names.
  • No "should work" claims. Every acceptance criterion gets evidence from the --verify command's actual output. Capture stdout verbatim into testingInstructions.
  • Never hand-fabricate tokens. All discipline-tokens come from devflow_token_emit({flowId, skillName, evidence}). The backend signs them; the unsigned token is returned once.
  • Respect the gate. A 409 response carries gate.failures[] with named conditions (e.g. plan-required, tasks-required, agent-summary, testing-instructions, adr-compliance-clean, pr-state-consistent). Fix the named field, then retry the SAME transition. Never invent fields the gate didn't mention.
  • Stop-Hook does the policing. You cannot legitimately end the session in idea / planning / ready / in_progress. If you think you're done, transition forward — the Stop-Hook will reject premature exit otherwise (DEVFLOW_STOP_HOOK_SOFT=1 is the only override and is gated).

Read the full file on GitHub · 165 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 165 lines · 0 tokens per session scan A 1e52f2ffceb8

Subscribe to this mod's changes

devflow-loop is a command published in the GitHub repository KlausFreiberufler/devflow-mcp (1 stars, last pushed 3d ago), licensed MIT. It adds 11 tokens to every session and 2,770 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.