75 lines
2.4 KiB
Python
75 lines
2.4 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
|
|
# Paths
|
|
script_dir = Path(__file__).parent.resolve()
|
|
plugins_dir = script_dir / "plugins"
|
|
marketplace_file = script_dir / ".claude-plugin" / "marketplace.json"
|
|
|
|
# Category mapping
|
|
def get_category_and_keywords(plugin_name):
|
|
if any(x in plugin_name for x in ['dev-', 'coding', 'frontend']):
|
|
return "development", ["development", "coding", "workflow"]
|
|
elif any(x in plugin_name for x in ['ops-', 'deploy', 'server']):
|
|
return "devops", ["devops", "deployment", "operations"]
|
|
elif any(x in plugin_name for x in ['ai-proj', 'req']):
|
|
return "productivity", ["project-management", "tasks", "requirements"]
|
|
elif any(x in plugin_name for x in ['feishu', 'wecom', 'siyuan']):
|
|
return "integration", ["integration", "automation", "productivity"]
|
|
elif 'biz-' in plugin_name:
|
|
return "business", ["business", "planning", "contracts"]
|
|
elif 'session' in plugin_name:
|
|
return "workflow", ["session", "workflow", "productivity"]
|
|
else:
|
|
return "utility", ["utility", "tools"]
|
|
|
|
# Collect plugins
|
|
plugins = []
|
|
for plugin_dir in sorted(plugins_dir.glob("*-plugin")):
|
|
if not plugin_dir.is_dir():
|
|
continue
|
|
|
|
manifest_path = plugin_dir / ".claude-plugin" / "plugin.json"
|
|
if not manifest_path.exists():
|
|
continue
|
|
|
|
with open(manifest_path) as f:
|
|
manifest = json.load(f)
|
|
|
|
plugin_name = plugin_dir.name
|
|
category, keywords = get_category_and_keywords(plugin_name)
|
|
|
|
plugins.append({
|
|
"name": plugin_name,
|
|
"source": f"./plugins/{plugin_name}",
|
|
"description": manifest.get("description", f"Plugin for {plugin_name}"),
|
|
"version": manifest.get("version", "1.0.0"),
|
|
"category": category,
|
|
"keywords": keywords,
|
|
"strict": False
|
|
})
|
|
|
|
# Create marketplace
|
|
marketplace = {
|
|
"name": "coolbuy-claude-plugins",
|
|
"owner": {
|
|
"name": "Donglin Lai (qiudl)",
|
|
"email": "qiudl@zhiyuncai.com"
|
|
},
|
|
"metadata": {
|
|
"description": "Custom Claude Code plugins for development workflows, DevOps, and business operations",
|
|
"version": "1.0.0",
|
|
"pluginRoot": "./plugins"
|
|
},
|
|
"plugins": plugins
|
|
}
|
|
|
|
# Write marketplace.json
|
|
with open(marketplace_file, 'w') as f:
|
|
json.dump(marketplace, f, indent=2, ensure_ascii=False)
|
|
|
|
print(f"✓ Generated marketplace.json with {len(plugins)} plugins")
|