refactor: 通用技能按类别拆分为独立目录

skills/ → skills-dev(9), skills-req(10), skills-ops(4),
skills-integration(8), skills-biz(4), skills-workflow(7)

generate-marketplace.py 改为自动扫描所有 skills-* 目录。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-14 11:31:58 +10:30
parent ea266e9cce
commit 712063071c
170 changed files with 341 additions and 346 deletions

View File

@@ -11,12 +11,21 @@ except ImportError:
# Paths
script_dir = Path(__file__).parent.resolve()
skills_dir = script_dir / "skills"
projects_dir = script_dir / "skills-projects"
personal_dir = script_dir / "skills-personal"
config_file = script_dir / "claude-config.yaml"
marketplace_file = script_dir / ".claude-plugin" / "marketplace.json"
# Skill directories (label, directory name)
SKILL_DIRS = [
("dev", "skills-dev"),
("req", "skills-req"),
("ops", "skills-ops"),
("integration", "skills-integration"),
("biz", "skills-biz"),
("workflow", "skills-workflow"),
("projects", "skills-projects"),
("personal", "skills-personal"),
]
def load_config():
"""Load claude-config.yaml and return disabled list + personal_dir."""
@@ -110,29 +119,22 @@ def scan_plugins(directory, source_prefix, disabled):
# Load config
disabled_skills, personal_dir_name = load_config()
personal_skills_dir = script_dir / personal_dir_name
# Collect plugins from skills/ and skills-personal/
# Collect plugins from all skill directories
plugins = []
print("Scanning skills/ ...")
plugins.extend(scan_plugins(skills_dir, "./skills", disabled_skills))
print(f" Found {len(plugins)} public plugins")
projects_count = 0
if projects_dir.is_dir():
print("Scanning skills-projects/ ...")
projects_plugins = scan_plugins(projects_dir, "./skills-projects", disabled_skills)
projects_count = len(projects_plugins)
plugins.extend(projects_plugins)
print(f" Found {projects_count} project plugins")
personal_count = 0
if personal_skills_dir.is_dir():
print(f"Scanning {personal_dir_name}/ ...")
personal_plugins = scan_plugins(personal_skills_dir, f"./{personal_dir_name}", disabled_skills)
personal_count = len(personal_plugins)
plugins.extend(personal_plugins)
print(f" Found {personal_count} personal plugins")
counts = {}
for label, dir_name in SKILL_DIRS:
# personal_dir may be overridden by config
if label == "personal":
dir_name = personal_dir_name
skill_path = script_dir / dir_name
if not skill_path.is_dir():
continue
print(f"Scanning {dir_name}/ ...")
found = scan_plugins(skill_path, f"./{dir_name}", disabled_skills)
counts[label] = len(found)
plugins.extend(found)
print(f" Found {counts[label]} {label} plugins")
# Create marketplace
marketplace = {
@@ -144,7 +146,7 @@ marketplace = {
"metadata": {
"description": "Custom Claude Code plugins for development workflows, DevOps, and business operations",
"version": "1.0.0",
"pluginRoot": "./skills"
"pluginRoot": "."
},
"plugins": plugins
}
@@ -156,4 +158,5 @@ marketplace_file.parent.mkdir(parents=True, exist_ok=True)
with open(marketplace_file, 'w') as f:
json.dump(marketplace, f, indent=2, ensure_ascii=False)
print(f"\n✓ Generated marketplace.json with {len(plugins)} plugins ({projects_count} project, {personal_count} personal)")
summary = ", ".join(f"{v} {k}" for k, v in counts.items() if v > 0)
print(f"\n✓ Generated marketplace.json with {len(plugins)} plugins ({summary})")