@arthai/agents 1.0.0 → 1.0.1

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.
Files changed (89) hide show
  1. package/README.md +108 -105
  2. package/VERSION +1 -1
  3. package/bin/cli.js +148 -12
  4. package/compiler.sh +69 -10
  5. package/dist/plugins/canvas/.claude-plugin/plugin.json +4 -2
  6. package/dist/plugins/canvas/{skills/planning/SKILL.md → commands/planning.md} +0 -2
  7. package/dist/plugins/compass/.claude-plugin/plugin.json +4 -2
  8. package/dist/plugins/compass/{skills/planning/SKILL.md → commands/planning.md} +0 -2
  9. package/dist/plugins/counsel/.claude-plugin/plugin.json +4 -2
  10. package/dist/plugins/counsel/{skills/client-discovery/SKILL.md → commands/client-discovery.md} +0 -2
  11. package/dist/plugins/{prime/skills/consulting/SKILL.md → counsel/commands/consulting.md} +0 -2
  12. package/dist/plugins/{prime/skills/deliverable-builder/SKILL.md → counsel/commands/deliverable-builder.md} +0 -2
  13. package/dist/plugins/counsel/{skills/engagement-tracker/SKILL.md → commands/engagement-tracker.md} +0 -2
  14. package/dist/plugins/{prime/skills/market-research/SKILL.md → counsel/commands/market-research.md} +0 -2
  15. package/dist/plugins/{prime/skills/opportunity-map/SKILL.md → counsel/commands/opportunity-map.md} +0 -2
  16. package/dist/plugins/{prime/skills/pitch-generator/SKILL.md → counsel/commands/pitch-generator.md} +0 -2
  17. package/dist/plugins/counsel/{skills/roi-calculator/SKILL.md → commands/roi-calculator.md} +0 -2
  18. package/dist/plugins/counsel/{skills/share/SKILL.md → commands/share.md} +0 -2
  19. package/dist/plugins/{prime/skills/solution-architect/SKILL.md → counsel/commands/solution-architect.md} +0 -2
  20. package/dist/plugins/{prime/skills/templates/SKILL.md → counsel/commands/templates.md} +0 -2
  21. package/dist/plugins/{prime/skills/welcome/SKILL.md → counsel/commands/welcome.md} +0 -2
  22. package/dist/plugins/{prime/skills/wizard/SKILL.md → counsel/commands/wizard.md} +0 -2
  23. package/dist/plugins/cruise/.claude-plugin/plugin.json +4 -2
  24. package/dist/plugins/cruise/{skills/autopilot/SKILL.md → commands/autopilot.md} +0 -2
  25. package/dist/plugins/forge/.claude-plugin/plugin.json +4 -2
  26. package/dist/plugins/{prime/skills/implement/SKILL.md → forge/commands/implement.md} +0 -2
  27. package/dist/plugins/{prime/skills/planning/SKILL.md → forge/commands/planning.md} +0 -2
  28. package/dist/plugins/forge/{skills/pr/SKILL.md → commands/pr.md} +0 -1
  29. package/dist/plugins/{prime/skills/precheck/SKILL.md → forge/commands/precheck.md} +0 -2
  30. package/dist/plugins/forge/{skills/qa/SKILL.md → commands/qa.md} +0 -2
  31. package/dist/plugins/{prime/skills/review-pr/SKILL.md → forge/commands/review-pr.md} +0 -2
  32. package/dist/plugins/prime/.claude-plugin/plugin.json +4 -2
  33. package/dist/plugins/prime/{skills/arth/SKILL.md → commands/arth.md} +0 -2
  34. package/dist/plugins/prime/{skills/autopilot/SKILL.md → commands/autopilot.md} +0 -2
  35. package/dist/plugins/prime/{skills/calibrate/SKILL.md → commands/calibrate.md} +0 -2
  36. package/dist/plugins/prime/{skills/ci-fix/SKILL.md → commands/ci-fix.md} +0 -2
  37. package/dist/plugins/prime/{skills/client-discovery/SKILL.md → commands/client-discovery.md} +0 -2
  38. package/dist/plugins/{counsel/skills/consulting/SKILL.md → prime/commands/consulting.md} +0 -2
  39. package/dist/plugins/prime/{skills/custom-domain/SKILL.md → commands/custom-domain.md} +0 -2
  40. package/dist/plugins/{counsel/skills/deliverable-builder/SKILL.md → prime/commands/deliverable-builder.md} +0 -2
  41. package/dist/plugins/prime/{skills/discord-ops/SKILL.md → commands/discord-ops.md} +0 -1
  42. package/dist/plugins/prime/{skills/engagement-tracker/SKILL.md → commands/engagement-tracker.md} +0 -2
  43. package/dist/plugins/prime/{skills → commands}/explore.md +0 -1
  44. package/dist/plugins/prime/{skills/fix/SKILL.md → commands/fix.md} +0 -2
  45. package/dist/plugins/{forge/skills/implement/SKILL.md → prime/commands/implement.md} +0 -2
  46. package/dist/plugins/prime/{skills/incident/SKILL.md → commands/incident.md} +0 -2
  47. package/dist/plugins/prime/{skills/issue/SKILL.md → commands/issue.md} +0 -1
  48. package/dist/plugins/{counsel/skills/market-research/SKILL.md → prime/commands/market-research.md} +0 -2
  49. package/dist/plugins/{spark/skills/onboard/SKILL.md → prime/commands/onboard.md} +0 -2
  50. package/dist/plugins/{counsel/skills/opportunity-map/SKILL.md → prime/commands/opportunity-map.md} +0 -2
  51. package/dist/plugins/{counsel/skills/pitch-generator/SKILL.md → prime/commands/pitch-generator.md} +0 -2
  52. package/dist/plugins/{forge/skills/planning/SKILL.md → prime/commands/planning.md} +0 -2
  53. package/dist/plugins/prime/{skills/pr/SKILL.md → commands/pr.md} +0 -1
  54. package/dist/plugins/{forge/skills/precheck/SKILL.md → prime/commands/precheck.md} +0 -2
  55. package/dist/plugins/{prism/skills/qa-incident/SKILL.md → prime/commands/qa-incident.md} +0 -2
  56. package/dist/plugins/{prism/skills/qa-learn/SKILL.md → prime/commands/qa-learn.md} +0 -2
  57. package/dist/plugins/prime/{skills/qa/SKILL.md → commands/qa.md} +0 -2
  58. package/dist/plugins/{sentinel/skills/restart/SKILL.md → prime/commands/restart.md} +0 -2
  59. package/dist/plugins/{forge/skills/review-pr/SKILL.md → prime/commands/review-pr.md} +0 -2
  60. package/dist/plugins/prime/{skills/roi-calculator/SKILL.md → commands/roi-calculator.md} +0 -2
  61. package/dist/plugins/prime/{skills/scan/SKILL.md → commands/scan.md} +0 -2
  62. package/dist/plugins/prime/{skills/setup/SKILL.md → commands/setup.md} +0 -2
  63. package/dist/plugins/prime/{skills/share/SKILL.md → commands/share.md} +0 -2
  64. package/dist/plugins/{counsel/skills/solution-architect/SKILL.md → prime/commands/solution-architect.md} +0 -2
  65. package/dist/plugins/prime/{skills/sre/SKILL.md → commands/sre.md} +0 -2
  66. package/dist/plugins/prime/{skills/sync/SKILL.md → commands/sync.md} +0 -1
  67. package/dist/plugins/{counsel/skills/templates/SKILL.md → prime/commands/templates.md} +0 -2
  68. package/dist/plugins/{counsel/skills/welcome/SKILL.md → prime/commands/welcome.md} +0 -2
  69. package/dist/plugins/{counsel/skills/wizard/SKILL.md → prime/commands/wizard.md} +0 -2
  70. package/dist/plugins/prism/.claude-plugin/plugin.json +4 -2
  71. package/dist/plugins/{prime/skills/qa-incident/SKILL.md → prism/commands/qa-incident.md} +0 -2
  72. package/dist/plugins/{prime/skills/qa-learn/SKILL.md → prism/commands/qa-learn.md} +0 -2
  73. package/dist/plugins/prism/{skills/qa/SKILL.md → commands/qa.md} +0 -2
  74. package/dist/plugins/scalpel/.claude-plugin/plugin.json +4 -2
  75. package/dist/plugins/scalpel/{skills/ci-fix/SKILL.md → commands/ci-fix.md} +0 -2
  76. package/dist/plugins/scalpel/{skills/fix/SKILL.md → commands/fix.md} +0 -2
  77. package/dist/plugins/scalpel/{skills/issue/SKILL.md → commands/issue.md} +0 -1
  78. package/dist/plugins/sentinel/.claude-plugin/plugin.json +4 -2
  79. package/dist/plugins/sentinel/{skills/incident/SKILL.md → commands/incident.md} +0 -2
  80. package/dist/plugins/{prime/skills/restart/SKILL.md → sentinel/commands/restart.md} +0 -2
  81. package/dist/plugins/sentinel/{skills/sre/SKILL.md → commands/sre.md} +0 -2
  82. package/dist/plugins/shield/.claude-plugin/plugin.json +4 -2
  83. package/dist/plugins/spark/.claude-plugin/plugin.json +4 -2
  84. package/dist/plugins/spark/{skills/calibrate/SKILL.md → commands/calibrate.md} +0 -2
  85. package/dist/plugins/{prime/skills/onboard/SKILL.md → spark/commands/onboard.md} +0 -2
  86. package/dist/plugins/spark/{skills/scan/SKILL.md → commands/scan.md} +0 -2
  87. package/dist/plugins/spark/{skills/setup/SKILL.md → commands/setup.md} +0 -2
  88. package/package.json +1 -1
  89. package/skills/publish/SKILL.md +218 -0
