plugins/agentic-engineering-principles/skills/agent-offloading/SKILL.md
Covers the agent-offloading principle for AI-assisted development — offload everything deterministic (git operations, validation commands, iteration accounting, output parsing, message routing) from the agent onto code, and reserve the agent for judgment, language understanding, and code synthesis. Includes the division-of-labor table, decision heuristics, orchestrator-owned fields, and typed side channels for agent-produced artifacts. Use when designing an agent workflow or orchestration loop, deciding whether a check belongs in a script or a prompt, tempted to ask an agent to track its own iterations or decide when to halt, or when parsing structured data out of agent response text.
npx skillsauth add amhuppert/my-ai-resources agent-offloadingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Maximally useful AI-assisted development offloads as much as possible from the agent onto deterministic code. Reserve the agent for the things only it can do: judgment, language understanding, and code synthesis. Everything else — bookkeeping, validation, routing, retries — belongs in the orchestrator, where it is cheaper, reproducible, and cannot hallucinate.
| Deterministic code | Agent | |---|---| | Git operations, file I/O, log/JSON parsing | Writing and editing source | | Validation command + exit code | Judging whether a result matches intent | | Iteration accounting, circuit breakers, locks | Producing the next plan step | | Schema-validating agent output (Zod / JSON Schema) | Interpreting ambiguous prompts | | Message routing between agents | Design review |
The left column is work a script does perfectly every time. The right column requires understanding what a human meant. If a responsibility could plausibly sit in either column, put it on the left.
Before adding an instruction to an agent prompt, ask:
If a prompt survives this checklist with more than a few asks, split it.
Worked example. When a unit of work has both a deterministic validator (build, typecheck, tests) and an LLM validator (does the change satisfy the acceptance criteria?), order them: deterministic first, agent second.
If the tree doesn't compile, no LLM turn helps — the agent validator would be judging the intent of code that cannot run. The deterministic gate is cheaper, faster, and its verdict is certain, so it burns first and short-circuits the expensive judgment call on failure.
Both kinds of failure still consume the same iteration budget and feed the same circuit breaker; the ordering only controls which check spends money first.
Some fields in an agent's structured response are not judgments the model makes — they are facts the orchestrator already knows from the phase it is running: the current phase, the round number, agent names, target identifiers. Keep these out of the model-facing schema entirely and inject them after parsing.
Asking the model to echo them is pure downside:
The pattern:
The model authors only judgment and content. The orchestrator owns every fact it can compute.
Don't make free-form agent prose the contract. When an agent produces a structured artifact — a plan, a manifest, a registration — prefer a typed side channel over parsing the response text:
The prose response is commentary for whoever is reading along; the canonical artifact travels through the typed channel. If you must extract structure from response text, instrument the fallback: needing a fenced-JSON rescue instead of the primary channel is a signal the contract is under strain, worth flagging rather than silently absorbing.
agent-structured-output — reliable machine-readable agent output: small manifests, files for content, bounded repaircli-tools-for-agents — design a project CLI as the agent tool surface: exit codes, file payloads, jobs, doctormechanical-guardrails — enforce conventions structurally with ratchets, tripwires, contract tests, and derived artifactsdevelopment
Debug a running web app via the web-debugger SDK: app logs, application state, runtime snapshots, React state, query cache.
development
Thoroughly understand a software development objective before implementation: research, identify ambiguities, ask clarifying questions. Use before starting implementation of a non-trivial or ambiguously specified feature, or when requirements leave open design decisions.
development
Locate the on-disk Claude Code transcript file (.jsonl under ~/.claude/projects/) for the current or a specified conversation.
development
Reflect on codebase navigation effectiveness at end of conversation. Surfaces dead ends, inefficiencies, missing context. Does not write files — pair with /kiro:steering-custom to persist.