指南:從關鍵詞打分到索引驅動的目錄治理)
Agentic Awesome Skills 智能自動分類實戰(zhàn)指南從關鍵詞打分到索引驅動的目錄治理【免費下載鏈接】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所定義的能力系統(tǒng)講解技能庫如何基于關鍵詞打分、優(yōu)先級規(guī)則與作用域匹配自動消除 uncategorized 狀態(tài)并最終以skills_index.json為唯一事實來源驅動 Web 應用分類篩選。讀完本文你將掌握自動分類腳本的運行與 Dry-Run 預演方法、13 個內置類別的完整關鍵詞體系、自定義關鍵詞擴展方式以及如何在新增技能時通過 frontmatter 聲明類別實現(xiàn)一次寫入、永久歸類。一、背景為什么要自動分類隨著技能庫增長到 2,000 個 SKILL.md手動維護類別既不現(xiàn)實也容易產(chǎn)生大量未分類條目。倉庫的解決方案是以內容驅動分類基于技能的名稱、描述與正文提取關鍵詞通過確定性規(guī)則給出類別標簽并把結果固化到skills_index.json中。當前狀態(tài)來自 smart-auto-categorization.md倉庫已通過生成的 catalog 完成索引大多數(shù)技能落入有意義類別仍有一小部分技能需要人工復審或補充關鍵詞覆蓋skills_index.json是類別標簽與計數(shù)的唯一事實來源類別過濾器應在構建時從索引派生而非硬編碼文檔數(shù)字。從當前索引實測以倉庫內 skills_index.json 為準共 2,124 條技能、106 個類別其中 development187、cloud146、ai-ml129、security86等居前仍有 333 條處于 uncategorized。這一數(shù)字會隨索引再生成而變化因此維護者文檔明確要求不要把固定計數(shù)復制進用戶文檔一律從索引動態(tài)生成。二、分類管線全景寫入即歸類整個自動分類體系由兩條管線組成分工明確一次性回填工具auto_categorize_skills.py掃描倉庫中尚無類別的技能直接改寫 SKILL.md 的 frontmatter索引生成器generate_index.py讀取所有 SKILL.mdfrontmatter 正文推斷類別并產(chǎn)出skills_index.json同時拷貝一份到 Web 應用使用的apps/web-app/public/skills.json。另有配套測試 test_generate_index_categorization.py 驗證推斷規(guī)則的正確性后面會詳細展開。三、分類規(guī)則詳解優(yōu)先級與打分機制3.1 優(yōu)先級系統(tǒng)分類決策遵循嚴格優(yōu)先級從源碼infer_category()見 generate_index.py可以確認優(yōu)先級依據(jù)置信度reason 標記1frontmatter 顯式category非 uncategorized1.0frontmatter:category2目錄結構SKILL.md 所在父目錄0.95path:folder3關鍵詞匹配名稱描述正文0.45 0.05×score上限 0.92keyword-match:...4動態(tài)推斷從技能 ID token 派生0.42 / 0.34 / 0.20derived-from-id-.../fallback:general原文檔簡化為 Frontmatter category Detected Keywords Fallback (uncategorized)實際索引生成器將目錄結構插在了第二級并且已不存在純 fallback 為 uncategorized 的情況——最后一級由動態(tài)推斷兜底保證每個技能都拿到一個非空類別。3.2 基于關鍵詞的分析auto_categorize_skills.py中的categorize_skill()tools/scripts/auto_categorize_skills.py把技能名與描述拼接成小寫文本再為每個類別統(tǒng)計關鍵詞命中得分。3.3 作用域匹配與加權原文檔提到兩條關鍵規(guī)則源碼實現(xiàn)完全對應精確短語匹配權重更高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 動態(tài)推斷與停用詞當關鍵詞全部未命中時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 針對未分類技能執(zhí)行分類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:才執(zhí)行 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注意上述數(shù)字是文檔編寫時的樣例快照每次運行結果取決于當前倉庫狀態(tài)原文檔也強調任何面向用戶的計數(shù)都應以skills_index.json實況為準。五、用索引實時查看類別分布不要手工統(tǒng)計或復制舊數(shù)字直接從索引生成這是原文檔給出的標準做法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在倉庫根目錄執(zhí)行上述腳本可得到skills2124 categories106之類的實時輸出當前實測數(shù)據(jù)隨倉庫演進會變化。分布信息還可通過generate_skills_report.py等配套工具進一步沉淀見 tools/scripts。六、索引生成器類別如何落盤6.1 再生成索引python tools/scripts/generate_index.py執(zhí)行后依據(jù) tools/scripts/generate_index.py遍歷skills/跳過隱藏目錄僅處理含 SKILL.md 的目錄解析 frontmatter 并清洗含的未加引號值自動補雙引號兼容郵箱等值frontmatter 字段name/description/risk/source/date_added/category優(yōu)先于目錄默認值無 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是審計分類依據(jù)的利器——例如某技能 reason 為keyword-match:llm,embedding,rag即表示由這三個關鍵詞命中ai-ml。6.3 測試如何守護分類規(guī)則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→ 動態(tài)推斷為hyperfluxderived-from-id-token:。這組測試保證了優(yōu)先級與置信度契約不會在后續(xù)重構中悄悄退化。七、Web 應用中的分類過濾分類的最終價值體現(xiàn)在apps/web-app的瀏覽體驗源碼見 apps/web-app/src/pages/Home.tsx類別篩選器categoryFilter通過 URL query 參數(shù)?category驅動支持分享與回退篩選邏輯為categoryFacet(skill.category) categoryFilter類別值直接取自索引下拉與按鈕列表從構建期生成的索引動態(tài)派生。改進前后對比源自原文檔Before無序列表包含 uncategorized無類別規(guī)模提示After類別按技能數(shù)降序最多在前uncategorized 最后計數(shù)來自生成索引而非硬編碼文檔數(shù)字瀏覽體驗顯著提升。下拉排序規(guī)則為All Categories → 最高計數(shù)類別 → 依次排列 → uncategorized若存在收尾。八、技能創(chuàng)作者指南讓新技能一次歸類8.1 新增技能時聲明類別在 SKILL.md 的 frontmatter 中直接寫入類別即可在下次索引生成時被優(yōu)先采用置信度 1.0--- name: my-skill description: ... category: web-development date_added: 2026-03-06 ---8.2 不確定類別怎么辦無需糾結下次重新生成索引時系統(tǒng)會自動歸類。只需執(zhí)行python tools/scripts/generate_index.py生成器會依次走 frontmatter → 目錄結構 → 關鍵詞 → 動態(tài)推斷的優(yōu)先級鏈絕不會把技能丟棄為未分類。九、內置類別與關鍵詞速查表以下關鍵詞體系來自 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 回填后者面向持續(xù)性的索引推斷。修改任何一方后都應重新跑對應流程以保持同步。十、自定義擴展新增類別與關鍵詞10.1 添加自定義關鍵詞編輯 tools/scripts/auto_categorize_skills.py 的CATEGORY_KEYWORDS配置CATEGORY_KEYWORDS { your-category: [ keyword1, keyword2, exact phrase, another-keyword ], # ... other categories }然后按順序重新執(zhí)行兩條命令讓回填與索引保持一致python tools/scripts/auto_categorize_skills.py python tools/scripts/generate_index.py10.2 類別歸一化規(guī)則所有類別值統(tǒng)一歸一化為小寫 kebab-casenormalize_category()下劃線轉連字符、空白折疊、非法字符剔除、連續(xù)連字符合并。因此寫Cloud DevOps、cloud_devops都會收斂為cloud-devops避免同類別多標簽分裂。十一、故障排查與最佳實踐11.1 仍有 Failed to categorize 的技能原文檔給出的三種處置路徑按推薦順序在 frontmatter 手動指定類別category: your-chosen-category向CATEGORY_KEYWORDS補充關鍵詞讓下一次自動分類能命中移動到更貼合的目錄目錄結構會作為第二優(yōu)先級回退skills/backend/my-new-skill/SKILL.md此外建議檢查是否命中了停用詞或描述過短——索引生成器對缺失 description 的技能會回退抽取正文首段因此為每個技能寫一段信息豐富的 description 是提升分類質量最經(jīng)濟的手段。11.2 修改 SKILL.md 后重新生成索引python tools/scripts/generate_index.py該命令將依次完成解析 frontmatter 類別 → 回退目錄結構 → 關鍵詞/動態(tài)推斷 → 生成新的skills_index.json→ 拷貝至apps/web-app/public/skills.json。十二、后續(xù)演進路線原文檔列出的后續(xù)工作可歸納為四件事在 Web 應用中驗證改進后的類別過濾器排序與計數(shù)是否與索引一致補齊缺失關鍵詞對仍 uncategorized 的技能逐一補充命中詞人工復核剩余未分類技能自動指派或人工審查雙軌并行持續(xù)監(jiān)控增長利用分類報告跟蹤新增 vs 已分類的變化趨勢。延伸閱讀分類設計完整方案docs/SMART_AUTO_CATEGORIZATION.md、docs/CATEGORIZATION_IMPLEMENTATION.md索引與目錄結構說明docs/README.md、CATALOG.md中文對照版維護指南docs_zh-CN/maintainers/smart-auto-categorization.md核心實現(xiàn)tools/scripts/auto_categorize_skills.py、tools/scripts/generate_index.py、skill_categorization/tools/scripts/generate_index.py規(guī)則測試skill_categorization/tools/scripts/tests/test_generate_index_categorization.pyWeb 應用篩選實現(xiàn)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創(chuàng)作聲明:本文部分內容由AI輔助生成(AIGC),僅供參考