mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-07-24 21:40:58 +03:00
Slim index.json to name+path only, fix plugin domain loading
- index.json: 463KB -> 84KB (name+path only, single cybersecurity domain) - update-index.yml: generates compact slim index on every push - marketplace.json + plugin.json: update skill count 607+ to 753
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
"email": "mukul975@users.noreply.github.com"
|
"email": "mukul975@users.noreply.github.com"
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": "607+ cybersecurity skills for AI agents and security practitioners covering web security, pentesting, forensics, threat intelligence, cloud security, and more.",
|
"description": "753 cybersecurity skills for AI agents and security practitioners covering web security, pentesting, forensics, threat intelligence, cloud security, and more.",
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "cybersecurity-skills",
|
"name": "cybersecurity-skills",
|
||||||
"description": "607+ cybersecurity skills covering web security, pentesting, DFIR, threat intelligence, cloud security, malware analysis, and more.",
|
"description": "753 cybersecurity skills covering web security, pentesting, DFIR, threat intelligence, cloud security, malware analysis, and more.",
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,68 +19,34 @@ jobs:
|
|||||||
- name: Regenerate index.json
|
- name: Regenerate index.json
|
||||||
run: |
|
run: |
|
||||||
python3 << 'EOF'
|
python3 << 'EOF'
|
||||||
import os, json, re
|
import os, json
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from collections import Counter
|
|
||||||
|
|
||||||
skills_dir = "skills"
|
skills_dir = "skills"
|
||||||
skills = []
|
skills = []
|
||||||
subdomain_counts = Counter()
|
|
||||||
tag_counter = Counter()
|
|
||||||
|
|
||||||
for skill_name in sorted(os.listdir(skills_dir)):
|
for skill_name in sorted(os.listdir(skills_dir)):
|
||||||
skill_md = os.path.join(skills_dir, skill_name, "SKILL.md")
|
skill_md = os.path.join(skills_dir, skill_name, "SKILL.md")
|
||||||
if not os.path.isfile(skill_md):
|
if not os.path.isfile(skill_md):
|
||||||
continue
|
continue
|
||||||
with open(skill_md, "r", encoding="utf-8") as f:
|
|
||||||
content = f.read()
|
|
||||||
fm_match = re.match(r"^---\n(.*?)\n---", content, re.DOTALL)
|
|
||||||
if not fm_match:
|
|
||||||
continue
|
|
||||||
fm = fm_match.group(1)
|
|
||||||
def get_field(field, text):
|
|
||||||
m = re.search(rf"^{field}:\s*(.+)$", text, re.MULTILINE)
|
|
||||||
return m.group(1).strip().strip('"') if m else ""
|
|
||||||
def get_tags(text):
|
|
||||||
m = re.search(r"^tags:\s*\[(.+)\]", text, re.MULTILINE)
|
|
||||||
return [t.strip() for t in m.group(1).split(",")] if m else []
|
|
||||||
|
|
||||||
tags = get_tags(fm)
|
|
||||||
subdomain = get_field("subdomain", fm)
|
|
||||||
subdomain_counts[subdomain] += 1
|
|
||||||
for t in tags:
|
|
||||||
tag_counter[t] += 1
|
|
||||||
|
|
||||||
skills.append({
|
skills.append({
|
||||||
"name": get_field("name", fm),
|
"name": skill_name,
|
||||||
"description": get_field("description", fm),
|
|
||||||
"domain": "cybersecurity",
|
|
||||||
"subdomain": subdomain,
|
|
||||||
"tags": tags,
|
|
||||||
"version": get_field("version", fm) or "1.0",
|
|
||||||
"author": "mukul975",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"path": f"skills/{skill_name}"
|
"path": f"skills/{skill_name}"
|
||||||
})
|
})
|
||||||
|
|
||||||
top_tags = sorted(tag_counter.items(), key=lambda x: -x[1])[:20]
|
|
||||||
index = {
|
index = {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"generated_at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
"generated_at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
||||||
"repository": "https://github.com/mukul975/Anthropic-Cybersecurity-Skills",
|
"repository": "https://github.com/mukul975/Anthropic-Cybersecurity-Skills",
|
||||||
|
"domain": "cybersecurity",
|
||||||
"total_skills": len(skills),
|
"total_skills": len(skills),
|
||||||
"total_domains": 1,
|
|
||||||
"total_subdomains": len(subdomain_counts),
|
|
||||||
"domain_stats": {"cybersecurity": len(skills)},
|
|
||||||
"subdomain_stats": dict(subdomain_counts),
|
|
||||||
"top_tags": [{"tag": t, "count": c} for t, c in top_tags],
|
|
||||||
"skills": skills
|
"skills": skills
|
||||||
}
|
}
|
||||||
|
|
||||||
with open("index.json", "w", encoding="utf-8") as f:
|
with open("index.json", "w", encoding="utf-8") as f:
|
||||||
json.dump(index, f, indent=2)
|
json.dump(index, f, separators=(',', ':'))
|
||||||
|
|
||||||
print(f"Updated index.json: {len(skills)} skills, {len(subdomain_counts)} subdomains")
|
print(f"Updated index.json: {len(skills)} skills")
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Commit updated index
|
- name: Commit updated index
|
||||||
|
|||||||
+1
-14031
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user