Skills README Updater Automatically scan and update the skills README.md when skills are added, modified, or removed. Usage After adding or modifying a skill, run the update script: The script will: 1. Scan all subdirectories in 2. Parse YAML frontmatter from each 3. Categorize skills based on predefined categories 4. Generate an updated with: - Categorized skill tables - Directory structure - Usage instructions - Timestamp Categories Skills are organized into these categories: | Category | Skills | |----------|--------| | 云基础设施 | aws-cli, aws-cost-explorer, eksctl | | Kubernetes & GitOps | k…

, line)\n if match:\n # 保存上一个 key 的值\n if current_key:\n result[current_key] = ' '.join(current_value).strip()\n\n current_key = match.group(1)\n value = match.group(2).strip()\n\n # 处理多行值的开始 (|)\n if value == '|':\n current_value = []\n elif value.startswith('\"') and value.endswith('\"'):\n current_value = [value[1:-1]]\n elif value.startswith(\"'\") and value.endswith(\"'\"):\n current_value = [value[1:-1]]\n else:\n current_value = [value] if value else []\n elif current_key and line.strip():\n # 多行值的续行\n current_value.append(line.strip())\n\n # 保存最后一个 key\n if current_key:\n result[current_key] = ' '.join(current_value).strip()\n\n return result\n\n\ndef parse_skill_metadata(skill_path: Path) -> dict | None:\n \"\"\"解析 SKILL.md 的 YAML frontmatter\"\"\"\n skill_md = skill_path / \"SKILL.md\"\n if not skill_md.exists():\n return None\n\n content = skill_md.read_text(encoding=\"utf-8\")\n\n # 提取 YAML frontmatter\n match = re.match(r'^---\\s*\\n(.*?)\\n---', content, re.DOTALL)\n if not match:\n return None\n\n try:\n metadata = parse_simple_yaml(match.group(1))\n desc = metadata.get(\"description\", \"\")\n # 取第一句作为简短描述\n first_sentence = desc.split(\".\")[0].strip() if desc else \"\"\n return {\n \"name\": metadata.get(\"name\", skill_path.name),\n \"description\": first_sentence\n }\n except Exception:\n return None\n\n\ndef get_category(skill_name: str) -> str:\n \"\"\"获取 skill 所属分类\"\"\"\n for category, skills in CATEGORIES.items():\n if skill_name in skills:\n return category\n return \"其他 (Other)\"\n\n\ndef scan_skills() -> dict[str, list[dict]]:\n \"\"\"扫描所有 skills 并按分类组织\"\"\"\n categorized = {}\n\n for item in SKILLS_DIR.iterdir():\n if not item.is_dir() or item.name.startswith(\".\"):\n continue\n\n metadata = parse_skill_metadata(item)\n if metadata:\n category = get_category(item.name)\n if category not in categorized:\n categorized[category] = []\n categorized[category].append(metadata)\n\n # 按名称排序\n for category in categorized:\n categorized[category].sort(key=lambda x: x[\"name\"])\n\n return categorized\n\n\ndef generate_readme(categorized: dict[str, list[dict]]) -> str:\n \"\"\"生成 README 内容\"\"\"\n lines = [\n \"# Claude Code Skills\",\n \"\",\n \"这是我的 Claude Code Skills 集合,用于扩展 Claude 的能力,提供专业领域的工作流和工具集成。\",\n \"\",\n \"## Skills 列表\",\n \"\",\n ]\n\n # 按预定义顺序输出分类\n category_order = list(CATEGORIES.keys()) + [\"其他 (Other)\"]\n\n for category in category_order:\n if category not in categorized:\n continue\n\n skills = categorized[category]\n lines.append(f\"### {category}\")\n lines.append(\"\")\n lines.append(\"| Skill | 描述 |\")\n lines.append(\"|-------|------|\")\n\n for skill in skills:\n # 截取描述,最多 80 个字符\n desc = skill[\"description\"]\n if len(desc) > 80:\n desc = desc[:77] + \"...\"\n lines.append(f\"| **{skill['name']}** | {desc} |\")\n\n lines.append(\"\")\n\n # 目录结构\n lines.extend([\n \"## 目录结构\",\n \"\",\n \"```\",\n \"~/.claude/skills/\",\n \"├── README.md # 本文件\",\n ])\n\n all_skills = []\n for skills in categorized.values():\n all_skills.extend([s[\"name\"] for s in skills])\n all_skills.sort()\n\n for i, skill in enumerate(all_skills):\n prefix = \"└──\" if i == len(all_skills) - 1 else \"├──\"\n lines.append(f\"{prefix} {skill}/\")\n\n lines.extend([\n \"```\",\n \"\",\n \"## 使用方式\",\n \"\",\n \"Skills 会在对话中根据上下文自动触发,也可以通过 `/skill-name` 手动调用。\",\n \"\",\n \"## 添加新 Skill\",\n \"\",\n \"使用 `skill-creator` 来创建新的 skill:\",\n \"\",\n \"```bash\",\n \"# 初始化新 skill\",\n \"python3 ~/.claude/skills/skill-creator/scripts/init_skill.py \u003cskill-name> --path ~/.claude/skills\",\n \"\",\n \"# 编辑 SKILL.md 和相关文件\",\n \"\",\n \"# 验证并打包\",\n \"python3 ~/.claude/skills/skill-creator/scripts/package_skill.py ~/.claude/skills/\u003cskill-name>\",\n \"\",\n \"# 更新 README\",\n \"python3 ~/.claude/skills/skills-readme-updater/scripts/update_readme.py\",\n \"```\",\n \"\",\n \"---\",\n \"\",\n f\"*最后更新: {datetime.now().strftime('%Y-%m-%d')}*\",\n \"\",\n ])\n\n return \"\\n\".join(lines)\n\n\ndef main():\n \"\"\"主函数\"\"\"\n print(\"🔍 扫描 skills 目录...\")\n categorized = scan_skills()\n\n total = sum(len(skills) for skills in categorized.values())\n print(f\"✅ 发现 {total} 个 skills\")\n\n print(\"📝 生成 README...\")\n readme_content = generate_readme(categorized)\n\n README_PATH.write_text(readme_content, encoding=\"utf-8\")\n print(f\"✅ README 已更新: {README_PATH}\")\n\n # 输出摘要\n print(\"\\n📊 Skills 统计:\")\n for category, skills in categorized.items():\n print(f\" {category}: {len(skills)} 个\")\n\n\nif __name__ == \"__main__\":\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":6785,"content_sha256":"2a151c608596affa56c71a35fdc1371c7ccc7edbe9163bb42ad38a2a55831ff2"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Skills README Updater","type":"text"}]},{"type":"paragraph","content":[{"text":"Automatically scan and update the skills README.md when skills are added, modified, or removed.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Usage","type":"text"}]},{"type":"paragraph","content":[{"text":"After adding or modifying a skill, run the update script:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python3 ~/.claude/skills/skills-readme-updater/scripts/update_readme.py","type":"text"}]},{"type":"paragraph","content":[{"text":"The script will:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Scan all subdirectories in ","type":"text"},{"text":"~/.claude/skills/","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Parse YAML frontmatter from each ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Categorize skills based on predefined categories","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generate an updated ","type":"text"},{"text":"README.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" with:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Categorized skill tables","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Directory structure","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Usage instructions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Timestamp","type":"text"}]}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Categories","type":"text"}]},{"type":"paragraph","content":[{"text":"Skills are organized into these categories:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Category","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Skills","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"云基础设施","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"aws-cli, aws-cost-explorer, eksctl","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Kubernetes & GitOps","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"kubectl, argocd-cli, kargo-cli, sync-to-prod","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"代码仓库","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"github-cli, gitlab-cli, changelog-generator","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"开发工具","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"justfile, skill-creator, skills-readme-updater","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"内容处理","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"humanizer-zh, obsidian-dashboard","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"To add a new category or reassign skills, edit the ","type":"text"},{"text":"CATEGORIES","type":"text","marks":[{"type":"code_inline"}]},{"text":" dict in ","type":"text"},{"text":"scripts/update_readme.py","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Workflow: Adding a New Skill","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Create the skill using ","type":"text"},{"text":"skill-creator","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Edit ","type":"text"},{"text":"SKILL.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" with proper metadata","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run the README updater:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python3 ~/.claude/skills/skills-readme-updater/scripts/update_readme.py","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Verify the README was updated correctly","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"skills-readme-updater","author":"@skillopedia","source":{"stars":3,"repo_name":"skills","origin_url":"https://github.com/oldwinter/skills/blob/HEAD/meta-skills/skills-readme-updater/SKILL.md","repo_owner":"oldwinter","body_sha256":"e37e7900bddcf24e4b3c359716876f4b9d6f632f21563f75e4be654858691514","cluster_key":"17f465b5befde31f97a191e45026ab2fae8fc1ac6eb9de81332d3764b486ec5f","clean_bundle":{"format":"clean-skill-bundle-v1","source":"oldwinter/skills/meta-skills/skills-readme-updater/SKILL.md","attachments":[{"id":"1b1931e6-24f2-52e9-b369-ad8e448cb639","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/1b1931e6-24f2-52e9-b369-ad8e448cb639/attachment.py","path":"scripts/update_readme.py","size":6785,"sha256":"2a151c608596affa56c71a35fdc1371c7ccc7edbe9163bb42ad38a2a55831ff2","contentType":"text/x-python; charset=utf-8"}],"bundle_sha256":"1b89aa4179b0d7d8df5f10a07500499d53831c7f170c35b92c6c503078ef314d","attachment_count":1,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"meta-skills/skills-readme-updater/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"data-analytics","category_label":"Data"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"data-analytics","import_tag":"clean-skills-v1","description":"This skill should be used after creating or modifying skills to update the main README.md file. It scans all skills in ~/.claude/skills/, extracts metadata from SKILL.md files, and regenerates the README with categorized skill listings. Triggers on requests mentioning \"update skills readme\", \"refresh skills list\", or after adding new skills."}},"renderedAt":1782981917715}

Skills README Updater Automatically scan and update the skills README.md when skills are added, modified, or removed. Usage After adding or modifying a skill, run the update script: The script will: 1. Scan all subdirectories in 2. Parse YAML frontmatter from each 3. Categorize skills based on predefined categories 4. Generate an updated with: - Categorized skill tables - Directory structure - Usage instructions - Timestamp Categories Skills are organized into these categories: | Category | Skills | |----------|--------| | 云基础设施 | aws-cli, aws-cost-explorer, eksctl | | Kubernetes & GitOps | k…