Guideline writing

From event4u-app/agent-config · View interactive version

Guideline writing is an AI agent skill from the GitHub repository event4u-app/agent-config. Use when creating or editing a guideline in docs/guidelines/ — reference material cited by skills, no auto-triggers — even when the user just says 'write up our naming conventions'.

How to use this skill

Skill file

<!-- cloud_safe: degrade -->

guideline-writing

When to use

Do NOT use this skill when:

Guideline vs rule vs skill — critical test

| Intent | Artifact |

|---|---|

| "Here is knowledge skills and rules may cite" | Guideline |

| "Agent must always / never do X" | Rule |

| "When Y happens, run these steps" | Skill |

A guideline is reference material. It is never a trigger. It has no

description used for routing — skills and rules link to it.

Procedure

0. Run the Drafting Protocol

Creating or materially rewriting a guideline must go through Understand

→ Research → Draft from the

CODE0 rule.

answer is "none", the guideline has no home — stop.

src/ for pages that already cover the topic.

Analyze 1–2 peer guidelines in the same topic folder for tone.

fill bodies once the outline is confirmed.

1. Pick the right topic folder

Folders under docs/guidelines/:

| Folder | Contents |

|---|---|

| agent-infra/ | Cross-cutting agent-system knowledge (naming, size, output patterns) |

| php/ | PHP-specific reference (patterns, services, jobs, resources) |

| e2e/ | End-to-end testing patterns |

If none fits, ask the user before creating a new folder.

2. Write frontmatter

Guidelines use a minimal frontmatter — no type, no auto-trigger semantics.

---
description: "Short human-readable summary — cited by skills, not used for routing"
source: package     # or project for consumer-local guidelines
---

If you do want to polish the description for a guideline whose summary

gets surfaced to agents, delegate to the

CODE0 skill — same

approval-gated flow as for skills and rules.

3. Structure the body

that cite it.

4. Wire it in

A guideline is useless if nothing cites it. Before closing the task:

→ See 'docs/guidelines/{topic}/{name}.md' for full X.

pointer. (Normative source: CODE0.)

5. Enforce the size budget

Guidelines have more room than rules but are not dumping grounds.

| Category | Target |

|---|---|

| Ideal | ≤ 200 lines |

| Acceptable | ≤ 400 lines |

| Split signal | > 500 lines |

Above the split signal, break by sub-topic into sibling files in the same folder.

6. Validate

→ 0 FAIL (guidelines have relaxed linting but must still parse).

the script list) — must exit 0 except for tolerated warnings.

Output format

  1. Complete guideline at docs/guidelines/{topic}/{name}.md
  2. At least one skill or rule linking to it
  3. Linter + check_references.ts clean
  4. bash scripts/condense.sh --sync confirmation

Gotchas

extract into the guideline and link from both.

executable (see preservation-guard).

Frugality Standards

Apply the Frugality Charter

to every guideline you author.

Examples in this artifact:

patterns; they do not restate Iron-Laws from rules.

pattern, not its motivation.

forks ("table vs. paragraph") — pick one.

Pre-save self-check:

  1. Does the guideline restate text from a rule body instead of

linking the rule?

  1. Are code examples preceded by narrative ramp-up?
  2. Does the guideline introduce a new convention without citing the

rule that holds the obligation?

  1. Are sections labeled "Overview" / "Background" carrying only

restatement?

Do NOT

Cloud Behavior

On cloud surfaces (Claude.ai Web, Skills API) the package's

scripts/check_references.ts, scripts/skill_linter.ts, and task

runner are not reachable. The skill still applies — with prose-only

validation:

attempt to write to disk.

alwaysApply.

named in a topic folder.

docs/guidelines/{topic}/{name}.md and run

task sync && task lint-skills && task check-refs locally before

committing.

run on the user's machine.

Examples

Good guideline name + description:

Path: docs/guidelines/agent-infra/size-and-scope.md

Description: "Golden size rules for rules, skills, commands, and guidelines"

Bad:

Path: guidelines/stuff (no topic folder, meaningless stem)

Description: "Things to know"

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.