repo-nexus 0.5.7 → 0.5.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 CHANGED
@@ -50,6 +50,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
50
50
  - Older configurations specifying `ai_instructions: CLAUDE.md | GEMINI.md | .cursorrules` are automatically migrated to enable the respective plugin and stripped of the legacy key during `rnex fix`.
51
51
 
52
52
  ### Fixed
53
+ - **Surgical Non-Destructive Cleanup of Skills, Agents, and Prompts**:
54
+ - Replaced destructive `rm -rf` on `.github/skills`, `.github/agents`, and provider directories with targeted cleanup (`clean_provider_skills`, `clean_provider_prompts`, `clean_copilot_agents`).
55
+ - Only Repo Nexus base prompts (`rnex-*`) and active plugin-generated skills/agents/prompts are removed during disable or reconciliation.
56
+ - User-authored custom skills in `.github/skills/`, custom agents in `.github/agents/`, and custom prompts are now safely preserved regardless of whether a provider plugin is enabled or disabled.
53
57
  - **Variable Shadowing and Directory Creation in Hook / Init Synchronization**:
54
58
  - Fixed variable name shadowing (`_target_dir`) across `cmd_init` and provider sync routines in POSIX shell.
55
59
  - Ensured target directories are created before moving temporary hook files in `_create_hook_script`.
package/docs/CLI.md CHANGED
@@ -72,10 +72,10 @@ rnex init [options] [directory]
72
72
  - `--hooks`: Force-enable automated Git hooks setup during initialization.
73
73
  - `--no-hooks`: Skip Git hooks configuration during initialization.
74
74
  - `--copilot`: Enable GitHub Copilot integration plugin (mirrors prompts, skills, agents, and instructions to `.github/`).
75
- - `--claude`: Enable Anthropic Claude Code plugin (maintains `CLAUDE.md`, mirrors prompts/skills to `.claude/`).
76
- - `--gemini`: Enable Google Gemini & Antigravity plugin (maintains `GEMINI.md`, mirrors prompts/skills to `.gemini/`).
77
- - `--cursor`: Enable Cursor IDE plugin (maintains `.cursorrules` / `.cursor/rules/`, mirrors prompts/skills to `.cursor/`).
78
- - `--windsurf`: Enable Windsurf IDE plugin (maintains `.windsurfrules`, mirrors prompts/skills to `.windsurf/`).
75
+ - `--claude`: Enable Anthropic Claude Code plugin (maintains `CLAUDE.md`, mirrors prompts/skills/agents to `.claude/`).
76
+ - `--gemini`: Enable Google Gemini & Antigravity plugin (maintains `GEMINI.md`, mirrors prompts/skills/agents to `.gemini/`).
77
+ - `--cursor`: Enable Cursor IDE plugin (maintains `.cursorrules` / `.cursor/rules/`, mirrors prompts/skills/agents to `.cursor/`).
78
+ - `--windsurf`: Enable Windsurf IDE plugin (maintains `.windsurfrules`, mirrors prompts/skills/agents to `.windsurf/`).
79
79
 
80
80
  #### What it does:
81
81
  1. Creates `rnex.yaml` with schema versioning (`version: <version>`), `repos_dir: ./repos`, and configured defaults.
@@ -76,13 +76,13 @@ git_hooks: true
76
76
  # copilot — GitHub Copilot integration: mirrors operational prompts, skills,
77
77
  # agents, and synthesized instructions into .github/
78
78
  # claude — Anthropic Claude Code integration: maintains CLAUDE.md instructions
79
- # and mirrors commands, prompts, and skills into .claude/
79
+ # and mirrors commands, prompts, skills, and agents into .claude/
80
80
  # gemini — Google Gemini / Antigravity integration: maintains GEMINI.md instructions
81
- # and mirrors prompts and skills into .gemini/
81
+ # and mirrors prompts, skills, and agents into .gemini/
82
82
  # cursor — Cursor IDE integration: maintains .cursorrules / .cursor/rules/
83
- # and mirrors prompts and skills into .cursor/
83
+ # and mirrors prompts, skills, and agents into .cursor/
84
84
  # windsurf — Windsurf IDE integration: maintains .windsurfrules
85
- # and mirrors prompts and skills into .windsurf/
85
+ # and mirrors prompts, skills, and agents into .windsurf/
86
86
  # karpathy-llm — Andrej Karpathy's agent behavioral principles,
87
87
  # context engineering guidelines, and LLM Wiki architecture
88
88
 
@@ -96,18 +96,22 @@ plugins:
96
96
  # instructions: true # maintain routing in CLAUDE.md (default: true)
97
97
  # prompts: true # mirror commands & prompts to .claude/commands/ (default: true)
98
98
  # skills: true # mirror skills to .claude/skills/ (default: true)
99
+ # agents: true # mirror custom agents to .claude/agents/ (default: true)
99
100
  # gemini:
100
101
  # instructions: true # maintain routing in GEMINI.md (default: true)
101
102
  # prompts: true # mirror prompts to .gemini/prompts/ (default: true)
102
103
  # skills: true # mirror skills to .gemini/skills/ (default: true)
104
+ # agents: true # mirror custom agents to .gemini/agents/ (default: true)
103
105
  # cursor:
104
106
  # instructions: true # maintain routing in .cursorrules & .cursor/rules/ (default: true)
105
107
  # prompts: true # mirror prompts to .cursor/prompts/ (default: true)
