Skip to content

Commit f86a129

Browse files
pgesiakclaude
andcommitted
feat: add plugin-workflow and dependency management system
Plugin-workflow agents: - test-writer: Generate behavioral tests for plugins - doc-generator: Auto-generate documentation - marketplace-manager: Manage marketplace entries - release-preparer: Prepare plugin releases - plugin-migrator: Migrate plugins between structures - dependency-analyzer: Analyze and track dependencies Dependency management: - Runtime validation (Bun check in llmstxt plugin) - Automated validation script (validate-dependencies.ts) - Pre-commit hook integration - Dependency manifest tracking (dependencies.json) - Documentation updates in CLAUDE.md and README files Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 4249137 commit f86a129

File tree

20 files changed

+2961
-8
lines changed

20 files changed

+2961
-8
lines changed

.claude-plugin/marketplace.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@
6565
"source": "./plugins/monorepo",
6666
"category": "development",
6767
"homepage": "https://github.com/hibariba/plugins/tree/main/plugins/monorepo"
68+
},
69+
{
70+
"name": "plugin-workflow",
71+
"description": "Automated workflow agents for plugin development: test generation, documentation, marketplace management, releases, migrations, and dependency analysis",
72+
"version": "1.0.0",
73+
"author": {
74+
"name": "hibariba",
75+
"email": "hibariba@gmail.com"
76+
},
77+
"source": "./plugins/plugin-workflow",
78+
"category": "development",
79+
"homepage": "https://github.com/hibariba/plugins/tree/main/plugins/plugin-workflow"
6880
}
6981
]
7082
}

.githooks/pre-commit

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,35 @@ if [ $? -ne 0 ]; then
2626
fi
2727

2828
echo -e "${GREEN}✅ No secrets detected${NC}"
29+
30+
# Check if any plugin files were modified
31+
PLUGIN_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^plugins/.*\.(ts|js|json|md)$')
32+
33+
if [ -n "$PLUGIN_FILES" ]; then
34+
echo ""
35+
echo "Plugin files modified, validating dependencies..."
36+
37+
# Check if Bun is available
38+
if ! command -v bun &> /dev/null; then
39+
echo "⚠️ Warning: Bun not installed, skipping dependency validation"
40+
echo " Install Bun: brew install oven-sh/bun/bun"
41+
else
42+
# Run dependency validation (silent unless errors)
43+
bun run scripts/validate-dependencies.ts --check --json > /tmp/dep-check.json 2>&1
44+
45+
if [ $? -ne 0 ]; then
46+
echo -e "${RED}❌ Dependency validation failed${NC}"
47+
echo ""
48+
echo "Missing dependencies detected. Run for details:"
49+
echo " bun run scripts/validate-dependencies.ts"
50+
echo ""
51+
echo "To bypass (NOT recommended):"
52+
echo " git commit --no-verify"
53+
exit 1
54+
fi
55+
56+
echo -e "${GREEN}✅ All dependencies satisfied${NC}"
57+
fi
58+
fi
59+
2960
exit 0

CLAUDE.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,51 @@ git commit -m "Remove plugin-name"
474474
git push
475475
```
476476

477+
### Manage Dependencies
478+
479+
Track and validate plugin dependencies across the repository:
480+
481+
```bash
482+
# Check all plugin dependencies
483+
bun run scripts/validate-dependencies.ts
484+
485+
# Check with exit code (for CI)
486+
bun run scripts/validate-dependencies.ts --check
487+
488+
# JSON output only
489+
bun run scripts/validate-dependencies.ts --json
490+
491+
# Update dependency manifest
492+
./scripts/update-dependency-manifest.sh
493+
494+
# Manifest is automatically validated on commit via pre-commit hook
495+
```
496+
497+
**When adding dependencies to a plugin:**
498+
499+
1. Document in README.md:
500+
```markdown
501+
## Requirements
502+
- Bun runtime (for TypeScript scripts)
503+
- jq (for JSON processing)
504+
```
505+
506+
2. Update manifest:
507+
```bash
508+
./scripts/update-dependency-manifest.sh
509+
```
510+
511+
3. Commit changes:
512+
```bash
513+
git add plugins/my-plugin dependencies.json
514+
git commit -m "feat: add dependencies to my-plugin"
515+
```
516+
517+
**Pre-commit hook automatically:**
518+
- Validates dependencies when plugin files change
519+
- Fails commit if dependencies are missing
520+
- Provides installation instructions for missing tools
521+
477522
## Marketplace Configuration
478523

479524
### Entry Format
@@ -590,9 +635,9 @@ After cloning, enable git hooks:
590635
git config core.hooksPath .githooks
591636
```
592637

