代码健康度检查
何时使用
- 定期检查项目质量基线
- PR 前快速自检
- 接手项目时了解质量现状
检查项
1. 类型安全
pnpm lint # tsc --noEmit
期望:零错误、零警告。
2. 测试通过率
pnpm test
期望:全部通过。
3. 构建成功
pnpm build
期望:零错误,dist/ 产出完整。
4. 测试覆盖度(结构检查)
对比 src/lib/*.ts 与 tests/*.test.ts,识别缺少对应测试的模块。
ls src/lib/*.ts | sed 's|src/lib/||;s|.ts||' | sort > /tmp/src-modules
ls tests/*.test.ts | sed 's|tests/||;s|.test.ts||' | sort > /tmp/test-modules
comm -23 /tmp/src-modules /tmp/test-modules
5. 依赖审计
pnpm audit --prod
6. 架构合规
检查 lib 层无 @clack/prompts 引入:
grep -r "@clack/prompts" src/lib/
期望:无输出。
输出格式
| 检查项 | 状态 | 备注 |
|---|---|---|
| 类型安全 | pass/fail | 错误数 |
| 测试 | pass/fail | 通过/失败数 |
| 构建 | pass/fail | |
| 覆盖度 | warn/pass | 缺失模块列表 |
| 依赖安全 | pass/warn | 漏洞数 |
| 架构合规 | pass/fail | 违规文件 |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |