agentleFS
Practice019Practice019/agent-skills/skill-audit/SKILL.md

skill-audit

Skill0 starsChanged 2 months agoMITView on GitHub

审计并修复整个 DSH 技能库:库级两级扫描(硬门禁 + 宽口径:frontmatter / name / CRLF / 引用可解析 / 机器路径 / 重复内容 / description 质量)加单技能纵深体检(frontmatter 残留键与键吞并、description 双语、专有运行时残留、引用精度、技能内重复、嵌套注册性),自动归类已知误报,再按 epoch 循环逐个原子修复并复验。当用户要求审查技能、检查 skill 规范、技能库体检、修复 skill、批量修技能、skill 有没有问题、清理技能库时使用。 Audit and repair the entire DSH skill library: library-level hard gate plus wide scan, plus a per-skill deep check (leftover foreign or swallowed frontmatter keys, bilingual description, foreign runtime residue, reference precision, intra-skill duplicates, nested-skill registration), auto-classify known false positives, then fix atomically one at a time in an epoch loop with re-verification. Use when the user asks to audit skills, check skill conventions, run a skill-library health check, repair skills, bulk-fix skills, or clean up the library.

  • Commits and pushes

58 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use root-cause, write-a-skill and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Ingramradical235Skill

    root-cause

    Structured root cause analysis using WHERE (MECE decomposition) then WHY (causal structure diagrams) pipeline. Includes coin-flip detection, logical-leap detection, and vicious cycle intervention. Use when buffer enters YELLOW/RED, when metrics stall, or when Actions execute but don't produce results.

    Also in 3 projects that use this

  • simo97Skill

    write-a-skill

    Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.

    Also in 4 projects that use this

  • Microsoft AzureSkill

    reflect

    Learning capture system that extracts HIGH/MED/LOW confidence patterns from conversations to prevent repeating mistakes. Use after user corrections ("no", "wrong"), praise ("perfect", "exactly"), or when discovering edge cases. Complements .squad/agents/{agent}/history.md and .squad/decisions.md.

    Also in 5 projects that use this

  • sunnyclinches44Skill

    explain

    Explains code using real-world analogies and ASCII diagrams

    Also in 4 projects that use this

  • eherrerosjSkill

    humanize

    Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive 'Signs of AI writing' guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases. Triggers on: 'humanize', 'make this sound human', 'remove AI writing', 'de-AI', 'sound more natural', 'less robotic', 'too AI-sounding', or when reviewing text that reads like AI output.

    Also in 3 projects that use this

  • MicrosoftSkill

    report

    Turn an exploration (threads, findings, charts) into a single Markdown report — note, blog post, executive summary, KPI dashboard, slide brief, or multi-section analytical report, with embedded charts.

    Also in 3 projects that use this

The file

Files
SKILL.md

技能库审计与修复

对本机 DSH 技能库做一次完整体检并修复:库级两级扫描 + 单技能纵深体检 → 分类裁决 → 原子修复 → 复验 → 报告。

目标与边界

做:

  • 扫描技能库全部文件,找出真缺陷(断链、frontmatter 不合法、name 不合规、CRLF、机器路径、重复内容、description 过短)
  • 对单个技能做纵深体检(frontmatter 残留键与键吞并、description 双语、专有运行时残留、引用精度、技能内重复、嵌套注册性)
  • 区分「真缺陷」与「已知误报」,只修前者
  • 按 epoch 循环逐个原子修复,每个修复都真实验证后才 commit
  • 输出可核对的审计报告

不做:

  • ❌ 不擅自删除技能、不擅自改技能语义(description 内容、工作流步骤)——灰色项先问用户
  • ❌ 不自动 git push、不自动 npm publish
  • ❌ 不把「同名不同内容」当重复删掉

本技能自带的三个工具

工具覆盖位置
硬门禁(库级)只看 SKILL.md 的 6 项(frontmatter/name/CRLF/读引用/~/用户名路径)../_shared/validate-skills.cjs
宽口径审计(库级)扫全部 .md:CRLF、显式相对引用、机器路径、重复内容、description 质量scripts/audit-library.cjs
单技能体检(纵深)逐个技能(含嵌套 SKILL.md):frontmatter 残留键与键吞并、description 双语与长度、专有运行时残留、引用精度、技能内重复、嵌套 SKILL.md、文件清单scripts/audit-skill.cjs

三个脚本都用自身位置反推技能库根目录,不需要硬编码路径;技能库整体移动后仍可用。三者共用同一套误报口径(NON_REPO / ARTIFACTS / BENIGN_TILDE),改口径要三处同步。

工作流程