593-
This enables pre-commit checks: plugin.json validation, frontmatter linting, gitleaks.
638+
This enables pre-commit checks: plugin.json validation, frontmatter linting, gitleaks, dependency validation.
594639

595-
**Requires:** `jq`, `gitleaks` (install: `brew install jq gitleaks`)
640+
**Requires:** `jq`, `gitleaks`, `bun` (install: `brew install jq gitleaks oven-sh/bun/bun`)
596641

597642
**Verify:** `git config core.hooksPath` should return `.githooks`
598643

@@ -663,6 +708,8 @@ All plugins in this marketplace should have:
663708
| **Update externals** | `git submodule update --remote` |
664709
| **Remove submodule** | `git submodule deinit -f external_plugins/name` |
665710
| **Run behavioral tests** | `./tests/eval-plugin.sh plugins/name` |
711+
| **Check dependencies** | `bun run scripts/validate-dependencies.ts` |
712+
| **Update dep manifest** | `./scripts/update-dependency-manifest.sh` |
666713
| **Sync issue labels** | `npx github-label-sync --labels .github/labels.yml owner/repo` |
667714
| **Test workflow locally** | `act issues -e test-event.json` (requires [act](https://github.com/nektos/act)) |
668715

dependencies.json

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"timestamp": "2026-02-02T04:31:51.828Z",
3+
"pluginCount": 6,
4+
"plugins": [
5+
{
6+
"name": "monorepo",
7+
"version": "0.2.0",
8+
"path": "/Users/me/Developer/projects/plugins/plugins/monorepo",
9+
"dependencies": [],
10+
"scripts": [],
11+
"hasHooks": false,
12+
"hasMcp": false
13+
},
14+
{
15+
"name": "example-plugin",
16+
"version": "1.0.0",
17+
"path": "/Users/me/Developer/projects/plugins/plugins/example-plugin",
18+
"dependencies": [],
19+
"scripts": [],
20+
"hasHooks": false,
21+
"hasMcp": false
22+
},
23+
{
24+
"name": "retrospective",
25+
"version": "0.1.0",
26+
"path": "/Users/me/Developer/projects/plugins/plugins/retrospective",
27+
"dependencies": [],
28+
"scripts": [],
29+
"hasHooks": false,
30+
"hasMcp": false
31+
},
32+
{
33+
"name": "high-signal-output",
34+
"version": "1.0.0",
35+
"path": "/Users/me/Developer/projects/plugins/plugins/high-signal-output",
36+
"dependencies": [],
37+
"scripts": [],
38+
"hasHooks": false,
39+
"hasMcp": false
40+
},
41+
{
42+
"name": "plugin-workflow",
43+
"version": "1.0.0",
44+
"path": "/Users/me/Developer/projects/plugins/plugins/plugin-workflow",
45+
"dependencies": [],
46+
"scripts": [],
47+
"hasHooks": true,
48+
"hasMcp": false
49+
},
50+
{
51+
"name": "llmstxt",
52+
"version": "1.0.0",
53+
"path": "/Users/me/Developer/projects/plugins/plugins/llmstxt",
54+
"dependencies": [
55+
{
56+
"type": "runtime",
57+
"name": "bun",
58+
"version": "1.3.6",
59+
"required": true,
60+
"satisfied": true,
61+
"checkCommand": "bun --version"
62+
},
63+
{
64+
"type": "network",
65+
"name": "network-access",
66+
"required": true,
67+
"satisfied": true,
68+
"checkCommand": "ping -c 1 example.com"
69+
}
70+
],
71+
"scripts": [
72+
"skills/llmstxt-to-skill/scripts/generate-skill.ts",
73+
"skills/llmstxt-to-skill/scripts/fetch-llmstxt.ts",
74+
"skills/llmstxt-to-skill/scripts/fetch-references.ts"
75+
],
76+
"hasHooks": false,
77+
"hasMcp": false
78+
}
79+
],
80+
"summary": {
81+
"totalDependencies": 2,
82+
"satisfied": 2,
83+
"missing": 0,
84+
"runtimes": [
85+
"bun"
86+
],
87+
"systemTools": []
88+
}
89+
}

plugins/example-plugin/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,44 @@ Add entry to `/.claude-plugin/marketplace.json`:
139139
}
140140
```
141141

142+
### 6. Document Dependencies (If Any)
143+
144+
If your plugin requires external tools or runtimes:
145+
146+
**In README.md:**
147+
```markdown
148+
## Requirements
149+
150+
- Bun runtime (for TypeScript scripts)
151+
- jq (for JSON processing)
152+
- Network access (for API calls)
153+
```
154+
155+
**In plugin.json:** (optional)
156+
```json
157+
{
158+
"requirements": {
159+
"runtime": ["bun"],
160+
"system": ["jq"],
161+
"network": true
162+
}
163+
}
164+
```
165+
166+
**Validate dependencies:**
167+
```bash
168+
# From repository root
169+
bun run scripts/validate-dependencies.ts
170+
171+
# Update manifest after changes
172+
./scripts/update-dependency-manifest.sh
173+
```
174+
175+
The repository automatically:
176+
- Validates dependencies on commit (pre-commit hook)
177+
- Tracks dependencies in `dependencies.json` manifest
178+
- Warns users about missing tools
179+
142180
## Component Types
143181

144182
This plugin demonstrates the two most common components. For advanced use cases:

plugins/llmstxt/skills/llmstxt-to-skill/SKILL.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,32 @@ What llms.txt URL would you like to convert?
1717
Example: https://code.claude.com/docs/llms.txt
1818
```
1919

