repo-nexus 0.6.4 → 0.6.5
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/CHANGELOG.md +6 -0
- package/lib/ai.sh +128 -1
- package/lib/commands/fix.sh +6 -6
- package/lib/commands/plugin.sh +7 -20
- package/lib/commands/status.sh +2 -2
- package/lib/hooks.sh +12 -12
- package/lib/plugins.sh +16 -0
- package/lib/repos.sh +16 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
|
+
- **Dynamic AI Instructions & Complete Plugin Deactivation in `rnex fix`**:
|
|
12
|
+
- [`get_rnex_instructions()`](file:///Users/admin/Projects/ai/repo-nexus/lib/ai.sh) dynamically evaluates whether `karpathy-llm` is enabled. When disabled or omitted from configuration, the Karpathy LLM Wiki mandatory gate alert, wiki orientation startup step, forbidden wiki actions, and wiki subagent references are omitted from [`AGENTS.md`](file:///Users/admin/Projects/ai/repo-nexus/AGENTS.md) and native provider instructions.
|
|
13
|
+
- `sync_plugins` automatically prunes scoped directories (`.rnex/plugins/<plugin>/`) from both the workspace root and member repositories whenever a plugin is marked `enabled: false` or omitted from config.
|
|
14
|
+
- Provider prompt mirrors across all supported assistants (`.github/prompts`, `.claude/commands`, `.claude/prompts`, `.gemini/prompts`, `.cursor/prompts`, `.windsurf/prompts`) are cleaned of prompts and workflows belonging to disabled plugins, while preserving base prompts and active plugin prompts.
|
|
15
|
+
- Hook dispatchers and `status` reports evaluate active enablement (`yaml_plugin_enabled`) rather than key presence, preventing disabled plugins from registering hook alerts or status indicators.
|
|
16
|
+
- User-authored content in wiki and intake directories is strictly preserved during plugin deactivation.
|
|
11
17
|
- **Universal `AGENTS.md` & Native Provider Instructions Architecture**:
|
|
12
18
|
- Maintained [`AGENTS.md`](file:///Users/admin/Projects/ai/repo-nexus/AGENTS.md) at the workspace root as the universal, cross-tool standard for workspace routing instructions.
|
|
13
19
|
- Assistants that read `AGENTS.md` unconditionally (such as GitHub Copilot) rely directly on `AGENTS.md`, eliminating redundant instruction files (`.github/copilot-instructions.md`) and diverging contexts.
|
package/lib/ai.sh
CHANGED
|
@@ -61,7 +61,9 @@ AI_MARKER_END="<!-- REPO-NEXUS:END -->"
|
|
|
61
61
|
|
|
62
62
|
get_rnex_instructions() {
|
|
63
63
|
_wiki_dir="$(karpathy_wiki_dir)"
|
|
64
|
-
|
|
64
|
+
|
|
65
|
+
if yaml_plugin_enabled "karpathy-llm"; then
|
|
66
|
+
cat <<AGENTS_EOF
|
|
65
67
|
# Multi-Repo AI Workspace Context
|
|
66
68
|
|
|
67
69
|
This workspace operates as a **Repo Nexus Virtual Meta-Repo** uniting independent repositories.
|
|
@@ -119,6 +121,55 @@ When workspace configuration, routing blocks, plugin assets, or member repositor
|
|
|
119
121
|
## Git Operations
|
|
120
122
|
Commit and push changes directly within the respective member repository root (\`repos/<name>/\`).
|
|
121
123
|
AGENTS_EOF
|
|
124
|
+
else
|
|
125
|
+
cat <<AGENTS_EOF
|
|
126
|
+
# Multi-Repo AI Workspace Context
|
|
127
|
+
|
|
128
|
+
This workspace operates as a **Repo Nexus Virtual Meta-Repo** uniting independent repositories.
|
|
129
|
+
|
|
130
|
+
## Routing Protocol for AI Assistants
|
|
131
|
+
|
|
132
|
+
### Mandatory Session Startup
|
|
133
|
+
|
|
134
|
+
Before answering the first task or making any task-specific tool call in a new session, execute these steps in strict sequence:
|
|
135
|
+
|
|
136
|
+
1. **Read Configuration First (Highest Priority)**: Inspect and read \`.local.rnex.yaml\` (if present) and \`rnex.yaml\` to identify workspace structure (\`repos_dir\`), active member repositories (\`repos/\`), and enabled plugins.
|
|
137
|
+
- \`.local.rnex.yaml\` takes highest priority over \`rnex.yaml\`.
|
|
138
|
+
- Repositories are enabled by default unless explicitly marked \`enabled: false\`. Disabled repositories are excluded from active tasks.
|
|
139
|
+
2. **Plugin Instructions**: Inspect instructions for every enabled Repo Nexus plugin under \`.rnex/plugins/<plugin-name>/\`.
|
|
140
|
+
3. **Targeted Member Repository Access Only**:
|
|
141
|
+
- Navigate directly to the specific files in \`repos/<name>/\` relevant to the user request.
|
|
142
|
+
- Never perform blind repository-wide scans or unbounded searches across \`repos/\`.
|
|
143
|
+
|
|
144
|
+
This is a hard gate, not optional orientation. Complete it once per session and retain the resulting context; do not repeatedly reload these files.
|
|
145
|
+
|
|
146
|
+
### Forbidden Startup Actions
|
|
147
|
+
- ❌ **DO NOT** grep or search \`repos/\` as your first step.
|
|
148
|
+
- ❌ **DO NOT** perform recursive tree exploration of member repositories.
|
|
149
|
+
|
|
150
|
+
## Workspace Skills, Workflows & Rules
|
|
151
|
+
Tools and agents operate on skills, workflows, instructions, and rules located under \`.rnex/\`:
|
|
152
|
+
- **Skills**: Inspect \`.rnex/skills/\` and active plugin skills under \`.rnex/plugins/<plugin-name>/skills/\`.
|
|
153
|
+
- **Workflows**: Inspect \`.rnex/workflows/\` and active plugin workflows under \`.rnex/plugins/<plugin-name>/workflows/\`.
|
|
154
|
+
- **Rules & Instructions**: Inspect \`.rnex/rules/\`, \`.rnex/instructions/\`, and active plugin rules/instructions under \`.rnex/plugins/<plugin-name>/\`.
|
|
155
|
+
|
|
156
|
+
## Subagents
|
|
157
|
+
Autonomous subagents are defined under \`.rnex/agents/\` and active plugin agents under \`.rnex/plugins/<plugin-name>/agents/\`.
|
|
158
|
+
- Subagents are kept in \`.rnex/\` and are not mirrored to external provider folders.
|
|
159
|
+
- To execute a task requiring a subagent, adopt the role, operational persona, and constraints specified in the corresponding subagent definition file.
|
|
160
|
+
|
|
161
|
+
## Member Repositories (\`repos/<name>/\`)
|
|
162
|
+
Each member repository is an autonomous Git repository. For repository-specific instructions, inspect \`repos/<name>/.rnex/\`. Inspect only targeted files required for the task.
|
|
163
|
+
|
|
164
|
+
## Workspace Maintenance
|
|
165
|
+
When workspace configuration, routing blocks, plugin assets, or member repository structures require reconciliation or schema upgrades:
|
|
166
|
+
- Run \`rnex fix\` (or its alias \`rnex update\` / \`rnex upgrade\`, which runs the unified fix reconciliation with upfront version checking).
|
|
167
|
+
- Use \`rnex fix -y\` to non-destructively apply configuration version upgrades automatically.
|
|
168
|
+
|
|
169
|
+
## Git Operations
|
|
170
|
+
Commit and push changes directly within the respective member repository root (\`repos/<name>/\`).
|
|
171
|
+
AGENTS_EOF
|
|
172
|
+
fi
|
|
122
173
|
}
|
|
123
174
|
|
|
124
175
|
merge_rnex_instructions() {
|
|
@@ -344,11 +395,18 @@ sync_rnex_base_assets() {
|
|
|
344
395
|
cp -f "$_sk_dir"/* "$NEXUS_DIR/.rnex/skills/$_sk_name/" 2>/dev/null || true
|
|
345
396
|
done
|
|
346
397
|
fi
|
|
398
|
+
|
|
399
|
+
# Purge any legacy plugin assets that shouldn't be in base .rnex/
|
|
400
|
+
rm -rf "$NEXUS_DIR/.rnex/skills/rnex-setup-karpathy-wiki" "$NEXUS_DIR/.rnex/skills/setup-karpathy-wiki" 2>/dev/null || true
|
|
401
|
+
rm -rf "$NEXUS_DIR/.rnex/skills/rnex-wiki-ingest" "$NEXUS_DIR/.rnex/skills/rnex-wiki-lint" "$NEXUS_DIR/.rnex/skills/wiki-curator" 2>/dev/null || true
|
|
402
|
+
rm -f "$NEXUS_DIR/.rnex/workflows/rnex-wiki-ingest.md" "$NEXUS_DIR/.rnex/workflows/rnex-wiki-lint.md" "$NEXUS_DIR/.rnex/workflows/wiki-ingest.md" "$NEXUS_DIR/.rnex/workflows/wiki-lint.md" 2>/dev/null || true
|
|
403
|
+
rm -f "$NEXUS_DIR/.rnex/agents/rnex-wiki-curator.agent.md" "$NEXUS_DIR/.rnex/agents/wiki-curator.agent.md" 2>/dev/null || true
|
|
347
404
|
}
|
|
348
405
|
|
|
349
406
|
sync_prompts() {
|
|
350
407
|
sync_rnex_base_assets
|
|
351
408
|
sync_ai_providers
|
|
409
|
+
clean_disabled_plugins_prompts_all_providers
|
|
352
410
|
}
|
|
353
411
|
|
|
354
412
|
sync_provider_prompts() {
|
|
@@ -380,6 +438,28 @@ sync_provider_prompts() {
|
|
|
380
438
|
rm -f "$_sp_dir/rnex-setup-karpathy-wiki${_ext}" "$_sp_dir/setup-karpathy-wiki${_ext}" 2>/dev/null || true
|
|
381
439
|
rm -f "$_sp_dir/wiki-ingest${_ext}" "$_sp_dir/wiki-lint${_ext}" 2>/dev/null || true
|
|
382
440
|
|
|
441
|
+
# Remove prompts belonging to disabled plugins from this provider directory
|
|
442
|
+
for _parent in "$SCRIPT_LOCATION/toolkit/plugins" "$(dirname "$SCRIPT_LOCATION")/toolkit/plugins" "$NEXUS_DIR/toolkit/plugins" "$NEXUS_DIR/.rnex/plugins"; do
|
|
443
|
+
[ -d "$_parent" ] || continue
|
|
444
|
+
for _pdir in "$_parent"/*; do
|
|
445
|
+
[ -d "$_pdir" ] || continue
|
|
446
|
+
_pname="$(basename "$_pdir")"
|
|
447
|
+
if ! yaml_plugin_enabled "$_pname"; then
|
|
448
|
+
for _sub in prompts workflows; do
|
|
449
|
+
[ -d "$_pdir/$_sub" ] || continue
|
|
450
|
+
for _pfile in "$_pdir/$_sub"/*.md; do
|
|
451
|
+
[ -f "$_pfile" ] || continue
|
|
452
|
+
_base="$(basename "$_pfile" .md)"
|
|
453
|
+
case "$_base" in
|
|
454
|
+
index|README) continue ;;
|
|
455
|
+
esac
|
|
456
|
+
rm -f "$_sp_dir/${_base}${_ext}" 2>/dev/null || true
|
|
457
|
+
done
|
|
458
|
+
done
|
|
459
|
+
fi
|
|
460
|
+
done
|
|
461
|
+
done
|
|
462
|
+
|
|
383
463
|
# Base toolkit prompts (from prompts or workflows)
|
|
384
464
|
if [ -n "$_src_prompts" ]; then
|
|
385
465
|
for _pfile in "$_src_prompts"/rnex-*.md; do
|
|
@@ -451,6 +531,53 @@ sync_provider_prompts() {
|
|
|
451
531
|
done
|
|
452
532
|
}
|
|
453
533
|
|
|
534
|
+
clean_plugin_prompts_across_providers() {
|
|
535
|
+
_pdir="$1"
|
|
536
|
+
[ -d "$_pdir" ] || return 0
|
|
537
|
+
|
|
538
|
+
for _sub in prompts workflows; do
|
|
539
|
+
[ -d "$_pdir/$_sub" ] || continue
|
|
540
|
+
for _pfile in "$_pdir/$_sub"/*.md; do
|
|
541
|
+
[ -f "$_pfile" ] || continue
|
|
542
|
+
_base="$(basename "$_pfile" .md)"
|
|
543
|
+
case "$_base" in
|
|
544
|
+
index|README) continue ;;
|
|
545
|
+
esac
|
|
546
|
+
rm -f "$NEXUS_DIR/.github/prompts/${_base}.prompt.md" 2>/dev/null || true
|
|
547
|
+
rm -f "$NEXUS_DIR/.claude/commands/${_base}.md" 2>/dev/null || true
|
|
548
|
+
rm -f "$NEXUS_DIR/.claude/prompts/${_base}.md" 2>/dev/null || true
|
|
549
|
+
rm -f "$NEXUS_DIR/.gemini/prompts/${_base}.prompt.md" 2>/dev/null || true
|
|
550
|
+
rm -f "$NEXUS_DIR/.cursor/prompts/${_base}.md" 2>/dev/null || true
|
|
551
|
+
rm -f "$NEXUS_DIR/.windsurf/prompts/${_base}.md" 2>/dev/null || true
|
|
552
|
+
done
|
|
553
|
+
done
|
|
554
|
+
|
|
555
|
+
rmdir "$NEXUS_DIR/.github/prompts" 2>/dev/null || true
|
|
556
|
+
rmdir "$NEXUS_DIR/.claude/commands" 2>/dev/null || true
|
|
557
|
+
rmdir "$NEXUS_DIR/.claude/prompts" 2>/dev/null || true
|
|
558
|
+
rmdir "$NEXUS_DIR/.gemini/prompts" 2>/dev/null || true
|
|
559
|
+
rmdir "$NEXUS_DIR/.cursor/prompts" 2>/dev/null || true
|
|
560
|
+
rmdir "$NEXUS_DIR/.windsurf/prompts" 2>/dev/null || true
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
clean_disabled_plugins_prompts_all_providers() {
|
|
564
|
+
_seen_plugins=" "
|
|
565
|
+
for _parent in "$SCRIPT_LOCATION/toolkit/plugins" "$(dirname "$SCRIPT_LOCATION")/toolkit/plugins" "$NEXUS_DIR/toolkit/plugins" "$NEXUS_DIR/.rnex/plugins"; do
|
|
566
|
+
[ -d "$_parent" ] || continue
|
|
567
|
+
for _pdir in "$_parent"/*; do
|
|
568
|
+
[ -d "$_pdir" ] || continue
|
|
569
|
+
_pname="$(basename "$_pdir")"
|
|
570
|
+
case "$_seen_plugins" in
|
|
571
|
+
*" $_pname "*) continue ;;
|
|
572
|
+
esac
|
|
573
|
+
_seen_plugins="${_seen_plugins}${_pname} "
|
|
574
|
+
if ! yaml_plugin_enabled "$_pname"; then
|
|
575
|
+
clean_plugin_prompts_across_providers "$_pdir"
|
|
576
|
+
fi
|
|
577
|
+
done
|
|
578
|
+
done
|
|
579
|
+
}
|
|
580
|
+
|
|
454
581
|
clean_provider_prompts() {
|
|
455
582
|
_sp_dir="$1"
|
|
456
583
|
_ext="${2:-.md}"
|
package/lib/commands/fix.sh
CHANGED
|
@@ -40,13 +40,16 @@ cmd_fix() {
|
|
|
40
40
|
# 1. Ensure .gitignore ignores repos/, .rnex/, and local configs, and strips legacy counters
|
|
41
41
|
reconcile_gitignore "$NEXUS_DIR"
|
|
42
42
|
|
|
43
|
-
# 2. Reconcile
|
|
43
|
+
# 2. Reconcile plugins (scopes, asset pruning for disabled plugins)
|
|
44
|
+
sync_plugins
|
|
45
|
+
|
|
46
|
+
# 3. Reconcile universal workspace instructions in AGENTS.md
|
|
44
47
|
merge_rnex_instructions "$NEXUS_DIR/AGENTS.md"
|
|
45
48
|
|
|
46
|
-
#
|
|
49
|
+
# 4. Sync standard skills, workflows, and provider prompts
|
|
47
50
|
sync_prompts
|
|
48
51
|
|
|
49
|
-
#
|
|
52
|
+
# 5. Reconcile Git hooks according to configuration
|
|
50
53
|
case "$GIT_HOOKS_CONFIG" in
|
|
51
54
|
false|no|0)
|
|
52
55
|
_cur_hp="$(git -C "$NEXUS_DIR" config --get core.hooksPath 2>/dev/null || true)"
|
|
@@ -82,9 +85,6 @@ cmd_fix() {
|
|
|
82
85
|
;;
|
|
83
86
|
esac
|
|
84
87
|
|
|
85
|
-
# 5. Reconcile plugins
|
|
86
|
-
sync_plugins
|
|
87
|
-
|
|
88
88
|
# 6. Reconcile member repos
|
|
89
89
|
yaml_list_repos | while read -r _name; do
|
|
90
90
|
[ -n "$_name" ] || continue
|
package/lib/commands/plugin.sh
CHANGED
|
@@ -17,9 +17,12 @@ cmd_plugin_list() {
|
|
|
17
17
|
_version="$(plugin_get_field "$_pdir" "version")"
|
|
18
18
|
_desc="$(plugin_get_field "$_pdir" "description")"
|
|
19
19
|
|
|
20
|
-
if
|
|
20
|
+
if yaml_plugin_enabled "$_name"; then
|
|
21
21
|
printf ' %b[enabled]%b %b%-15s%b %b(v%s)%b - %s\n' \
|
|
22
22
|
"$_G" "$_NC" "$_BOLD" "$_name" "$_NC" "$_DIM" "${_version:-0.1.0}" "$_NC" "$_desc"
|
|
23
|
+
elif yaml_has_plugin "$_name"; then
|
|
24
|
+
printf ' %b[disabled]%b %b%-15s%b %b(v%s)%b - %s\n' \
|
|
25
|
+
"$_Y" "$_NC" "$_BOLD" "$_name" "$_NC" "$_DIM" "${_version:-0.1.0}" "$_NC" "$_desc"
|
|
23
26
|
else
|
|
24
27
|
printf ' %b[available]%b %b%-15s%b %b(v%s)%b - %s\n' \
|
|
25
28
|
"$_DIM" "$_NC" "$_BOLD" "$_name" "$_NC" "$_DIM" "${_version:-0.1.0}" "$_NC" "$_desc"
|
|
@@ -50,7 +53,7 @@ cmd_plugin_info() {
|
|
|
50
53
|
if yaml_plugin_enabled "$_name"; then
|
|
51
54
|
_status="${_G}enabled${_NC}"
|
|
52
55
|
elif yaml_has_plugin "$_name"; then
|
|
53
|
-
_status="${_DIM}disabled
|
|
56
|
+
_status="${_DIM}disabled in configuration${_NC}"
|
|
54
57
|
else
|
|
55
58
|
_status="${_DIM}available (not enabled)${_NC}"
|
|
56
59
|
fi
|
|
@@ -179,24 +182,8 @@ cmd_plugin_disable() {
|
|
|
179
182
|
log_ok "Plugin '$_name' disabled from workspace"
|
|
180
183
|
fi
|
|
181
184
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
rm -rf "$NEXUS_DIR/.rnex/plugins/$_name"
|
|
185
|
-
log_ok "Removed workspace plugin scope: .rnex/plugins/$_name"
|
|
186
|
-
fi
|
|
187
|
-
|
|
188
|
-
yaml_list_repos | while read -r _rname; do
|
|
189
|
-
_rpath="$(resolve_repo_path "$_rname")"
|
|
190
|
-
if [ -d "$_rpath/.rnex/plugins/$_name" ]; then
|
|
191
|
-
rm -rf "$_rpath/.rnex/plugins/$_name"
|
|
192
|
-
fi
|
|
193
|
-
done
|
|
194
|
-
fi
|
|
195
|
-
|
|
196
|
-
sync_prompts
|
|
197
|
-
if [ ! -f "$NEXUS_DIR/AGENTS.md" ]; then
|
|
198
|
-
merge_rnex_instructions "$NEXUS_DIR/AGENTS.md"
|
|
199
|
-
fi
|
|
185
|
+
sync_plugins
|
|
186
|
+
cmd_fix -q
|
|
200
187
|
log_ok "Plugin '$_name' disabled from workspace"
|
|
201
188
|
}
|
|
202
189
|
|
package/lib/commands/status.sh
CHANGED
|
@@ -64,7 +64,7 @@ cmd_status() {
|
|
|
64
64
|
true|yes|1)
|
|
65
65
|
if [ "$_gh_active" -eq 1 ]; then
|
|
66
66
|
_active_trigger=""
|
|
67
|
-
if
|
|
67
|
+
if yaml_plugin_enabled "karpathy-llm"; then
|
|
68
68
|
_active_trigger="$(yaml_plugin_get "karpathy-llm" "lint_trigger")"
|
|
69
69
|
fi
|
|
70
70
|
if [ -n "$_active_trigger" ]; then
|
|
@@ -79,7 +79,7 @@ cmd_status() {
|
|
|
79
79
|
*)
|
|
80
80
|
if [ "$_gh_active" -eq 1 ]; then
|
|
81
81
|
_active_trigger=""
|
|
82
|
-
if
|
|
82
|
+
if yaml_plugin_enabled "karpathy-llm"; then
|
|
83
83
|
_active_trigger="$(yaml_plugin_get "karpathy-llm" "lint_trigger")"
|
|
84
84
|
fi
|
|
85
85
|
if [ -n "$_active_trigger" ]; then
|
package/lib/hooks.sh
CHANGED
|
@@ -138,16 +138,16 @@ cmd_hooks() {
|
|
|
138
138
|
done
|
|
139
139
|
|
|
140
140
|
_active_trigger=""
|
|
141
|
-
if
|
|
141
|
+
if yaml_plugin_enabled "karpathy-llm"; then
|
|
142
142
|
_active_trigger="$(yaml_plugin_get "karpathy-llm" "lint_trigger")"
|
|
143
|
+
printf '\n%bActive Plugin Triggers:%b\n' "$_BOLD" "$_NC"
|
|
144
|
+
if [ -n "$_active_trigger" ]; then
|
|
145
|
+
printf ' %b●%b karpathy-llm: %s\n' "$_G" "$_NC" "$_active_trigger"
|
|
146
|
+
else
|
|
147
|
+
printf ' %b○%b karpathy-llm: (manual only / no trigger set in rnex.yaml)\n' "$_DIM" "$_NC"
|
|
148
|
+
fi
|
|
149
|
+
printf '\n'
|
|
143
150
|
fi
|
|
144
|
-
printf '\n%bActive Plugin Triggers:%b\n' "$_BOLD" "$_NC"
|
|
145
|
-
if [ -n "$_active_trigger" ]; then
|
|
146
|
-
printf ' %b●%b karpathy-llm: %s\n' "$_G" "$_NC" "$_active_trigger"
|
|
147
|
-
else
|
|
148
|
-
printf ' %b○%b karpathy-llm: (manual only / no trigger set in rnex.yaml)\n' "$_DIM" "$_NC"
|
|
149
|
-
fi
|
|
150
|
-
printf '\n'
|
|
151
151
|
;;
|
|
152
152
|
run)
|
|
153
153
|
shift
|
|
@@ -158,7 +158,7 @@ cmd_hooks() {
|
|
|
158
158
|
case "$_hook_name" in
|
|
159
159
|
post-merge)
|
|
160
160
|
cmd_fix -y --quiet || true
|
|
161
|
-
if
|
|
161
|
+
if yaml_plugin_enabled "karpathy-llm"; then
|
|
162
162
|
_trigger="$(yaml_plugin_get "karpathy-llm" "lint_trigger")"
|
|
163
163
|
if [ "$_trigger" = "git-post-merge" ] || [ "$_trigger" = "post-merge" ]; then
|
|
164
164
|
_wiki_dir="$(karpathy_wiki_dir)"
|
|
@@ -175,7 +175,7 @@ cmd_hooks() {
|
|
|
175
175
|
return 0
|
|
176
176
|
;;
|
|
177
177
|
post-commit)
|
|
178
|
-
if
|
|
178
|
+
if yaml_plugin_enabled "karpathy-llm"; then
|
|
179
179
|
_trigger="$(yaml_plugin_get "karpathy-llm" "lint_trigger")"
|
|
180
180
|
if [ "$_trigger" = "git-post-commit" ] || [ "$_trigger" = "post-commit" ]; then
|
|
181
181
|
_wiki_dir="$(karpathy_wiki_dir)"
|
|
@@ -193,7 +193,7 @@ cmd_hooks() {
|
|
|
193
193
|
return 0
|
|
194
194
|
;;
|
|
195
195
|
pre-commit)
|
|
196
|
-
if
|
|
196
|
+
if yaml_plugin_enabled "karpathy-llm"; then
|
|
197
197
|
_trigger="$(yaml_plugin_get "karpathy-llm" "lint_trigger")"
|
|
198
198
|
if [ "$_trigger" = "git-pre-commit" ] || [ "$_trigger" = "pre-commit" ]; then
|
|
199
199
|
_wiki_dir="$(karpathy_wiki_dir)"
|
|
@@ -211,7 +211,7 @@ cmd_hooks() {
|
|
|
211
211
|
return 0
|
|
212
212
|
;;
|
|
213
213
|
pre-push)
|
|
214
|
-
if
|
|
214
|
+
if yaml_plugin_enabled "karpathy-llm"; then
|
|
215
215
|
_trigger="$(yaml_plugin_get "karpathy-llm" "lint_trigger")"
|
|
216
216
|
if [ "$_trigger" = "git-pre-push" ] || [ "$_trigger" = "pre-push" ]; then
|
|
217
217
|
_wiki_dir="$(karpathy_wiki_dir)"
|
package/lib/plugins.sh
CHANGED
|
@@ -115,8 +115,24 @@ sync_plugins() {
|
|
|
115
115
|
_wiki_dir="$(karpathy_wiki_dir)"
|
|
116
116
|
_raw_dir="$(karpathy_raw_dir)"
|
|
117
117
|
|
|
118
|
+
# 1. Prune plugins that are disabled or no longer enabled in config
|
|
119
|
+
if [ -d "$NEXUS_DIR/.rnex/plugins" ]; then
|
|
120
|
+
for _existing in "$NEXUS_DIR/.rnex/plugins"/*; do
|
|
121
|
+
[ -d "$_existing" ] || continue
|
|
122
|
+
_pname="$(basename "$_existing")"
|
|
123
|
+
if ! yaml_plugin_enabled "$_pname"; then
|
|
124
|
+
clean_plugin_prompts_across_providers "$_existing"
|
|
125
|
+
rm -rf "$_existing"
|
|
126
|
+
log_ok "Removed disabled plugin scope: .rnex/plugins/$_pname"
|
|
127
|
+
fi
|
|
128
|
+
done
|
|
129
|
+
rmdir "$NEXUS_DIR/.rnex/plugins" 2>/dev/null || true
|
|
130
|
+
fi
|
|
131
|
+
|
|
132
|
+
# 2. Sync enabled plugins
|
|
118
133
|
yaml_list_plugins | while read -r _pname; do
|
|
119
134
|
[ -n "$_pname" ] || continue
|
|
135
|
+
yaml_plugin_enabled "$_pname" || continue
|
|
120
136
|
_pdir="$(find_plugin_dir "$_pname" 2>/dev/null || true)"
|
|
121
137
|
if [ -z "$_pdir" ]; then
|
|
122
138
|
log_warn "Plugin '$_pname' declared in config but not found on disk"
|
package/lib/repos.sh
CHANGED
|
@@ -86,17 +86,31 @@ EOF
|
|
|
86
86
|
log_ok "Initialized .rnex in $(basename "$_repo_path")"
|
|
87
87
|
fi
|
|
88
88
|
|
|
89
|
+
# Prune disabled plugins from member repo
|
|
90
|
+
if [ -d "$_r_rnex/plugins" ]; then
|
|
91
|
+
for _existing in "$_r_rnex/plugins"/*; do
|
|
92
|
+
[ -d "$_existing" ] || continue
|
|
93
|
+
_pname="$(basename "$_existing")"
|
|
94
|
+
if ! yaml_plugin_enabled "$_pname"; then
|
|
95
|
+
rm -rf "$_existing"
|
|
96
|
+
fi
|
|
97
|
+
done
|
|
98
|
+
rmdir "$_r_rnex/plugins" 2>/dev/null || true
|
|
99
|
+
fi
|
|
100
|
+
|
|
89
101
|
# Sync scoped active plugins into member repo under .rnex/plugins/<plugin-name>/
|
|
90
102
|
yaml_list_plugins | while read -r _pname; do
|
|
91
103
|
[ -n "$_pname" ] || continue
|
|
104
|
+
yaml_plugin_enabled "$_pname" || continue
|
|
92
105
|
_pdir="$(find_plugin_dir "$_pname" 2>/dev/null || true)"
|
|
93
106
|
[ -n "$_pdir" ] || continue
|
|
94
107
|
|
|
95
108
|
_dest_pdir="$_r_rnex/plugins/$_pname"
|
|
96
109
|
mkdir -p "$_dest_pdir"
|
|
97
110
|
|
|
98
|
-
# Deterministically sync plugin asset directories into member repo
|
|
99
|
-
|
|
111
|
+
# Deterministically sync plugin asset directories into member repo (no prompts in plugins)
|
|
112
|
+
rm -rf "${_dest_pdir:?}/prompts" 2>/dev/null || true
|
|
113
|
+
for _sub in rules workflows instructions skills agents templates; do
|
|
100
114
|
if [ -d "$_pdir/$_sub" ]; then
|
|
101
115
|
rm -rf "${_dest_pdir:?}/$_sub"
|
|
102
116
|
mkdir -p "$_dest_pdir/$_sub"
|
package/package.json
CHANGED