From brewcode
Syncs project rules from KNOWLEDGE.jsonl or session learnings to .claude/rules/. Useful for maintaining consistent rule sets across sessions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/brewcode:rules <free-form prompt: what to do with rules><free-form prompt: what to do with rules>sonnetThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **TARGET:** Project `.claude/rules/` only. NEVER `~/.claude/rules/`
TARGET: Project
.claude/rules/only. NEVER~/.claude/rules/
| Const | Value |
|---|---|
| ARTIFACT | rules |
| SPECIALIST | bc-rules-organizer |
| LIST_CMD | bash "${CLAUDE_SKILL_DIR}/scripts/rules.sh" list |
Treat the entire user input ($ARGUMENTS) as ONE free-form natural-language prompt.
There is NO keyword grammar and NO argument parser — argument-hint is only a loose example.
Classify the prompt + recent conversation context into exactly ONE mode:
| Mode | Chosen when prompt signals |
|---|---|
status | "статус", "что есть", "состояние", health / overview / "show me" (DEFAULT for any "show me" intent) |
list | explicit "список" / "list" / "перечисли" ONLY |
create | "создай" / "create" / "new" / "добавь" / "scaffold" |
improve | "улучши" / "improve" / "refactor" / "fix" / "почини", OR a bare existing name/path |
review | "ревью" / "review" / "validate" / "проверь корректность" |
Batch flag: plural form, "все" / "all", or multiple names/paths -> fan-out (one specialist spawn per item).
Then ANNOUNCE the chosen mode (MANDATORY, before any work):
Mode: <mode> (rules) — chosen because <evidence quoted from the prompt>
Proceed to Step 4.
Ask ONE AskUserQuestion. Question: What do you want to do with rules?
Options (in this order):
Status (rules) — (Recommended) rich status of this artifactStatus (all: agents+rules+skills) — cross-link: run the collector for all threeCreate new rulesImprove existing rulesReview rulesList (plain)Nothing / cancelAfter the choice:
Nothing / cancel -> stop.create or improve -> ask ONE follow-up AskUserQuestion for the target/description
plus the artifact-specific params (see "Artifact-specific params" below).status -> go to Step 5.status (all) -> go to Step 5, running the collector for agents + rules + skills together.list -> run LIST_CMD, print the plain inventory it produces, then STOP (no status assembly).create -> gather minimal params (Step 3 / artifact-specific), spawn SPECIALIST via Task.
Batch -> spawn one SPECIALIST per item, ALL in ONE message (parallel).improve -> resolve target(s), spawn SPECIALIST via Task per target (parallel for batch).review -> spawn brewcode:reviewer (two-phase: review -> double-check findings -> report).Delegate collection to ONE Explore/Bash subagent, then assemble a rich status (never a bare list):
.claude/) / global (~/.claude/) — counts + names + load path._SKILL.md / _<name>.md), model.Bash in tools: (macOS search rule);
skills with weak description triggers; rules duplicated in CLAUDE.md.For the Status (all) menu option: run the SAME collector for agents + rules + skills together.
list)# rules [<mode>]
## Detection
| Input | <prompt or "(none -> menu)"> |
| Mode | <mode> |
| Reason | <why this mode> |
| Targets| <names/paths> |
## Result
(create/improve/review: each output path + specialist agent + scope/model)
## Status
(status mode: full table from Step 5; else short "what changed" for touched artifacts)
## Next Steps
(recommendations; ALWAYS remind to run /docs for any created/changed artifact)
For status mode the report is the Step 5 status table.
Note: rules has only an ORGANIZER (bc-rules-organizer), no separate creator — creation is
organizer-driven. For create/improve: AskUserQuestion for the knowledge source —
(a) KNOWLEDGE.jsonl path (parse t:"❌"->avoid, t:"✅"->practice), (b) inline prompt
( + text), (c) session learnings (extract 5 most impactful findings as ❌/✅).
Spawn SPECIALIST (bc-rules-organizer) with the agent-prompt template:
npx claudepluginhub kochetkov-ma/claude-brewcode --plugin brewcodeScans installed skills to extract cross-cutting principles and distills them into rules by appending, revising, or creating rule files. Use for periodic rules maintenance after installing new skills.
Inspect and maintain the live-rules in the project's live-rules file (.claude/live-rules.md by default, or wherever LIVE_RULES_PATH points): list every rule with its scope and status, audit them for problems (broken frontmatter, globs that match nothing, duplicates, oversized bodies, conflicts), enable or disable a rule, or explain which rules are currently active. Use when the user asks to "list my rules", "what rules are active", "show live-rules", "audit my rules", "disable the X rule", "enable the X rule", "turn off that rule", "why did Claude get that instruction", or "clean up my rules". To create or edit a rule, use add-rule instead.
Extract conventions and implicit knowledge from session data into .claude/rules/local/ files. USE WHEN repeated patterns are found across sessions.