Skip to content
Back to skills

Writing Agent Instructions

ASecurity

Create, revise, or audit skills, AGENTS.md, CLAUDE.md, or native memory: triggers, progressive disclosure, evals, retrospectives, memory pruning, and turning mistakes into checks. Not for user READMEs, API docs, or code comments.

  • 8 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 20, 2026
ai-agentsapidocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add lawzava/megapowers --skill writing-agent-instructions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Writing Agent Instructions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Writing Agent Instructions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lawzava-writing-agent-instructions/badge)](https://www.skillsdirectory.com/skills/lawzava-writing-agent-instructions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: writing-agent-instructions
description: "Create, revise, or audit skills, AGENTS.md, CLAUDE.md, or native memory: triggers, progressive disclosure, evals, retrospectives, memory pruning, and turning mistakes into checks. Not for user READMEs, API docs, or code comments."
---

# Writing Agent Instructions

Choose the smallest instruction surface for the work:

- Put durable repository facts, commands, boundaries, and conventions in the
  nearest applicable project instruction file.
- Put reusable task judgment or a multi-step capability in a skill.
- Put rules that must execute or block an action in tests, hooks, settings, or
  a deterministic tool. Prose can guide a model but cannot enforce behavior.

Each time you correct an agent, first ask whether a check, type, lint rule,
hook, or API change can make the mistake impossible. Add prose only when none
fits, and say why. A check's failure message is itself an instruction: name
the root-cause fix, not only the violation, so the agent does not patch
around the check.

Read applicable repository instructions, nearby instructions, code, tests, and
configured tools before drafting. Attribute load-bearing statements to direct
observation, repository policy, upstream documentation, or explicit author
decisions. Remove claims that code or a command can reveal cheaply unless
their omission repeatedly causes bad decisions.

Write the minimum instruction that changes behavior. State the condition, the
required outcome, and any real boundary. Preserve user intent and existing
authorization. Say what to use ("use Y for Z"); a "do not use X" line steers
toward X and blocks edge cases where X fits. State real safety and authority
limits directly. Mark superseded routes legacy and say when to ask. Keep
examples, preferences, and hypothetical risks out of blanket prohibitions,
approval gates, fixed workflows, and extra files. Add detail only when omitting
it caused an observed failure or creates a concrete risk.

For a skill, read [skill authoring](references/skills.md). For project or
subfolder guidance, read
[repository instructions](references/repository-instructions.md). For a
retrospective, read [retrospective](references/retrospective.md); to audit native
memory, [memory hygiene](references/memory-hygiene.md).
Read multiple references only when the task spans more than one surface.

Validate new skills or material behavior changes at two boundaries: harness
discovery and format acceptance, then realistic positive, near-miss negative,
and pressure cases. Compare the same cases against the previous instructions
or no-skill baseline. Inspect task outcomes as well as activation, and keep the
change only when it improves the intended behavior without a material
regression outside its scope. For a typo or link fix that does not change
behavior, static checks suffice.

Files in this skill

  • SKILL.md2.6 KB
  • references/repository-instructions.md4.1 KB
  • references/skills.md4.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.