repo-nexus 0.7.6 → 0.7.8
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 +13 -0
- package/docs/CLI.md +2 -2
- package/docs/plugins/claude.md +2 -2
- package/docs/plugins/copilot.md +47 -0
- package/docs/plugins/gemini.md +2 -2
- package/docs/plugins/index.md +1 -1
- package/lib/ai.sh +112 -14
- package/lib/commands/init.sh +6 -1
- package/lib/commands/status.sh +5 -2
- package/lib/hooks.sh +76 -4
- package/lib/yaml.sh +5 -5
- package/package.json +1 -1
- package/toolkit/plugins/copilot/README.md +31 -0
- package/toolkit/plugins/copilot/instructions/rnex-copilot-integration.md +24 -0
- package/toolkit/plugins/copilot/plugin.yaml +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ All notable changes to Repo Nexus (`rnex`) will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.7.7] - 2026-10-15
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Native `SKILL.md` Bundle Support for User Skills**:
|
|
12
|
+
- Upgraded User Skill generator (`rnex_register_user_skill`) to emit dual formats tailored to each AI provider's discovery engine:
|
|
13
|
+
- **Skill-Based Providers (`.github/skills/`, `.claude/skills/`, `.gemini/skills/`)**: Generates native `rnex-<name>/SKILL.md` directory bundles containing YAML frontmatter (`name: rnex-<name>`, `description: "..."`) for automatic discoverability in VS Code, Copilot Chat, Antigravity, and Claude Code skill-pickers.
|
|
14
|
+
- **Rule-Based Providers (`.cursor/rules/`, `.windsurf/rules/`)**: Generates flat `rnex-<name>.md` pointer files aligning with Cursor and Windsurf rule conventions.
|
|
15
|
+
- Automatically extracts skill descriptions from target markdown headers to populate YAML frontmatter cleanly.
|
|
16
|
+
- **GitHub Copilot Integration Plugin (`copilot`)**:
|
|
17
|
+
- Restored `copilot` as a first-class AI provider plugin in `toolkit/plugins/copilot/`.
|
|
18
|
+
- Supports `instructions: true` (managing `.github/copilot-instructions.md` within non-destructive delimiters) and `skills: true` (generating native User Skill bundles in `.github/skills/`).
|
|
19
|
+
- Added CLI flags `--copilot` and `--no-copilot` to `rnex init`.
|
|
20
|
+
|
|
8
21
|
## [0.7.5] - 2026-10-15
|
|
9
22
|
|
|
10
23
|
### Added
|
package/docs/CLI.md
CHANGED
|
@@ -87,8 +87,8 @@ Every lifecycle hook receives the following environment variables:
|
|
|
87
87
|
| `RNEX_QUIET` | Set to `1` when `--quiet` was passed, `0` otherwise. |
|
|
88
88
|
|
|
89
89
|
Hooks have access to POSIX helper functions for managing User Skill pointers:
|
|
90
|
-
- `rnex_register_user_skill <skill_name> <target_path_in_rnex>`: Generates a zero-logic user skill pointer (`rnex-<
|
|
91
|
-
- `rnex_unregister_user_skill <skill_name>`: Removes the `rnex-<skill_name
|
|
90
|
+
- `rnex_register_user_skill <skill_name> <target_path_in_rnex>`: Generates a zero-logic user skill pointer (either a native `rnex-<name>/SKILL.md` bundle with YAML frontmatter for skill-based providers, or a flat `rnex-<name>.md` file for rule-based providers) linking to the target skill protocol.
|
|
91
|
+
- `rnex_unregister_user_skill <skill_name>`: Removes the `rnex-<skill_name>` user skill pointer (bundle or flat file) from all active provider directories.
|
|
92
92
|
|
|
93
93
|
### Karpathy LLM Wiki Plugin
|
|
94
94
|
The `karpathy-llm` plugin uses lifecycle hooks to manage its domain directories:
|
package/docs/plugins/claude.md
CHANGED
|
@@ -15,8 +15,8 @@ Operational skills, rules, and subagents remain cleanly encapsulated within `.rn
|
|
|
15
15
|
|
|
16
16
|
## Capabilities
|
|
17
17
|
|
|
18
|
-
1. **Zero-Logic User Skills (`.claude/skills/rnex
|
|
19
|
-
- Generates
|
|
18
|
+
1. **Zero-Logic User Skills (`.claude/skills/rnex-*/SKILL.md`)**:
|
|
19
|
+
- Generates native `SKILL.md` bundles prefixed with `rnex-` in `.claude/skills/` with YAML frontmatter for Claude Code skill discovery.
|
|
20
20
|
- Contains zero inline heuristics—redirects Claude directly to the underlying agentic skill protocols inside `.rnex/`.
|
|
21
21
|
|
|
22
22
|
2. **Native Instruction Support via `CLAUDE.md` & `AGENTS.md`**:
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: GitHub Copilot Plugin
|
|
3
|
+
description: GitHub Copilot workspace routing instructions and user skill integration for Repo Nexus.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitHub Copilot Plugin (`copilot`)
|
|
7
|
+
|
|
8
|
+
The `copilot` plugin integrates GitHub Copilot with Repo Nexus by projecting workspace routing instructions into `.github/copilot-instructions.md` and user skills into `.github/skills/`.
|
|
9
|
+
|
|
10
|
+
## Architecture & Integration
|
|
11
|
+
|
|
12
|
+
GitHub Copilot operates natively within VS Code, Visual Studio, JetBrains, and GitHub.com:
|
|
13
|
+
- **Universal Routing (`AGENTS.md`)**: GitHub Copilot natively reads `AGENTS.md` at the workspace root.
|
|
14
|
+
- **Custom Instructions (`.github/copilot-instructions.md`)**: When `instructions: true`, Repo Nexus injects its non-destructive routing block inside `<!-- REPO-NEXUS:START -->` and `<!-- REPO-NEXUS:END -->`. Custom developer rules outside these markers are strictly preserved.
|
|
15
|
+
- **User Skills (`.github/skills/`)**: When `skills: true`, Repo Nexus generates native `SKILL.md` directory bundles (`.github/skills/rnex-<name>/SKILL.md`) with YAML frontmatter, making them automatically discoverable in VS Code and Copilot Chat skill-pickers while redirecting to the underlying agentic skills under `.rnex/skills/` and active plugins.
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Enable in `rnex.yaml`:
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
plugins:
|
|
23
|
+
copilot:
|
|
24
|
+
instructions: true # Maintain routing in .github/copilot-instructions.md
|
|
25
|
+
skills: true # Generate user skills in .github/skills/
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
To disable locally without altering team configuration, add to `.local.rnex.yaml`:
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
plugins:
|
|
32
|
+
copilot:
|
|
33
|
+
enabled: false
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## CLI Management
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Enable Copilot plugin across workspace
|
|
40
|
+
rnex plugin enable copilot
|
|
41
|
+
|
|
42
|
+
# Inspect Copilot plugin status
|
|
43
|
+
rnex plugin info copilot
|
|
44
|
+
|
|
45
|
+
# Disable Copilot plugin
|
|
46
|
+
rnex plugin disable copilot
|
|
47
|
+
```
|
package/docs/plugins/gemini.md
CHANGED
|
@@ -15,8 +15,8 @@ Operational skills, rules, and subagents remain cleanly encapsulated within `.rn
|
|
|
15
15
|
|
|
16
16
|
## Capabilities
|
|
17
17
|
|
|
18
|
-
1. **Zero-Logic User Skills (`.gemini/skills/rnex
|
|
19
|
-
- Generates
|
|
18
|
+
1. **Zero-Logic User Skills (`.gemini/skills/rnex-*/SKILL.md`)**:
|
|
19
|
+
- Generates native `SKILL.md` bundles prefixed with `rnex-` in `.gemini/skills/` with YAML frontmatter for Gemini and Antigravity skill discovery.
|
|
20
20
|
- Contains zero inline heuristics—redirects Gemini/Antigravity directly to the underlying agentic skill protocols inside `.rnex/`.
|
|
21
21
|
|
|
22
22
|
2. **Native Instructions Support via `GEMINI.md`**:
|
package/docs/plugins/index.md
CHANGED
|
@@ -23,7 +23,7 @@ Active plugins are mirrored into each active member repository under `repos/<nam
|
|
|
23
23
|
Repo Nexus decouples functional plugins from AI provider plugins:
|
|
24
24
|
- **Core Skills (`toolkit/skills/` $\rightarrow$ `.rnex/skills/`)**: Workspace-level capabilities owned by Repo Nexus core.
|
|
25
25
|
- **Plugin Skills (`toolkit/plugins/<plugin>/skills/` $\rightarrow$ `.rnex/plugins/<plugin>/skills/`)**: Scoped domain skills owned exclusively by individual plugins.
|
|
26
|
-
- **User Skills
|
|
26
|
+
- **User Skills**: Provider plugins (`copilot`, `claude`, `gemini`, `cursor`, and `windsurf`) project zero-logic user skill pointers into active provider directories using native `SKILL.md` bundles with YAML frontmatter in skill directories (`.github/skills/`, `.claude/skills/`, `.gemini/skills/`) and flat files in rule directories (`.cursor/rules/`, `.windsurf/rules/`), redirecting AI assistants directly to the underlying agentic skills in `.rnex/`.
|
|
27
27
|
|
|
28
28
|
### 4. Non-Destructive Delimited Merging
|
|
29
29
|
When plugins update root instruction files (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `.cursorrules`, `.windsurfrules`), Repo Nexus isolates auto-managed routing between explicit delimiters:
|
package/lib/ai.sh
CHANGED
|
@@ -359,6 +359,7 @@ export RNEX_ROOT="${RNEX_ROOT:-$(cd "$(dirname "$0")/../.." 2>/dev/null && pwd -
|
|
|
359
359
|
|
|
360
360
|
if [ -z "$RNEX_PROVIDER_SKILL_DIRS" ]; then
|
|
361
361
|
_dirs=""
|
|
362
|
+
[ -d "$RNEX_ROOT/.github/skills" ] && _dirs="${_dirs:+$_dirs }.github/skills"
|
|
362
363
|
[ -d "$RNEX_ROOT/.cursor" ] && _dirs="${_dirs:+$_dirs }.cursor/rules"
|
|
363
364
|
[ -d "$RNEX_ROOT/.claude" ] && _dirs="${_dirs:+$_dirs }.claude/skills"
|
|
364
365
|
[ -d "$RNEX_ROOT/.windsurf" ] && _dirs="${_dirs:+$_dirs }.windsurf/rules"
|
|
@@ -369,21 +370,63 @@ fi
|
|
|
369
370
|
rnex_register_user_skill() {
|
|
370
371
|
skill_name="$1"
|
|
371
372
|
target_path="$2"
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
_dirs="${RNEX_PROVIDER_SKILL_DIRS:-}"
|
|
374
|
+
_r="${RNEX_ROOT:-.}"
|
|
375
|
+
|
|
376
|
+
_target_file=""
|
|
377
|
+
if [ -f "$_r/$target_path" ]; then
|
|
378
|
+
_target_file="$_r/$target_path"
|
|
379
|
+
elif [ -f "$target_path" ]; then
|
|
380
|
+
_target_file="$target_path"
|
|
381
|
+
fi
|
|
382
|
+
|
|
383
|
+
_skill_desc=""
|
|
384
|
+
if [ -n "$_target_file" ]; then
|
|
385
|
+
_skill_desc="$(awk 'NF && !/^#/ { print; exit }' "$_target_file" 2>/dev/null)"
|
|
386
|
+
fi
|
|
387
|
+
if [ -z "$_skill_desc" ]; then
|
|
388
|
+
_skill_desc="Repo Nexus agentic skill protocol for ${skill_name}."
|
|
389
|
+
fi
|
|
390
|
+
_skill_desc="$(printf '%s' "$_skill_desc" | tr '\n\r' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"/\\"/g')"
|
|
391
|
+
|
|
392
|
+
for provider_dir in $_dirs; do
|
|
393
|
+
case "$provider_dir" in
|
|
394
|
+
*rules*)
|
|
395
|
+
mkdir -p "$_r/$provider_dir"
|
|
396
|
+
rm -rf "$_r/$provider_dir/rnex-${skill_name}" 2>/dev/null || true
|
|
397
|
+
cat << EOF > "$_r/$provider_dir/rnex-${skill_name}.md"
|
|
375
398
|
# User Skill: rnex-${skill_name}
|
|
376
399
|
|
|
377
400
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
378
401
|
\`${target_path}\`
|
|
379
402
|
EOF
|
|
403
|
+
;;
|
|
404
|
+
*)
|
|
405
|
+
mkdir -p "$_r/$provider_dir/rnex-${skill_name}"
|
|
406
|
+
rm -f "$_r/$provider_dir/rnex-${skill_name}.md" 2>/dev/null || true
|
|
407
|
+
cat << EOF > "$_r/$provider_dir/rnex-${skill_name}/SKILL.md"
|
|
408
|
+
---
|
|
409
|
+
name: rnex-${skill_name}
|
|
410
|
+
description: "${_skill_desc}"
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
# User Skill: rnex-${skill_name}
|
|
414
|
+
|
|
415
|
+
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
416
|
+
\`${target_path}\`
|
|
417
|
+
EOF
|
|
418
|
+
;;
|
|
419
|
+
esac
|
|
380
420
|
done
|
|
381
421
|
}
|
|
382
422
|
|
|
383
423
|
rnex_unregister_user_skill() {
|
|
384
424
|
skill_name="$1"
|
|
385
|
-
|
|
386
|
-
|
|
425
|
+
_dirs="${RNEX_PROVIDER_SKILL_DIRS:-}"
|
|
426
|
+
_r="${RNEX_ROOT:-.}"
|
|
427
|
+
for provider_dir in $_dirs; do
|
|
428
|
+
rm -f "$_r/$provider_dir/rnex-${skill_name}.md"
|
|
429
|
+
rm -rf "$_r/$provider_dir/rnex-${skill_name}"
|
|
387
430
|
done
|
|
388
431
|
}
|
|
389
432
|
ENV_EOF
|
|
@@ -392,6 +435,9 @@ ENV_EOF
|
|
|
392
435
|
|
|
393
436
|
get_active_provider_skill_dirs() {
|
|
394
437
|
_dirs=""
|
|
438
|
+
if provider_option_enabled "copilot" "skills" 2>/dev/null; then
|
|
439
|
+
_dirs="${_dirs:+$_dirs }.github/skills"
|
|
440
|
+
fi
|
|
395
441
|
if provider_option_enabled "cursor" "skills" 2>/dev/null; then
|
|
396
442
|
_dirs="${_dirs:+$_dirs }.cursor/rules"
|
|
397
443
|
fi
|
|
@@ -413,14 +459,51 @@ rnex_register_user_skill() {
|
|
|
413
459
|
target_path="$2"
|
|
414
460
|
_dirs="${RNEX_PROVIDER_SKILL_DIRS:-$(get_active_provider_skill_dirs)}"
|
|
415
461
|
_r="${NEXUS_DIR:-${RNEX_ROOT:-.}}"
|
|
462
|
+
|
|
463
|
+
_target_file=""
|
|
464
|
+
if [ -f "$_r/$target_path" ]; then
|
|
465
|
+
_target_file="$_r/$target_path"
|
|
466
|
+
elif [ -f "$target_path" ]; then
|
|
467
|
+
_target_file="$target_path"
|
|
468
|
+
fi
|
|
469
|
+
|
|
470
|
+
_skill_desc=""
|
|
471
|
+
if [ -n "$_target_file" ]; then
|
|
472
|
+
_skill_desc="$(awk 'NF && !/^#/ { print; exit }' "$_target_file" 2>/dev/null)"
|
|
473
|
+
fi
|
|
474
|
+
if [ -z "$_skill_desc" ]; then
|
|
475
|
+
_skill_desc="Repo Nexus agentic skill protocol for ${skill_name}."
|
|
476
|
+
fi
|
|
477
|
+
_skill_desc="$(printf '%s' "$_skill_desc" | tr '\n\r' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"/\\"/g')"
|
|
478
|
+
|
|
416
479
|
for provider_dir in $_dirs; do
|
|
417
|
-
|
|
418
|
-
|
|
480
|
+
case "$provider_dir" in
|
|
481
|
+
*rules*)
|
|
482
|
+
mkdir -p "$_r/$provider_dir"
|
|
483
|
+
rm -rf "$_r/$provider_dir/rnex-${skill_name}" 2>/dev/null || true
|
|
484
|
+
cat << EOF > "$_r/$provider_dir/rnex-${skill_name}.md"
|
|
419
485
|
# User Skill: rnex-${skill_name}
|
|
420
486
|
|
|
421
487
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
422
488
|
\`${target_path}\`
|
|
423
489
|
EOF
|
|
490
|
+
;;
|
|
491
|
+
*)
|
|
492
|
+
mkdir -p "$_r/$provider_dir/rnex-${skill_name}"
|
|
493
|
+
rm -f "$_r/$provider_dir/rnex-${skill_name}.md" 2>/dev/null || true
|
|
494
|
+
cat << EOF > "$_r/$provider_dir/rnex-${skill_name}/SKILL.md"
|
|
495
|
+
---
|
|
496
|
+
name: rnex-${skill_name}
|
|
497
|
+
description: "${_skill_desc}"
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
# User Skill: rnex-${skill_name}
|
|
501
|
+
|
|
502
|
+
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
503
|
+
\`${target_path}\`
|
|
504
|
+
EOF
|
|
505
|
+
;;
|
|
506
|
+
esac
|
|
424
507
|
done
|
|
425
508
|
}
|
|
426
509
|
|
|
@@ -431,6 +514,7 @@ rnex_unregister_user_skill() {
|
|
|
431
514
|
_r="${NEXUS_DIR:-${RNEX_ROOT:-.}}"
|
|
432
515
|
for provider_dir in $_dirs; do
|
|
433
516
|
rm -f "$_r/$provider_dir/rnex-${skill_name}.md"
|
|
517
|
+
rm -rf "$_r/$provider_dir/rnex-${skill_name}"
|
|
434
518
|
done
|
|
435
519
|
}
|
|
436
520
|
|
|
@@ -440,8 +524,7 @@ clean_provider_user_skills() {
|
|
|
440
524
|
rm -f "$_sk_dir"/rnex-*.md 2>/dev/null || true
|
|
441
525
|
for _d in "$_sk_dir"/rnex-*; do
|
|
442
526
|
[ -d "$_d" ] || continue
|
|
443
|
-
rm -
|
|
444
|
-
rmdir "$_d" 2>/dev/null || true
|
|
527
|
+
rm -rf "$_d" 2>/dev/null || true
|
|
445
528
|
done
|
|
446
529
|
rmdir "$_sk_dir" 2>/dev/null || true
|
|
447
530
|
}
|
|
@@ -671,13 +754,28 @@ sync_windsurf() {
|
|
|
671
754
|
rmdir "$NEXUS_DIR/.windsurf" 2>/dev/null || true
|
|
672
755
|
}
|
|
673
756
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
757
|
+
sync_copilot() {
|
|
758
|
+
if copilot_plugin_enabled; then
|
|
759
|
+
if copilot_instructions_enabled; then
|
|
760
|
+
mkdir -p "$NEXUS_DIR/.github"
|
|
761
|
+
merge_rnex_instructions "$NEXUS_DIR/.github/copilot-instructions.md"
|
|
762
|
+
else
|
|
763
|
+
clean_rnex_instructions "$NEXUS_DIR/.github/copilot-instructions.md"
|
|
764
|
+
fi
|
|
765
|
+
if ! copilot_skills_enabled; then
|
|
766
|
+
clean_provider_user_skills "$NEXUS_DIR/.github/skills"
|
|
767
|
+
fi
|
|
768
|
+
else
|
|
769
|
+
clean_rnex_instructions "$NEXUS_DIR/.github/copilot-instructions.md"
|
|
770
|
+
clean_provider_user_skills "$NEXUS_DIR/.github/skills"
|
|
771
|
+
fi
|
|
679
772
|
clean_provider_agents "$NEXUS_DIR/.github/agents" ".agent.md"
|
|
773
|
+
rm -rf "$NEXUS_DIR/.github/prompts" 2>/dev/null || true
|
|
774
|
+
rmdir "$NEXUS_DIR/.github" 2>/dev/null || true
|
|
775
|
+
}
|
|
680
776
|
|
|
777
|
+
sync_ai_providers() {
|
|
778
|
+
sync_copilot
|
|
681
779
|
sync_claude
|
|
682
780
|
sync_gemini
|
|
683
781
|
sync_cursor
|
package/lib/commands/init.sh
CHANGED
|
@@ -21,7 +21,8 @@ cmd_init() {
|
|
|
21
21
|
-y|--yes) _non_interactive=1 ;;
|
|
22
22
|
--hooks) _cli_hooks="true" ;;
|
|
23
23
|
--no-hooks) _cli_no_hooks=1; _cli_hooks="false" ;;
|
|
24
|
-
--copilot
|
|
24
|
+
--copilot) _cli_copilot="true" ;;
|
|
25
|
+
--no-copilot) _cli_copilot="false" ;;
|
|
25
26
|
--claude) _cli_claude="true" ;;
|
|
26
27
|
--no-claude) _cli_claude="false" ;;
|
|
27
28
|
--gemini) _cli_gemini="true" ;;
|
|
@@ -102,6 +103,9 @@ cmd_init() {
|
|
|
102
103
|
log_dim " rnex sync"
|
|
103
104
|
else
|
|
104
105
|
_init_plugins=""
|
|
106
|
+
if [ "$_cli_copilot" = "true" ]; then
|
|
107
|
+
_init_plugins="${_init_plugins} copilot:\n instructions: true\n skills: true\n"
|
|
108
|
+
fi
|
|
105
109
|
if [ "$_cli_claude" = "true" ]; then
|
|
106
110
|
_init_plugins="${_init_plugins} claude:\n instructions: true\n skills: true\n"
|
|
107
111
|
fi
|
|
@@ -149,6 +153,7 @@ YAML_EOF
|
|
|
149
153
|
[ -f "$_init_dir/GEMINI.md" ] && merge_rnex_instructions "$_init_dir/GEMINI.md"
|
|
150
154
|
[ -f "$_init_dir/.cursorrules" ] && merge_rnex_instructions "$_init_dir/.cursorrules"
|
|
151
155
|
[ -f "$_init_dir/.windsurfrules" ] && merge_rnex_instructions "$_init_dir/.windsurfrules"
|
|
156
|
+
[ -f "$_init_dir/.github/copilot-instructions.md" ] && merge_rnex_instructions "$_init_dir/.github/copilot-instructions.md"
|
|
152
157
|
|
|
153
158
|
# ---- 3. Create repos directory with .gitkeep -----------------------------
|
|
154
159
|
_repos_dir="$_init_dir/repos"
|
package/lib/commands/status.sh
CHANGED
|
@@ -165,15 +165,18 @@ cmd_status() {
|
|
|
165
165
|
if [ -d "$NEXUS_DIR/.cursor/rules" ] && ls "$NEXUS_DIR/.cursor/rules"/rnex-*.md >/dev/null 2>&1; then
|
|
166
166
|
printf ' %b✓%b %s %b(Cursor user skills)%b\n' "$_G" "$_NC" ".cursor/rules/" "$_DIM" "$_NC"
|
|
167
167
|
fi
|
|
168
|
-
if [ -d "$NEXUS_DIR/.claude/skills" ] && ls "$NEXUS_DIR/.claude/skills"/rnex-*.md >/dev/null 2>&1; then
|
|
168
|
+
if [ -d "$NEXUS_DIR/.claude/skills" ] && { ls "$NEXUS_DIR/.claude/skills"/rnex-*.md >/dev/null 2>&1 || ls -d "$NEXUS_DIR/.claude/skills"/rnex-* >/dev/null 2>&1; }; then
|
|
169
169
|
printf ' %b✓%b %s %b(Claude user skills)%b\n' "$_G" "$_NC" ".claude/skills/" "$_DIM" "$_NC"
|
|
170
170
|
fi
|
|
171
171
|
if [ -d "$NEXUS_DIR/.windsurf/rules" ] && ls "$NEXUS_DIR/.windsurf/rules"/rnex-*.md >/dev/null 2>&1; then
|
|
172
172
|
printf ' %b✓%b %s %b(Windsurf user skills)%b\n' "$_G" "$_NC" ".windsurf/rules/" "$_DIM" "$_NC"
|
|
173
173
|
fi
|
|
174
|
-
if [ -d "$NEXUS_DIR/.gemini/skills" ] && ls "$NEXUS_DIR/.gemini/skills"/rnex-*.md >/dev/null 2>&1; then
|
|
174
|
+
if [ -d "$NEXUS_DIR/.gemini/skills" ] && { ls "$NEXUS_DIR/.gemini/skills"/rnex-*.md >/dev/null 2>&1 || ls -d "$NEXUS_DIR/.gemini/skills"/rnex-* >/dev/null 2>&1; }; then
|
|
175
175
|
printf ' %b✓%b %s %b(Gemini user skills)%b\n' "$_G" "$_NC" ".gemini/skills/" "$_DIM" "$_NC"
|
|
176
176
|
fi
|
|
177
|
+
if [ -d "$NEXUS_DIR/.github/skills" ] && { ls "$NEXUS_DIR/.github/skills"/rnex-*.md >/dev/null 2>&1 || ls -d "$NEXUS_DIR/.github/skills"/rnex-* >/dev/null 2>&1; }; then
|
|
178
|
+
printf ' %b✓%b %s %b(Copilot user skills)%b\n' "$_G" "$_NC" ".github/skills/" "$_DIM" "$_NC"
|
|
179
|
+
fi
|
|
177
180
|
printf '\n'
|
|
178
181
|
|
|
179
182
|
printf '%bActive Plugins:%b\n' "$_BOLD" "$_NC"
|
package/lib/hooks.sh
CHANGED
|
@@ -62,14 +62,49 @@ run_hook() {
|
|
|
62
62
|
rnex_register_user_skill() {
|
|
63
63
|
skill_name="$1"
|
|
64
64
|
target_path="$2"
|
|
65
|
+
_target_file=""
|
|
66
|
+
if [ -f "$RNEX_ROOT/$target_path" ]; then
|
|
67
|
+
_target_file="$RNEX_ROOT/$target_path"
|
|
68
|
+
elif [ -f "$target_path" ]; then
|
|
69
|
+
_target_file="$target_path"
|
|
70
|
+
fi
|
|
71
|
+
_skill_desc=""
|
|
72
|
+
if [ -n "$_target_file" ]; then
|
|
73
|
+
_skill_desc="$(awk 'NF && !/^#/ { print; exit }' "$_target_file" 2>/dev/null)"
|
|
74
|
+
fi
|
|
75
|
+
if [ -z "$_skill_desc" ]; then
|
|
76
|
+
_skill_desc="Repo Nexus agentic skill protocol for ${skill_name}."
|
|
77
|
+
fi
|
|
78
|
+
_skill_desc="$(printf '%s' "$_skill_desc" | tr '\n\r' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"/\\"/g')"
|
|
79
|
+
|
|
65
80
|
for provider_dir in $RNEX_PROVIDER_SKILL_DIRS; do
|
|
66
|
-
|
|
67
|
-
|
|
81
|
+
case "$provider_dir" in
|
|
82
|
+
*rules*)
|
|
83
|
+
mkdir -p "$RNEX_ROOT/$provider_dir"
|
|
84
|
+
rm -rf "$RNEX_ROOT/$provider_dir/rnex-${skill_name}" 2>/dev/null || true
|
|
85
|
+
cat << EOF > "$RNEX_ROOT/$provider_dir/rnex-${skill_name}.md"
|
|
86
|
+
# User Skill: rnex-${skill_name}
|
|
87
|
+
|
|
88
|
+
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
89
|
+
\`${target_path}\`
|
|
90
|
+
EOF
|
|
91
|
+
;;
|
|
92
|
+
*)
|
|
93
|
+
mkdir -p "$RNEX_ROOT/$provider_dir/rnex-${skill_name}"
|
|
94
|
+
rm -f "$RNEX_ROOT/$provider_dir/rnex-${skill_name}.md" 2>/dev/null || true
|
|
95
|
+
cat << EOF > "$RNEX_ROOT/$provider_dir/rnex-${skill_name}/SKILL.md"
|
|
96
|
+
---
|
|
97
|
+
name: rnex-${skill_name}
|
|
98
|
+
description: "${_skill_desc}"
|
|
99
|
+
---
|
|
100
|
+
|
|
68
101
|
# User Skill: rnex-${skill_name}
|
|
69
102
|
|
|
70
103
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
71
104
|
\`${target_path}\`
|
|
72
105
|
EOF
|
|
106
|
+
;;
|
|
107
|
+
esac
|
|
73
108
|
done
|
|
74
109
|
}
|
|
75
110
|
|
|
@@ -78,6 +113,7 @@ EOF
|
|
|
78
113
|
skill_name="$1"
|
|
79
114
|
for provider_dir in $RNEX_PROVIDER_SKILL_DIRS; do
|
|
80
115
|
rm -f "$RNEX_ROOT/$provider_dir/rnex-${skill_name}.md"
|
|
116
|
+
rm -rf "$RNEX_ROOT/$provider_dir/rnex-${skill_name}"
|
|
81
117
|
done
|
|
82
118
|
}
|
|
83
119
|
set -- "$@"
|
|
@@ -141,14 +177,49 @@ run_plugin_hook() {
|
|
|
141
177
|
rnex_register_user_skill() {
|
|
142
178
|
skill_name="$1"
|
|
143
179
|
target_path="$2"
|
|
180
|
+
_target_file=""
|
|
181
|
+
if [ -f "$RNEX_ROOT/$target_path" ]; then
|
|
182
|
+
_target_file="$RNEX_ROOT/$target_path"
|
|
183
|
+
elif [ -f "$target_path" ]; then
|
|
184
|
+
_target_file="$target_path"
|
|
185
|
+
fi
|
|
186
|
+
_skill_desc=""
|
|
187
|
+
if [ -n "$_target_file" ]; then
|
|
188
|
+
_skill_desc="$(awk 'NF && !/^#/ { print; exit }' "$_target_file" 2>/dev/null)"
|
|
189
|
+
fi
|
|
190
|
+
if [ -z "$_skill_desc" ]; then
|
|
191
|
+
_skill_desc="Repo Nexus agentic skill protocol for ${skill_name}."
|
|
192
|
+
fi
|
|
193
|
+
_skill_desc="$(printf '%s' "$_skill_desc" | tr '\n\r' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"/\\"/g')"
|
|
194
|
+
|
|
144
195
|
for provider_dir in $RNEX_PROVIDER_SKILL_DIRS; do
|
|
145
|
-
|
|
146
|
-
|
|
196
|
+
case "$provider_dir" in
|
|
197
|
+
*rules*)
|
|
198
|
+
mkdir -p "$RNEX_ROOT/$provider_dir"
|
|
199
|
+
rm -rf "$RNEX_ROOT/$provider_dir/rnex-${skill_name}" 2>/dev/null || true
|
|
200
|
+
cat << EOF > "$RNEX_ROOT/$provider_dir/rnex-${skill_name}.md"
|
|
201
|
+
# User Skill: rnex-${skill_name}
|
|
202
|
+
|
|
203
|
+
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
204
|
+
\`${target_path}\`
|
|
205
|
+
EOF
|
|
206
|
+
;;
|
|
207
|
+
*)
|
|
208
|
+
mkdir -p "$RNEX_ROOT/$provider_dir/rnex-${skill_name}"
|
|
209
|
+
rm -f "$RNEX_ROOT/$provider_dir/rnex-${skill_name}.md" 2>/dev/null || true
|
|
210
|
+
cat << EOF > "$RNEX_ROOT/$provider_dir/rnex-${skill_name}/SKILL.md"
|
|
211
|
+
---
|
|
212
|
+
name: rnex-${skill_name}
|
|
213
|
+
description: "${_skill_desc}"
|
|
214
|
+
---
|
|
215
|
+
|
|
147
216
|
# User Skill: rnex-${skill_name}
|
|
148
217
|
|
|
149
218
|
CRITICAL: Do not execute inline heuristics. Read and strictly follow the agentic skill protocol at:
|
|
150
219
|
\`${target_path}\`
|
|
151
220
|
EOF
|
|
221
|
+
;;
|
|
222
|
+
esac
|
|
152
223
|
done
|
|
153
224
|
}
|
|
154
225
|
|
|
@@ -157,6 +228,7 @@ EOF
|
|
|
157
228
|
skill_name="$1"
|
|
158
229
|
for provider_dir in $RNEX_PROVIDER_SKILL_DIRS; do
|
|
159
230
|
rm -f "$RNEX_ROOT/$provider_dir/rnex-${skill_name}.md"
|
|
231
|
+
rm -rf "$RNEX_ROOT/$provider_dir/rnex-${skill_name}"
|
|
160
232
|
done
|
|
161
233
|
}
|
|
162
234
|
set -- "$@"
|
package/lib/yaml.sh
CHANGED
|
@@ -117,9 +117,9 @@ provider_option_enabled() {
|
|
|
117
117
|
esac
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
copilot_plugin_enabled() {
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
copilot_plugin_enabled() { provider_plugin_enabled "copilot"; }
|
|
121
|
+
copilot_instructions_enabled() { provider_option_enabled "copilot" "instructions"; }
|
|
122
|
+
copilot_skills_enabled() { provider_option_enabled "copilot" "skills"; }
|
|
123
123
|
copilot_agents_enabled() { return 1; }
|
|
124
124
|
|
|
125
125
|
claude_plugin_enabled() { provider_plugin_enabled "claude"; }
|
|
@@ -143,7 +143,7 @@ windsurf_skills_enabled() { provider_option_enabled "windsurf" "skills"; }
|
|
|
143
143
|
windsurf_agents_enabled() { return 1; }
|
|
144
144
|
|
|
145
145
|
has_ai_provider_plugin_enabled() {
|
|
146
|
-
for _ap in claude gemini cursor windsurf; do
|
|
146
|
+
for _ap in copilot claude gemini cursor windsurf; do
|
|
147
147
|
if provider_plugin_enabled "$_ap"; then
|
|
148
148
|
return 0
|
|
149
149
|
fi
|
|
@@ -261,7 +261,7 @@ yaml_enable_plugin() {
|
|
|
261
261
|
if ! _yaml_list_plugins_from_file "$_target_file" | grep -qx "$_name" 2>/dev/null; then
|
|
262
262
|
_tmp="$(mktemp)"
|
|
263
263
|
case "$_name" in
|
|
264
|
-
claude|gemini|cursor|windsurf)
|
|
264
|
+
copilot|claude|gemini|cursor|windsurf)
|
|
265
265
|
awk -v name="$_name" '
|
|
266
266
|
/^plugins:[ ]*$/ || /^plugins:[ ]*#/ {
|
|
267
267
|
print
|
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# GitHub Copilot Plugin for Repo Nexus
|
|
2
|
+
|
|
3
|
+
A built-in Repo Nexus plugin providing instructions and skill integration for GitHub Copilot.
|
|
4
|
+
|
|
5
|
+
## Capabilities
|
|
6
|
+
|
|
7
|
+
1. **Instructions Integration**: Generates and maintains `.github/copilot-instructions.md` with Repo Nexus routing instructions while preserving custom instructions outside delimiters.
|
|
8
|
+
2. **User Skills Generation**: Standardized Repo Nexus core skills and active plugins' skills are mirrored as zero-logic User Skill pointers (`rnex-<name>.md`) in `.github/skills/`.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
Enable the plugin across the workspace:
|
|
13
|
+
```bash
|
|
14
|
+
rnex plugin enable copilot
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or configure options in `rnex.yaml` or `.local.rnex.yaml`:
|
|
18
|
+
```yaml
|
|
19
|
+
plugins:
|
|
20
|
+
copilot:
|
|
21
|
+
instructions: true
|
|
22
|
+
skills: true
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Options
|
|
26
|
+
|
|
27
|
+
| Option | Type | Default | Description |
|
|
28
|
+
|--------|------|---------|-------------|
|
|
29
|
+
| `instructions` | boolean | `true` | Maintain routing in `.github/copilot-instructions.md` |
|
|
30
|
+
| `skills` | boolean | `true` | Generate user skills in `.github/skills/` |
|
|
31
|
+
| `enabled` | boolean | `true` | Set to `false` in `.local.rnex.yaml` to override team config |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# GitHub Copilot Integration for Repo Nexus
|
|
2
|
+
|
|
3
|
+
This workspace has the Repo Nexus `copilot` plugin enabled.
|
|
4
|
+
|
|
5
|
+
## Operating Principles
|
|
6
|
+
- **Instructions Integration**: GitHub Copilot natively reads `.github/copilot-instructions.md` and root `AGENTS.md` for workspace routing and active plugin guidelines between `<!-- REPO-NEXUS:START -->` and `<!-- REPO-NEXUS:END -->`. Custom instructions outside these markers are strictly preserved.
|
|
7
|
+
- **User Skills**: Standardized Repo Nexus core skills and active plugin skills can be accessed via `.github/skills/rnex-*.md` when `skills: true`.
|
|
8
|
+
|
|
9
|
+
## Configuration
|
|
10
|
+
Configure plugin options in `rnex.yaml` or override them per developer in `.local.rnex.yaml`:
|
|
11
|
+
|
|
12
|
+
```yaml
|
|
13
|
+
plugins:
|
|
14
|
+
copilot:
|
|
15
|
+
instructions: true # Maintain routing in .github/copilot-instructions.md (default: true)
|
|
16
|
+
skills: true # Generate user skills in .github/skills/ (default: true)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
To disable locally without altering team configuration, add to `.local.rnex.yaml`:
|
|
20
|
+
```yaml
|
|
21
|
+
plugins:
|
|
22
|
+
copilot:
|
|
23
|
+
enabled: false
|
|
24
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
name: copilot
|
|
2
|
+
version: 0.5.1
|
|
3
|
+
description: GitHub Copilot integration (maintains .github/copilot-instructions.md and user skills in .github/skills/)
|
|
4
|
+
author: unoxen
|
|
5
|
+
homepage: https://github.com/unoxen/repo-nexus
|
|
6
|
+
instructions:
|
|
7
|
+
- instructions/rnex-copilot-integration.md: .rnex/plugins/copilot/instructions/rnex-copilot-integration.md
|