Skip to content

Commit 2f1a2d9

Browse files
committed
feat(plugin): add plugin finisher support
1 parent 3f5ebbd commit 2f1a2d9

File tree

3 files changed

+305
-0
lines changed

3 files changed

+305
-0
lines changed

.claude/agents/plugin-reviewer.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
name: plugin-reviewer
3+
description: Review plugin for quality, completeness, and best practices before publishing to marketplace
4+
color: purple
5+
tools:
6+
- Read
7+
- Glob
8+
- Grep
9+
- Bash
10+
---
11+
12+
# Plugin Quality Reviewer
13+
14+
Review the plugin at the given path for quality and completeness before marketplace publication.
15+
16+
## Review Checklist
17+
18+
### 1. Plugin Manifest (plugin.json)
19+
20+
Check `.claude-plugin/plugin.json`:
21+
- ✅ Valid JSON syntax
22+
- ✅ Required fields: name, version, description, author
23+
- ✅ Semantic versioning (e.g., 0.1.0, 1.0.0)
24+
- ✅ Author has name field
25+
- ✅ No placeholder emails like "your-email@example.com"
26+
27+
### 2. Documentation
28+
29+
Check `README.md`:
30+
- ✅ Installation instructions
31+
- ✅ Usage examples
32+
- ✅ Clear description of what the plugin does
33+
- ✅ Attribution for external content (if any)
34+
- ✅ Prerequisites documented (if any)
35+
36+
### 3. Skills Quality
37+
38+
For each skill in `skills/*/SKILL.md`:
39+
- ✅ Has YAML frontmatter with name and description
40+
- ✅ Description has specific trigger phrases (not vague)
41+
- ✅ Content is imperative style (instructions FOR Claude)
42+
- ✅ Reasonable length (~2000 words in main SKILL.md)
43+
- ✅ Uses references/ for detailed content
44+
- ✅ Includes working examples
45+
46+
### 4. Commands Quality
47+
48+
For each command in `commands/*.md`:
49+
- ✅ Has YAML frontmatter with name and description
50+
- ✅ Specifies allowed-tools (minimal necessary set)
51+
- ✅ Includes argument-hint if takes parameters
52+
- ✅ Clear instructions FOR Claude (not documentation)
53+
54+
### 5. Security & Best Practices
55+
56+
- ✅ No hardcoded credentials or API keys
57+
- ✅ No absolute paths (use relative or ${CLAUDE_PLUGIN_ROOT})
58+
- ✅ LICENSE file present
59+
- ✅ No .DS_Store or temp files
60+
- ✅ Follows naming conventions (kebab-case)
61+
- ✅ No overly broad tool permissions
62+
63+
### 6. Marketplace Entry
64+
65+
Check `.claude-plugin/marketplace.json`:
66+
- ✅ Entry exists for this plugin
67+
- ✅ Matches plugin.json metadata
68+
- ✅ Appropriate category selected
69+
- ✅ Homepage URL valid
70+
71+
## Output Format
72+
73+
Provide a summary report:
74+
75+
```
76+
## Plugin Review: [plugin-name]
77+
78+
### ✅ Passed (X/Y checks)
79+
- Valid plugin.json
80+
- Complete README
81+
- [list items]
82+
83+
### ❌ Issues Found
84+
- [specific issue with location]
85+
- [specific issue with location]
86+
87+
### 💡 Recommendations
88+
- [optional improvements]
89+
90+
### Status
91+
[READY FOR MARKETPLACE | NEEDS FIXES]
92+
```
93+
94+
## Usage
95+
96+
Invoke with the plugin directory path:
97+
```
98+
Review plugins/my-plugin/ before publishing
99+
```