package/README.md CHANGED
@@ -1,123 +1,126 @@
1
- # Claude Agents
1
+ # @arthai/agents
2
2
 
3
- A portable toolkit of 18 AI agents, 18 skills, and 13 hooks for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). Install once at `~/.claude-agents/`, symlink into any project — all projects stay in sync automatically.
3
+ AI development toolkit for Claude Code agents, skills, and hooks organized into installable bundles.
4
4
 
5
- ## Quick Start
5
+ ## Install
6
6
 
7
7
  ```bash
8
- # 1. Clone + license
9
- git clone git@github.com:ArthTech-AI/claude-agents.git ~/.claude-agents
10
- ~/.claude-agents/install.sh --key ARTH-XXXX-XXXX-XXXX-XXXX
8
+ # Install a bundle into your project
9
+ npx @arthai/agents install forge .
11
10
 
12
- # 2. Install into your project
13
- ~/.claude-agents/install.sh /path/to/project
11
+ # Install multiple bundles
12
+ npx @arthai/agents install forge spark shield .
13
+
14
+ # See all available bundles
15
+ npx @arthai/agents list
16
+
17
+ # Show what's in a bundle
18
+ npx @arthai/agents info forge
14
19
  ```
15
20
 
16
- Open Claude Code — agents, skills, and hooks are active. Auto-syncs on every session start.
17
-
18
- First session: type `/calibrate` to deep-learn your project (reads source code, recommends agents, skills, MCP servers).
19
-
20
- ### Other Install Modes
21
-
22
- | Command | When to use |
23
- |---------|-------------|
24
- | `install.sh --assess .` | See what you have vs the toolkit (read-only) |
25
- | `install.sh --setup .` | Change category selections |
26
- | `install.sh --upgrade .` | Upgrade existing project (converts stale files) |
27
- | `install.sh --convert .` | Migrate from copy-based install |
28
- | `install.sh --status .` | Show what's linked/overridden/missing |
29
-
30
- ## What You Get
31
-
32
- **18 Agents** specialized AI workers Claude delegates to automatically:
33
-
34
- | Tier | Model | Cost | Agents |
35
- |------|-------|------|--------|
36
- | Cheap | Haiku | 1x | explore-light, ops, qa-baseline-updater, qa-test-promoter |
37
- | Mid | Sonnet | 10x | frontend, python-backend, sre, qa, qa-domain, qa-e2e, qa-challenger, code-reviewer, design-studio:think, design-studio:critique |
38
- | Expensive | Opus | 60x | architect, product-manager, gtm-expert, design-studio:create |
39
-
40
- **19 Skills** invoke with `/name` in Claude Code:
41
-
42
- | Skill | What it does |
43
- |-------|-------------|
44
- | `/calibrate` | Deep-learn project, recommend + install MCP servers, agents, skills, workflows, knowledge base |
45
- | `/onboard` | Session start — project briefing + work prioritization |
46
- | `/planning <feature>` | Spawn planning team (PM + Architect + optional Design/GTM) |
47
- | `/implement <feature>` | Spawn implementation team from plan |
48
- | `/pr` | QA + PR creation + post-merge cleanup |
49
- | `/qa [full\|staging\|prod]` | Run QA checks at different levels |
50
- | `/ci-fix [ci\|staging\|prod]` | Auto-remediate CI/CD failures (3 retries) |
51
- | `/issue <title>` | GitHub issue management |
52
- | `/explore <query>` | Fast codebase search (Haiku) |
53
- | `/scan` | Auto-populate CLAUDE.md from codebase |
54
- | `/sync` | Sync toolkit, check status, contribute back |
55
- | `/restart` | Kill and restart local dev servers |
56
- | `/sre <cmd>` | SRE operations: status, health, logs, debug |
57
- | `/qa-incident` | Log a QA incident |
58
- | `/qa-learn` | Review QA knowledge base |
59
- | `/discord-ops` | Discord ChatOps reference |
60
- | `/superpowers` | Advanced operations |
61
- | `/autopilot [issue]` | Autonomous work loop — assess, plan, implement, QA, PR |
62
- | `/railway` | Railway-specific ops (needs `--railway` flag) |
63
-
64
- **13 Hooks** — run automatically on Claude Code events:
65
-
66
- | Hook | Event | Purpose |
67
- |------|-------|---------|
68
- | triage-router.sh | UserPromptSubmit | Cost-aware routing to cheaper agents |
69
- | session-bootstrap.sh | SessionStart | Compact project briefing |
70
- | sync-agents.sh | SessionStart | Auto-pull repo + re-sync |
71
- | pre-bash-guard.sh | PreToolUse | Blocks dangerous commands |
72
- | pre-edit-guard.sh | PreToolUse | Prevents edits to protected files |
73
- | pre-task-context.sh | PreToolUse | Injects CLAUDE.md into spawned agents |
74
- | post-test-summary.sh | PostToolUse | Summarizes test/lint output |
75
- | post-deploy-health.sh | PostToolUse | Health checks after deploys |
76
- | post-edit-lint.sh | PostToolUse | Lint check after file edits |
77
- | sync-worktree.sh | PostToolUse | Syncs config across worktrees |
78
- | sync-railway-worktree.sh | PostToolUse | Railway worktree sync |
79
- | post-git-state.sh | PostToolUse | Detects merges, resets autopilot phase |
80
- | session-start.sh | SessionStart | Legacy session start |
81
-
82
- ## Install Modes
83
-
84
- | Command | Purpose |
85
- |---------|---------|
86
- | `install.sh .` | Sync — create missing symlinks, skip existing files |
87
- | `install.sh --init .` | Greenfield — scaffold dirs + CLAUDE.md + settings.json + sync |
88
- | `install.sh --setup .` | Interactive — pick which categories to install |
89
- | `install.sh --convert .` | Migrate — replace matching copies with symlinks |
90
- | `install.sh --assess .` | Brownfield analysis — read-only, shows diffs |
91
- | `install.sh --upgrade .` | Brownfield upgrade — interactive per-file conversion |
92
- | `install.sh --status .` | Status report — what's linked, overridden, missing |
93
- | `install.sh --uninstall .` | Clean removal — restore backups, remove symlinks |
94
- | `install.sh --generate-config .` | Generate config from existing .claude/ contents |
95
- | `install.sh --key KEY` | Store license key |
96
-
97
- Flags: `--railway` (Railway skills), `--yes` (auto-approve upgrades), `--skip file1,file2` (exclude files)
98
-
99
- ## How It Works
100
-
101
- Symlinks from your project to `~/.claude-agents/`. Update the repo, all projects update.
21
+ ## Bundles
22
+
23
+ Pick what you need. Each bundle is a self-contained set of agents, skills, and hooks.
24
+
25
+ ### Development
26
+
27
+ | Bundle | Command | What you get |
28
+ |--------|---------|-------------|
29
+ | **forge** | `npx @arthai/agents install forge .` | Full dev workflow: `/planning`, `/implement`, `/qa`, `/pr`, `/precheck`, `/review-pr` + 6 agents (architect, PM, backend, frontend, QA, code-reviewer) + triage router hook |
30
+ | **scalpel** | `npx @arthai/agents install scalpel .` | Bug fixing: `/fix`, `/ci-fix`, `/issue` + code-reviewer agent + edit guard hook |
31
+ | **spark** | `npx @arthai/agents install spark .` | Project setup: `/onboard`, `/calibrate`, `/scan`, `/setup` + setup and explore agents |
32
+
33
+ ### Operations
34
+
35
+ | Bundle | Command | What you get |
36
+ |--------|---------|-------------|
37
+ | **sentinel** | `npx @arthai/agents install sentinel .` | SRE + ops: `/sre`, `/incident`, `/restart` + SRE and ops agents + deploy health + git state hooks |
38
+ | **prism** | `npx @arthai/agents install prism .` | Deep QA: `/qa`, `/qa-learn`, `/qa-incident` + 6 QA agents (qa, e2e, domain, challenger, baseline, promoter) |
39
+ | **shield** | `npx @arthai/agents install shield .` | Safety guardrails: bash guard, edit guard, session bootstrap, triage router hooks (no skills — hooks only) |
40
+
41
+ ### Strategy
42
+
43
+ | Bundle | Command | What you get |
44
+ |--------|---------|-------------|
45
+ | **canvas** | `npx @arthai/agents install canvas .` | Design: `/planning` + design-studio agents (think, create, critique) + frontend agent |
46
+ | **compass** | `npx @arthai/agents install compass .` | Product: `/planning` + PM, GTM, user researcher, content strategist agents |
47
+ | **counsel** | `npx @arthai/agents install counsel .` | Consulting: 13 skills (client-discovery, proposals, deliverables, ROI, etc.) + 4 consulting agents |
48
+
49
+ ### Power
102
50
 
