brewdocauto-synclisted
Install: claude install-skill kochetkov-ma/claude-brewcode
# Auto-Sync
<instructions>
## Mode Detection
**EXECUTE** using Bash tool (args: `$ARGUMENTS`):
```bash
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/rules`
- `agents/` — sync via `/brewdoc:auto-sync .claude/agents`
- `skills/` — sync via `/brewdoc:auto-sync .claude/skills`
## INDEX Format
```jsonl
{"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)
## Frontmatter Fields
Required (3):
```yaml
auto-sync: enabled
auto-sync-date: 2026-02-05
auto-sync-type: skil