.claude/settings.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(ls:*)",
5+
"Bash(curl:*)",
6+
"Bash(tr:*)",
7+
"Bash(chmod:*)",
8+
"Bash(./scripts/generate-skill-index.sh:*)",
9+
"Bash(./.claude/skills/openclaw/scripts/generate-skill-index.sh:*)",
10+
"Bash(./.claude/skills/openclaw/scripts/update-openclaw-docs.sh:*)",
11+
"Bash(./.claude/skills/openclaw-docs/scripts/update-openclaw-docs.sh:*)",
12+
"Bash(for f in skill-*.md)",
13+
"WebSearch",
14+
"Bash(find:*)",
15+
"Bash(tree:*)",
16+
"Bash(ruby:*)",
17+
"Bash(wc:*)",
18+
"Bash(gh issue create:*)",
19+
"Bash(gh label:*)",
20+
"Bash(git remote:*)",
21+
"Bash(npx github-label-sync:*)",
22+
"Bash(gh issue close:*)",
23+
"Bash(for plugin in plugins/*/)",
24+
"Bash(do cp LICENSE \"$plugin/LICENSE\")",
25+
"Bash(done)",
26+
"Bash(./tests/validate-plugin.sh:*)",
27+
"Bash(jq:*)"
28+
]
29+
},
30+
"hooks": {
31+
"PostToolUse": [
32+
{
33+
"matcher": "Edit|Write",
34+
"hooks": [
35+
{
36+
"type": "command",
37+
"command": "bash -c 'INPUT=$(cat); file_path=$(echo \"$INPUT\" | jq -r \".tool_input.file_path // empty\"); if [[ \"$file_path\" == */plugins/*/.claude-plugin/plugin.json ]]; then plugin_dir=\"${file_path%/.claude-plugin/plugin.json}\"; echo \"Validating plugin at $plugin_dir...\"; ./tests/validate-plugin.sh \"$plugin_dir\"; fi'",
38+
"timeout": 30,
39+
"statusMessage": "Validating plugin.json..."
40+
}
41+
]
42+
}
43+
],
44+
"PreToolUse": [
45+
{
46+
"matcher": "Edit|Write",
47+
"hooks": [
48+
{
49+
"type": "prompt",
50+
"prompt": "You are about to edit a file. Context: $ARGUMENTS\n\nIf the file path is .claude-plugin/marketplace.json, verify:\n1. The edit maintains valid JSON structure\n2. All required fields are present (name, description, version, author, source, category)\n3. The source path matches an actual plugin directory\n4. No duplicate plugin names\n\nFor marketplace.json edits, respond with {\"ok\": false, \"reason\": \"explanation\"} to block if validation fails. For other files, respond with {\"ok\": true}.\n\nAfter marketplace.json edits are approved, Claude should run: jq empty .claude-plugin/marketplace.json",
51+
"timeout": 30
52+
}
53+
]
54+
}
55+
]
56+
},
57+
"enabledPlugins": {
58+
"monorepo@hibariba-plugins": true
59+
}
60+
}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
name: finalize-plugin
3+
description: Finalize plugin for marketplace - validate, test, add marketplace entry, commit and push
4+
disable-model-invocation: true
5+
---
6+
7+
# Finalize Plugin for Marketplace
8+
9+
Complete workflow to prepare a plugin for publication to the marketplace.
10+
11+
## What This Does
12+
13+
1. **Validate structure** - Run validation scripts
14+
2. **Test behavior** - Run behavioral tests (if available)
15+
3. **Update marketplace** - Add/update marketplace.json entry
16+
4. **Validate JSON** - Ensure all JSON is valid
17+
5. **Stage & commit** - Create commit with conventional commit style
18+
6. **Push** - Push to remote repository
19+
20+
## Usage
21+
22+
```
23+
/finalize-plugin plugins/my-plugin
24+
```
25+
26+
## Workflow Steps
27+
28+
### 1. Run Validation
29+
30+
```bash
31+
./tests/validate-plugin.sh plugins/my-plugin/
32+
```
33+
34+
If validation fails, stop and report issues.
35+
36+
### 2. Run Behavioral Tests (if available)
37+
38+
```bash
39+
# Check if test file exists
40+
if [ -f "tests/my-plugin.txt" ]; then
41+
./tests/eval-plugin.sh plugins/my-plugin
42+
fi
43+
```
44+
45+
If tests fail, report and ask if user wants to proceed anyway.
46+
47+
### 3. Update Marketplace Entry
48+
49+
Read the plugin's `.claude-plugin/plugin.json` and check if entry exists in `.claude-plugin/marketplace.json`.
50+
51+
- If missing: Add new entry
52+
- If exists: Verify it matches plugin.json
53+
54+
Marketplace entry format:
55+
```json
56+
{
57+
"name": "plugin-name",
58+
"description": "from plugin.json",
59+
"version": "from plugin.json",
60+
"author": {
61+
"name": "from plugin.json",
62+
"email": "from plugin.json"
63+
},
64+
"source": "./plugins/plugin-name",
65+
"category": "[appropriate category]",
66+
"homepage": "https://github.com/hibariba/plugins/tree/main/plugins/plugin-name"
67+
}
68+
```
69+
70+
Categories: `development`, `productivity`, `testing`, `learning`
71+
72+
### 4. Validate All JSON
73+
74+
```bash
75+
jq empty .claude-plugin/marketplace.json && \
76+
jq empty plugins/my-plugin/.claude-plugin/plugin.json && \
77+
echo "✅ All JSON valid"
78+
```
79+
80+
### 5. Stage Files
81+
82+
```bash
83+
git add .claude-plugin/marketplace.json plugins/my-plugin/
84+
```
85+
86+
### 6. Create Commit
87+
88+
Follow conventional commit style from recent commits:
89+
90+
```bash
91+
git log --oneline -5 # Check recent style
92+
93+
# Commit format
94+
git commit -m "feat: add [plugin-name] plugin
95+
96+
- [Brief description of what plugin does]
97+
- [Key features/skills included]
98+
99+
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
100+
```
101+
102+
### 7. Push to Remote
103+
104+
```bash
105+
git push
106+
```
107+
108+
## Pre-Commit Checklist
109+
110+
Before running this workflow, ensure:
111+
112+
- [ ] Plugin has LICENSE file
113+
- [ ] README.md has installation & usage examples
114+
- [ ] All skills have clear trigger descriptions
115+
- [ ] No .DS_Store or temp files
116+
- [ ] No hardcoded credentials or absolute paths
117+
- [ ] Author email is correct (not placeholder)
118+
119+
## Error Handling
120+
121+
If any step fails:
122+
1. Report the error clearly
123+
2. Show the exact command that failed
124+
3. Suggest fixes
125+
4. Ask if user wants to continue or abort
126+
127+
## Success Output
128+
129+
```
130+
✅ Plugin finalized successfully
131+
132+
Validation: Passed
133+
Tests: Passed (or Skipped)
134+
Marketplace: Updated
135+
Commit: [commit-hash]
136+
Pushed: main -> origin/main
137+
138+
Plugin is now published in marketplace!
139+
```
140+
141+
## Notes
142+
143+
- This is a user-invocable skill only (disable-model-invocation: true)
144+
- Always run from repository root
145+
- Requires git remote access
146+
- Follows repository's commit conventions

0 commit comments

Comments
 (0)