@arthai/agents 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +86 -105
  2. package/VERSION +1 -1
  3. package/bin/cli.js +11 -0
  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
@@ -0,0 +1,218 @@
1
+ ---
2
+ name: publish
3
+ description: "Compile plugins, validate against Anthropic spec, publish to npm + marketplace. Usage: /publish [version], /publish patch, /publish minor, /publish major, /publish validate"
4
+ user-invocable: true
5
+ arguments: "version, patch, minor, major, or validate"
6
+ ---
7
+
8
+ # /publish — Release Distribution Channels
9
+
10
+ Compiles plugins, validates against the Anthropic Claude Code plugin spec, publishes to npm and updates the marketplace repo. Handles version bumping, tagging, and post-publish verification.
11
+
12
+ ## Argument Parsing
13
+
14
+ | Input | Action |
15
+ |-------|--------|
16
+ | `/publish` | Validate + show current state, prompt for version |
17
+ | `/publish validate` | Validate only — no publish, no tag |
18
+ | `/publish patch` | Bump patch (1.0.0 → 1.0.1), compile, validate, tag, push |
19
+ | `/publish minor` | Bump minor (1.0.0 → 1.1.0), compile, validate, tag, push |
20
+ | `/publish major` | Bump major (1.0.0 → 2.0.0), compile, validate, tag, push |
21
+ | `/publish 1.2.3` | Set exact version, compile, validate, tag, push |
22
+
23
+ ## Step 1: Read Current State
24
+
25
+ ```bash
26
+ # Current version
27
+ cat VERSION
28
+
29
+ # Last published npm version
30
+ npm view @arthai/agents version 2>/dev/null || echo "not published"
31
+
32
+ # Last git tag
33
+ git describe --tags --abbrev=0 2>/dev/null || echo "no tags"
34
+
35
+ # Uncommitted changes
36
+ git status --short
37
+ ```
38
+
39
+ If there are uncommitted changes, STOP. Tell the user to commit first.
40
+
41
+ ## Step 2: Compile Plugins
42
+
43
+ ```bash
44
+ chmod +x compiler.sh
45
+ ./compiler.sh
46
+ ```
47
+
48
+ If the compiler fails, STOP and show the error.
49
+
50
+ ## Step 3: Validate Against Anthropic Plugin Spec
51
+
52
+ Run ALL of these checks. Every failure is a blocker.
53
+
54
+ ### 3a. plugin.json validation
55
+
56
+ For each plugin in `dist/plugins/*/`:
57
+
58
+ ```bash
59
+ # plugin.json exists and is valid JSON
60
+ jq empty "$plugin/.claude-plugin/plugin.json"
61
+
62
+ # Required: name (string)
63
+ jq -e '.name | type == "string"' "$plugin/.claude-plugin/plugin.json"
64
+
65
+ # author must be object, not string
66
+ AUTHOR_TYPE=$(jq -r '.author | type' "$plugin/.claude-plugin/plugin.json")
67
+ if [ "$AUTHOR_TYPE" = "string" ]; then
68
+ echo "FAIL: author must be {\"name\": \"...\"}, not a string"
69
+ fi
70
+
71
+ # version must be valid semver
72
+ jq -r '.version' "$plugin/.claude-plugin/plugin.json" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'
73
+ ```
74
+
75
+ ### 3b. Directory structure
76
+
77
+ ```bash
78
+ # Components at plugin root, NOT inside .claude-plugin/
79
+ for dir in agents skills hooks; do
80
+ if [ -d "$plugin/.claude-plugin/$dir" ]; then
81
+ echo "FAIL: $dir/ must be at plugin root, not inside .claude-plugin/"
82
+ fi
83
+ done
84
+ ```
85
+
86
+ ### 3c. No symlinks (causes install failures)
87
+
88
+ ```bash
89
+ # Zero symlinks in compiled output
90
+ SYMLINKS=$(find "$plugin" -type l 2>/dev/null)
91
+ if [ -n "$SYMLINKS" ]; then
92
+ echo "FAIL: symlinks found — Claude Code copies plugins to cache, symlinks break"
93
+ echo "$SYMLINKS"
94
+ fi
95
+ ```
96
+
97
+ ### 3d. Hook format
98
+
99
+ ```bash
100
+ if [ -f "$plugin/hooks/hooks.json" ]; then
101
+ # Valid JSON
102
+ jq empty "$plugin/hooks/hooks.json"
103
+
104
+ # Uses CLAUDE_PLUGIN_ROOT, not CLAUDE_PROJECT_DIR
105
+ if jq -r '.. | strings' "$plugin/hooks/hooks.json" | grep -q 'CLAUDE_PROJECT_DIR'; then
106
+ echo "FAIL: hooks.json must use \${CLAUDE_PLUGIN_ROOT}, not CLAUDE_PROJECT_DIR"
107
+ fi
108
+
109
+ # All referenced .sh files exist and are executable
110
+ jq -r '.. | objects | .command // empty' "$plugin/hooks/hooks.json" | grep '\.sh' | while read cmd; do
111
+ script=$(echo "$cmd" | sed 's|.*hooks/||')
112
+ [ -f "$plugin/hooks/$script" ] || echo "FAIL: $script not found"
113
+ [ -x "$plugin/hooks/$script" ] || echo "FAIL: $script not executable"
114
+ done
115
+ fi
116
+ ```
117
+
118
+ ### 3e. Agent frontmatter
119
+
120
+ ```bash
121
+ for agent in "$plugin/agents/"*.md; do
122
+ [ -f "$agent" ] || continue
123
+ head -1 "$agent" | grep -q "^---" || echo "FAIL: $(basename $agent) missing frontmatter"
124
+ done
125
+ ```
126
+
127
+ ### 3f. Skill structure
128
+
129
+ ```bash
130
+ for skill_dir in "$plugin/skills/"*/; do
131
+ [ -d "$skill_dir" ] || continue
132
+ # Skip container dirs (have nested SKILL.md)
133
+ if find "$skill_dir" -mindepth 2 -name "SKILL.md" -print -quit 2>/dev/null | grep -q .; then
134
+ continue
135
+ fi
136
+ [ -f "$skill_dir/SKILL.md" ] || echo "FAIL: $(basename $skill_dir) missing SKILL.md"
137
+ done
138
+ ```
139
+
140
+ ### 3g. Marketplace format (if marketplace-README.md exists)
141
+
142
+ ```bash
143
+ if [ -f ".claude-plugin/marketplace.json" ] || [ -f "marketplace-README.md" ]; then
144
+ # marketplace.json must be at .claude-plugin/marketplace.json
145
+ # NOT at repo root
146
+ fi
147
+ ```
148
+
149
+ If `/publish validate` was the command, show results and STOP here.
150
+
151
+ ## Step 4: Bump Version
152
+
153
+ Based on the argument:
154
+ - `patch`: increment patch (1.0.0 → 1.0.1)
155
+ - `minor`: increment minor (1.0.0 → 1.1.0)
156
+ - `major`: increment major (1.0.0 → 2.0.0)
157
+ - `1.2.3`: use exact version
158
+
159
+ ```bash
160
+ NEW_VERSION="<computed>"
161
+ echo "$NEW_VERSION" > VERSION
162
+ ```
163
+
164
+ ## Step 5: Commit and Tag
165
+
166
+ ```bash
167
+ git add VERSION
168
+ git commit -m "chore: bump version to $NEW_VERSION"
169
+ # Push via PR if branch protection exists, direct push otherwise
170
+ git tag "v$NEW_VERSION"
171
+ git push --tags
172
+ ```
173
+
174
+ The tag push triggers `publish-npm.yml` which:
175
+ 1. Derives version from git tag (not VERSION file)
176
+ 2. Compiles all plugins
177
+ 3. Publishes to npm
178
+ 4. Updates marketplace repo (`.claude-plugin/marketplace.json` + `plugins/`)
179
+
180
+ ## Step 6: Verify Publish
181
+
182
+ Wait for the publish workflow to complete, then verify:
183
+
184
+ ```bash
185
+ # Check workflow status
186
+ gh run list --workflow publish-npm.yml --limit 1
187
+
188
+ # Verify npm
189
+ npm view @arthai/agents version
190
+
191
+ # Verify marketplace
192
+ gh api repos/ArthTech-AI/arthai-marketplace/contents/.claude-plugin/marketplace.json \
193
+ --jq '.content' | base64 -d | jq '.version'
194
+ ```
195
+
196
+ If the publish workflow fails, show the error logs:
197
+ ```bash
198
+ gh run view <run-id> --log-failed | tail -20
199
+ ```
200
+
201
+ ## Step 7: Test Plugin Install
202
+
203
+ Tell the user to test in Claude Code:
204
+
205
+ ```
206
+ /plugin marketplace update arthai-marketplace
207
+ /plugin install prime@arthai-marketplace
208
+ ```
209
+
210
+ ## Common Failures and Fixes
211
+
212
+ | Error | Cause | Fix |
213
+ |-------|-------|-----|
214
+ | `author: expected object, received string` | `"author": "Name"` in plugin.json | Change to `"author": {"name": "Name"}` in compiler.sh |
215
+ | `symlink cycle` | `cp -r` copies circular symlinks from install.sh artifacts | Use `rsync --no-links` in compiler.sh |
216
+ | `marketplace.json not found` | File at repo root instead of `.claude-plugin/` | Move to `.claude-plugin/marketplace.json` |
217
+ | `E403 cannot publish over previous version` | VERSION not bumped | Derive from git tag, not VERSION file |
218
+ | `Plugin directory not found at path` | `source` path in marketplace.json is wrong | Must be `./plugins/<name>` relative to marketplace root |