brewdoc/skills/auto-sync/SKILL.md
Sync skill, agent, markdown docs from official sources in place. Triggers: sync docs, auto-sync, refresh skill docs.
npx skillsauth add kochetkov-ma/claude-brewcode brewdoc:auto-syncInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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 (primary) | Global ${BD_PLUGIN_DATA}/auto-sync/INDEX.jsonl (plugin data dir — used for GLOBAL mode because ~/.claude/* is blocked by protected-path policy)
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.
</instructions> <phase name="status">.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"
# Primary: project-relative .claude/auto-sync/ (required — ~/.claude/* is
# blocked by Claude Code's protected-path policy in headless sessions).
INDEX_DIR=".claude/auto-sync"
if [ "$SCOPE" = "global" ]; then
# GLOBAL mode scans ~/.claude/** (read-only) but writes its INDEX to
# the plugin data dir, NOT to ~/.claude/auto-sync (blocked path).
INDEX_DIR="${BD_PLUGIN_DATA:-$HOME/.claude/brewdoc}/auto-sync"
fi
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 |
|------|-------|
</phase>
| 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" |
development
Publish HTML, markdown, text, any file, or a multi-file site to brewpage.app — free hosting with no sign-up. Paste text, share a file, upload a site, or host a temporary page and get an instant public URL to share a link. Asks namespace and password, returns the public URL. Triggers: publish, publish HTML, share link, share a link, share a file, upload to brewpage, host page, host a temporary page, host a website, free hosting, paste text, instant public URL, no sign-up, brewpage, publish site, upload site, upload directory, deploy site, сделай публичную ссылку, опубликуй.
tools
Toggles terse-output mode to cut preamble and filler. Triggers: think-short, be terse, think shorter.
devops
Publish content to brewpage.app — text, markdown, JSON, file, or multi-file site. Asks namespace and password, returns public URL. Triggers: publish, share link, upload to brewpage, host page, brewpage, publish site, upload site, upload directory, deploy site, сделай публичную ссылку, опубликуй.
data-ai
Generate AI images via OpenRouter, Z.ai, Imagen 4, DALL-E 3, anti-slop. Triggers: generate image, AI image, og image.