Recursive workflow for agentic engineering. Like Factory Missions but properly recursive, free and open source.
npx skills add https://github.com/try-works/recursive-mode --skill recursive-specCLI を使用してこのスキルをインストールし、ワークスペースで SKILL.md ワークフローの使用を開始します。
recursive-mode is an installable skill package for structured AI-assisted software development.
It gives an agent a file-backed workflow for requirements, planning, implementation, testing, review, closeout, and memory, instead of leaving that process in chat history alone.
This repo currently ships these default installable skills:
recursive-moderecursive-specrecursive-worktreerecursive-debuggingrecursive-tddrecursive-review-bundlerecursive-routerrecursive-subagentOptional add-on source:
recursive-benchmark| Skill | Purpose |
|---|---|
recursive-spec |
Co-authors repo-aware requirements for a new run from plan/spec prompts, keeps the draft outside the repo until approval, then creates the run and writes 00-requirements.md. |
recursive-worktree |
Sets up an isolated worktree before implementation starts. |
recursive-debugging |
Adds structured root-cause analysis before fixing bugs or failing tests. |
recursive-tdd |
Enforces RED-GREEN-REFACTOR discipline for implementation work. |
recursive-review-bundle |
Builds canonical review bundles for delegated Phase 3.5 review. |
recursive-router |
Routes delegated subagent roles through configured external transports, CLIs, and models while preserving explicit fallback and controller verification. The current CLI/IDE/agent remains the orchestrator; routed CLIs only handle bounded delegated work with a real context bundle. Opt-in only: use it when the user explicitly asks to route or set up model/provider bindings. |
recursive-subagent |
Helps delegate bounded implementation, audit, or review work and verify the results. |
Optional add-on:
| Skill | Purpose |
|---|---|
recursive-benchmark |
Creates paired recursive-off and recursive-on benchmark repos, supports easy/medium/hard packaged scenarios, can run arms sequentially or in parallel with runner-specific fallback when needed, captures logs/timings/screenshots, and writes a comparison report. |
The workflow package includes functionality for:
00-requirements.md content through Phase 1 Source Requirement Inventory and Phase 2 lossless requirement mapping/.recursive/config/recursive-router.json when the user explicitly asks to set up or use routingcli_overrides or custom_clis when the working CLI entrypoint differs across operating systems, shells, or devicesflowchart TD
A[Create run in /.recursive/run/<run-id>/] --> B[Phase 0: requirements and worktree setup]
B --> C[Phase 1-2: AS-IS and plan]
C --> D[Phase 3: implementation in isolated worktree]
D --> E[Phase 3.5: delegated review or self-audit]
E --> F[Phase 4: tests and verification]
F --> G[Phase 5: manual QA or agent-operated QA]
G --> H[Phase 6-8: decisions, state, memory closeout]
H --> I[Lock artifacts and verify locks]
I --> J[Future runs start with better context]
C -. addenda update understanding .-> C
D -. draft -> audit -> repair -> re-audit .-> D
E -. main agent verifies delegated work .-> E
H -. durable lessons promoted into memory .-> J
J -. prior decisions, state, memory reread .-> C
At a high level, the workflow turns a task into a durable run, moves that run through audited phases, and then feeds validated outcomes back into decisions, state, and memory so later runs start from better context.
The main non-optional guardrails are:
draft -> audit -> repair -> re-audit -> pass -> lockSource Requirement Inventory, Requirement Mapping, and Plan Drift CheckUsing the workflow can help you:
This workflow applies recursion in practice by making later work continuously refer back to, check, and refine earlier work.
In concrete terms:
draft -> audit -> repair -> re-audit until the work is actually readySo the workflow is “recursive” not because it uses a programming-language recursion trick, but because the process repeatedly revisits its own outputs, uses them as inputs, and improves future work through structured feedback loops.
The workflow includes a file-based memory layer under /.recursive/memory/.
In practice, that memory is used to store durable project knowledge such as:
It is intentionally separated from:
That separation matters because it lets the workflow distinguish between:
Benefits of this memory model include:
Install the main skill:
npx skills add try-works/recursive-mode
List everything in the package:
npx skills add try-works/recursive-mode --list
npx skills add try-works/recursive-mode --list --full-depth
Install all included skills:
npx skills add try-works/recursive-mode --skill '*' --full-depth
Install a single subskill:
npx skills add try-works/recursive-mode --skill recursive-spec --full-depth
Install the benchmark add-on only when you explicitly want benchmark runs:
npx skills add <recursive-benchmark-package-or-repo> --full-depth
After installing the skill package into your agent environment, the intended normal flow is:
recursive-spec to draft them from plan/spec prompts such as create a plan, help me plan, or create a specImplement the run/.recursive/ is missing, the skill should auto-bootstrap it before continuingrecursive-spec is intentionally approval-gated: it should collaborate on the draft first, keep that draft in temporary/session storage, and only create /.recursive/run/<run-id>/00-requirements.md after the user approves the spec.
If you want to measure recursive-mode itself, install recursive-benchmark on demand from its dedicated add-on package or repo source and then use it to create paired recursive-off and recursive-on benchmark repos from the packaged benchmark fixture and generate a markdown comparison report with logs, scores, and screenshot artifacts when present.
Manual bootstrap commands remain the fallback path when the runtime cannot auto-run the installer:
python "<SKILL_DIR>/scripts/install-recursive-mode.py" --repo-root .
bash "<SKILL_DIR>/scripts/install-recursive-mode.sh" --repo-root .
pwsh -NoProfile -File "<SKILL_DIR>/scripts/install-recursive-mode.ps1" -RepoRoot .
That creates the reusable /.recursive/ scaffold, bridge docs, memory routers, routed delegation policy scaffold, and run layout used by the workflow.
The bundled installer carries its own canonical workflow template, so bootstrap works from the installed skill package even when hidden repo directories are not present in the package layout.
Important boundary:
npx skills add ... installs the skill package into agent directories/.recursive/config/recursive-router.json; /.recursive/config/recursive-router-discovered.json is created locally after router probe or verification and should stay gitignored on that devicedocs/templates/hooks/ can auto-bootstrap the scaffold at session startFrom there, the canonical workflow contract lives in:
/.recursive/RECURSIVE.mdIf an agent is already inside the repo and needs a lightweight index of what to read under /.recursive/, start with:
/.recursive/AGENTS.mdThe installable root skill entrypoint is:
/SKILL.mdThe packaged benchmark flow is meant to answer a simple question: does recursive-mode improve real coding-agent outcomes on the same project?
The packaged benchmark set uses React + TypeScript + Vite projects that:
The benchmark harness creates paired repos for recursive-off and recursive-on, bootstraps the recursive-mode scaffold into the recursive-on repo, records the selected runner and model, enforces a timeout budget, evaluates build/test/preview outcomes, supports Codex CLI, Kimi CLI, and OpenCode CLI, runs a mandatory controller-side judge review for every completed arm with gpt-5.4 when available and the benchmarked model as fallback, writes per-arm progress files so live status can be inferred from workspace changes, keeps repo-local .benchmark-workspaces/ ignored, and writes a markdown scoreboard report that separates runner health from product outcome, reports whether the recursive-on arm actually completed the recursive run artifact set, surfaces the recursive-on worktree isolation decision from 00-worktree.md, supports timestamp fallback evidence, applies optional hint penalties, embeds screenshots when available, and includes a combined benchmark score that blends heuristic rubric coverage (70%) with the judge metric (30%).
For OpenCode benchmarking, the harness accepts provider-qualified model ids such as opencode/gpt-5-nano and discovers the CLI from OPENCODE_CLI_PATH, PATH, or the verified Windows fallback path D:\opencode\opencode-cli.exe.
Packaged scenario tiers:
local-first-planner - easyteam-capacity-board - mediumrelease-readiness-dashboard - hardscientific-calculator-rust - xhardThe xhard Rust/WASM fixture intentionally starts from a bootstrap-only dependency scaffold rather than a placeholder calculator app, so the benchmarked agent must create the actual product code instead of only transforming preseeded UI and logic files.
Maintainer entrypoints:
python "<SKILL_DIR>/scripts/run-recursive-benchmark.py" --runner all --scenario local-first-planner
python "<SKILL_DIR>/scripts/run-recursive-benchmark.py" --runner kimi --scenario team-capacity-board --arm-mode parallel
python "<SKILL_DIR>/scripts/run-recursive-benchmark.py" --runner codex --scenario scientific-calculator-rust
python "<SKILL_DIR>/scripts/run-recursive-benchmark.py" --runner opencode --opencode-model opencode/gpt-5-nano --scenario team-capacity-board
pwsh -NoProfile -File "<SKILL_DIR>/scripts/run-recursive-benchmark.ps1" -Runner all
Once a repo is bootstrapped and the requirements or plan live in repository files, the user should be able to start or resume work with short commands instead of long prompts.
Examples:
Implement the runImplement run 75Implement requirement '75'Implement the planCreate a new run based on the planStart a recursive runHow those are interpreted:
The important boundary is that prompts stay short and command-like, while the actual requirements and plan still live in repository documents.
High level:
SKILL.md
skills/
scripts/
references/
.recursive/
SKILL.md: installable root skill entrypointskills/: installable subskillsscripts/: bootstrap, lint, status, lock, bundle, closeout, smoke, and hygiene toolsreferences/: templates and reusable guidance.recursive/: canonical workflow spec, internal routing/index docs, and durable repo-internal control-plane docsThis repository evolved from the older rlm-workflow project. That name remains historical only; recursive-mode is the current product and package surface.