train-agent

Distills lessons from review/retry loops into persistent agent memory files.

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/sagittaras/agentic-workflow --skill train-agent-sagittaras
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: train-agent
Source: https://github.com/sagittaras/agentic-workflow/tree/main/skills/train-agent
Command: npx skills add https://github.com/sagittaras/agentic-workflow --skill train-agent-sagittaras

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Lessons learned during code review and retry cycles usually stay buried in PR comments, so agents repeat the same mistakes. This Skill turns resolved review/retry loops and other readable inputs into generalized, durable knowledge written into each agent's own persistent memory. ## Core Features & Use Cases - Memory writing by the agent itself: Dispatches target agents as subagents so memory writes happen under their own memory: permission, then verifies what was actually created. - Target agent resolution: Derives which agents an input concerns from the task, the review record, or project and plugin agent definitions, checking memory: and write-tool prerequisites before dispatch. - Consolidation and verification: Enforces memory conventions (MEMORY.md index, typed topic files, Why/How to apply lines) and reports created, updated, deleted, skipped, and non-conforming entries. - Use Case: After a review round on issue #42 found a bug and a retry fixed it, run the Skill so the reviewing agent records a generalized pitfall rule in its memory instead of leaving the lesson in a PR comment. ## Quick Start Ask the assistant to have the tech-lead agent record the lesson learned from the review loop on issue #42 into its memory.

Frequently Asked Questions about train-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train an AI agent from a code review loop?

Pass the agent name and the full review/retry record (issue or PR number, or pasted text) as arguments. The Skill loads the input, dispatches the target agent as a subagent, and the agent writes a generalized rule into its own memory folder.

Where does agent memory get stored?

Memory lives in a folder named after the agent, chosen by its memory: frontmatter value: .claude/agent-memory/<agent>/ for project, .claude/agent-memory-local/<agent>/ for local, or ~/.claude/agent-memory/<agent>/ for user scope.

Why can't the Skill write to agent memory directly?

Write permission to agent memory derives from the agent's own memory: field and only applies while it actually runs as that subagent. The Skill therefore dispatches the agent with the Agent tool and only verifies the result afterward.

What inputs can be used for agent training?

Any readable input works: review/retry records, repository files, URLs, or plain text in the prompt. Architectural decision records (ADRs) are explicitly excluded because they are read reactively on demand, not held as standing memory.

What happens if the target agent lacks memory or write tools?

Agents missing the memory: field or Write/Edit tools are skipped and reported with the exact missing prerequisite. Fixing the definition is delegated to the write-agent skill; train-agent never edits agent definitions itself.