Community编程与开发github.com

测试审计

编写/修改/审查/清理测试:拒绝重复或与实现耦合的证明;移除仅用于测试的生产代码接缝。

测试审计 是什么?

该技能专注于提升软件测试质量与可维护性。它定义了一套严格的“编写门禁”流程,要求开发者在添加任何新测试前,必须验证其是否保护了可观察的行为、不变式或独立契约,并且是有效的回归测试。技能明确列出了应拒绝的“垃圾模式”,例如自我比较、实现耦合断言以及测试专属的生产代码接缝。此外,它还提供了测试保留标准与审计验证指南,强调以批次方式清理低价值测试,而非追求删除数量,并确保在删除前记录剩余的证明。该技能适用于任何使用Vitest等测试框架的项目,帮助团队产出更健壮、更有价值的测试套件。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/.agents/skills/test-audit

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

测试审计 是做什么的?

  • 编写门禁:每个新增或变更的测试都必须经过审核。
  • 审计:以连贯的拥有者批次清理低价值证明;不要追求删除数量。
  • 全子系统行动:先阅读 CAMPAIGN.md。

编写门禁

在添加测试之前,请回答:

  1. 它保护的是可观察的行为、不变式还是独立契约?
  2. 它是否是一个可信的、能使其失败的回归测试?
  3. 为什么现有证明无法覆盖?每个契约:在最强边界处有一个主要拥有者。另一层需要不同的传输/生命周期风险。扩展表格/共享夹具;合并重复的设置。
  4. 是否存在没有生产调用者需要的导出、标志、包装器、注入钩子?将证明移至真实的边界。
  • 使用 边界与成本指南。
  • 回归测试必须在修复前因预期原因失败,修复后通过;报告不可用的基线证明。
  • 一个拥有者的回归测试涵盖了一个错误;不要在每一个跨越的层次上重复。
  • 保持行为不变的重构不应破坏测试。

垃圾模式

  • 拒绝自我比较、复制清单、源代码搜索、实现/调用形状断言、重复契约、测试专属的生产代码接缝、受测对象生成的期望值、提供断言行为的模拟对象。
  • 夹具不得伪造拥有者收据/顺序或声称从未写入的持久化路径。
  • 阴性对照必须在预期的守卫处失败;名称必须与所练习的行为匹配。
  • 审计候选:使用 完整检查清单。

保留标准

  • 保留独立 API、SDK、协议、配置、迁移、存储、安全、平台、默认值、提示字节、生成语言、包、发布、架构、可观察顺序契约。静态/慢速 ≠ 可丢弃。
  • 源检查必须在仅标识符重构后仍然有效,并保护独立的用户面向契约。
  • 基线失败可能是需要修复的错误,而不是需要删除的测试。

审计与验证

  • 在审计编辑之前:阅读 候选证据与工作流;检查完整的拥有者/调用者/历史;在删除前记录剩余的证明。
  • 删除过时的生产代码接缝及其测试;不要为了删除数量而优化。
  • 遵循 证明策略;保留活跃的 Vitest 工作区;运行拥有者/兄弟证明及变更检查;然后自动审查。
  • 报告原因、保留的契约、证明/成本、生产代码与测试代码行数、后续行动。仅在获得任务授权时提交/推送/合并。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills and agent Templates when requested; add Templates; install, verify, update, uninstall, publish, or sync skills.

相关技能