/llm-author:rule-file-writingfrom llm-author
Guides creation and optimization of rule files for per-token behavioral steering of AI coding assistants. Covers drafting, trimming ballast, and structural alignment.
Ships in llm-author. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A rule file is an instruction file that an AI coding assistant automatically loads for a matching user, project, or directory scope. It supplies persistent behavioral steering rather than a task-specific workflow.
Rule files are context tax paid whenever their scope matches. Optimize for behavioral steering per token: keep what changes generation, cut what justifies the rule to a human reader.
This skill covers rule files only. For skills, agents, or commands, use the corresponding authoring workflow. For SKILL.md or agent content, defer to content-editing.
digraph rule_file_writing {
"Rule-file request" [shape=doublecircle];
"Create or Optimize?" [shape=diamond];
"Conversation already supplies rule, failure mode, trigger, rationalizations, and path?" [shape=diamond];
"Interview the user (one question at a time)" [shape=box];
"Draft from the rules-file skeleton" [shape=box];
"Present the draft for a sanity check" [shape=box];
"Pass 1: content cuts (essential vs ballast, honesty gate)" [shape=box];
"Pass 2: structural alignment (family pattern, front-loaded gate, three-angle)" [shape=box];
"Report trajectory: original -> Pass 1 -> Pass 2" [shape=doublecircle];
"Stop — no third pass" [shape=octagon style=filled fillcolor=red];
"Rule-file request" -> "Create or Optimize?";
"Create or Optimize?" -> "Conversation already supplies rule, failure mode, trigger, rationalizations, and path?" [label="create"];
"Create or Optimize?" -> "Pass 1: content cuts (essential vs ballast, honesty gate)" [label="optimize"];
"Conversation already supplies rule, failure mode, trigger, rationalizations, and path?" -> "Draft from the rules-file skeleton" [label="yes"];
"Conversation already supplies rule, failure mode, trigger, rationalizations, and path?" -> "Interview the user (one question at a time)" [label="no"];
"Interview the user (one question at a time)" -> "Draft from the rules-file skeleton";
"Draft from the rules-file skeleton" -> "Present the draft for a sanity check";
"Present the draft for a sanity check" -> "Pass 1: content cuts (essential vs ballast, honesty gate)";
"Pass 1: content cuts (essential vs ballast, honesty gate)" -> "Pass 2: structural alignment (family pattern, front-loaded gate, three-angle)";
"Pass 2: structural alignment (family pattern, front-loaded gate, three-angle)" -> "Report trajectory: original -> Pass 1 -> Pass 2";
"Report trajectory: original -> Pass 1 -> Pass 2" -> "Stop — no third pass";
}
Skip this step if the conversation already contains (a) the rule, (b) the failure mode it prevents, (c) the triggering action, (d) plausible bypass rationalizations, and (e) the target path.
Otherwise ask the user one question at a time, with multiple-choice options where possible:
CRITICAL opener.Decision Test heading.assets/templates/rules-file-skeleton.md.## Banned Patterns if the rule has no syntactic form.{{OPTIONAL_ALLOWED_EXCEPTIONS_SECTION}} if there are no exceptions — no empty heading.{{BODY_SECTION_TITLE}} to ## Core Rules unless a more specific frame applies.Minimum viable output: CRITICAL opener + Decision Test + body + Red Flags.
Show the draft to the user for a sanity check before entering the optimize workflow.
Two fixed passes. No third pass — if the user wants more, they re-invoke.
references/essential-vs-ballast.md for the classification tables and the per-paragraph decision test.references/techniques.md and references/three-angle-pattern.md.techniques.md (family-pattern order, front-loaded decision gate, code-block framing, WHY clauses, explicit gate conditions).original → Pass 1 → Pass 2.If two passes produce minimal cuts, report 0% and stop. Manufactured cuts are banned — the calibrated-honesty gate in essential-vs-ballast.md enforces this. Expected reduction ranges:
| File state | Expected Pass 1 + Pass 2 reduction |
|---|---|
| Heavy ballast (essay-style, citations, "why" sections) | 40–55% |
| Moderately tight | 10–25% |
| Already tight (authored with these principles) | 1.5–10% |
| Already optimal | 0% — report honestly |
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/content-editingEvaluates proposed changes to LLM-targeted content (skills, agents, commands) and guides toward corrections over additions. MUST invoke when editing SKILL.md files, modifying agent markdown in agents/, updating command markdown in commands/, adding new sections or instructions, expanding skill content, user says "is this too long", "content bloat", "should I add this", or improving/enhancing skills./prompt-engineeringUse when the user asks to create, write, improve, or debug a prompt, build a prompt chain, design a system prompt, adapt a prompt for GPT-6, GPT-6.1, or GPT-5.6 (OpenAI), GLM 4.7 (Z.ai), or Gemini 3, create a Gemini deep research prompt, migrate a prompt or skill from Claude 4 to Claude 5, from Opus 5 to Opus 5.5, from Sonnet 5 to Sonnet 5.5, from Haiku 4.5 to Haiku 5.5, or between GPT versions (e.g. GPT-5.6 to GPT-6, GPT-6 Sol to GPT-6.1 Sol), optimize LLM-targeted content (skills, agents, instructions, documentation), author a prompt an invoking workflow dispatches to a worker process, distill prompt-authoring rules into a session-scoped ruleset, or needs prompt engineering guidance. Also handles prompt refinement and follow-up modifications./writing-handoff-promptsUse when the user explicitly asks to write a handoff prompt for a fresh, new, separate, or other session — for example to start a spec's implementation, apply review or report fixes, turn review findings into a change proposal, or continue work — in a session that will have none of this session's context. Invoke on such an explicit request or when an invoking workflow's step calls for a handoff body to dispatch — never proactively otherwise. Produces a self-contained handoff prompt (every needed fact stated inline or reachable by an explicit file reference; the work type, branch, commit and verification policy, and scope deduced from context), then offers to save it to a file or copy it to the clipboard — or, when a workflow step invoked it for a body to dispatch, hands the finished prompt back to that workflow instead of asking.npx claudepluginhub it-bens/ai-tools --plugin llm-authorOther plugins' skills for the same job