@brickhouse-tech/sync-agents 0.1.0 → 0.1.3
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/package.json +10 -7
- package/src/sh/sync-agents.sh +58 -50
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brickhouse-tech/sync-agents",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Simple scripts to DRY up common agent interactions across multiple LLM providers.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
6
|
+
"agents",
|
|
7
|
+
"claude",
|
|
8
|
+
"sync",
|
|
9
|
+
"codex",
|
|
10
|
+
"gpt",
|
|
11
|
+
"windsurf"
|
|
9
12
|
],
|
|
10
13
|
"homepage": "https://github.com/brickhouse-tech/sync-agents#readme",
|
|
11
14
|
"bugs": {
|
|
@@ -23,14 +26,14 @@
|
|
|
23
26
|
"src/**/*"
|
|
24
27
|
],
|
|
25
28
|
"scripts": {
|
|
29
|
+
"lint": "shellcheck src/sh/*.sh",
|
|
26
30
|
"test": "npx bats test/"
|
|
27
31
|
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
},
|
|
30
32
|
"devDependencies": {
|
|
31
33
|
"@commitlint/cli": "^20",
|
|
32
34
|
"@commitlint/config-conventional": "^20",
|
|
33
35
|
"commitlint": "20",
|
|
36
|
+
"shellcheck": "^4.1.0",
|
|
34
37
|
"sort-package-json": "3.6"
|
|
35
38
|
}
|
|
36
39
|
}
|
package/src/sh/sync-agents.sh
CHANGED
|
@@ -8,8 +8,12 @@ PACKAGE_JSON="${SCRIPT_DIR}/../../package.json"
|
|
|
8
8
|
TEMPLATES_DIR="${SCRIPT_DIR}/../md"
|
|
9
9
|
|
|
10
10
|
# Pull version from package.json
|
|
11
|
+
# Try relative path first (works in repo / npm local install),
|
|
12
|
+
# then resolve via node for global installs where the symlink target differs.
|
|
11
13
|
if [[ -f "$PACKAGE_JSON" ]]; then
|
|
12
14
|
VERSION="$(sed -n 's/.*"version": *"\([^"]*\)".*/\1/p' "$PACKAGE_JSON" | head -1)"
|
|
15
|
+
elif command -v node >/dev/null 2>&1; then
|
|
16
|
+
VERSION="$(node -p "require('@brickhouse-tech/sync-agents/package.json').version" 2>/dev/null || echo "unknown")"
|
|
13
17
|
else
|
|
14
18
|
VERSION="unknown"
|
|
15
19
|
fi
|
|
@@ -246,8 +250,10 @@ cmd_sync() {
|
|
|
246
250
|
# Sync subdirectories: rules, skills, workflows
|
|
247
251
|
for subdir in rules skills workflows; do
|
|
248
252
|
if [[ -d "$agents_abs/$subdir" ]]; then
|
|
249
|
-
|
|
250
|
-
|
|
253
|
+
# Both .agents/ and .<target>/ live at PROJECT_ROOT, so the relative
|
|
254
|
+
# path from .<target>/<subdir> back to .agents/<subdir> is always one
|
|
255
|
+
# level up: ../.agents/<subdir>
|
|
256
|
+
local source_rel="../$AGENTS_DIR/$subdir"
|
|
251
257
|
create_symlink "$source_rel" "$target_dir/$subdir" "$DRY_RUN"
|
|
252
258
|
fi
|
|
253
259
|
done
|
|
@@ -374,53 +380,55 @@ This file indexes all rules, skills, and workflows defined in `.agents/`.
|
|
|
374
380
|
|
|
375
381
|
HEADER
|
|
376
382
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
383
|
+
{
|
|
384
|
+
# Rules
|
|
385
|
+
echo "## Rules"
|
|
386
|
+
echo ""
|
|
387
|
+
if compgen -G "$agents_dir/rules/*.md" > /dev/null 2>&1; then
|
|
388
|
+
for f in "$agents_dir/rules/"*.md; do
|
|
389
|
+
local name
|
|
390
|
+
name="$(basename "$f" .md)"
|
|
391
|
+
echo "- [$name](.agents/rules/$name.md)"
|
|
392
|
+
done
|
|
393
|
+
else
|
|
394
|
+
echo "_No rules defined yet. Add one with \`sync-agents add rule <name>\`._"
|
|
395
|
+
fi
|
|
396
|
+
echo ""
|
|
397
|
+
|
|
398
|
+
# Skills
|
|
399
|
+
echo "## Skills"
|
|
400
|
+
echo ""
|
|
401
|
+
if compgen -G "$agents_dir/skills/*.md" > /dev/null 2>&1; then
|
|
402
|
+
for f in "$agents_dir/skills/"*.md; do
|
|
403
|
+
local name
|
|
404
|
+
name="$(basename "$f" .md)"
|
|
405
|
+
echo "- [$name](.agents/skills/$name.md)"
|
|
406
|
+
done
|
|
407
|
+
else
|
|
408
|
+
echo "_No skills defined yet. Add one with \`sync-agents add skill <name>\`._"
|
|
409
|
+
fi
|
|
410
|
+
echo ""
|
|
411
|
+
|
|
412
|
+
# Workflows
|
|
413
|
+
echo "## Workflows"
|
|
414
|
+
echo ""
|
|
415
|
+
if compgen -G "$agents_dir/workflows/*.md" > /dev/null 2>&1; then
|
|
416
|
+
for f in "$agents_dir/workflows/"*.md; do
|
|
417
|
+
local name
|
|
418
|
+
name="$(basename "$f" .md)"
|
|
419
|
+
echo "- [$name](.agents/workflows/$name.md)"
|
|
420
|
+
done
|
|
421
|
+
else
|
|
422
|
+
echo "_No workflows defined yet. Add one with \`sync-agents add workflow <name>\`._"
|
|
423
|
+
fi
|
|
424
|
+
echo ""
|
|
425
|
+
|
|
426
|
+
# State reference
|
|
427
|
+
echo "## State"
|
|
428
|
+
echo ""
|
|
429
|
+
echo "- [STATE.md](.agents/STATE.md)"
|
|
430
|
+
echo ""
|
|
431
|
+
} >> "$outfile"
|
|
424
432
|
}
|
|
425
433
|
|
|
426
434
|
# --------------------------------------------------------------------------
|
|
@@ -435,7 +443,7 @@ print_tree() {
|
|
|
435
443
|
# Collect entries
|
|
436
444
|
while IFS= read -r entry; do
|
|
437
445
|
entries+=("$entry")
|
|
438
|
-
done < <(
|
|
446
|
+
done < <(find "$dir" -maxdepth 1 -mindepth 1 -exec basename {} \; 2>/dev/null | sort)
|
|
439
447
|
|
|
440
448
|
local count=${#entries[@]}
|
|
441
449
|
if [[ $count -eq 0 ]]; then
|