20-
### Step 2: Ask Output Location
20+
### Step 2: Validate Bun Runtime
21+
22+
Check if Bun is installed before proceeding:
23+
24+
```bash
25+
bun --version
26+
```
27+
28+
**If Bun is not found:**
29+
- Report error: "Bun runtime is required but not installed."
30+
- Provide installation instructions:
31+
```
32+
Install Bun:
33+
• macOS/Linux: curl -fsSL https://bun.sh/install | bash
34+
• Homebrew: brew install oven-sh/bun/bun
35+
• Windows: powershell -c "irm bun.sh/install.ps1|iex"
36+
37+
After installation, restart your terminal and try again.
38+
More info: https://bun.sh
39+
```
40+
- Stop execution (do not proceed with workflow)
41+
42+
**If Bun is found:**
43+
- Continue silently (no output needed)
44+
45+
### Step 3: Ask Output Location
2146

2247
Use AskUserQuestion:
2348
- **Question:** "Where should I create the skill?"
@@ -26,35 +51,35 @@ Use AskUserQuestion:
2651
2. `~/.claude/skills/` - Global, available everywhere
2752
3. Custom path...
2853

29-
### Step 3: Parse llms.txt and Save to File
54+
### Step 4: Parse llms.txt and Save to File
3055

3156
```bash
3257
bun run ${CLAUDE_PLUGIN_ROOT}/skills/llmstxt-to-skill/scripts/fetch-llmstxt.ts "URL" /tmp/llmstxt-data.json
3358
```
3459

3560
This saves the parsed data to a temp file. Read the file to get title and skillName.
3661

37-
### Step 4: Create Directory
62+
### Step 5: Create Directory
3863

3964
```bash
4065
mkdir -p "OUTPUT_PATH/SKILL_NAME/references"
4166
```
4267

43-
### Step 5: Fetch References
68+
### Step 6: Fetch References
4469

4570
```bash
4671
bun run ${CLAUDE_PLUGIN_ROOT}/skills/llmstxt-to-skill/scripts/fetch-references.ts /tmp/llmstxt-data.json "OUTPUT_PATH/SKILL_NAME/references"
4772
```
4873

4974
Report: "Fetching X references..." then "Fetched X/Y (Z warnings)"
5075

51-
### Step 6: Generate SKILL.md
76+
### Step 7: Generate SKILL.md
5277

5378
```bash
5479
bun run ${CLAUDE_PLUGIN_ROOT}/skills/llmstxt-to-skill/scripts/generate-skill.ts "OUTPUT_PATH/SKILL_NAME" /tmp/llmstxt-data.json
5580
```
5681

57-
### Step 7: Cleanup and Report
82+
### Step 8: Cleanup and Report
5883

5984
```bash
6085
rm /tmp/llmstxt-data.json
@@ -74,6 +99,7 @@ The skill will auto-trigger when asking about TOPIC.
7499

75100
| Error | Action |
76101
|-------|--------|
102+
| Bun not installed | Show installation instructions, stop workflow |
77103
| Reference fetch fails | Log warning, continue with others |
78104
| Invalid llms.txt URL | Report clear error message |
79105
| Directory not writable | Suggest alternative location |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "plugin-workflow",
3+
"version": "1.0.0",
4+
"description": "Automated workflow agents for plugin development: test generation, documentation, marketplace management, releases, migrations, and dependency analysis",
5+
"author": {
6+
"name": "Plugin Marketplace",
7+
"email": "plugins@example.com"
8+
},
9+
"components": {
10+
"skills": false,
11+
"commands": false,
12+
"agents": true,
13+
"hooks": true,
14+
"mcp": false
15+
}
16+
}

0 commit comments

Comments
 (0)