This is a systematic code auditor that scans your codebase for bugs, security holes, performance issues, maintainability debt, and architectural drift. It won't fix anything, just produces a structured inventory of findings cross-classified by severity (P0/P1/P2) and type. You tell it what to scan (a module, directory, or search term), it reads the actual code with file:line references, and outputs markdown reports in .codestable/audits/ with confidence levels and suggested next actions. The hard limit of 5 findings per dimension forces it to report what actually matters instead of dumping everything. Think of it as filling the gap between "I know there's a bug here" and "something feels off but I don't know where to look."
npx -y skills add liuzhengdongfortest/codestable --skill cs-audit --agent claude-codeInstalls into .claude/skills of the current project.
开始任何判断或动作前,先读取 .codestable/attention.md;缺失则视为骨架不完整,提示先补齐或运行 cs-onboard,不要回退到外部 AI 入口文件。
cs-issue 等你报 bug,cs-refactor 等你指优化点,cs-explore 等你提问题——但"我也不知道哪有问题,你先扫一遍看看"这个诉求没人接。cs-audit 补上这块:在用户限定的范围内主动扫描,产出一份按严重度 × 性质交叉分类的发现清单。
本技能只发现、不定修。修是 cs-issue / cs-refactor 的事。
.codestable/audits/{YYYY-MM-DD}-{slug}/
├── index.md # 速览:范围、总评、发现清单交叉矩阵
├── finding-01.md
├── finding-02.md
└── ...
日期取审计当天。slug 短到一眼看出审计目标(auth-module、order-flow、payment-security)。
所有 audit 文档带 YAML frontmatter(doc_type 分别为 audit-index 和 audit-finding)便于 search-yaml.py 检索。
每个发现打两个标签:
性质:bug | security | performance | maintainability | arch-drift
严重度:P0(必须修)| P1(应该修)| P2(可以修)
交叉示例:
security × P0:SQL 注入、明文存密码bug × P1:特定边界条件下空指针,实际触发概率低performance × P2:循环内多余的对象分配,热点路径才需要改另外每个发现带 置信度(high / medium / low)和建议动作(cs-issue / cs-refactor)。
完整模板见 reference.md。
审计不能全仓库盲扫——成本高、噪音大。先帮用户把范围收窄到可执行。
问用户三样(有一样就能起步):
src/services/ 下面"用户描述已清楚直接进 Phase 2。用户说"整个项目都扫" → 推回去——建议先扫最常改的模块或最近出过问题的区域。
收敛后给用户确认:"扫 src/services/order/ 和 src/api/order.ts,约 12 个文件,看安全 / 性能 / bug 隐患三个维度。范围 OK 吗?"
按用户圈定的维度逐维扫描(用户没指定就全扫 5 维):
.codestable/architecture/ 记录不一致、分层泄漏、跨模块隐式耦合扫描时用 Glob / Grep / Read 真实读代码。每条发现必须记录 文件:行号 + 具体代码片段。
上限:每种维度最多报 5 条。不是凑数——够了就停,不够也不硬凑。
置信度口径:
high:代码路径可确认触发,影响明确medium:静态分析能定位问题,但触发条件不确定low:线索可疑,需要进一步确认但值得标记index.md:范围、总评、发现清单表格(交叉分类)finding-NN.md先写 index 再写 finding——这个顺序让 AI 先做整体判断再展开细节,避免陷入单条发现迷失全局。
index.md 末尾给优先级建议:
用户选哪条 → 路由到 cs-issue 或 cs-refactor。cs-audit 自己不修。
| 技能 | 触发 | cs-audit 怎么对待 |
|---|---|---|
cs-issue | 用户报已知 bug | audit 发现 bug 后建议开 cs-issue |
cs-refactor | 用户指已知优化点 | audit 发现可优化点后建议开 cs-refactor |
cs-explore | 围绕一个问题查代码 | audit 是批量扫多个维度,不等同于 explore |
cs-arch | 维护架构文档 | cs-arch 维护文档,cs-audit 检查代码是否偏离文档 |
cs-security-review | 安全审查 | audit 的安全维度是轻量扫描,深度安全审查走专项 |
high.codestable/architecture/ 对照status: superseded + superseded-by: {新目录}reference.md — index.md / finding-NN.md 模板.codestable/reference/shared-conventions.md — 跨工作流共享口径.codestable/architecture/ — 架构偏离类发现对照源juliusbrussee/caveman
mattpocock/skills
shadcn/improve
obra/superpowers
forrestchang/andrej-karpathy-skills
vercel-labs/skills