skills/mine/writing-agents-md/SKILL.md
Author lean AGENTS.md/CLAUDE.md instruction files — resident system-prompt context where every line pays rent. Use when writing an agent instruction file from scratch, auditing or trimming a bloated one, or gating whether a new rule earns residence and at which scope. Don't use for on-demand skills (use writing-skills) or human-facing docs and READMEs.
npx skillsauth add pedronauck/skills writing-agents-mdInstall 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.
Keep agent instruction files lean enough that every rule in them binds.
An AGENTS.md or CLAUDE.md (COPILOT.md, .cursorrules — any harness instruction file) is not documentation. It is a fragment of the system prompt: the harness injects it verbatim into every session, before the task is known, and it never unloads. A skill loads on demand; this file is resident. Three consequences govern everything below:
The file that survives these constraints is a delta: the difference between stock agent behavior and what this project needs. Everything that isn't delta is rent paid for nothing.
Run on every line written, kept, or proposed. A line stays only if all three hold; a line that fails is deleted or relocated, never softened.
Place each rule at the narrowest scope that still covers the tasks needing it:
| Scope | Resident for | Belongs there |
|---|---|---|
| Global (~/.claude/CLAUDE.md) | every project | cross-project workflow rules — the highest bar |
| Repo root file | every task in the repo | commands, repo-wide tripwires, deviations from convention |
| Subtree file (<dir>/AGENTS.md) | work inside that subtree | area-specific rules, loaded only when the agent touches the area |
| Skill | on trigger | procedures and multi-step workflows |
| Linked doc | on demand | reference some tasks need; word the pointer for when to read it |
Two mechanics decide placement more than anything else: nested files load lazily, so the directory tree is the progressive disclosure these files natively support. And in Claude Code, an @path import expands at load time — resident, full rent — while a plain path mentioned in prose is read only on demand.
make check before commit", not "ensure quality gates pass".gen/ — regenerated on build."Write — a new file for a repo:
Done when: every line passes all three rent tests at its chosen scope.
Trim — an existing file:
Done when: every original line has a verdict and the surviving file passes the Write bar.
Gate — a single new rule, usually promoting a chat correction:
Done when: the rule lives at exactly one scope, exactly once.
development
Deep review of branch diffs, working trees, or GitHub PRs at any size. Use when the user asks for CodeRabbit-grade review, an incremental re-review after new pushes, publication of findings to a PR, a cross-LLM peer-review verdict round, or conformance review against spec artifacts. Don't use for applying fixes, reviewing specs or PRDs as documents, or quick single-file feedback.
tools
Orchestrate Claude and Codex worker TUIs from a controller agent through herdr panes and the herdr socket CLI. Use when delegating bounded tasks to herdr worker panes, running user-activated plan-first delegations (Claude Code plan mode, Codex Plan mode), waiting on native agent status (idle, working, blocked, done), or verifying worker reports. Workers launch as interactive TUIs via herdr agent start — never through headless runners (compozy exec, claude -p, codex exec). Not for cmux workspaces (see cmux-orchestration) and not for end-user herdr control.
tools
TanStack Query, Router, and Form patterns for React. Use when writing useQuery/queryOptions, mutations, caching, file-based routes, search params, loaders, or TanStack Form validation. Don't use for TanStack Start, TanStack DB/collections, Zustand client state, or non-TanStack routing.
development
Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.