51
+ | Bundle | Command | What you get |
52
+ |--------|---------|-------------|
53
+ | **cruise** | `npx @arthai/agents install cruise .` | Autonomous mode: `/autopilot` — picks up issues, implements, QAs, creates PRs. Auto-installs forge + scalpel + sentinel. |
54
+ | **prime** | `npx @arthai/agents install prime .` | Everything. All 25 agents, 37 skills, 16 hooks. |
55
+
56
+ ## Workflows
57
+
58
+ After installing, use skills in Claude Code:
59
+
60
+ **Start a new project:**
103
61
  ```
104
- your-project/.claude/agents/architect.md → ~/.claude-agents/agents/architect.md
62
+ /onboard # get project briefing
63
+ /calibrate # auto-configure toolkit for your codebase
64
+ /planning my-feature # design the feature with architect + PM agents
65
+ /implement my-feature # build with parallel agent team
105
66
  ```
106
67
 
107
- **Override**: Replace any symlink with a regular file. Installer skips it forever.
108
- **Auto-sync**: `sync-agents.sh` hook pulls latest on every session start.
109
- **Auto-adapt**: `/calibrate` reads actual source code (not just config files) to tailor agents, skills, MCP servers, and workflows to your project.
110
- **Cost routing**: Triage router delegates to Haiku/Sonnet before using Opus.
68
+ **Fix a bug:**
69
+ ```
70
+ /fix #42 # root cause analysis + fix + regression tests
71
+ /ci-fix # auto-repair CI failures
72
+ ```
111
73
 
