Agent Instruction Writing
Write compact agent instructions that steer behavior without policy sprawl.
Operating Principles
- Treat every line as part of the control surface; keep only steering-relevant information.
- Preserve hierarchy and give each behavior one canonical home.
- Make defaults, escalation paths, and stop conditions explicit.
- Use neutral, testable wording and remove stale, overlapping, and task-local noise.
Requirements Intake
Collect only inputs that materially change behavior:
- Target artifact and scope (
AGENTS.md, SKILL.md, system prompt).
- Non-negotiable constraints and prohibited actions.
- Default behavior and escalation conditions (ambiguity, risk, secrets, destructive actions).
- Definition of done (validation, artifacts, output shape).
- Known failure modes or prior drift to prevent recurrence.
Drafting Workflow
- Define trigger and scope in frontmatter or opening lines.
- State default behavior before exceptions.
- Add escalation rules, tool boundaries, destructive safeguards, and output rules.
- Keep reusable procedure in the main file; move bulky detail to
references/.
- Run an editing pass for compression and contradiction.
Editing Pass
- Replace explanation with direct directives.
- Keep one responsibility per line; encode conditions directly (
If X, do Y; else do Z).
- Remove filler, repetition, and examples that add no control value.
- Check for global/local conflicts, duplicate ownership, unbounded absolutes, and conflicting examples.
Neutral Language
Default to neutral prompts that do not force outcomes.
- Prefer:
Inspect component behavior and report findings with evidence.
- Avoid:
Find a bug in component X.
Artifact Protocols
AGENTS.md
- Preserve hierarchy (system > developer > user > file-local policy).
- Make default behavior explicit and keep question policy narrow.
- Define tool boundaries, destructive safeguards, and output rules.
- Use
AGENTS.md as a routing layer, not a policy dump.
- Minimize churn on updates; preserve valid text verbatim where possible.
SKILL.md
- Put trigger conditions in frontmatter
description.
- Keep the body procedural; do not spend body space on trigger detection.
- Use progressive disclosure: core workflow in
SKILL.md, heavy detail in references/.
- Include command snippets only when deterministic and reusable.
- Use this skill for instruction text quality; use
skill-creator for package structure, bundled resources, initialization, and validation.
System Prompts
- Reserve them for highest-level invariants, safety boundaries, and default behavior.
- Do not pack in task-local detail that belongs in lower-priority prompts or skills.
- State precedence-sensitive rules and output constraints clearly and minimally.
- Remove stylistic guidance that does not materially change behavior.
Completion Contract
Before considering instruction work complete, verify:
- Trigger text routes the intended tasks.
- Defaults, escalation rules, and safeguards are explicit.
- Each behavior has one canonical home across related instruction files.
- Non-obvious or high-risk directives include a good/bad example when omission would cause misreads.
- Validation commands pass when available, and the instructions are executable without hidden assumptions.
Goal: concise instruction sets that reliably steer agent behavior without bloating context.
1---2name: agent-instruction-writing3description: Use when editing `AGENTS.md`, `SKILL.md`, or agent system prompts.4---56# Agent Instruction Writing78Write compact agent instructions that steer behavior without policy sprawl.910## Operating Principles11121. Treat every line as part of the control surface; keep only steering-relevant information.132. Preserve hierarchy and give each behavior one canonical home.143. Make defaults, escalation paths, and stop conditions explicit.154. Use neutral, testable wording and remove stale, overlapping, and task-local noise.1617## Requirements Intake1819Collect only inputs that materially change behavior:2021- Target artifact and scope (`AGENTS.md`, `SKILL.md`, system prompt).22- Non-negotiable constraints and prohibited actions.23- Default behavior and escalation conditions (ambiguity, risk, secrets, destructive actions).24- Definition of done (validation, artifacts, output shape).25- Known failure modes or prior drift to prevent recurrence.2627## Drafting Workflow28291. Define trigger and scope in frontmatter or opening lines.302. State default behavior before exceptions.313. Add escalation rules, tool boundaries, destructive safeguards, and output rules.324. Keep reusable procedure in the main file; move bulky detail to `references/`.335. Run an editing pass for compression and contradiction.3435## Editing Pass3637- Replace explanation with direct directives.38- Keep one responsibility per line; encode conditions directly (`If X, do Y; else do Z`).39- Remove filler, repetition, and examples that add no control value.40- Check for global/local conflicts, duplicate ownership, unbounded absolutes, and conflicting examples.4142## Neutral Language4344Default to neutral prompts that do not force outcomes.4546- Prefer: `Inspect component behavior and report findings with evidence.`47- Avoid: `Find a bug in component X.`4849## Artifact Protocols5051### `AGENTS.md`5253- Preserve hierarchy (system > developer > user > file-local policy).54- Make default behavior explicit and keep question policy narrow.55- Define tool boundaries, destructive safeguards, and output rules.56- Use `AGENTS.md` as a routing layer, not a policy dump.57- Minimize churn on updates; preserve valid text verbatim where possible.5859### `SKILL.md`6061- Put trigger conditions in frontmatter `description`.62- Keep the body procedural; do not spend body space on trigger detection.63- Use progressive disclosure: core workflow in `SKILL.md`, heavy detail in `references/`.64- Include command snippets only when deterministic and reusable.65- Use this skill for instruction text quality; use `skill-creator` for package structure, bundled resources, initialization, and validation.6667### System Prompts6869- Reserve them for highest-level invariants, safety boundaries, and default behavior.70- Do not pack in task-local detail that belongs in lower-priority prompts or skills.71- State precedence-sensitive rules and output constraints clearly and minimally.72- Remove stylistic guidance that does not materially change behavior.7374## Completion Contract7576Before considering instruction work complete, verify:7778- Trigger text routes the intended tasks.79- Defaults, escalation rules, and safeguards are explicit.80- Each behavior has one canonical home across related instruction files.81- Non-obvious or high-risk directives include a good/bad example when omission would cause misreads.82- Validation commands pass when available, and the instructions are executable without hidden assumptions.8384Goal: concise instruction sets that reliably steer agent behavior without bloating context.