一键导入
brewdoc-auto-sync
Sync skill, agent, markdown docs from official sources in place. Triggers: sync docs, auto-sync, refresh skill docs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Sync skill, agent, markdown docs from official sources in place. Triggers: sync docs, auto-sync, refresh skill docs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
SSH server management — connect, configure, deploy, administer Linux servers with safety gates.
Manager mode. on installs+arms a HARD delegation wall into THIS project (PreToolUse denies Write/Edit/Bash in main session, subagents free); off disarms; uninstall removes it. Codeword ++m auto-injects a delegate-everything prompt (plan-aware: adds the plan supplement in plan mode); ++a auto-injects an architecture-first directive (mode-agnostic); ++rr/++r auto-inject review discipline (anti-regression / two-phase double-check), all independent of this skill. level strict|balanced, status, edit, reset. Triggers: manager, менеджер, hard mode, хард режим, delegate.
Installs or removes the think-short terse-mode hooks. Triggers: think-short, be terse, terse mode, инжект терс-режим.
Creates and improves Claude Code subagents. Triggers: create agent, improve agent, scaffold agent, fix agent.
Extracts etalon classes, patterns, architecture into convention docs. Triggers: extract conventions, etalon classes.
Orchestrates e2e testing: BDD scenarios, Playwright autotests. Triggers: e2e tests, BDD scenarios, write autotest.
| name | brewdoc:auto-sync |
| description | Sync skill, agent, markdown docs from official sources in place. Triggers: sync docs, auto-sync, refresh skill docs. |
| user-invocable | true |
| argument-hint | [status] | [init <path>] | [global] | [path] |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash, Task, WebFetch, Skill |
| model | opus |
| auto-sync | enabled |
| auto-sync-date | "2026-02-11T00:00:00.000Z" |
| auto-sync-type | skill |
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.
.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 |
|------|-------|
| 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" |