Files
antigravity-skills-reference/scripts/update_readme.py
sck_0 263c507684 chore: SOTA audit fixes – catalog recursive, readme regex, docs, CI, installer
- P0: Catalog includes nested skills (listSkillIdsRecursive), 626 skills
- P0: update_readme.py regex fixes 'high-performance agentic skills'
- P1: SKILL_ANATOMY risk values aligned to none|safe|critical|offensive (EN + vi)
- P1: requirements.txt + CONTRIBUTING Python setup
- P1: data/package.json version 4.6.0
- P2: npm run test + CI test step; validator docs + validation-baseline in .gitignore
- P3: Installer --version/--tag support; CI npm audit; __pycache__ in .gitignore
2026-02-02 22:04:20 +01:00

66 lines
1.7 KiB
Python

#!/usr/bin/env python3
import json
import os
import re
def update_readme():
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
readme_path = os.path.join(base_dir, "README.md")
index_path = os.path.join(base_dir, "skills_index.json")
print(f"📖 Reading skills index from: {index_path}")
with open(index_path, "r", encoding="utf-8") as f:
skills = json.load(f)
total_skills = len(skills)
print(f"🔢 Total skills found: {total_skills}")
print(f"📝 Updating README at: {readme_path}")
with open(readme_path, "r", encoding="utf-8") as f:
content = f.read()
# 1. Update Title Count
content = re.sub(
r"(# 🌌 Antigravity Awesome Skills: )\d+(\+ Agentic Skills)",
rf"\g<1>{total_skills}\g<2>",
content,
)
# 2. Update Blockquote Count
content = re.sub(
r"(Collection of )\d+(\+ Universal)",
rf"\g<1>{total_skills}\g<2>",
content,
)
# 3. Update Intro Text Count
content = re.sub(
r"(library of \*\*)\d+( high-performance agentic skills\*\*)",
rf"\g<1>{total_skills}\g<2>",
content,
)
# 4. Update Browse section header
content = re.sub(
r"## Browse \d+\+ Skills",
f"## Browse {total_skills}+ Skills",
content,
)
# 5. Update TOC link for Browse (anchor matches header-derived slug)
content = re.sub(
r"\[📚 Browse \d+\+ Skills\]\(#browse-\d+-skills\)",
f"[📚 Browse {total_skills}+ Skills](#browse-{total_skills}-skills)",
content,
)
with open(readme_path, "w", encoding="utf-8") as f:
f.write(content)
print("✅ README.md updated successfully.")
if __name__ == "__main__":
update_readme()