Recursive training

From try-works/role-model · View interactive version

Recursive training is an AI agent skill from the GitHub repository try-works/role-model. Use after completed recursive-mode runs accumulate to extract durable experiential memory into `/.recursive/memory/`, then load it for later runs through the canonical loader.

How to use this skill

Skill file

recursive-training

Purpose

Use this skill after a repository has accumulated completed recursive-mode runs and you want to turn repeated successes or failures into durable, repo-local guidance.

The canonical workflow still lives in /.recursive/RECURSIVE.md. This skill owns only the training, loading, and memory-discipline layer that sits around completed runs.

When to use it

Use recursive-training to:

Hard rules

  1. Repository-local only. Training data and extracted memory stay inside the current repo.
  2. No parameter updates. Learning happens through files in /.recursive/memory/, not model mutation.
  3. /.recursive/memory/ is the only canonical store. Pointer files are bootstrap-managed and non-authoritative.
  4. All markdown under /.recursive/run/<run-id>/ is eligible training input, not just 00-08.
  5. Group runs by subsystem only. The extractor assigns task types per learning item.
  6. Use contrastive extraction when both winners and losers exist; fall back to winner-only extraction for high-quality repos.
  7. Every extracted item must remain evidence-grounded in completed runs.
  8. Training scripts do not own AGENTS.md; bootstrap owns bridge-file updates.

Training model

recursive-training combines two ideas:

At a high level:

  1. Parse all markdown artifacts from completed runs.
  2. Infer the dominant subsystem from changed paths and evidence across those artifacts.
  3. Classify each subsystem group as contrastive, winner-only, or insufficient.
  4. Ask the extractor for structured learning items.
  5. Write those items into:
  1. Refresh the memory registry/startup guidance without treating pointer files as authoritative memory.

For the full schema, grouping logic, evidence signals, and extraction contracts, see:

Phase 8 and loading boundary

Phase 8 records the current run's observations in 08-memory-impact.md.

Training then turns many completed runs into cross-run memory.

That means:

Detailed Phase 8 handoff and loader behavior lives in references/phase8-and-loading.md.

Commands

Full training:

python .recursive/scripts/recursive-training-grpo.py --repo-root .

Incremental training after a specific run:

python .recursive/scripts/recursive-training-grpo.py --repo-root . --incremental --run-id <run-id>

Post-Phase 8 trigger:

python .recursive/scripts/recursive-training-phase8-trigger.py --repo-root . --run-id <run-id>
python .recursive/scripts/recursive-training-phase8-trigger.py --repo-root . --run-id <run-id> --auto

Read-only startup guidance:

python .recursive/scripts/recursive-training-sync.py --repo-root .

Canonical memory loading before a new run:

python .recursive/scripts/recursive-training-loader.py \
  --repo-root . \
  --query "<task description>" \
  --files "<comma-separated paths>"

Optional MCP convenience layer:

python .recursive/scripts/recursive-training-mcp.py --repo-root .

Trigger patterns

Recognize these as training requests:

Default behavior:

Operator checklist

  1. Confirm the repo already has recursive-mode scaffolding.
  2. Confirm completed runs exist under /.recursive/run/.
  3. Run the trigger or grpo script with the intended scope.
  4. Verify updated items land under /.recursive/memory/domains/ and /.recursive/memory/training/.
  5. Before the next run, read /.recursive/memory/MEMORY.md and call the loader with task context.
  6. Treat loader output as advisory context; the canonical records stay in the memory plane.

Script surface

Detailed references

Coverage Gate

Coverage: PASS

Approval Gate

Approval: PASS

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.