/agent-workflow-engineering:migrating-agents-md-to-control-flowfrom Agent Workflow Engineering
Audits repos that rely on AGENTS.md, CLAUDE.md, or similar agent instruction files, then migrates repeatable workflows into skills and mandatory checks into scripts/hooks/CI, leaving only stable context and policy in repo instructions.
Ships in Agent Workflow Engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Use this skill when a repository depends on large agent instruction files such as AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, or equivalent docs for both repository context and workflow execution.
The goal is to move repeated or mandatory behavior into the right control surface without replacing one giant prose file with giant generated prompts hidden in skills or scripts.
Load references/failure-modes.md during final review or when a candidate migration feels weak.
Bundled scripts, relative to this skill directory:
scripts/validate-migration-skill.sh <skill-dir>: validate this skill or a generated migration skill.scripts/validate-migration-report.sh <migration-report.md>: validate required migration report sections.Proceed with migration when at least two are true:
Prefer audit-only output when most are true:
If uncertain, produce a report and recommend against file changes until the user confirms the migration value.
Extract distinct operational rules, split rules that span categories, and assign each rule exactly one primary target:
| Rule shape | Primary target |
|---|---|
| Stable repository context, architecture constraints, naming, edit boundaries | Concise AGENTS.md policy |
| Approval boundaries for dependencies, schemas, production config, external contracts, or critical deletion | Concise AGENTS.md policy; never automate away approval |
| Reusable workflow that still needs judgment after deterministic checks are removed | skills/<name>/SKILL.md, only if the Skill Candidate Test passes |
| Mechanically checkable behavior such as lint, schema/file validation, drift checks, formatting, or builds | scripts/, hooks, CI, or task-runner entries |
| Required ordering, blocking gates, retries, fallbacks, or machine-readable state | Task runner, script, CI, hook configuration, or orchestrator |
Ask "can this be runtime control flow?" before creating a skill. Use the LLM for interpretation, tradeoffs, explanation, and residual-risk analysis; use deterministic mechanisms for mandatory or mechanically decidable behavior. Label prose-only required behavior as advisory unless an actual script, hook, CI job, task runner, or orchestrator enforces it.
Discover instruction surfaces:
Inspect AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, README workflow sections, docs mentioning required agent behavior, helper scripts, CI, and hook/config files. Record path, purpose, context/procedure/enforcement type, and freshness.
Extract actionable statements: Normalize each instruction into a concise operational rule such as "Run tests after edits" or "Ask for approval before adding dependencies." Do not preserve rhetorical wording.
Classify and model rules: Use the routing model above. For each repeated or mandatory workflow candidate, sketch:
inputs -> states -> deterministic checkpoints -> success/failure status -> next action
Include required inputs, ordered states, blocking checks, retry/fallback behavior, machine-readable output if useful, LLM-only judgment, stop conditions, and escalation conditions.
Decide each candidate's target:
Record each candidate as create skill, update existing skill, merge, keep in AGENTS.md, convert
to script/hook/CI, convert to orchestration, or reject. Check existing repo-local and available
skills before creating a new one, and apply the Skill Candidate Test below before choosing a skill.
Produce a migration report before broad edits:
Write migration-report.md with these sections:
If the repo is large or ambiguous, stop here unless the user explicitly asked to apply changes.
Apply changes conservatively when requested:
Shorten AGENTS.md without turning it into a stub. When a procedure moves into a skill, script,
hook, CI job, task runner, or orchestrator, remove duplicated procedural prose from AGENTS.md;
leave concise context, policy, approval boundaries, and workflow entrypoints that point to the new
control surface. Produce only the approved artifacts: the report, updated instructions, qualifying
repo-local skills, deterministic helpers, or control-flow configuration. For a generated skill,
include a clear name and trigger, applicability boundaries, required inputs, an ordered procedure,
validation, stop/escalation conditions, output expectations, and links to enforcing mechanisms.
Keep project-specific lore out of skill bodies, and include concrete commands only when the skill
is specifically about that tool, framework, or environment. Add hooks only for zero-exception behavior.
Review failure modes:
Load references/failure-modes.md and verify no weak skill, README duplication, prompt relocation, false enforcement claim, fake state machine, unsupported policy inference, or unnecessary hook was introduced.
Validate:
Run relevant existing tests or lightweight checks when safe. For this skill or generated migration skills, run scripts/validate-migration-skill.sh. For reports, run scripts/validate-migration-report.sh.
Create or update a skill only when deterministic control flow is insufficient and most are true:
AGENTS.md policy.Reject candidates that merely relocate long instructions without an executable checkpoint, clearer entrypoint, or real judgment procedure. Prefer no new skill over a narrow, repo-specific, or low-reuse skill.
Do not automatically:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub abagames/agentic-gamedev-skills --plugin agent-workflow-engineering9 skills in this plugin
/critiquing-own-responseReviews the agent's own immediately preceding response as an advisory pass, surfacing assumptions, reasoning gaps, alternatives, and unverified claims. Use ONLY when the user explicitly asks for self-critique, critical thinking, or challenges to the agent's prior answer. Do not use for normal follow-ups, someone else's work, automatic checking, or independent quality assurance./dispatching-agent-workRoutes a user's request to a separate task, subagent, automation, or current agent with an appropriate model role, reasoning effort, and workspace isolation. Use when the user or an authoritative instruction asks to dispatch, delegate, orchestrate, enter dispatch mode, run work in another session, select an execution backend, or schedule work. While dispatch mode is active, proactively send substantive execution to the host's preferred worker boundary: a new user-visible task in Codex Desktop App and a subagent on hosts without durable tasks. Do not invoke merely because ordinary work is complex, long-running, or parallelizable, or when this skill is only being mentioned, reviewed, or edited./extracting-agent-skillsDistills reusable agent procedures, validation loops, debugging methods, tool-use patterns, and decision rules from completed, paused, abandoned, or failed projects. Use when closing or archiving a project, reducing side-project sprawl, or when asked to harvest project knowledge into reusable agent capabilities. Gates candidates for trigger clarity, validation, and transferability to avoid weak skills./extracting-spec-design-laddersReverse-engineers existing source code into a two-layer artifact ladder — a concrete reproduction spec (preserves behavior-affecting constants, same-tick ordering, input edges, collision/threshold semantics; drops cosmetics) and an abstract design doc (intentionally omits reproduction detail and records what is unspecified vs. safe-to-assume). Use to document or recover a program's intent and reproducible behavior without leaking implementation-only detail into the design layer./gating-by-blind-restorationValidates that one abstraction layer (a spec, design doc, schema, contract, or generated artifact) is self-sufficient by spawning an ISOLATED sub-agent that sees only that layer and must reconstruct the adjacent layer, returning pass / weak-pass / fail. Use when checking whether an extracted or generated artifact preserves enough structure to be rebuilt or used without the original source, and to prevent an author from grading their own output./gating-expensive-batch-workSplits a batch of expensive per-item agent work into a cheap reversible pass over every item and an expensive irreversible pass, separated by a method-freeze checkpoint. Use when running one costly procedure over many items (evaluations, migrations, audits, labeling, benchmark or fixture construction) and the method — rubric, transform rules, criteria, instrument — could still turn out to be wrong, or when part of the work spends something that cannot be spent twice: fresh seeds, held-out data, one-shot quota, published output, or a reviewer's first impression. Not for single items, cheap items, or a method already validated on the same class of item.Other plugins' skills for the same job