sensei by microsoft/github-copilot-for-azure
npx skills add https://github.com/microsoft/github-copilot-for-azure --skill sensei"真正的导师不是通过告知来教导,而是通过精炼。" - The Skill Sensei
使用 Ralph 循环模式 自动化技能 frontmatter 改进 - 迭代改进技能,直到它们达到中高合规性且测试通过,然后检查令牌使用情况并提示采取行动。
当用户说 "sensei help" 或询问如何使用 sensei 时,显示此内容:
╔══════════════════════════════════════════════════════════════════╗
║ SENSEI - 技能 Frontmatter 合规性改进器 ║
╠══════════════════════════════════════════════════════════════════╣
║ ║
║ 用法: ║
║ 在 <技能名称> 上运行 sensei # 单个技能 ║
║ 在 <技能名称> 上运行 sensei --skip-integration # 快速模式 ║
║ 在 <技能1>, <技能2>, ... 上运行 sensei # 多个技能 ║
║ 在所有低合规性技能上运行 sensei # 按分数批量处理 ║
║ 在所有技能上运行 sensei # 所有技能 ║
║ ║
║ 示例: ║
║ 在 appinsights-instrumentation 上运行 sensei ║
║ 在 azure-security 上运行 sensei --skip-integration ║
║ 在 azure-security, azure-observability 上运行 sensei ║
║ 在所有低合规性技能上运行 sensei ║
║ ║
║ 功能: ║
║ 1. 读取 - 加载技能的 SKILL.md、测试和令牌计数 ║
║ 2. 评分 - 检查合规性 (低/中/中高/高) ║
║ 3. 脚手架 - 如果缺失,则从模板创建测试 ║
║ 4. 改进 - 添加 WHEN: 触发器 (跨模型优化) ║
║ 5. 测试 - 运行测试,必要时修复 ║
║ 6. 引用 - 验证 Markdown 链接 ║
║ 7. 令牌 - 检查令牌预算,收集建议 ║
║ 8. 总结 - 显示改进前后的对比及未实施的建议 ║
║ 9. 提示 - 询问:提交、创建问题,还是跳过? ║
║ 10. 重复 - 直到达到中高评分且测试通过 ║
║ ║
║ 目标评分: 中高 ║
║ ✓ 描述 > 150 字符,≤ 60 个单词 ║
║ ✓ 有 "WHEN:" 触发短语 (首选) ║
║ ✓ 没有 "DO NOT USE FOR:" (在多技能环境中存在风险) ║
║ ✓ SKILL.md < 500 令牌 (软限制) ║
║ ║
║ 更多信息: ║
║ 查看 .github/skills/sensei/README.md 获取完整文档 ║
║ ║
╚══════════════════════════════════════════════════════════════════╝
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Run sensei on azure-deploy
Run sensei on azure-security, azure-observability
Run sensei on all Low-adherence skills
Run sensei on all skills
对于每个技能,执行此循环,直到评分 >= 中高 且 测试通过:
plugin/skills/{技能名称}/SKILL.md、测试和令牌计数name (无 --,无开头/结尾 -,小写字母数字)license, metadata, allowed-tools)tests/{技能名称}/ 不存在,则从 tests/_template/ 创建shouldTriggerPrompts 和 shouldNotTriggerPrompts 以匹配cd tests && npm test -- --testPathPatterns={技能名称}cd scripts && npm run references {技能名称} 以检查 Markdown 链接Sensei 根据 agentskills.io 规范 验证技能。完整细节请参见 SCORING.md。
| 评分 | 要求 |
|---|---|
| 无效 | 名称未通过规范验证 (连续连字符、开头/结尾连字符、大写字母等) |
| 低 | 基本描述,无明确触发器 |
| 中 | 有关键词/短语触发器,描述 > 150 字符,>60 个单词 |
| 中高 | 有 "WHEN:" (首选) 或 "USE FOR:" 触发器,≤60 个单词 |
| 高 | 中高 + 兼容性字段 |
目标: 中高 (独特的触发器,简洁的描述)
⚠️ "DO NOT USE FOR:" 在多技能环境中存在风险 (15+ 个重叠技能) - 在快速模式匹配模型上会导致关键词污染。对于小型、孤立的技能集是安全的。为了跨模型安全,请使用带有
WHEN:的积极路由。
强烈建议 (如果缺失,将作为建议报告):
license — 标识应用于技能的许可证metadata.version — 为使用者跟踪技能版本根据 agentskills.io 规范,必需和可选字段:
---
name: skill-name
description: "[动作动词] [唯一领域]。[一句澄清说明]。WHEN: \"触发器 1\", \"触发器 2\", \"触发器 3\"。"
license: MIT
metadata:
version: "1.0"
# 其他可选的规范字段 — 如果已存在则保留:
# metadata.author: example-org
# allowed-tools: Bash(git:*) Read
---
重要: 对描述使用内联双引号字符串。请勿使用
>-折叠标量 (与 skills.sh 不兼容)。请勿使用|字面块 (保留换行符)。保持总描述在 1024 个字符以内且 ≤60 个单词。
⚠️ "DO NOT USE FOR:" 具有上下文相关的风险。 在多技能环境 (10+ 个具有重叠领域的技能) 中,反触发器子句引入了那些在 Claude Sonnet 和快速模式匹配模型上导致错误技能激活的关键词 (证据)。对于小型、孤立的技能集 (1-5 个技能),风险较低。如有疑问,请使用带有
WHEN:和独特引用短语的积极路由。
当测试不存在时,从 tests/_template/ 搭建脚手架:
cp -r tests/_template tests/{skill-name}
然后更新:
SKILL_NAME 常量shouldTriggerPrompts - 5+ 个与新 frontmatter 触发器匹配的提示shouldNotTriggerPrompts - 5+ 个与反触发器匹配的提示提交消息:
sensei: improve {skill-name} frontmatter
plugin/skills/ - 这些是 Copilot 使用的 Azure 技能.github/skills/ 包含用于开发者工具的元技能,如 sensei| 标志 | 描述 |
|---|---|
--skip-integration | 跳过集成测试以加快迭代。仅运行单元测试和触发器测试。 |
⚠️ 跳过集成测试可以加速循环,但可能会遗漏运行时问题。考虑在最终提交前运行完整测试。
每周安装数
429
仓库
GitHub 星标数
160
首次出现
2026年2月4日
安全审计
安装于
codex353
gemini-cli349
opencode321
github-copilot314
cursor311
kimi-cli308
"A true master teaches not by telling, but by refining." - The Skill Sensei
Automates skill frontmatter improvement using the Ralph loop pattern - iteratively improving skills until they reach Medium-High compliance with passing tests, then checking token usage and prompting for action.
When user says "sensei help" or asks how to use sensei, show this:
╔══════════════════════════════════════════════════════════════════╗
║ SENSEI - Skill Frontmatter Compliance Improver ║
╠══════════════════════════════════════════════════════════════════╣
║ ║
║ USAGE: ║
║ Run sensei on <skill-name> # Single skill ║
║ Run sensei on <skill-name> --skip-integration # Fast mode ║
║ Run sensei on <skill1>, <skill2>, ... # Multiple skills ║
║ Run sensei on all Low-adherence skills # Batch by score ║
║ Run sensei on all skills # All skills ║
║ ║
║ EXAMPLES: ║
║ Run sensei on appinsights-instrumentation ║
║ Run sensei on azure-security --skip-integration ║
║ Run sensei on azure-security, azure-observability ║
║ Run sensei on all Low-adherence skills ║
║ ║
║ WHAT IT DOES: ║
║ 1. READ - Load skill's SKILL.md, tests, and token count ║
║ 2. SCORE - Check compliance (Low/Medium/Medium-High/High) ║
║ 3. SCAFFOLD - Create tests from template if missing ║
║ 4. IMPROVE - Add WHEN: triggers (cross-model optimized) ║
║ 5. TEST - Run tests, fix if needed ║
║ 6. REFERENCES- Validate markdown links ║
║ 7. TOKENS - Check token budget, gather suggestions ║
║ 8. SUMMARY - Show before/after with suggestions ║
║ 9. PROMPT - Ask: Commit, Create Issue, or Skip? ║
║ 10. REPEAT - Until Medium-High score + tests pass ║
║ ║
║ TARGET SCORE: Medium-High ║
║ ✓ Description > 150 chars, ≤ 60 words ║
║ ✓ Has "WHEN:" trigger phrases (preferred) ║
║ ✓ No "DO NOT USE FOR:" (risky in multi-skill envs) ║
║ ✓ SKILL.md < 500 tokens (soft limit) ║
║ ║
║ MORE INFO: ║
║ See .github/skills/sensei/README.md for full documentation ║
║ ║
╚══════════════════════════════════════════════════════════════════╝
Run sensei on azure-deploy
Run sensei on azure-security, azure-observability
Run sensei on all Low-adherence skills
Run sensei on all skills
For each skill, execute this loop until score >= Medium-High AND tests pass:
plugin/skills/{skill-name}/SKILL.md, tests, and token countname per agentskills.io spec (no --, no start/end -, lowercase alphanumeric)license, metadata, allowed-tools) if presentSensei validates skills against the agentskills.io specification. See SCORING.md for full details.
| Score | Requirements |
|---|---|
| Invalid | Name fails spec validation (consecutive hyphens, start/end hyphen, uppercase, etc.) |
| Low | Basic description, no explicit triggers |
| Medium | Has trigger keywords/phrases, description > 150 chars, >60 words |
| Medium-High | Has "WHEN:" (preferred) or "USE FOR:" triggers, ≤60 words |
| High | Medium-High + compatibility field |
Target: Medium-High (distinctive triggers, concise description)
⚠️ "DO NOT USE FOR:" is risky in multi-skill environments (15+ overlapping skills) — causes keyword contamination on fast-pattern-matching models. Safe for small, isolated skill sets. Use positive routing with
WHEN:for cross-model safety.
Strongly recommended (reported as suggestions if missing):
license — identifies the license applied to the skillmetadata.version — tracks the skill version for consumersPer the agentskills.io spec, required and optional fields:
---
name: skill-name
description: "[ACTION VERB] [UNIQUE_DOMAIN]. [One clarifying sentence]. WHEN: \"trigger 1\", \"trigger 2\", \"trigger 3\"."
license: MIT
metadata:
version: "1.0"
# Other optional spec fields — preserve if already present:
# metadata.author: example-org
# allowed-tools: Bash(git:*) Read
---
IMPORTANT: Use inline double-quoted strings for descriptions. Do NOT use
>-folded scalars (incompatible with skills.sh). Do NOT use|literal blocks (preserves newlines). Keep total description under 1024 characters and ≤60 words.
⚠️ "DO NOT USE FOR:" carries context-dependent risk. In multi-skill environments (10+ skills with overlapping domains), anti-trigger clauses introduce the very keywords that cause wrong-skill activation on Claude Sonnet and fast-pattern-matching models (evidence). For small, isolated skill sets (1-5 skills), the risk is low. When in doubt, use positive routing with
WHEN:and distinctive quoted phrases.
When tests don't exist, scaffold from tests/_template/:
cp -r tests/_template tests/{skill-name}
Then update:
SKILL_NAME constant in all test filesshouldTriggerPrompts - 5+ prompts matching new frontmatter triggersshouldNotTriggerPrompts - 5+ prompts matching anti-triggersCommit Messages:
sensei: improve {skill-name} frontmatter
plugin/skills/ - these are the Azure skills used by Copilot.github/skills/ contains meta-skills like sensei for developer tooling| Flag | Description |
|---|---|
--skip-integration | Skip integration tests for faster iteration. Only runs unit and trigger tests. |
⚠️ Skipping integration tests speeds up the loop but may miss runtime issues. Consider running full tests before final commit.
Weekly Installs
429
Repository
GitHub Stars
160
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex353
gemini-cli349
opencode321
github-copilot314
cursor311
kimi-cli308
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
103,800 周安装
tests/{skill-name}/ doesn't exist, create from tests/_template/shouldTriggerPrompts and shouldNotTriggerPrompts to matchcd tests && npm test -- --testPathPatterns={skill-name}cd scripts && npm run references {skill-name} to check markdown links