@brickhouse-tech/sync-agents 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -2
- package/package.json +1 -1
- package/src/sh/sync-agents.sh +5 -0
package/README.md
CHANGED
|
@@ -31,13 +31,16 @@ chmod +x /usr/local/bin/sync-agents
|
|
|
31
31
|
|
|
32
32
|
```
|
|
33
33
|
.agents/
|
|
34
|
+
├── config # sync targets (claude, windsurf, cursor, copilot)
|
|
34
35
|
├── rules/
|
|
35
36
|
│ ├── rule1.md
|
|
36
37
|
│ ├── rule2.md
|
|
37
38
|
│ └── ...
|
|
38
39
|
├── skills/
|
|
39
|
-
│ ├── skill1
|
|
40
|
-
│
|
|
40
|
+
│ ├── skill1/
|
|
41
|
+
│ │ └── SKILL.md
|
|
42
|
+
│ ├── skill2/
|
|
43
|
+
│ │ └── SKILL.md
|
|
41
44
|
│ └── ...
|
|
42
45
|
├── workflows/
|
|
43
46
|
│ ├── workflow1.md
|
|
@@ -46,6 +49,8 @@ chmod +x /usr/local/bin/sync-agents
|
|
|
46
49
|
└── STATE.md
|
|
47
50
|
```
|
|
48
51
|
|
|
52
|
+
> **Note:** Skills use a directory layout (`skills/name/SKILL.md`) rather than flat files. This allows skills to include supporting files alongside their definition. The `fix` command can convert legacy flat skill files to the directory layout automatically.
|
|
53
|
+
|
|
49
54
|
Running `sync-agents sync` creates symlinks from `.agents/` subdirectories into `.claude/`, `.windsurf/`, `.cursor/`, and `.github/copilot/`. Any changes to `.agents/` are automatically reflected in the target directories because they are symlinks, not copies.
|
|
50
55
|
|
|
51
56
|
AGENTS.md is also symlinked to CLAUDE.md so that Claude reads the index natively.
|
|
@@ -70,6 +75,7 @@ AGENTS.md is also symlinked to CLAUDE.md so that Claude reads the index natively
|
|
|
70
75
|
| `add <type> <name>` | Add a new rule, skill, or workflow from a template (type is `rule`, `skill`, or `workflow`) |
|
|
71
76
|
| `index` | Regenerate `AGENTS.md` by scanning the contents of `.agents/` |
|
|
72
77
|
| `clean` | Remove all synced symlinks and empty target directories (does not remove `.agents/`) |
|
|
78
|
+
| `fix [type]` | Migrate legacy dirs into `.agents/`, convert flat skill files to directory layout, and repair broken symlinks. Type: `skills`, `rules`, `workflows`, or `all` (default) |
|
|
73
79
|
|
|
74
80
|
## Options
|
|
75
81
|
|
|
@@ -81,6 +87,47 @@ AGENTS.md is also symlinked to CLAUDE.md so that Claude reads the index natively
|
|
|
81
87
|
| `--targets <list>` | Comma-separated list of sync targets (default: `claude,windsurf,cursor,copilot`) |
|
|
82
88
|
| `--dry-run` | Show what would be done without making changes |
|
|
83
89
|
| `--force` | Overwrite existing files and symlinks |
|
|
90
|
+
| `--no-clobber` | (fix only) Skip items that already exist in `.agents/` instead of merging |
|
|
91
|
+
|
|
92
|
+
## Configuration
|
|
93
|
+
|
|
94
|
+
`sync-agents init` creates `.agents/config` with default sync targets:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
# sync-agents configuration
|
|
98
|
+
# Comma-separated list of sync targets (available: claude, windsurf, cursor, copilot)
|
|
99
|
+
targets = claude,windsurf,cursor,copilot
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Edit this file to limit which targets `sync` writes to by default. The `--targets` flag on any command overrides the config.
|
|
103
|
+
|
|
104
|
+
## Fix
|
|
105
|
+
|
|
106
|
+
The `fix` command handles three scenarios:
|
|
107
|
+
|
|
108
|
+
1. **Legacy directory migration** — Moves top-level `skills/`, `rules/`, or `workflows/` directories into `.agents/` and replaces them with symlinks.
|
|
109
|
+
2. **Flat skill conversion** — Converts `.agents/skills/name.md` flat files to the directory layout `.agents/skills/name/SKILL.md`.
|
|
110
|
+
3. **Symlink repair** — Recreates missing or broken symlinks in target directories (`.claude/`, `.windsurf/`, etc.) and the `CLAUDE.md` symlink.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Fix everything (all types)
|
|
114
|
+
sync-agents fix
|
|
115
|
+
|
|
116
|
+
# Fix only skills
|
|
117
|
+
sync-agents fix skills
|
|
118
|
+
|
|
119
|
+
# Preview without changing anything
|
|
120
|
+
sync-agents fix --dry-run
|
|
121
|
+
|
|
122
|
+
# Don't overwrite items already in .agents/
|
|
123
|
+
sync-agents fix --no-clobber skills
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A reproducible demo is available in [`examples/fix/`](examples/fix/):
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
bash examples/fix/run-demo.sh
|
|
130
|
+
```
|
|
84
131
|
|
|
85
132
|
## Inheritance
|
|
86
133
|
|
|
@@ -262,6 +309,12 @@ sync-agents index
|
|
|
262
309
|
# Remove all synced symlinks
|
|
263
310
|
sync-agents clean
|
|
264
311
|
|
|
312
|
+
# Fix legacy layouts and broken symlinks
|
|
313
|
+
sync-agents fix
|
|
314
|
+
|
|
315
|
+
# Fix only skills (migrate + convert flat files + repair symlinks)
|
|
316
|
+
sync-agents fix skills
|
|
317
|
+
|
|
265
318
|
# Work in a different directory
|
|
266
319
|
sync-agents sync --dir /path/to/project
|
|
267
320
|
```
|
package/package.json
CHANGED
package/src/sh/sync-agents.sh
CHANGED
|
@@ -81,6 +81,7 @@ ${BOLD}COMMANDS${RESET}
|
|
|
81
81
|
inherit <label> <path> Add an inheritance link to AGENTS.md (convention-based)
|
|
82
82
|
inherit --list List current inheritance links
|
|
83
83
|
inherit --remove <label> Remove an inheritance link by label
|
|
84
|
+
version Show version (same as --version)
|
|
84
85
|
|
|
85
86
|
${BOLD}OPTIONS${RESET}
|
|
86
87
|
-h, --help Show this help message
|
|
@@ -1462,6 +1463,10 @@ main() {
|
|
|
1462
1463
|
inherit)
|
|
1463
1464
|
cmd_inherit "$@"
|
|
1464
1465
|
;;
|
|
1466
|
+
version)
|
|
1467
|
+
echo "sync-agents v${VERSION}"
|
|
1468
|
+
exit 0
|
|
1469
|
+
;;
|
|
1465
1470
|
"")
|
|
1466
1471
|
usage
|
|
1467
1472
|
exit 0
|