112
- ## Docs
74
+ **Ship code:**
75
+ ```
76
+ /precheck # local CI in 30s
77
+ /qa commit # targeted QA on changed files
78
+ /pr # create PR with QA results
79
+ ```
113
80
 
114
- - **[GETTING-STARTED.md](GETTING-STARTED.md)** — Full user guide (install, usage, customization, contributing)
115
- - **[tests/README.md](tests/README.md)** — Test suite quick start
116
- - **[tests/TESTING.md](tests/TESTING.md)** Full test guide (suites, fixtures, libraries, writing tests)
81
+ **Autonomous mode:**
82
+ ```
83
+ /autopilot # picks up issues implements QAs creates PRs
84
+ ```
85
+
86
+ **Operations:**
87
+ ```
88
+ /sre status # health check all services
89
+ /incident # triage + parallel diagnosis
90
+ /restart # restart local dev servers
91
+ ```
92
+
93
+ ## Uninstall
94
+
95
+ ```bash
96
+ npx @arthai/agents uninstall forge .
97
+ ```
98
+
99
+ Remove everything:
100
+
101
+ ```bash
102
+ rm -rf .claude/skills .claude/agents .claude/hooks
103
+ ```
104
+
105
+ Note: hooks merged into `.claude/settings.json` need to be removed manually.
106
+
107
+ ## Troubleshooting
108
+
109
+ | Problem | Fix |
110
+ |---------|-----|
111
+ | Skills not showing | Restart Claude Code in the project |
112
+ | `/planning` says unknown skill | Verify files exist: `ls .claude/skills/planning/SKILL.md` |
113
+ | Install says "not found in dist/" | Update: `npx @arthai/agents@latest install forge .` |
114
+
115
+ ## Also available as Claude Code plugin
116
+
117
+ ```
118
+ /plugin marketplace add ArthTech-AI/arthai-marketplace
119
+ /plugin install forge@arthai-marketplace
120
+ ```
117
121
 