阶段 0:建立安全基线(不可跳过)

git -C <skills-root> status --short
git -C <skills-root> log --oneline -1
  • 工作树必须 clean;有未提交改动时先问用户是否先提交。
  • 看到 D(工作树删了文件)先问,不要 git restore:未提交的删除可能是有意为之。实测踩过——把用户手删的 3 个技能当成事故恢复了,方向完全反了。
  • 记录基线 commit,便于回退。

阶段 1:跑三级扫描

node "<skills-root>\_shared\validate-skills.cjs"
node "<skills-root>\skill-audit\scripts\audit-library.cjs"
node "<skills-root>\skill-audit\scripts\audit-skill.cjs"                # 全部顶层技能
node "<skills-root>\skill-audit\scripts\audit-skill.cjs" <skill-a> <技能b>   # 只体检指定技能

读退出码和汇总行(passed/failed、ERROR/WARN/INFO、PASS/WARN/FAIL),不要只看有没有红字。

单技能体检的输出约定:

  • [PASS] 无问题;[WARN] 有建议项;[FAIL] 有必须修的 ERROR(退出码 1)。
  • · 行是信息(含已归类的误报);! 行是 WARN;- 行是 ERROR。
  • 技能库刚做增删/移植时,必须对新技能单独跑一次(audit-skill.cjs <name>),库级扫描不会告诉你 description 是否双语、是否残留上游 frontmatter 键。

阶段 2:分类裁决

把 ERROR / WARN 分成三类,不要跳过分拣:

类别判据处置
真缺陷引用指向不存在的仓库内文件;frontmatter 不合法;description 标量吞并了后续顶层键(license/version/platforms 等,元数据丢失且路由描述被污染);name 非 kebab 或与目录名不一致;SKILL.md 含 CRLF;本机真实用户名绝对路径;正文残留 OPENSQUILLA/{baseDir}/{{ with.* }}/skill_exec 等专有运行时调用(检测说明见「本技能自带的三个工具」)必须修
已知误报命中下方「误报分类表」记入报告,不改
灰色description 过短或缺某一语言半句、上游 frontmatter 键残留、同名不同内容、嵌套 SKILL.md、第三方正文里的历史写法先问用户,不擅自改语义

阶段 3:修复(epoch 循环)

每个真缺陷 = 一个原子 commit:

  1. 先改引用,后删文件——避免中间态断链。
  2. 每轮:改 → 复跑两级扫描 → 通过才 git commit。
  3. 失败就 git restore 回退,换思路重试,不要原样重试。
  4. commit message 写清「改了什么 + 用什么命令验证」。

阶段 4:复验

  • validate-skills.cjs → failed=0
  • audit-library.cjs → ERROR=0
  • audit-skill.cjs → FAIL=0(WARN 逐条裁决后记入报告)
  • 顶层技能数与 catalog 条目数符合预期(除非本轮就是增删技能)

阶段 5:报告

用下方输出模板,如实写返工次数与未修项。

阶段 6:发布(可选,需用户明确同意)

CHANGELOG + package.json + tag。不自动 push、不自动 npm publish。

误报分类表(务必对照,别把误报改坏)

现象为什么不是缺陷
DESIGN.md、tasks/、SPEC.md、src/、tests/、docs/ 引用不存在指向用户项目产物,本就不在技能库内
agent-workspace\...、./logs/...、./scratch/${VAR}/...运行时目录 / 带变量模板
../../../var/www/html/、/etc/passwd攻击载荷里的靶机路径
C:\Users\Public、C:\Users\user、C:\Users\Administrator靶机路径;只查本机真实用户名才算缺陷
代码块内的路由模板路径(如指向 tool-index 的相对路径)写给「新建技能」的模板,基准是子技能目录
CHANGELOG.md / CONTRIBUTING.md / README.md 里的路径变更说明 / 文档的描述性文字
规则说明里的 read ~/ 反例正在讲「禁止这样写」
同名但内容不同的文件(00-index.md、信息收集.md)不同目录各有其职;只有 md5 相同才算重复
tool-index.md 含 CRLF机器生成的索引,已 gitignore
audit-skill.cjs 报 .ps1/.py/.json 含 CRLFcore.autocrlf=true 下工作副本本就是 CRLF,仓库 blob 是 LF(用 git ls-files --eol <path> 核对 i/lf w/crlf);故该脚本只对 .md 报 CRLF
audit-skill.cjs 报「正文引用旧运行时名」且命中行含 DSH environment note / 原文本 / 替换那是解释「已替换成 DSH 写法」的说明性文字,脚本已自动降级为 INFO
英文-only 技能报「description 缺中文半句」第三方原样导入、用户明确要求保留英文原文的技能;属灰色项,先问用户再补

