Agentic Awesome Skills 智能自动分类实战指南:从关键词打分到索引驱动的目录治理 Agentic Awesome Skills 智能自动分类实战指南从关键词打分到索引驱动的目录治理【免费下载链接】agentic-awesome-skillsAAS Core is the local, agent-first control plane for complete catalog discovery, agent-owned selection, stack validation, and planning, backed by 2,115 agentic skills. Includes CLI, local MCP, catalog, plugins, and Workbench.项目地址: https://gitcode.com/gh_mirrors/an/agentic-awesome-skills导读本文围绕 agentic-awesome-skillsAAS仓库中docs/maintainers/smart-auto-categorization.md所定义的能力系统讲解技能库如何基于关键词打分、优先级规则与作用域匹配自动消除 uncategorized 状态并最终以skills_index.json为唯一事实来源驱动 Web 应用分类筛选。读完本文你将掌握自动分类脚本的运行与 Dry-Run 预演方法、13 个内置类别的完整关键词体系、自定义关键词扩展方式以及如何在新增技能时通过 frontmatter 声明类别实现一次写入、永久归类。一、背景为什么要自动分类随着技能库增长到 2,000 个 SKILL.md手动维护类别既不现实也容易产生大量未分类条目。仓库的解决方案是以内容驱动分类基于技能的名称、描述与正文提取关键词通过确定性规则给出类别标签并把结果固化到skills_index.json中。当前状态来自 smart-auto-categorization.md仓库已通过生成的 catalog 完成索引大多数技能落入有意义类别仍有一小部分技能需要人工复审或补充关键词覆盖skills_index.json是类别标签与计数的唯一事实来源类别过滤器应在构建时从索引派生而非硬编码文档数字。从当前索引实测以仓库内 skills_index.json 为准共 2,124 条技能、106 个类别其中 development187、cloud146、ai-ml129、security86等居前仍有 333 条处于 uncategorized。这一数字会随索引再生成而变化因此维护者文档明确要求不要把固定计数复制进用户文档一律从索引动态生成。二、分类管线全景写入即归类整个自动分类体系由两条管线组成分工明确一次性回填工具auto_categorize_skills.py扫描仓库中尚无类别的技能直接改写 SKILL.md 的 frontmatter索引生成器generate_index.py读取所有 SKILL.mdfrontmatter 正文推断类别并产出skills_index.json同时拷贝一份到 Web 应用使用的apps/web-app/public/skills.json。另有配套测试 test_generate_index_categorization.py 验证推断规则的正确性后面会详细展开。三、分类规则详解优先级与打分机制3.1 优先级系统分类决策遵循严格优先级从源码infer_category()见 generate_index.py可以确认优先级依据置信度reason 标记1frontmatter 显式category非 uncategorized1.0frontmatter:category2目录结构SKILL.md 所在父目录0.95path:folder3关键词匹配名称描述正文0.45 0.05×score上限 0.92keyword-match:...4动态推断从技能 ID token 派生0.42 / 0.34 / 0.20derived-from-id-.../fallback:general原文档简化为 Frontmatter category Detected Keywords Fallback (uncategorized)实际索引生成器将目录结构插在了第二级并且已不存在纯 fallback 为 uncategorized 的情况——最后一级由动态推断兜底保证每个技能都拿到一个非空类别。3.2 基于关键词的分析auto_categorize_skills.py中的categorize_skill()tools/scripts/auto_categorize_skills.py把技能名与描述拼接成小写文本再为每个类别统计关键词命中得分。3.3 作用域匹配与加权原文档提到两条关键规则源码实现完全对应精确短语匹配权重更高re.search(r\b re.escape(keyword) r\b, text)命中记 2 分auto_categorize_skills.py中而包含式匹配只记 1 分词边界避免误报使用\b...\b正则防止 react 匹配到 reactive 之类的子串。索引生成器的generate_index.py将上述权重进一步细化为词边界命中 3 分长度 ≥5 的关键词包含匹配 1 分且综合id name description body_text四路文本见 skill_categorization/tools/scripts/generate_index.py。3.4 动态推断与停用词当关键词全部未命中时infer_dynamic_category()会从技能 ID 拆 token若前两个 token 命中已知前缀集合azure、aws、google、github、gitlab、slack、discord、shopify、wordpress、odoo、notion、expo、react、nextjs、kubernetes 等生成${prefix}-${token}类别置信度 0.42否则取最后一个 token 作类别置信度 0.34全部失败则归入general置信度 0.20。token 清洗会剔除STOPWORD_TOKENSskill、tools、builder、expert、guide、workflow、v2、ts、py 等 40 常见词并丢弃长度小于 3 的 tokenskill_categorization/tools/scripts/generate_index.py。四、动手实践运行自动分类4.1 针对未分类技能执行分类python tools/scripts/auto_categorize_skills.py脚本会遍历skills/目录下每个含 SKILL.md 的目录解析 frontmatterYAML 解析失败则跳过并告警已有非 uncategorized 类别 → 计入already_categorized并跳过无类别 → 调用categorize_skill()打分最高分类别写入 frontmatter无任何命中 → 计入failed_count。4.2 Dry-Run 预演推荐先跑python tools/scripts/auto_categorize_skills.py --dry-run--dry-run只计算并打印报告、不写任何文件源码中if not dry_run:才执行 YAML 回写见 auto_categorize_skills.py适合在正式回填前人工核对变更集。4.3 输出报告解读运行结束后会打印如下结构的报告 AUTO-CATEGORIZATION REPORT Summary: ✅ Categorized: 776 ⏭️ Already categorized: 46 ❌ Failed to categorize: 124 Total processed: full repository Sample changes: • 3d-web-experience uncategorized → web-development • ab-test-setup uncategorized → testing • agent-framework-azure-ai-py uncategorized → backend注意上述数字是文档编写时的样例快照每次运行结果取决于当前仓库状态原文档也强调任何面向用户的计数都应以skills_index.json实况为准。五、用索引实时查看类别分布不要手工统计或复制旧数字直接从索引生成这是原文档给出的标准做法node - NODE const fs require(fs); const skills JSON.parse(fs.readFileSync(skills_index.json, utf8)); const counts new Map(); for (const skill of skills) { const category skill.category || uncategorized; counts.set(category, (counts.get(category) || 0) 1); } console.log(skills${skills.length} categories${counts.size}); for (const [category, count] of [...counts.entries()].sort((a, b) b[1] - a[1]).slice(0, 12)) { console.log(${category}: ${count}); } NODE在仓库根目录执行上述脚本可得到skills2124 categories106之类的实时输出当前实测数据随仓库演进会变化。分布信息还可通过generate_skills_report.py等配套工具进一步沉淀见 tools/scripts。六、索引生成器类别如何落盘6.1 再生成索引python tools/scripts/generate_index.py执行后依据 tools/scripts/generate_index.py遍历skills/跳过隐藏目录仅处理含 SKILL.md 的目录解析 frontmatter 并清洗含的未加引号值自动补双引号兼容邮箱等值frontmatter 字段name/description/risk/source/date_added/category优先于目录默认值无 description 时回退提取正文第一个非标题段落截断 250 字符调用infer_category()得到categorycategory_confidencecategory_reason按名称排序后写入skills_index.jsonUTF-8、LF 行尾并拷贝到apps/web-app/public/skills.json。6.2 索引中的分类字段实测skills_index.json中每条记录包含id、path、category、name、description、risk、source、date_added、plugin等字段。其中category_confidence与category_reason是审计分类依据的利器——例如某技能 reason 为keyword-match:llm,embedding,rag即表示由这三个关键词命中ai-ml。6.3 测试如何守护分类规则test_generate_index_categorization.py 覆盖四条关键路径normalize_category(Cloud DevOps)→cloud-devopskebab-case 归一化frontmatter 显式security→ 直接采用且置信度 1.0、reason 以frontmatter:开头关键词命中kubernetes/deployment→cloud-devops且置信度 ≥ 0.5无关键词的vendorx-hyperflux→ 动态推断为hyperfluxderived-from-id-token:。这组测试保证了优先级与置信度契约不会在后续重构中悄悄退化。七、Web 应用中的分类过滤分类的最终价值体现在apps/web-app的浏览体验源码见 apps/web-app/src/pages/Home.tsx类别筛选器categoryFilter通过 URL query 参数?category驱动支持分享与回退筛选逻辑为categoryFacet(skill.category) categoryFilter类别值直接取自索引下拉与按钮列表从构建期生成的索引动态派生。改进前后对比源自原文档Before无序列表包含 uncategorized无类别规模提示After类别按技能数降序最多在前uncategorized 最后计数来自生成索引而非硬编码文档数字浏览体验显著提升。下拉排序规则为All Categories → 最高计数类别 → 依次排列 → uncategorized若存在收尾。八、技能创作者指南让新技能一次归类8.1 新增技能时声明类别在 SKILL.md 的 frontmatter 中直接写入类别即可在下次索引生成时被优先采用置信度 1.0--- name: my-skill description: ... category: web-development date_added: 2026-03-06 ---8.2 不确定类别怎么办无需纠结下次重新生成索引时系统会自动归类。只需执行python tools/scripts/generate_index.py生成器会依次走 frontmatter → 目录结构 → 关键词 → 动态推断的优先级链绝不会把技能丢弃为未分类。九、内置类别与关键词速查表以下关键词体系来自 auto_categorize_skills.py 的CATEGORY_KEYWORDS配置共 13 个类别覆盖原文档 Keyword Reference 全部条目并有所扩展web-developmentreact, vue, angular, svelte, nextjs, gatsby, remix, html, css, javascript, typescript, frontend, web, tailwind, bootstrap, sass, less, webpack, vite, rollup, parcel, rest api, graphql, http, fetch, axios, cors, responsive, seo, accessibility, a11y, pwa, progressive, dom, jsx, tsx, component, router, routingbackendnodejs, node.js, express, fastapi, django, flask, spring, java, python, golang, rust, c#, csharp, dotnet, .net, laravel, php, ruby, rails, server, backend, api, rest, graphql, database, sql, mongodb, postgres, mysql, redis, cache, authentication, auth, jwt, oauth, session, middleware, routing, controller, modeldatabasedatabase, sql, postgres, postgresql, mysql, mariadb, mongodb, nosql, firestore, dynamodb, cassandra, elasticsearch, redis, memcached, graphql, prisma, orm, query, migration, schema, indexai-mlai, artificial intelligence, machine learning, ml, deep learning, neural, tensorflow, pytorch, scikit, nlp, computer vision, cv, llm, gpt, bert, classification, regression, clustering, transformer, embedding, vector, training, modeldevopsdevops, docker, kubernetes, k8s, ci/cd, git, github, gitlab, jenkins, gitlab-ci, github actions, aws, azure, gcp, terraform, ansible, vagrant, deploy, deployment, container, orchestration, monitoring, logging, prometheus, grafanacloudaws, amazon, azure, gcp, google cloud, cloud, ec2, s3, lambda, cloudformation, terraform, serverless, functions, storage, cdn, distributedsecuritysecurity, encryption, cryptography, ssl, tls, hashing, bcrypt, jwt, oauth, authentication, authorization, firewall, penetration, audit, vulnerability, privacy, gdpr, compliancetestingtest, testing, jest, mocha, jasmine, pytest, unittest, cypress, selenium, puppeteer, e2e, unit test, integration, coverage, ci/cdmobilemobile, android, ios, react native, flutter, swift, kotlin, objective-c, app, native, cross-platform, expo, cordova, xamaringame-developmentgame, unity, unreal, godot, canvas, webgl, threejs, babylon, phaser, sprite, physics, collision, 2d, 3d, shader, renderingdata-sciencedata, analytics, science, pandas, numpy, scipy, jupyter, notebook, visualization, matplotlib, plotly, statistics, correlation, regression, clusteringautomationautomation, scripting, selenium, puppeteer, robot, workflow, scheduled, trigger, integrationcontentmarkdown, documentation, content, blog, writing, seo, meta, schema, og, twitter, description需要说明索引生成器 skill_categorization/tools/scripts/generate_index.py 维护的是另一套精简类别名web-engineering、cloud-devops、testing-qa、data-engineering、research、bioinformatics、geospatial、finance 等两者用途不同——前者面向一次性的 SKILL.md 回填后者面向持续性的索引推断。修改任何一方后都应重新跑对应流程以保持同步。十、自定义扩展新增类别与关键词10.1 添加自定义关键词编辑 tools/scripts/auto_categorize_skills.py 的CATEGORY_KEYWORDS配置CATEGORY_KEYWORDS { your-category: [ keyword1, keyword2, exact phrase, another-keyword ], # ... other categories }然后按顺序重新执行两条命令让回填与索引保持一致python tools/scripts/auto_categorize_skills.py python tools/scripts/generate_index.py10.2 类别归一化规则所有类别值统一归一化为小写 kebab-casenormalize_category()下划线转连字符、空白折叠、非法字符剔除、连续连字符合并。因此写Cloud DevOps、cloud_devops都会收敛为cloud-devops避免同类别多标签分裂。十一、故障排查与最佳实践11.1 仍有 Failed to categorize 的技能原文档给出的三种处置路径按推荐顺序在 frontmatter 手动指定类别category: your-chosen-category向CATEGORY_KEYWORDS补充关键词让下一次自动分类能命中移动到更贴合的目录目录结构会作为第二优先级回退skills/backend/my-new-skill/SKILL.md此外建议检查是否命中了停用词或描述过短——索引生成器对缺失 description 的技能会回退抽取正文首段因此为每个技能写一段信息丰富的 description 是提升分类质量最经济的手段。11.2 修改 SKILL.md 后重新生成索引python tools/scripts/generate_index.py该命令将依次完成解析 frontmatter 类别 → 回退目录结构 → 关键词/动态推断 → 生成新的skills_index.json→ 拷贝至apps/web-app/public/skills.json。十二、后续演进路线原文档列出的后续工作可归纳为四件事在 Web 应用中验证改进后的类别过滤器排序与计数是否与索引一致补齐缺失关键词对仍 uncategorized 的技能逐一补充命中词人工复核剩余未分类技能自动指派或人工审查双轨并行持续监控增长利用分类报告跟踪新增 vs 已分类的变化趋势。延伸阅读分类设计完整方案docs/SMART_AUTO_CATEGORIZATION.md、docs/CATEGORIZATION_IMPLEMENTATION.md索引与目录结构说明docs/README.md、CATALOG.md中文对照版维护指南docs_zh-CN/maintainers/smart-auto-categorization.md核心实现tools/scripts/auto_categorize_skills.py、tools/scripts/generate_index.py、skill_categorization/tools/scripts/generate_index.py规则测试skill_categorization/tools/scripts/tests/test_generate_index_categorization.pyWeb 应用筛选实现apps/web-app/src/pages/Home.tsx【免费下载链接】agentic-awesome-skillsAAS Core is the local, agent-first control plane for complete catalog discovery, agent-owned selection, stack validation, and planning, backed by 2,115 agentic skills. Includes CLI, local MCP, catalog, plugins, and Workbench.项目地址: https://gitcode.com/gh_mirrors/an/agentic-awesome-skills创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考