118
122
  ## Requirements
119
123
 
120
124
  - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code)
121
- - `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in settings
125
+ - Node.js 18+
122
126
  - License key (format: `ARTH-XXXX-XXXX-XXXX-XXXX`)
123
- - (Optional) [Railway CLI](https://docs.railway.app/guides/cli) for Railway skills
package/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
package/bin/cli.js CHANGED
@@ -26,6 +26,10 @@ switch (command) {
26
26
  case 'info':
27
27
  handleInfo(args[1]);
28
28
  break;
29
+ case 'uninstall':
30
+ case 'remove':
31
+ handleUninstall(args.slice(1));
32
+ break;
29
33
  case 'legacy':
30
34
  handleLegacy(args.slice(1));
31
35
  break;
@@ -94,7 +98,13 @@ function handleInstall(rawArgs) {
94
98
  process.exit(1);
95
99
  }
96
100
 
97
- const pluginsTargetDir = path.join(targetDir, '.claude', 'plugins');
101
+ const claudeDir = path.join(targetDir, '.claude');
102
+ const skillsDir = path.join(claudeDir, 'skills');
103
+ const agentsDir = path.join(claudeDir, 'agents');
104
+
105
+ let totalCommands = 0;
106
+ let totalAgents = 0;
107
+ let totalHooks = 0;
98
108
 
99
109
  for (const name of resolved) {
100
110
  // Defense-in-depth: verify the resolved path stays inside PLUGINS_DIR
@@ -107,11 +117,13 @@ function handleInstall(rawArgs) {
107
117
  console.error(`Plugin '${name}' not found in dist/plugins/. Run compiler.sh first.`);
108
118
  process.exit(1);
109
119
  }
110
- copyPlugin(pluginDir, pluginsTargetDir, name);
111
- console.log(` Installed: ${name} → ${path.join(pluginsTargetDir, name)}`);
120
+ const counts = installBundle(pluginDir, claudeDir, skillsDir, agentsDir, name);
121
+ totalCommands += counts.commands;
122
+ totalAgents += counts.agents;
123
+ totalHooks += counts.hooks;
112
124
  }
113
125
 
114
- console.log(`\nDone. ${resolved.length} plugin(s) installed to ${pluginsTargetDir}`);
126
+ console.log(`\nDone. ${resolved.length} bundle(s) installed: ${totalCommands} skills, ${totalAgents} agents, ${totalHooks} hooks`);
115
127
  }
116
128
 
117
129
  // ── list ──────────────────────────────────────────────────────────────────────
@@ -199,6 +211,71 @@ function handleLegacy(legacyArgs) {
199
211
  process.exit(result.status || 0);
200
212
  }
201
213
 
214
+ // ── uninstall ────────────────────────────────────────────────────────────────
215
+
216
+ function handleUninstall(rawArgs) {
217
+ if (rawArgs.length === 0) {
218
+ console.error('Usage: arthai uninstall <bundle> [bundle...] [target-path]');
219
+ process.exit(1);
220
+ }
221
+
222
+ const targetDir = looksLikePath(rawArgs[rawArgs.length - 1])
223
+ ? rawArgs.pop()
224
+ : process.cwd();
225
+
226
+ const bundleNames = rawArgs.filter(a => isValidBundleName(a));
227
+ if (bundleNames.length === 0) {
228
+ console.error('No valid bundle names provided.');
229
+ process.exit(1);
230
+ }
231
+
232
+ const claudeDir = path.join(targetDir, '.claude');
233
+ const skillsDir = path.join(claudeDir, 'skills');
234
+ const agentsDir = path.join(claudeDir, 'agents');
235
+
236
+ for (const name of bundleNames) {
237
+ const pluginDir = path.resolve(PLUGINS_DIR, name);
238
+ if (!fs.existsSync(pluginDir)) {
239
+ console.error(`Bundle '${name}' not found in dist/plugins/.`);
240
+ continue;
241
+ }
242
+
243
+ let removed = 0;
244
+
245
+ // Remove skills that came from this bundle's commands/
246
+ const commandsDir = path.join(pluginDir, 'commands');
247
+ if (fs.existsSync(commandsDir)) {
248
+ for (const file of fs.readdirSync(commandsDir)) {
249
+ if (!file.endsWith('.md')) continue;
250
+ const skillName = file.replace('.md', '');
251
+ const skillPath = path.join(skillsDir, skillName);
252
+ if (fs.existsSync(skillPath)) {
253
+ fs.rmSync(skillPath, { recursive: true });
254
+ removed++;
255
+ }
256
+ }
257
+ }
258
+
259
+ // Remove agents that came from this bundle
260
+ const srcAgents = path.join(pluginDir, 'agents');
261
+ if (fs.existsSync(srcAgents)) {
262
+ for (const file of fs.readdirSync(srcAgents)) {
263
+ if (!file.endsWith('.md')) continue;
264
+ const agentPath = path.join(agentsDir, file);
265
+ if (fs.existsSync(agentPath)) {
266
+ fs.unlinkSync(agentPath);
267
+ removed++;
268
+ }
269
+ }
270
+ }
271
+
272
+ console.log(` Removed ${name}: ${removed} files`);
273
+ }
274
+
275
+ console.log('\nNote: hooks in .claude/settings.json were not removed — edit manually if needed.');
276
+ console.log('Done.');
277
+ }
278
+
202
279
  // ── helpers ───────────────────────────────────────────────────────────────────
203
280
 
204
281
  // Validate bundle names: only lowercase alphanumeric and hyphens, max 64 chars.
@@ -257,17 +334,76 @@ function resolveDependencies(names) {
257
334
  return resolved;
258
335
  }
259
336
 
260
- function copyPlugin(sourceDir, targetPluginsDir, name) {
261
- const dest = path.join(targetPluginsDir, name);
337
+ function installBundle(pluginDir, claudeDir, skillsDir, agentsDir, name) {
338
+ const counts = { commands: 0, agents: 0, hooks: 0 };
339
+
340
+ // 1. Copy commands/ → .claude/skills/<name>/SKILL.md (each .md becomes a skill dir)
341
+ const commandsDir = path.join(pluginDir, 'commands');
342
+ if (fs.existsSync(commandsDir)) {
343
+ for (const file of fs.readdirSync(commandsDir)) {
344
+ if (!file.endsWith('.md')) continue;
345
+ const skillName = file.replace('.md', '');
346
+ const destDir = path.join(skillsDir, skillName);
347
+ fs.mkdirSync(destDir, { recursive: true });
348
+ fs.copyFileSync(path.join(commandsDir, file), path.join(destDir, 'SKILL.md'));
349
+ counts.commands++;
350
+ }
351
+ console.log(` ${name}: ${counts.commands} skills → ${skillsDir}`);
352
+ }
353
+
354
+ // 2. Copy agents/ → .claude/agents/
355
+ const srcAgents = path.join(pluginDir, 'agents');
356
+ if (fs.existsSync(srcAgents)) {
357
+ fs.mkdirSync(agentsDir, { recursive: true });
358
+ for (const file of fs.readdirSync(srcAgents)) {
359
+ if (!file.endsWith('.md')) continue;
360
+ fs.copyFileSync(path.join(srcAgents, file), path.join(agentsDir, file));
361
+ counts.agents++;
362
+ }
363
+ console.log(` ${name}: ${counts.agents} agents → ${agentsDir}`);
364
+ }
365
+
366
+ // 3. Merge hooks into .claude/settings.json
367
+ const hooksJson = path.join(pluginDir, 'hooks', 'hooks.json');
368
+ if (fs.existsSync(hooksJson)) {
369
+ const pluginHooks = JSON.parse(fs.readFileSync(hooksJson, 'utf8'));
370
+ const settingsPath = path.join(claudeDir, 'settings.json');
371
+ let settings = {};
372
+ if (fs.existsSync(settingsPath)) {
373
+ try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); } catch (e) { settings = {}; }
374
+ }
375
+ if (!settings.hooks) settings.hooks = {};
376
+
377
+ // Copy hook scripts to .claude/hooks/
378
+ const hooksDir = path.join(claudeDir, 'hooks');
379
+ fs.mkdirSync(hooksDir, { recursive: true });
380
+ const srcHooksDir = path.join(pluginDir, 'hooks');
381
+ for (const file of fs.readdirSync(srcHooksDir)) {
382
+ if (!file.endsWith('.sh')) continue;
383
+ const dest = path.join(hooksDir, file);
384
+ fs.copyFileSync(path.join(srcHooksDir, file), dest);
385
+ fs.chmodSync(dest, 0o755);
386
+ }
387
+
388
+ // Merge hook entries (rewrite CLAUDE_PLUGIN_ROOT to project hooks path)
389
+ const hookData = pluginHooks.hooks || pluginHooks;
390
+ for (const [event, entries] of Object.entries(hookData)) {
391
+ if (!settings.hooks[event]) settings.hooks[event] = [];
392
+ for (const entry of entries) {
393
+ // Rewrite command paths from ${CLAUDE_PLUGIN_ROOT} to $CLAUDE_PROJECT_DIR/.claude
394
+ const rewritten = JSON.parse(
395
+ JSON.stringify(entry).replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, '$CLAUDE_PROJECT_DIR/.claude')
396
+ );
397
+ settings.hooks[event].push(rewritten);
398
+ counts.hooks++;
399
+ }
400
+ }
262
401
 
263
- // Remove existing
264
- if (fs.existsSync(dest)) {
265
- fs.rmSync(dest, { recursive: true });
402
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
403
+ console.log(` ${name}: ${counts.hooks} hook entries merged into settings.json`);
266
404
  }
267
- fs.mkdirSync(dest, { recursive: true });
268
405
 
269
- // Recursive copy
270
- copyDirRecursive(sourceDir, dest);
406
+ return counts;
271
407
  }
272
408
 
273
409
  function copyDirRecursive(src, dest) {
package/compiler.sh CHANGED
@@ -153,6 +153,7 @@ for bundle_file in "${BUNDLE_FILES[@]}"; do
153
153
  mkdir -p "$PLUGIN_DIR/.claude-plugin"
154
154
  mkdir -p "$PLUGIN_DIR/agents"
155
155
  mkdir -p "$PLUGIN_DIR/skills"
156
+ mkdir -p "$PLUGIN_DIR/commands"
156
157
  mkdir -p "$PLUGIN_DIR/hooks"
157
158
 
158
159
  # ── 1. Write plugin.json ──────────────────────────────────────────────────
@@ -163,8 +164,7 @@ for bundle_file in "${BUNDLE_FILES[@]}"; do
163
164
  --arg name "$NAME" \
164
165
  --arg description "$DESC" \
165
166
  --arg version "$VERSION" \
166
- --arg author "Arth AI" \
167
- '{"name": $name, "description": $description, "version": $version, "author": $author}' \
167
+ '{"name": $name, "description": $description, "version": $version, "author": {"name": "Arth AI"}}' \
168
168
  > "$PLUGIN_DIR/.claude-plugin/plugin.json"
169
169
 
170
170
  # ── 2. Determine agents/skills/hooks lists ────────────────────────────────
@@ -223,19 +223,73 @@ for bundle_file in "${BUNDLE_FILES[@]}"; do
223
223
  ((AGENT_COUNT++)) || true
224
224
  done
225
225
 
226
- # ── 4. Copy skills ────────────────────────────────────────────────────────
226
+ # ── 4. Copy skills → commands/ (user-invocable) or skills/ (agent-invoked) ──
227
+ #
228
+ # Claude Code plugin system:
229
+ # commands/*.md → slash commands users type (/plugin:name)
230
+ # skills/*/SKILL.md → context skills Claude auto-invokes
231
+ #
232
+ # We detect user-invocable skills by checking for "user-invocable: true"
233
+ # in SKILL.md frontmatter. These become flat .md files in commands/.
234
+ # Custom frontmatter fields (user-invocable, arguments) are stripped
235
+ # since Claude Code doesn't recognize them.
227
236
 
228
237
  SKILL_COUNT=0
238
+ CMD_COUNT=0
229
239
  for skill_path in "${SKILL_PATHS[@]:-}"; do
230
240
  [ -z "$skill_path" ] && continue
231
241
  src="$SCRIPT_DIR/$skill_path"
232
- if [ -d "$src" ]; then
233
- # Use -P to avoid following symlinks (prevents cycles from install.sh artifacts)
234
- cp -rP "$src" "$PLUGIN_DIR/skills/"
235
- ((SKILL_COUNT++)) || true
242
+ if [ -d "$src" ] && [ -f "$src/SKILL.md" ]; then
243
+ # Check if this is a user-invocable skill goes to commands/
244
+ if grep -q 'user-invocable:.*true' "$src/SKILL.md" 2>/dev/null; then
245
+ # Copy SKILL.md to commands/<name>.md, stripping custom fields
246
+ skill_name=$(basename "$src")
247
+ sed '/^user-invocable:/d; /^arguments:/d' "$src/SKILL.md" \
248
+ > "$PLUGIN_DIR/commands/$skill_name.md"
249
+ # Copy any supporting files (references, scripts) alongside
250
+ find "$src" -maxdepth 1 -not -name SKILL.md -not -name "$(basename "$src")" -not -type l -not -path "$src" | while IFS= read -r extra; do
251
+ if [ -d "$extra" ]; then
252
+ rsync -a --no-links "$extra" "$PLUGIN_DIR/commands/"
253
+ elif [ -f "$extra" ]; then
254
+ cp "$extra" "$PLUGIN_DIR/commands/"
255
+ fi
256
+ done
257
+ ((CMD_COUNT++)) || true
258
+ else
259
+ # Agent-invoked skill → stays in skills/
260
+ rsync -a --no-links "$src" "$PLUGIN_DIR/skills/"
261
+ ((SKILL_COUNT++)) || true
262
+ fi
263
+ elif [ -d "$src" ]; then
264
+ # Directory without SKILL.md — check for nested skills (container dir)
265
+ if find "$src" -mindepth 2 -name "SKILL.md" -print -quit 2>/dev/null | grep -q .; then
266
+ # Container dir — process each sub-skill
267
+ for sub_skill in "$src"/*/; do
268
+ [ -f "$sub_skill/SKILL.md" ] || continue
269
+ if grep -q 'user-invocable:.*true' "$sub_skill/SKILL.md" 2>/dev/null; then
270
+ sub_name=$(basename "$sub_skill")
271
+ sed '/^user-invocable:/d; /^arguments:/d' "$sub_skill/SKILL.md" \
272
+ > "$PLUGIN_DIR/commands/$sub_name.md"
273
+ ((CMD_COUNT++)) || true
274
+ else
275
+ rsync -a --no-links "$sub_skill" "$PLUGIN_DIR/skills/"
276
+ ((SKILL_COUNT++)) || true
277
+ fi
278
+ done
279
+ else
280
+ rsync -a --no-links "$src" "$PLUGIN_DIR/skills/"
281
+ ((SKILL_COUNT++)) || true
282
+ fi
236
283
  elif [ -f "$src" ]; then
237
- cp "$src" "$PLUGIN_DIR/skills/"
238
- ((SKILL_COUNT++)) || true
284
+ # Flat .md file (e.g., explore.md)
285
+ if grep -q 'user-invocable:.*true' "$src" 2>/dev/null; then
286
+ sed '/^user-invocable:/d; /^arguments:/d' "$src" \
287
+ > "$PLUGIN_DIR/commands/$(basename "$src")"
288
+ ((CMD_COUNT++)) || true
289
+ else
290
+ cp "$src" "$PLUGIN_DIR/skills/"
291
+ ((SKILL_COUNT++)) || true
292
+ fi
239
293
  else
240
294
  echo " WARNING: Skill not found: $src" >&2
241
295
  ((ERRORS++)) || true
@@ -292,7 +346,12 @@ for bundle_file in "${BUNDLE_FILES[@]}"; do
292
346
  echo "$HOOKS_JSON" | jq '.' > "$PLUGIN_DIR/hooks/hooks.json"
293
347
  fi
294
348
 
295
- echo " agents=$AGENT_COUNT skills=$SKILL_COUNT hooks=$HOOK_COUNT"
349
+ # Remove empty directories
350
+ rmdir "$PLUGIN_DIR/commands" 2>/dev/null || true
351
+ rmdir "$PLUGIN_DIR/skills" 2>/dev/null || true
352
+ rmdir "$PLUGIN_DIR/hooks" 2>/dev/null || true
353
+
354
+ echo " agents=$AGENT_COUNT commands=$CMD_COUNT skills=$SKILL_COUNT hooks=$HOOK_COUNT"
296
355
  ((COMPILED++)) || true
297
356
  done
298
357
 
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "canvas",
3
3
  "description": "Design-driven development — adversarial design critique + frontend",
4
- "version": "1.0.0",
5
- "author": "Arth AI"
4
+ "version": "1.0.1",
5
+ "author": {
6
+ "name": "Arth AI"
7
+ }
6
8
  }
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: planning
3
3
  description: "Spin up an adversarial planning team for a feature. Usage: /planning <feature-name> [--design] [--gtm] [--fast] [--lite] [-- <brief>]"
4
- user-invocable: true
5
- arguments: "<feature-name> <--design> <--gtm> <--fast> <--lite> <-- brief>"
6
4
  ---
7
5
 
8
6
  # Planning Team Skill
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "compass",
3
3
  "description": "Product strategy — PM, GTM, user research, content strategy",
4
- "version": "1.0.0",
5
- "author": "Arth AI"
4
+ "version": "1.0.1",
5
+ "author": {
6
+ "name": "Arth AI"
7
+ }
6
8
  }
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: planning
3
3
  description: "Spin up an adversarial planning team for a feature. Usage: /planning <feature-name> [--design] [--gtm] [--fast] [--lite] [-- <brief>]"
4
- user-invocable: true
5
- arguments: "<feature-name> <--design> <--gtm> <--fast> <--lite> <-- brief>"
6
4
  ---
7
5
 
8
6
  # Planning Team Skill
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "counsel",
3
3
  "description": "AI consulting toolkit — client discovery, proposals, deliverables",
4
- "version": "1.0.0",
5
- "author": "Arth AI"
4
+ "version": "1.0.1",
5
+ "author": {
6
+ "name": "Arth AI"
7
+ }
6
8
  }
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: client-discovery
3
3
  description: "Client discovery and AI readiness assessment. Usage: /client-discovery <client-name> [-- <brief>]"
4
- user-invocable: true
5
- arguments: "<client-name> [-- brief]"
6
4
  ---
7
5
 
8
6
  # Client Discovery & AI Readiness Assessment
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: consulting
3
3
  description: "Run a full AI consulting engagement. Usage: /consulting <client-name> [--phase discovery|assess|propose|design|deliver|track] [-- <brief>]"
4
- user-invocable: true
5
- arguments: "<client-name> [--phase] [-- brief]"
6
4
  ---
7
5
 
8
6
  # AI Consulting Engagement Orchestrator
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: deliverable-builder
3
3
  description: "Build client-ready consulting deliverables. Usage: /deliverable-builder <client-name> [--type final-report|status-update|board-deck|implementation-guide|training-plan|change-management|data-strategy]"
4
- user-invocable: true
5
- arguments: "<client-name> [--type]"
6
4
  ---
7
5
 
8
6
  # Deliverable Builder Skill
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: engagement-tracker
3
3
  description: "Track consulting engagement progress and milestones. Usage: /engagement-tracker <client-name> [--action status|update|milestone]"
4
- user-invocable: true
5
- arguments: "<client-name> [--action status|update|milestone]"
6
4
  ---
7
5
 
8
6
  # Engagement Tracker Skill
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: market-research
3
3
  description: "Research industry AI adoption, competitors, and trends. Usage: /market-research <client-name> [--focus industry|competitors|trends]"
4
- user-invocable: true
5
- arguments: "<client-name> [--focus industry|competitors|trends]"
6
4
  ---
7
5
 
8
6
  # Market Research Skill