跳到正文
cccskills
免费在 GitHub 公开

test

Behavior-first test guidance.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md2.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Test

Invocation

This skill is performed in the Developer persona. If you are not already running as Developer (for example, the user invoked /test directly), read subagents/developer.md and adopt its role guidance for the rest of this task. Stay in the current chat—do not delegate to a subagent.

Objective

Write or improve tests that defend real user-visible behavior without encoding broken behavior as correct.

Core Rules

  • Start from the expected user behavior or contract, not implementation details.
  • Test names must describe observable behavior only.
  • Never write a green test that asserts a known bug as correct behavior.
  • If a test reveals a product bug, call that out explicitly instead of mutating the test to hide it.
  • Prefer existing test helpers, fixtures, and patterns before creating new ones.

Naming Guidance

  • Good: when a valid user signs in, they reach the dashboard
  • Good: when repo access is removed, the preview no longer shows that collaborator
  • Bad: useThing works correctly
  • Bad: POST /api/foo returns 200
  • Bad: someHelper handles edge cases

Repo Conventions

  • Place unit tests close to the code they cover as *.test.ts or *.test.tsx.
  • Run the relevant test suite for unit-level verification.
  • Run E2E tests when the change requires browser-flow validation.
  • If the repo does not provide a narrower script for the exact test slice you want, say so explicitly rather than inventing one.

Bug Discovery Protocol

  1. A failing test that exposes a real bug is a useful deliverable.
  2. If the observed behavior looks wrong, ask whether it is intentional before turning it into the asserted contract.
  3. Fix the application behavior when it is in scope.
  4. If the bug is out of scope, document the gap clearly instead of pretending the behavior is correct.

Review Checklist

  • Does the test assert a real contract or user-visible behavior?
  • Does it verify more than status-only success?
  • Does it match existing repo test structure and helpers?
  • Does it avoid broad mocks when the contract is integration-sensitive?
  • Does it run under the right repo verification command?

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

brief

免费

Create a product brief document for a feature or project.

中文简介正在准备中。当前显示原文说明。

g2i-ai/agents522026年4月21日 更新

code

免费

Implement production changes with or without new test coverage.

中文简介正在准备中。当前显示原文说明。

g2i-ai/agents522026年4月21日 更新

draft-pr

免费

Prepare commits, push a branch, and create a draft PR targeting your base branch.

中文简介正在准备中。当前显示原文说明。

g2i-ai/agents522026年4月21日 更新

Generate a PR description for the current branch against your base branch.

中文简介正在准备中。当前显示原文说明。

g2i-ai/agents522026年4月21日 更新

review

免费

Review a branch or PR for merge readiness and produce a QA report.

中文简介正在准备中。当前显示原文说明。

g2i-ai/agents522026年4月21日 更新

spec

免费

Transform a product brief into a technical specification.

中文简介正在准备中。当前显示原文说明。

g2i-ai/agents522026年4月21日 更新

查看 g2i-ai 的全部技能

报告此技能的问题