自检(证明体检器不是空转)

改过 scripts/audit-skill.cjs 或怀疑它漏检时,在临时目录(不要放进技能库)造一份故意做坏的夹具库验证它确实报错:

# 自己写一个 .cjs 在 <fixture-dir>\fake-lib 下造各类坏样本,
# 并把真实的 scripts/audit-skill.cjs 复制到 <fixture-dir>\fake-lib\skill-audit\scripts\ 下
# (体检器用自身位置反推根目录,复制后 ROOT 才指向夹具库)
node <fixture-dir>\make-fixture.cjs <fixture-dir>\fake-lib <skills-root>\skill-audit\scripts
node <fixture-dir>\fake-lib\skill-audit\scripts\audit-skill.cjs

夹具必须含正样本(一个干净技能,期望 PASS),否则证明不了「不误报」。期望命中:

  • FAIL:非 kebab name / 与目录名不一致、相对引用断链、SKILL.md 含 CRLF、本机用户名绝对路径、read ~/(反例写法)、description 标量吞并后续顶层键(顶层与嵌套各造一例)。
  • WARN:上游 frontmatter 残留键、正文专有运行时残留、技能内内容完全相同的副本、description 缺中文/英文半句。
  • INFO:嵌套 SKILL.md、说明性引用。
  • 退出码 1;正样本 PASS。

注意:裸文件名读引用(tool-index.md、frameworks.md)不由本脚本报出,那是 audit-library.cjs 的 INFO 类。夹具库用完即删,不要放进技能库。

修复规范

路径引用

  • 技能内引用一律相对本技能目录;跨技能用 ../<其他技能>/x.md
  • 禁止 read ~/...(read 不展开 ~,会解析成 <cwd>~/... 直接 not found)
  • 禁止本机真实用户名绝对路径,改用 $env:USERPROFILE

第三方技能(最小改动)

  • 只改 frontmatter 与路径引用,正文保持原样,保住上游可同步性
  • 交叉引用优于物理合并;合并会丢上游归属与许可证

共享文件去重

  • 先按 md5 分组,只有内容完全相同的才算重复
  • 两份内容不同时:取超集(或更新版),把另一份独有内容并入;不要随手选体积大的
  • 顺序:先改引用 → 再删副本 → 复扫

输出模板

## 技能库审计报告(<日期>)
规模: SKILL.md=<n>  顶层技能=<n>  catalog=<n>
硬门禁: validate-skills.cjs → passed=<n> failed=<n>
宽口径: audit-library.cjs → ERROR=<n> WARN=<n> INFO=<n>
单技能: audit-skill.cjs → 体检=<n> PASS=<n> WARN=<n> FAIL=<n>

真缺陷(已修)
| 位置 | 问题 | 修法 | 验证命令 |

灰色(待你拍板)
- <逐条>

已知误报(未改,分类计数)
- <分类>: <n>

返工记录
- 第 <k> 轮:<失败原因> → <换的思路>

版本: <是否发布 / tag>

常见坑

坑后果正确做法
只看 SKILL.md 就宣布「全绿」漏掉内容文件的 CRLF / 断链库级两级扫描都跑
只跑库级扫描就宣布单技能合规漏掉 description 缺半句、上游 frontmatter 键残留、技能内重复、嵌套 SKILL.md阶段 1 第三个脚本(audit-skill.cjs)也要跑
不先 git status 就审计在残缺技能库上得结论阶段 0 强制做
把用户手删的文件 git restore 回来方向反了,覆盖用户意图见 D 先问
把同名不同内容当重复删删掉有意的区分只按 md5 判重复
先删文件后改引用中间态断链,复扫必失败先改引用
用 node -e "..." 写校验逻辑PowerShell 剥离引号,语法报错写成 .cjs 文件再跑
体检器报一堆噪声就关掉它真缺陷被淹没先把已知误报写进分类表并降级为 INFO,再复跑
改了体检器不做夹具自检静默漏检,越修越假绿用「自检」一节的夹具库验证报错能力
双语 description 的引号在英文半句结束后忘了闭合后续 license:/version:/platforms: 被一起吞进标量:YAML 仍能解析,硬门禁与库级扫描全绿,只有元数据丢失 + 路由描述被污染让闭合引号落在英文半句末尾;改完跑 audit-skill.cjs 确认「键吞并」为 0。已知这一类只在纵深体检里查得出来,必须查嵌套 SKILL.md
顺手 push / publish不可控需用户明确同意

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.