106
108
  # skills: true # mirror skills to .cursor/skills/ (default: true)
109
+ # agents: true # mirror custom agents to .cursor/agents/ (default: true)
107
110
  # windsurf:
108
111
  # instructions: true # maintain routing in .windsurfrules (default: true)
109
112
  # prompts: true # mirror prompts to .windsurf/prompts/ (default: true)
110
113
  # skills: true # mirror skills to .windsurf/skills/ (default: true)
114
+ # agents: true # mirror custom agents to .windsurf/agents/ (default: true)
111
115
  # karpathy-llm: {}
112
116
 
113
117
  # ------------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-nexus",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "Lightweight, zero-dependency Virtual Meta-Repo companion for multi-repo workspaces and shared AI context (no git submodules)",
5
5
  "bin": {
6
6
  "repo-nexus": "rnex",
package/rnex CHANGED
@@ -399,21 +399,25 @@ claude_plugin_enabled() { provider_plugin_enabled "claude"; }
399
399
  claude_prompts_enabled() { provider_option_enabled "claude" "prompts"; }
400
400
  claude_skills_enabled() { provider_option_enabled "claude" "skills"; }
401
401
  claude_instructions_enabled() { provider_option_enabled "claude" "instructions"; }
402
+ claude_agents_enabled() { provider_option_enabled "claude" "agents"; }
402
403
 
403
404
  gemini_plugin_enabled() { provider_plugin_enabled "gemini"; }
404
405
  gemini_prompts_enabled() { provider_option_enabled "gemini" "prompts"; }
405
406
  gemini_skills_enabled() { provider_option_enabled "gemini" "skills"; }
406
407
  gemini_instructions_enabled() { provider_option_enabled "gemini" "instructions"; }
408
+ gemini_agents_enabled() { provider_option_enabled "gemini" "agents"; }
407
409
 
408
410
  cursor_plugin_enabled() { provider_plugin_enabled "cursor"; }
409
411
  cursor_prompts_enabled() { provider_option_enabled "cursor" "prompts"; }
410
412
  cursor_skills_enabled() { provider_option_enabled "cursor" "skills"; }
411
413
  cursor_instructions_enabled() { provider_option_enabled "cursor" "instructions"; }
414
+ cursor_agents_enabled() { provider_option_enabled "cursor" "agents"; }
412
415
 
413
416
  windsurf_plugin_enabled() { provider_plugin_enabled "windsurf"; }
414
417
  windsurf_prompts_enabled() { provider_option_enabled "windsurf" "prompts"; }
415
418
  windsurf_skills_enabled() { provider_option_enabled "windsurf" "skills"; }
416
419
  windsurf_instructions_enabled() { provider_option_enabled "windsurf" "instructions"; }
420
+ windsurf_agents_enabled() { provider_option_enabled "windsurf" "agents"; }
417
421
 
418
422
  has_ai_provider_plugin_enabled() {
419
423
  for _ap in claude gemini cursor windsurf; do
@@ -554,14 +558,14 @@ yaml_enable_plugin() {
554
558
  awk -v name="$_name" '
555
559
  /^plugins:[ ]*$/ || /^plugins:[ ]*#/ {
556
560
  print
557
- printf " %s:\n instructions: true\n prompts: true\n skills: true\n", name
561
+ printf " %s:\n instructions: true\n prompts: true\n skills: true\n agents: true\n", name
558
562
  added=1
559
563
  next
560
564
  }
561
565
  { print }
562
566
  END {
563
567
  if (!added) {
564
- printf "plugins:\n %s:\n instructions: true\n prompts: true\n skills: true\n", name
568
+ printf "plugins:\n %s:\n instructions: true\n prompts: true\n skills: true\n agents: true\n", name
565
569
  }
566
570
  }
567
571
  ' "$_target_file" > "$_tmp" && mv "$_tmp" "$_target_file"
@@ -1376,25 +1380,7 @@ sync_code_workspace() {
1376
1380
  sync_copilot_instructions() {
1377
1381
  _dst_ci="$NEXUS_DIR/.github/copilot-instructions.md"
1378
1382
  if ! copilot_instructions_enabled; then
1379
- if [ -f "$_dst_ci" ]; then
1380
- if grep -q "$AI_MARKER_START" "$_dst_ci" 2>/dev/null; then
1381
- _non_rnex="$(awk -v s="$AI_MARKER_START" -v e="$AI_MARKER_END" '
1382
- $0 ~ s { skip=1; next }
1383
- $0 ~ e { skip=0; next }
1384
- !skip { print }
1385
- ' "$_dst_ci" | tr -d " \t\r\n")"
1386
- if [ -z "$_non_rnex" ]; then
1387
- rm -f "$_dst_ci"
1388
- else
1389
- _tmp="$(mktemp)"
1390
- awk -v s="$AI_MARKER_START" -v e="$AI_MARKER_END" '
1391
- $0 ~ s { skip=1; next }
1392
- $0 ~ e { skip=0; next }
1393
- !skip { print }
1394
- ' "$_dst_ci" > "$_tmp" && mv "$_tmp" "$_dst_ci"
1395
- fi
1396
- fi
1397
- fi
1383
+ clean_rnex_instructions "$_dst_ci"
1398
1384
  return 0
1399
1385
  fi
1400
1386
 
@@ -1655,66 +1641,181 @@ sync_provider_skills() {
1655
1641
  done
1656
1642
  }
1657
1643
 
1644
+ clean_provider_prompts() {
1645
+ _sp_dir="$1"
1646
+ _ext="${2:-.md}"
1647
+ [ -d "$_sp_dir" ] || return 0
1648
+
1649
+ if [ -z "$_src_prompts" ]; then
1650
+ if [ -d "$SCRIPT_LOCATION/toolkit/prompts" ]; then
1651
+ _src_prompts="$SCRIPT_LOCATION/toolkit/prompts"
1652
+ elif [ -d "$(dirname "$SCRIPT_LOCATION")/toolkit/prompts" ]; then
1653
+ _src_prompts="$(dirname "$SCRIPT_LOCATION")/toolkit/prompts"
1654
+ elif [ -d "$NEXUS_DIR/toolkit/prompts" ]; then
1655
+ _src_prompts="$NEXUS_DIR/toolkit/prompts"
1656
+ fi
1657
+ fi
1658
+
1659
+ # Remove base toolkit prompts
1660
+ if [ -n "$_src_prompts" ]; then
1661
+ for _pfile in "$_src_prompts"/rnex-*.md; do
1662
+ [ -f "$_pfile" ] || continue
1663
+ _pname="$(basename "$_pfile" .md)"
1664
+ rm -f "$_sp_dir/${_pname}${_ext}" 2>/dev/null || true
1665
+ done
1666
+ fi
1667
+
1668
+ # Remove plugin prompts & workflows
1669
+ for _pdir in "$DIR/toolkit/plugins"/* "$NEXUS_DIR/.rnex/plugins"/*; do
1670
+ [ -d "$_pdir" ] || continue
1671
+ for _sub in prompts workflows; do
1672
+ [ -d "$_pdir/$_sub" ] || continue
1673
+ for _pfile in "$_pdir/$_sub"/*.md; do
1674
+ [ -f "$_pfile" ] || continue
1675
+ _base="$(basename "$_pfile" .md)"
1676
+ case "$_base" in
1677
+ index|README) continue ;;
1678
+ esac
1679
+ rm -f "$_sp_dir/${_base}${_ext}" 2>/dev/null || true
1680
+ done
1681
+ done
1682
+ done
1683
+
1684
+ rmdir "$_sp_dir" 2>/dev/null || true
1685
+ }
1686
+
1687
+ clean_provider_skills() {
1688
+ _sk_dir="$1"
1689
+ [ -d "$_sk_dir" ] || return 0
1690
+
1691
+ if [ -z "$_src_prompts" ]; then
1692
+ if [ -d "$SCRIPT_LOCATION/toolkit/prompts" ]; then
1693
+ _src_prompts="$SCRIPT_LOCATION/toolkit/prompts"
1694
+ elif [ -d "$(dirname "$SCRIPT_LOCATION")/toolkit/prompts" ]; then
1695
+ _src_prompts="$(dirname "$SCRIPT_LOCATION")/toolkit/prompts"
1696
+ elif [ -d "$NEXUS_DIR/toolkit/prompts" ]; then
1697
+ _src_prompts="$NEXUS_DIR/toolkit/prompts"
1698
+ fi
1699
+ fi
1700
+
1701
+ # Remove base toolkit skills
1702
+ if [ -n "$_src_prompts" ]; then
1703
+ for _pfile in "$_src_prompts"/rnex-*.md; do
1704
+ [ -f "$_pfile" ] || continue
1705
+ _pname="$(basename "$_pfile" .md)"
1706
+ rm -f "$_sk_dir/$_pname/SKILL.md" 2>/dev/null || true
1707
+ rmdir "$_sk_dir/$_pname" 2>/dev/null || true
1708
+ done
1709
+ fi
1710
+
1711
+ # Remove plugin skills, prompts, workflows, & agents as skills
1712
+ for _pdir in "$DIR/toolkit/plugins"/* "$NEXUS_DIR/.rnex/plugins"/*; do
1713
+ [ -d "$_pdir" ] || continue
1714
+ for _sub in skills prompts workflows agents; do
1715
+ [ -d "$_pdir/$_sub" ] || continue
1716
+ for _s_entry in "$_pdir/$_sub"/*; do
1717
+ [ -e "$_s_entry" ] || continue
1718
+ _sname="$(basename "$_s_entry" .md)"
1719
+ _sname="$(basename "$_sname" .agent.md)"
1720
+ case "$_sname" in
1721
+ index|README) continue ;;
1722
+ esac
1723
+ rm -f "$_sk_dir/$_sname/SKILL.md" 2>/dev/null || true
1724
+ rmdir "$_sk_dir/$_sname" 2>/dev/null || true
1725
+ done
1726
+ done
1727
+ done
1728
+
1729
+ rmdir "$_sk_dir" 2>/dev/null || true
1730
+ }
1731
+
1732
+ sync_provider_agents() {
1733
+ _ag_dir="$1"
1734
+ _ext="${2:-.md}"
1735
+ mkdir -p "$_ag_dir"
1736
+
1737
+ yaml_list_plugins | while read -r _pname; do
1738
+ [ -n "$_pname" ] || continue
1739
+ yaml_plugin_enabled "$_pname" || continue
1740
+ case "$_pname" in
1741
+ copilot|claude|gemini|cursor|windsurf) continue ;;
1742
+ esac
1743
+ _pdir="$(find_plugin_dir "$_pname" 2>/dev/null || true)"
1744
+ [ -n "$_pdir" ] || continue
1745
+
1746
+ for _s_dir in "$_pdir/agents" "$NEXUS_DIR/.rnex/plugins/$_pname/agents"; do
1747
+ [ -d "$_s_dir" ] || continue
1748
+ for _afile in "$_s_dir"/*.md; do
1749
+ [ -f "$_afile" ] || continue
1750
+ _aname="$(basename "$_afile" .agent.md)"
1751
+ _aname="$(basename "$_aname" .md)"
1752
+ _dst_agent="$_ag_dir/${_aname}${_ext}"
1753
+ if grep -q '^---' "$_afile" 2>/dev/null; then
1754
+ cp -f "$_afile" "$_dst_agent"
1755
+ else
1756
+ _desc="$(awk '
1757
+ /^#/ { in_title=1; next }
1758
+ in_title && /^[A-Za-z]/ { print; exit }
1759
+ ' "$_afile" 2>/dev/null)"
1760
+ [ -n "$_desc" ] || _desc="Agent $_aname from plugin $_pname"
1761
+ {
1762
+ printf -- '---\nname: %s\ndescription: %s\n---\n\n' "$_aname" "$_desc"
1763
+ cat "$_afile"
1764
+ } > "$_dst_agent"
1765
+ fi
1766
+ done
1767
+ done
1768
+ done
1769
+ }
1770
+
1771
+ clean_provider_agents() {
1772
+ _ag_dir="$1"
1773
+ _ext="${2:-.md}"
1774
+ [ -d "$_ag_dir" ] || return 0
1775
+
1776
+ for _pdir in "$DIR/toolkit/plugins"/* "$NEXUS_DIR/.rnex/plugins"/*; do
1777
+ [ -d "$_pdir" ] || continue
1778
+ [ -d "$_pdir/agents" ] || continue
1779
+ for _afile in "$_pdir/agents"/*.md; do
1780
+ [ -f "$_afile" ] || continue
1781
+ _aname="$(basename "$_afile" .agent.md)"
1782
+ _aname="$(basename "$_aname" .md)"
1783
+ rm -f "$_ag_dir/${_aname}${_ext}" 2>/dev/null || true
1784
+ if [ "$_ag_dir" = "$NEXUS_DIR/.github/agents" ]; then
1785
+ rm -f "$NEXUS_DIR/.github/skills/$_aname/SKILL.md" 2>/dev/null || true
1786
+ rmdir "$NEXUS_DIR/.github/skills/$_aname" 2>/dev/null || true
1787
+ fi
1788
+ done
1789
+ done
1790
+
1791
+ rmdir "$_ag_dir" 2>/dev/null || true
1792
+ }
1793
+
1658
1794
  sync_copilot() {
1659
1795
  if copilot_prompts_enabled; then
1660
1796
  sync_provider_prompts "$NEXUS_DIR/.github/prompts" ".prompt.md"
1661
1797
  else
1662
- if [ -d "$NEXUS_DIR/.github/prompts" ]; then
1663
- rm -f "$NEXUS_DIR/.github/prompts"/*.prompt.md 2>/dev/null || true
1664
- rmdir "$NEXUS_DIR/.github/prompts" 2>/dev/null || true
1665
- fi
1798
+ clean_provider_prompts "$NEXUS_DIR/.github/prompts" ".prompt.md"
1666
1799
  fi
1667
1800
 
1668
1801
  if copilot_skills_enabled; then
1669
1802
  sync_provider_skills "$NEXUS_DIR/.github/skills"
1670
1803
  else
1671
- if [ -d "$NEXUS_DIR/.github/skills" ]; then
1672
- rm -rf "$NEXUS_DIR/.github/skills" 2>/dev/null || true
1673
- fi
1804
+ clean_provider_skills "$NEXUS_DIR/.github/skills"
1674
1805
  fi
1675
1806
 
1676
1807
  if copilot_agents_enabled; then
1677
- _copilot_agents="$NEXUS_DIR/.github/agents"
1678
- yaml_list_plugins | while read -r _pname; do
1679
- [ -n "$_pname" ] || continue
1680
- yaml_plugin_enabled "$_pname" || continue
1681
- case "$_pname" in
1682
- copilot|claude|gemini|cursor|windsurf) continue ;;
1683
- esac
1684
- _pdir="$(find_plugin_dir "$_pname" 2>/dev/null || true)"
1685
- [ -n "$_pdir" ] || continue
1686
-
1687
- for _s_dir in "$_pdir/agents" "$NEXUS_DIR/.rnex/plugins/$_pname/agents"; do
1688
- [ -d "$_s_dir" ] || continue
1689
- for _afile in "$_s_dir"/*.md; do
1690
- [ -f "$_afile" ] || continue
1691
- _aname="$(basename "$_afile" .agent.md)"
1692
- _aname="$(basename "$_aname" .md)"
1693
- mkdir -p "$_copilot_agents"
1694
- if grep -q '^---' "$_afile" 2>/dev/null; then
1695
- cp -f "$_afile" "$_copilot_agents/$_aname.agent.md"
1696
- else
1697
- _desc="$(awk '
1698
- /^#/ { in_title=1; next }
1699
- in_title && /^[A-Za-z]/ { print; exit }
1700
- ' "$_afile" 2>/dev/null)"
1701
- [ -n "$_desc" ] || _desc="Agent $_aname from plugin $_pname"
1702
- {
1703
- printf -- '---\nname: %s\ndescription: %s\n---\n\n' "$_aname" "$_desc"
1704
- cat "$_afile"
1705
- } > "$_copilot_agents/$_aname.agent.md"
1706
- fi
1707
- if copilot_skills_enabled; then
1708
- mkdir -p "$NEXUS_DIR/.github/skills/$_aname"
1709
- cp -f "$_copilot_agents/$_aname.agent.md" "$NEXUS_DIR/.github/skills/$_aname/SKILL.md"
1710
- fi
1711
- done
1808
+ sync_provider_agents "$NEXUS_DIR/.github/agents" ".agent.md"
1809
+ if copilot_skills_enabled; then
1810
+ for _ag_file in "$NEXUS_DIR/.github/agents"/*.agent.md; do
1811
+ [ -f "$_ag_file" ] || continue
1812
+ _aname="$(basename "$_ag_file" .agent.md)"
1813
+ mkdir -p "$NEXUS_DIR/.github/skills/$_aname"
1814
+ cp -f "$_ag_file" "$NEXUS_DIR/.github/skills/$_aname/SKILL.md"
1712
1815
  done
1713
- done
1714
- else
1715
- if [ -d "$NEXUS_DIR/.github/agents" ]; then
1716
- rm -rf "$NEXUS_DIR/.github/agents" 2>/dev/null || true
1717
1816
  fi
1817
+ else
1818
+ clean_provider_agents "$NEXUS_DIR/.github/agents" ".agent.md"
1718
1819
  fi
1719
1820
 
1720
1821
  sync_copilot_instructions
@@ -1732,17 +1833,27 @@ sync_claude() {
1732
1833
  sync_provider_prompts "$NEXUS_DIR/.claude/commands" ".md"
1733
1834
  sync_provider_prompts "$NEXUS_DIR/.claude/prompts" ".md"
1734
1835
  else
1735
- rm -rf "$NEXUS_DIR/.claude/commands" "$NEXUS_DIR/.claude/prompts" 2>/dev/null || true
1836
+ clean_provider_prompts "$NEXUS_DIR/.claude/commands" ".md"
1837
+ clean_provider_prompts "$NEXUS_DIR/.claude/prompts" ".md"
1736
1838
  fi
1737
1839
 
1738
1840
  if claude_skills_enabled; then
1739
1841
  sync_provider_skills "$NEXUS_DIR/.claude/skills"
1740
1842
  else
1741
- rm -rf "$NEXUS_DIR/.claude/skills" 2>/dev/null || true
1843
+ clean_provider_skills "$NEXUS_DIR/.claude/skills"
1844
+ fi
1845
+
1846
+ if claude_agents_enabled; then
1847
+ sync_provider_agents "$NEXUS_DIR/.claude/agents" ".md"
1848
+ else
1849
+ clean_provider_agents "$NEXUS_DIR/.claude/agents" ".md"
1742
1850
  fi
1743
1851
  else
1744
1852
  clean_rnex_instructions "$NEXUS_DIR/CLAUDE.md"
1745
- rm -rf "$NEXUS_DIR/.claude/commands" "$NEXUS_DIR/.claude/prompts" "$NEXUS_DIR/.claude/skills" 2>/dev/null || true
1853
+ clean_provider_prompts "$NEXUS_DIR/.claude/commands" ".md"
1854
+ clean_provider_prompts "$NEXUS_DIR/.claude/prompts" ".md"
1855
+ clean_provider_skills "$NEXUS_DIR/.claude/skills"
1856
+ clean_provider_agents "$NEXUS_DIR/.claude/agents" ".md"
1746
1857
  rmdir "$NEXUS_DIR/.claude" 2>/dev/null || true
1747
1858
  fi
1748
1859
  }
@@ -1758,17 +1869,26 @@ sync_gemini() {
1758
1869
  if gemini_prompts_enabled; then
1759
1870
  sync_provider_prompts "$NEXUS_DIR/.gemini/prompts" ".prompt.md"
1760
1871
  else
1761
- rm -rf "$NEXUS_DIR/.gemini/prompts" 2>/dev/null || true
1872
+ clean_provider_prompts "$NEXUS_DIR/.gemini/prompts" ".prompt.md"
1762
1873
  fi
1763
1874
 
1764
1875
  if gemini_skills_enabled; then
1765
1876
  sync_provider_skills "$NEXUS_DIR/.gemini/skills"
1766
1877
  else
1767
- rm -rf "$NEXUS_DIR/.gemini/skills" 2>/dev/null || true
1878
+ clean_provider_skills "$NEXUS_DIR/.gemini/skills"
1879
+ fi
1880
+
1881
+ if gemini_agents_enabled; then
1882
+ sync_provider_agents "$NEXUS_DIR/.gemini/agents" ".md"
1883
+ else
1884
+ clean_provider_agents "$NEXUS_DIR/.gemini/agents" ".md"
1768
1885
  fi
1769
1886
  else
1770
1887
  clean_rnex_instructions "$NEXUS_DIR/GEMINI.md"
1771
- rm -rf "$NEXUS_DIR/.gemini/prompts" "$NEXUS_DIR/.gemini/skills" "$NEXUS_DIR/.gemini/rules" 2>/dev/null || true
1888
+ clean_provider_prompts "$NEXUS_DIR/.gemini/prompts" ".prompt.md"
1889
+ clean_provider_skills "$NEXUS_DIR/.gemini/skills"
1890
+ clean_provider_agents "$NEXUS_DIR/.gemini/agents" ".md"
1891
+ rmdir "$NEXUS_DIR/.gemini/rules" 2>/dev/null || true
1772
1892
  rmdir "$NEXUS_DIR/.gemini" 2>/dev/null || true
1773
1893
  fi
1774
1894
  }
@@ -1790,24 +1910,32 @@ sync_cursor() {
1790
1910
  clean_rnex_instructions "$NEXUS_DIR/.cursorrules"
1791
1911
  rm -f "$NEXUS_DIR/.cursor/rules/repo-nexus.mdc" 2>/dev/null || true
1792
1912
  rmdir "$NEXUS_DIR/.cursor/rules" 2>/dev/null || true
1793
- rmdir "$NEXUS_DIR/.cursor" 2>/dev/null || true
1794
1913
  fi
1795
1914
 
1796
1915
  if cursor_prompts_enabled; then
1797
1916
  sync_provider_prompts "$NEXUS_DIR/.cursor/prompts" ".md"
1798
1917
  else
1799
- rm -rf "$NEXUS_DIR/.cursor/prompts" 2>/dev/null || true
1918
+ clean_provider_prompts "$NEXUS_DIR/.cursor/prompts" ".md"
1800
1919
  fi
1801
1920
 
1802
1921
  if cursor_skills_enabled; then
1803
1922
  sync_provider_skills "$NEXUS_DIR/.cursor/skills"
1804
1923
  else
1805
- rm -rf "$NEXUS_DIR/.cursor/skills" 2>/dev/null || true
1924
+ clean_provider_skills "$NEXUS_DIR/.cursor/skills"
1925
+ fi
1926
+
1927
+ if cursor_agents_enabled; then
1928
+ sync_provider_agents "$NEXUS_DIR/.cursor/agents" ".md"
1929
+ else
1930
+ clean_provider_agents "$NEXUS_DIR/.cursor/agents" ".md"
1806
1931
  fi
1807
1932
  else
1808
1933
  clean_rnex_instructions "$NEXUS_DIR/.cursorrules"
1809
- rm -rf "$NEXUS_DIR/.cursor/prompts" "$NEXUS_DIR/.cursor/skills" "$NEXUS_DIR/.cursor/rules/repo-nexus.mdc" 2>/dev/null || true
1934
+ rm -f "$NEXUS_DIR/.cursor/rules/repo-nexus.mdc" 2>/dev/null || true
1810
1935
  rmdir "$NEXUS_DIR/.cursor/rules" 2>/dev/null || true
1936
+ clean_provider_prompts "$NEXUS_DIR/.cursor/prompts" ".md"
1937
+ clean_provider_skills "$NEXUS_DIR/.cursor/skills"
1938
+ clean_provider_agents "$NEXUS_DIR/.cursor/agents" ".md"
1811
1939
  rmdir "$NEXUS_DIR/.cursor" 2>/dev/null || true
1812
1940
  fi
1813
1941
  }
@@ -1823,17 +1951,25 @@ sync_windsurf() {
1823
1951
  if windsurf_prompts_enabled; then
1824
1952
  sync_provider_prompts "$NEXUS_DIR/.windsurf/prompts" ".md"
1825
1953
  else
1826
- rm -rf "$NEXUS_DIR/.windsurf/prompts" 2>/dev/null || true
1954
+ clean_provider_prompts "$NEXUS_DIR/.windsurf/prompts" ".md"
1827
1955
  fi
1828
1956
 
1829
1957
  if windsurf_skills_enabled; then
1830
1958
  sync_provider_skills "$NEXUS_DIR/.windsurf/skills"
1831
1959
  else
1832
- rm -rf "$NEXUS_DIR/.windsurf/skills" 2>/dev/null || true
1960
+ clean_provider_skills "$NEXUS_DIR/.windsurf/skills"
1961
+ fi
1962
+
1963
+ if windsurf_agents_enabled; then
1964
+ sync_provider_agents "$NEXUS_DIR/.windsurf/agents" ".md"
1965
+ else
1966
+ clean_provider_agents "$NEXUS_DIR/.windsurf/agents" ".md"
1833
1967
  fi
1834
1968
  else
1835
1969
  clean_rnex_instructions "$NEXUS_DIR/.windsurfrules"
1836
- rm -rf "$NEXUS_DIR/.windsurf/prompts" "$NEXUS_DIR/.windsurf/skills" 2>/dev/null || true
1970
+ clean_provider_prompts "$NEXUS_DIR/.windsurf/prompts" ".md"
1971
+ clean_provider_skills "$NEXUS_DIR/.windsurf/skills"
1972
+ clean_provider_agents "$NEXUS_DIR/.windsurf/agents" ".md"
1837
1973
  rmdir "$NEXUS_DIR/.windsurf" 2>/dev/null || true
1838
1974
  fi
1839
1975
  }
@@ -2270,16 +2406,16 @@ cmd_init() {
2270
2406
  _init_plugins="${_init_plugins} copilot:\n prompts: true\n skills: true\n instructions: true\n agents: true\n"
2271
2407
  fi
2272
2408
  if [ "$_cli_claude" = "true" ]; then
2273
- _init_plugins="${_init_plugins} claude:\n instructions: true\n prompts: true\n skills: true\n"
2409
+ _init_plugins="${_init_plugins} claude:\n instructions: true\n prompts: true\n skills: true\n agents: true\n"
2274
2410
  fi
2275
2411
  if [ "$_cli_gemini" = "true" ]; then
2276
- _init_plugins="${_init_plugins} gemini:\n instructions: true\n prompts: true\n skills: true\n"
2412
+ _init_plugins="${_init_plugins} gemini:\n instructions: true\n prompts: true\n skills: true\n agents: true\n"
2277
2413
  fi
2278
2414
  if [ "$_cli_cursor" = "true" ]; then
2279
- _init_plugins="${_init_plugins} cursor:\n instructions: true\n prompts: true\n skills: true\n"
2415
+ _init_plugins="${_init_plugins} cursor:\n instructions: true\n prompts: true\n skills: true\n agents: true\n"
2280
2416
  fi
2281
2417
  if [ "$_cli_windsurf" = "true" ]; then
2282
- _init_plugins="${_init_plugins} windsurf:\n instructions: true\n prompts: true\n skills: true\n"
2418
+ _init_plugins="${_init_plugins} windsurf:\n instructions: true\n prompts: true\n skills: true\n agents: true\n"
2283
2419
  fi
2284
2420
 
2285
2421
  cat > "$_target_yaml" <<YAML_EOF
@@ -2822,24 +2958,36 @@ cmd_status() {
2822
2958
  if [ -d "$NEXUS_DIR/.claude/skills" ]; then
2823
2959
  printf ' %b✓%b %s %b(Claude skills)%b\n' "$_G" "$_NC" ".claude/skills/" "$_DIM" "$_NC"
2824
2960
  fi
2961
+ if [ -d "$NEXUS_DIR/.claude/agents" ]; then
2962
+ printf ' %b✓%b %s %b(Claude agents)%b\n' "$_G" "$_NC" ".claude/agents/" "$_DIM" "$_NC"
2963
+ fi
2825
2964
  if [ -d "$NEXUS_DIR/.gemini/prompts" ]; then
2826
2965
  printf ' %b✓%b %s %b(Gemini prompts)%b\n' "$_G" "$_NC" ".gemini/prompts/" "$_DIM" "$_NC"
2827
2966
  fi
2828
2967
  if [ -d "$NEXUS_DIR/.gemini/skills" ]; then
2829
2968
  printf ' %b✓%b %s %b(Gemini skills)%b\n' "$_G" "$_NC" ".gemini/skills/" "$_DIM" "$_NC"
2830
2969
  fi
2970
+ if [ -d "$NEXUS_DIR/.gemini/agents" ]; then
2971
+ printf ' %b✓%b %s %b(Gemini agents)%b\n' "$_G" "$_NC" ".gemini/agents/" "$_DIM" "$_NC"
2972
+ fi
2831
2973
  if [ -d "$NEXUS_DIR/.cursor/prompts" ]; then
2832
2974
  printf ' %b✓%b %s %b(Cursor prompts)%b\n' "$_G" "$_NC" ".cursor/prompts/" "$_DIM" "$_NC"
2833
2975
  fi
2834
2976
  if [ -d "$NEXUS_DIR/.cursor/skills" ]; then
2835
2977
  printf ' %b✓%b %s %b(Cursor skills)%b\n' "$_G" "$_NC" ".cursor/skills/" "$_DIM" "$_NC"
2836
2978
  fi
2979
+ if [ -d "$NEXUS_DIR/.cursor/agents" ]; then
2980
+ printf ' %b✓%b %s %b(Cursor agents)%b\n' "$_G" "$_NC" ".cursor/agents/" "$_DIM" "$_NC"
2981
+ fi
2837
2982
  if [ -d "$NEXUS_DIR/.windsurf/prompts" ]; then
2838
2983
  printf ' %b✓%b %s %b(Windsurf prompts)%b\n' "$_G" "$_NC" ".windsurf/prompts/" "$_DIM" "$_NC"
2839
2984
  fi
2840
2985
  if [ -d "$NEXUS_DIR/.windsurf/skills" ]; then
2841
2986
  printf ' %b✓%b %s %b(Windsurf skills)%b\n' "$_G" "$_NC" ".windsurf/skills/" "$_DIM" "$_NC"
2842
2987
  fi
2988
+ if [ -d "$NEXUS_DIR/.windsurf/agents" ]; then
2989
+ printf ' %b✓%b %s %b(Windsurf agents)%b\n' "$_G" "$_NC" ".windsurf/agents/" "$_DIM" "$_NC"
2990
+ fi
2843
2991
  printf '\n'
2844
2992
 
2845
2993
  printf '%bActive Plugins:%b\n' "$_BOLD" "$_NC"
@@ -2867,10 +3015,11 @@ cmd_status() {
2867
3015
  "$(copilot_agents_enabled && echo "true" || echo "false")" "$_NC"
2868
3016
  ;;
2869
3017
  claude|gemini|cursor|windsurf)
2870
- printf ' %b↳ Options: instructions=%s, prompts=%s, skills=%s%b\n' "$_DIM" \
3018
+ printf ' %b↳ Options: instructions=%s, prompts=%s, skills=%s, agents=%s%b\n' "$_DIM" \
2871
3019
  "$(provider_option_enabled "$_pname" "instructions" && echo "true" || echo "false")" \
2872
3020
  "$(provider_option_enabled "$_pname" "prompts" && echo "true" || echo "false")" \
2873
- "$(provider_option_enabled "$_pname" "skills" && echo "true" || echo "false")" "$_NC"
3021
+ "$(provider_option_enabled "$_pname" "skills" && echo "true" || echo "false")" \
3022
+ "$(provider_option_enabled "$_pname" "agents" && echo "true" || echo "false")" "$_NC"
2874
3023
  ;;
2875
3024
  esac
2876
3025
  fi
@@ -2958,10 +3107,6 @@ cmd_fix() {
2958
3107
  elif ! has_ai_provider_plugin_enabled; then
2959
3108
  merge_rnex_instructions "$NEXUS_DIR/AGENTS.md"
2960
3109
  fi
2961
- [ -f "$NEXUS_DIR/CLAUDE.md" ] && ! claude_plugin_enabled && merge_rnex_instructions "$NEXUS_DIR/CLAUDE.md"
2962
- [ -f "$NEXUS_DIR/GEMINI.md" ] && ! gemini_plugin_enabled && merge_rnex_instructions "$NEXUS_DIR/GEMINI.md"
2963
- [ -f "$NEXUS_DIR/.cursorrules" ] && ! cursor_plugin_enabled && merge_rnex_instructions "$NEXUS_DIR/.cursorrules"
2964
- [ -f "$NEXUS_DIR/.windsurfrules" ] && ! windsurf_plugin_enabled && merge_rnex_instructions "$NEXUS_DIR/.windsurfrules"
2965
3110
 
2966
3111
  # 3. Sync standard prompts to .rnex/prompts/
2967
3112
  sync_prompts
@@ -3117,21 +3262,25 @@ cmd_plugin_info() {
3117
3262
  printf ' - instructions: true|false (mirror instructions to CLAUDE.md; current: %s)\n' "$(claude_instructions_enabled && echo "true" || echo "false")"
3118
3263
  printf ' - prompts: true|false (mirror prompts to .claude/commands/ and .claude/prompts/; current: %s)\n' "$(claude_prompts_enabled && echo "true" || echo "false")"
3119
3264
  printf ' - skills: true|false (mirror skills to .claude/skills/<name>/SKILL.md; current: %s)\n' "$(claude_skills_enabled && echo "true" || echo "false")"
3265
+ printf ' - agents: true|false (mirror agents to .claude/agents/*.md; current: %s)\n' "$(claude_agents_enabled && echo "true" || echo "false")"
3120
3266
  elif [ "$_name" = "gemini" ]; then
3121
3267
  printf '\n%bConfigurable Options (in rnex.yaml or .local.rnex.yaml):%b\n' "$_BOLD" "$_NC"
3122
3268
  printf ' - instructions: true|false (mirror instructions to GEMINI.md; current: %s)\n' "$(gemini_instructions_enabled && echo "true" || echo "false")"
3123
3269
  printf ' - prompts: true|false (mirror prompts to .gemini/prompts/; current: %s)\n' "$(gemini_prompts_enabled && echo "true" || echo "false")"
3124
3270
  printf ' - skills: true|false (mirror skills to .gemini/skills/<name>/SKILL.md; current: %s)\n' "$(gemini_skills_enabled && echo "true" || echo "false")"
3271
+ printf ' - agents: true|false (mirror agents to .gemini/agents/*.md; current: %s)\n' "$(gemini_agents_enabled && echo "true" || echo "false")"
3125
3272
  elif [ "$_name" = "cursor" ]; then
3126
3273
  printf '\n%bConfigurable Options (in rnex.yaml or .local.rnex.yaml):%b\n' "$_BOLD" "$_NC"
3127
3274
  printf ' - instructions: true|false (mirror instructions to .cursorrules & .cursor/rules/; current: %s)\n' "$(cursor_instructions_enabled && echo "true" || echo "false")"
3128
3275
  printf ' - prompts: true|false (mirror prompts to .cursor/prompts/; current: %s)\n' "$(cursor_prompts_enabled && echo "true" || echo "false")"
3129
3276
  printf ' - skills: true|false (mirror skills to .cursor/skills/<name>/SKILL.md; current: %s)\n' "$(cursor_skills_enabled && echo "true" || echo "false")"
3277
+ printf ' - agents: true|false (mirror agents to .cursor/agents/*.md; current: %s)\n' "$(cursor_agents_enabled && echo "true" || echo "false")"
3130
3278
  elif [ "$_name" = "windsurf" ]; then
3131
3279
  printf '\n%bConfigurable Options (in rnex.yaml or .local.rnex.yaml):%b\n' "$_BOLD" "$_NC"
3132
3280
  printf ' - instructions: true|false (mirror instructions to .windsurfrules; current: %s)\n' "$(windsurf_instructions_enabled && echo "true" || echo "false")"
3133
3281
  printf ' - prompts: true|false (mirror prompts to .windsurf/prompts/; current: %s)\n' "$(windsurf_prompts_enabled && echo "true" || echo "false")"
3134
3282
  printf ' - skills: true|false (mirror skills to .windsurf/skills/<name>/SKILL.md; current: %s)\n' "$(windsurf_skills_enabled && echo "true" || echo "false")"
3283
+ printf ' - agents: true|false (mirror agents to .windsurf/agents/*.md; current: %s)\n' "$(windsurf_agents_enabled && echo "true" || echo "false")"
3135
3284
  fi
3136
3285
 
3137
3286
  printf '\n%bScoped Directory:%b .rnex/plugins/%s\n' "$_BOLD" "$_NC" "$_name"