Help us improve
Share bugs, ideas, or general feedback.
From brewdoc
Indexes and syncs Claude skills, agents, rules, and markdown docs via status reports, init tagging, and scans of global/project/file/folder scopes.
npx claudepluginhub kochetkov-ma/claude-brewcode --plugin brewdocHow this skill is triggered — by the user, by Claude, or both
Slash command
/brewdoc:auto-syncopusThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<instructions>
Scans .claude/ directories for skills, commands, and agents, extracts metadata, compares to existing CLAUDE.md files, and updates documentation by adding missing entries, removing stale ones, and fixing counts.
Synchronizes project docs (CLAUDE.md, README.md, architecture.md) with code state via quality scoring (0-100), gap analysis, skill/ADR audits using git log, and change reports. Use for doc-code alignment.
Synchronizes CLAUDE.md navigation indexes and README.md architecture docs across repositories or directories. Use for audits after code changes or triggers like 'sync docs', 'update CLAUDE.md'.
Share bugs, ideas, or general feedback.
EXECUTE using Bash tool (args: $ARGUMENTS):
bash "${CLAUDE_SKILL_DIR}/scripts/detect-mode.sh" $ARGUMENTS
Parse output: MODE|ARG|FLAGS. If exit code non-zero → report error, EXIT.
| Mode | Trigger | Scope |
|---|---|---|
| STATUS | status | Report INDEX state → EXIT |
| INIT | init <path> | Tag file + add to INDEX → EXIT |
| GLOBAL | global | ~/.claude/** (excludes managed dirs) |
| PROJECT | empty | .claude/** (excludes managed dirs) |
| FILE | file path | Single file |
| FOLDER | folder path | All .md in folder |
Managed directories (excluded from auto-scan, explicit path required):
rules/ — sync via /brewdoc:auto-sync .claude/rulesagents/ — sync via /brewdoc:auto-sync .claude/agentsskills/ — sync via /brewdoc:auto-sync .claude/skills{"p":"skills/auth/SKILL.md","t":"skill","u":"2026-02-05","pr":"default"}
| Field | Description |
|---|---|
p | Relative path |
t | Type: skill/agent/rule/config/doc |
u | Last sync date (YYYY-MM-DD) |
pr | Protocol: default/override |
Paths: Project .claude/auto-sync/INDEX.jsonl | Global ~/.claude/auto-sync/INDEX.jsonl
Required (3):
auto-sync: enabled
auto-sync-date: 2026-02-05
auto-sync-type: skill
Optional override (multiline YAML):
auto-sync-override: |
sources: src/**/*.ts, .claude/agents/*.md
focus: API endpoints, error handling
preserve: ## User Notes, ## Custom Config
When auto-sync-override: present in frontmatter → INDEX gets pr: "override".
Stored in frontmatter only — never in document body.
.md files in scopediscover.sh typed) — output: TYPE|PATH per lineInput: init <path>
<path> — if NOT found → error, EXITauto-sync: enabled → "Already tagged", EXITauto-sync: enabled, auto-sync-date: {today}, auto-sync-type: {type}auto-sync-override: → set pr: override|defaultEXECUTE using Bash tool:
SCOPE="project" # or "global"
INDEX_DIR=".claude/auto-sync"
[ "$SCOPE" = "global" ] && INDEX_DIR="$HOME/.claude/auto-sync"
mkdir -p "$INDEX_DIR" && INDEX_FILE="$INDEX_DIR/INDEX.jsonl" && touch "$INDEX_FILE"
echo "INDEX=$INDEX_FILE"
INTERVAL_DAYS, PARALLEL_AGENTS from .claude/tasks/cfg/brewdoc.config.json)bash "${CLAUDE_SKILL_DIR}/scripts/discover.sh" "$SCOPE_PATH" typed
Output: TYPE|PATH per line (types: skill, agent, rule, config, doc). Capped at MAX_FILES (default 50).
For each file not in INDEX → auto-add:
auto-sync: enabled, auto-sync-date, auto-sync-type<auto-sync-override> → set prindex-ops.sh add)Find stale entries — EXECUTE using Bash tool:
bash "${CLAUDE_SKILL_DIR}/scripts/index-ops.sh" stale "$INDEX_FILE" "$INTERVAL_DAYS"
Launch bd-auto-sync-processor agents (max PARALLEL_AGENTS batches, model="sonnet"):
Task(subagent_type="brewdoc:bd-auto-sync-processor",
prompt="PATH: {path} | TYPE: {type} | FLAGS: {flags}")
Context: BD_PLUGIN_ROOT is injected into agent prompt by pre-task.mjs hook.
For each result:
updated or unchanged → update INDEX u to today (index-ops.sh update)error → log to Errors table, do NOT update INDEX (file remains stale for retry)Output report:
## Auto-Sync Complete
| Metric | Count |
|--------|-------|
| Discovered | {N} |
| Queued (stale/new) | {N} |
| Updated | {N} |
| Unchanged | {N} |
| Errors | {N} |
### Updated
| Path | Type | Changes |
|------|------|---------|
### Errors
| Path | Error |
|------|-------|
| Error | Action |
|---|---|
| INDEX corrupt | Rebuild from discovery |
| File not found | Skip, add to errors |
| Agent timeout | Retry once |
| No tagged files | Report "0 found" |
/brewdoc:doc called | "Use /brewdoc:auto-sync" |