Syncs KNOWLEDGE.jsonl or session learnings to project rules. Use when - updating rules, syncing knowledge, extracting learnings, organizing anti-patterns. Trigger keywords - rules, knowledge sync, avoid patterns, best practices, session rules, extract rules.
Captures learnings, anti-patterns, and best practices — from KNOWLEDGE files, arbitrary files, or the current conversation — then organizes them into structured .claude/rules/ files that Claude Code loads automatically on every session.
Target scope: project .claude/rules/ only. The skill never writes to ~/.claude/rules/.
/brewcode:rules
No arguments: presents the interactive menu with Status (rules) pre-selected as the recommended action.
Pass a free-form prompt to skip the menu entirely:
/brewcode:rules capture what we learned fixing the N+1 query bug today
Every invocation goes through the same flow:
$ARGUMENTS; if empty, goes to the interactive menu.Mode: <mode> (rules) — chosen because <evidence>AskUserQuestion:
bc-rules-organizer agent (create / improve / review / batch) or runs rules.sh list directly (list mode).list mode.| Mode | How it activates | What it does |
|------|-----------------|--------------|
| status | Default when no other mode is detected | Shows file counts, last-modified, coverage |
| list | Explicit only — "list", "show rules", "what rules" | Runs rules.sh list, plain file listing |
| create | "create", "add", "new rule" in prompt | bc-rules-organizer creates entries from knowledge source |
| improve | "improve", "update", "refine" in prompt | bc-rules-organizer refines existing entries |
| review | "review", "check", "audit" in prompt | bc-rules-organizer audits rule files for quality |
| batch | Multiple sources detected | bc-rules-organizer processes all sources in one pass |
| Source | Example |
|--------|---------|
| KNOWLEDGE.jsonl path | /brewcode:rules path/to/KNOWLEDGE.jsonl — parses t:"❌" → avoid, t:"✅" → best-practice |
| File path + inline prompt | /brewcode:rules docs/retro.md "extract SQL anti-patterns" |
| Session learnings (no path) | /brewcode:rules capture today's key findings — extracts 5 most impactful findings as ❌/✅ |
# Open the interactive menu
/brewcode:rules
# Check the current state of rule files
/brewcode:rules what is the current state of our rules
# Capture session learnings after debugging
/brewcode:rules capture what we learned fixing the auth bug
# Import from a KNOWLEDGE.jsonl file
/brewcode:rules path/to/KNOWLEDGE.jsonl add new entries
# Extract anti-patterns from a review document
/brewcode:rules docs/sql-review.md "extract SQL anti-patterns and best practices"
# Plain listing of all rule files and entry counts
/brewcode:rules list
Rule files are created or updated in .claude/rules/:
| File | Content |
|------|---------|
| avoid.md | General anti-patterns (table: #, Avoid, Instead, Why) |
| best-practice.md | General best practices (table: #, Practice, Context, Source) |
| {prefix}-avoid.md | Domain-specific anti-patterns, e.g. sql-avoid.md, test-avoid.md |
| {prefix}-best-practice.md | Domain-specific best practices, e.g. sql-best-practice.md |
All files use the markdown table format validated by rules.sh validate.
New entries go through three checks before being written:
No CLAUDE.md update step: the skill writes rule files only.
/brewcode:rules at the end of any long debugging or implementation session to capture learnings before compaction.list is the fastest way to verify file counts and spot unbalanced rule files.test-avoid.md, sql-best-practice.md) reduce noise for unrelated tasks.Full docs: rules
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer