--- source_keys: - agentskills-spec - agentskills-best-practices --- # Patterns Reference Upstream source: agentskills.io — best-practices (instruction patterns), specification. Read this when judging the **patterns** dimension: whether each instruction construct a skill uses is the right construct for the job and is correctly formed. Formation, not content — a Gotcha's *content* is judged in `references/body-discipline.md`. ## The constructs and when each is right | Construct | Right when | Wrong when | |---|---|---| | Gotchas | An environment fact contradicts a reasonable default | Used as a summary of the steps below | | Prescriptive sequence | The operation is fragile and flag order or exact arguments must not change | Several approaches are equally valid | | Checklist | A multi-step workflow the agent must complete in order | A single step dressed up as a list | | Conditional reference | Detail is needed on one branch only | The reference is needed on every run and is loaded blind | | Output template | The agent must emit a specific format a caller consumes | The output is prose nobody parses | ## Formation rules **Gotchas** sit near the top of the body, before the steps that would otherwise walk into them. Placement late in the body is a SUGGESTION, not a FAIL — the content is still correct, it is just read after the mistake. **Prescriptive sequences** that quote a fenced block inside another markdown block must escape the inner fence as `` \`\`\` ``. An unescaped inner fence terminates the outer block and the remaining instructions render as prose. **Conditional references** state a specific trigger, naming a file that exists in the skill's own `references/` directory: ```text If the API returns a non-200 status, read `references/api-errors.md`. ``` That block is fenced because the filename in it is illustrative — an unfenced `references/` pointer in a `SKILL.md` body must resolve on disk or the gate reports a hard ERROR. The generic form — pointing at the directory and hoping — defeats progressive disclosure, because the agent either loads everything or loads nothing. `Kyberforge.PaddingPhrase` catches the common generic phrasing deterministically; other malformed forms are judgment. **Output templates** belong in the body when the agent must emit them on every run, and in `references/` when only one dispatch branch produces that output. A template inlined for a branch most invocations never take is body-discipline padding. The FAIL and SUGGESTION criteria for this dimension live in `references/finding-criteria.md`, which Step 3 loads on every run.