/rulecast:add-rule [the convention, or nothing for what just happened]from rulecast
Turns one convention into a rulecast rule, with the developer approving every change. The convention is the one the developer names, or, with nothing named, the one the session just showed. Use when the developer asks to add a rulecast rule, to make rulecast catch something, or to stop a mistake from recurring.
Ships in rulecast. 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.
None: SKILL.md is the whole skill.
Turn one convention into a rulecast rule. The developer decides what the convention is, where it is written down, and whether the rule stays. Ask at each step below, and wait for the answer.
The developer asked for: $ARGUMENTS
Commands below say rulecast. If rulecast is not on the PATH, use npx @syv-ai/rulecast.
Never start drafting until the developer has confirmed which rule to add. Always ask with a recommendation.
Write each candidate as one sentence about the code, the way the project's docs would state it: "Services raise domain exceptions, never HTTPException", not "don't do what I did in users.py". For the one you recommend, add a line on what the rule would catch and where. Then ask the developer to confirm or correct it, and wait.
A convention says what should hold from now on. If what happened was a one-off bug, say so and recommend a test instead of a rule; add a rule only if the developer still wants one.
.rulecast-config.yaml files above the files the convention is about. A repository can have one at the top, one per package, or both, and every config above a file applies to it. If there is none, stop: rulecast is not set up yet. Offer /rulecast:setup, which follows SETUP.md with the developer.rulecast list. If a rule already enforces the convention and should have caught what happened, the work is to fix that rule rather than add one. Show the developer what it checks and why it missed, and continue from "4. Draft, measure and confirm the rule" below with that rule. If the not_checked entries it prints at the end name the convention's section, the convention was considered before: tell the developer the reason given then, and ask whether it still holds.rulecast list --catalog. If a catalog rule enforces the convention, recommend adopting it over drafting a new one: show what it checks and how many of the project's files it matches (rulecast list --catalog <id>), and with the developer's agreement run rulecast add <id> in that config's directory. Then find its section as "3. Find where the convention is written" below says, add it as a context override on the entry, and go to "5. Finish".Every rule cites the doc section that states its convention, so the agent that breaks it reads why.
AGENTS.md, CLAUDE.md and the docs they point to) for a section that states the convention. A section about the same area is not enough: it has to state this rule.rulecast list says new conventions go. If that is a folder, propose the file: the existing area it belongs to, or a new one. If nothing is set, propose a place next to related conventions. The developer can name another place and has the final say. Show it, and write it only after the developer agrees to the wording and the place.Follow DRAFT-RULES.md for this one convention: section 2 to tell whether code can show a break and to pick the detector, then section 3, steps 1 to 7. Draft in the config chosen in step 2, and run its commands in that config's directory.
not_checked entry in the config instead, with the section and the reason, as DRAFT-RULES.md section 4 describes. Write nothing about it in the docs.bad example, and the fix is a good good one. Shorten both to the lines that matter.If the approved rule has refuse_write (adopted with rulecast add or written into the config), run rulecast install where sessions start, so the hook that refuses writes is registered. rulecast add says so when it is missing.
Tell the developer, briefly:
--against (or --history) counts;.rulecast-config.yaml, a rule or a doc without the developer's approval of that change, shown to them first. This holds whoever started the skill.rulecast-ignore, to make the new one pass.What SKILL.md sets; muted values are Claude Code's defaults
Also when, in a rulecast project with the developer there to answer, they correct you and the correction says how code here should always or never be written. Then do not start this skill. Finish the fix and end that reply with one line: Want me to add a rulecast rule for this? "<the convention, in one sentence about the code>". Offer once per convention per session, never again for that convention after a no, and at most once per reply. Do not offer for a change of mind about this task, a one-off bug, or a mistake a rulecast finding already caught. Start this skill only after a yes, passing that sentence.
2 skills in this plugin
Other plugins' skills for the same job
npx claudepluginhub syv-ai/rulecast --plugin rulecast