Writing skills

From juanibiapina/dotfiles · View interactive version

Writing skills is an AI agent skill from the GitHub repository juanibiapina/dotfiles. Guidance and vocabulary for writing agent prompts, covering skills, prompt templates, and the pi system prompt. Use when authoring, revising, reviewing, or pruning a skill, prompt template, or SYSTEM.md, writing a skill description, deciding what lives in SKILL.md versus a linked file, or diagnosing

How to use this skill

Skill file

Writing Skills

Guidance for writing skills that are predictable, concise, and intent-focused. A skill's job is to make the agent take the same process every run, not to produce the same output. Every rule below serves that.

State intent, not mechanics

State what to achieve and why, not how to execute. Trust the agent to figure out mechanics.

Too prescriptive:

Step 1: Run git log to find the commit.

Step 2: Run git cherry-pick \<hash\>.

Step 3: If there are conflicts, run git status.

Better:

Cherry-pick the commit onto a clean branch. Resolve conflicts preserving intent. If it can't land cleanly, explain why.

Descriptions

The description is the only part of a skill the agent sees before loading it, so it decides when the skill fires. Write it in third person as "<what it does>. Use when <triggers>.", using the words the user would actually type.

Degrees of freedom

Match specificity to the task's fragility.

Most skills are high freedom. Use low freedom only for operations that break when done differently.

What to include

Wrap examples in <example> tags so the agent can tell them apart from instructions.

CLI reference (commands, flags, examples) is fine at any length. That's knowledge, not prescription.

Leading words

A leading word is a compact concept already in the model's pretraining that anchors a behaviour in the fewest tokens (e.g. tight, red, tracer bullet, fog of war). Repeated as a token, not restated as a sentence, it recruits priors the model already holds and makes the behaviour fire the same way every run.

Hunt for restatements a single word can retire: "fast, deterministic, low-overhead" becomes a tight loop. You win twice: fewer tokens, and a sharper hook for the agent.

Prompt the positive

Steering by prohibition backfires: "don't write verbose comments" makes verbosity the pattern the agent just read. State the target behaviour instead ("write one-line comments"). Keep a prohibition only as a hard guardrail you can't phrase positively, and pair it with what to do instead. When a prohibition is needed, name the specific patterns ("cream background, pill-shaped buttons"); a vague class ("generic look") swaps one default for another.

Calm language

State each rule in normal case with its reason; the model generalizes from the reason. All-caps NEVER, MUST, or CRITICAL makes current models overtrigger. Reserve a hard guardrail for mistakes that are costly, and say why it matters.

Checkable conditions

End each step on a checkable condition: can the agent tell done from not-done? Where it matters, make it exhaustive ("every modified model accounted for", not "produce a change list"). A vague bound lets the agent declare done early.

Branch on a condition the model can check too, such as scope, a settled decision, or new evidence. A model does not grade its own output consistently (blocking or minor, severity, priority, confidence), and a review prompt that asks only for high-severity issues can make the model report less.

Prove standalone claims

Before calling a skill standalone, generic, portable, or "runs anywhere", name

the concrete capabilities it needs and confirm the target runtime (stock

interactive pi) supplies them. If it needs a specific host's tools, it is

host-specific: it lives with that host, not in a generic library.

Progressive disclosure

Keep SKILL.md legible. Push reference the agent needs only sometimes into a linked file, reached by a pointer, so the top stays short. Inline what every run needs; disclose what only some runs reach. The pointer's wording, not its target, decides how reliably the agent reaches it.

Keep it short

If a skill runs past ~50 lines, ask whether every line earns its place. Watch for these failure modes:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.