跳到正文
cccskills
免费在 GitHub 公开

superior-testing

Design, implement, repair, or review automated tests for observable behavior, regressions, contracts, stateful boundaries, and flaky failures. Use when testing is a primary part of the request or when choosing test levels, isolation, fixtures, or reliability requires dedicated judgment. Do not use merely to run existing checks after an ordinary implementation.

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

KodekaTeam/superior-skills星标 23(GitHub 23 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(3)

  • SKILL.md5.3 KB
  • references/reliable-test-design.md4.0 KB
  • references/test-strategy-and-levels.md4.2 KB

SKILL.md(原文)

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

Superior Testing

Make tests provide durable evidence about behavior and risk. Fit the suite to the repository's existing tools and architecture; do not impose a generic test pyramid, framework, or coverage target.

Establish the contract

Before writing a test, identify:

  • the observable behavior or invariant being protected;
  • the failure or regression the test must distinguish;
  • the public boundary where the behavior can be observed;
  • dependencies, state, time, concurrency, and external systems involved;
  • existing test conventions, helpers, fixtures, and CI constraints.

For a reported bug, reproduce the failure before changing the implementation when practical. Confirm that the test fails for the intended reason rather than because the fixture, environment, or assertion is broken.

Choose the narrowest credible test

Read references/test-strategy-and-levels.md when selecting among unit, component, integration, contract, end-to-end, property-based, or migration tests, or when a change needs coverage at more than one layer.

Prefer the least expensive test that exercises the real owner of the risk:

  • pure rules at a stable callable boundary;
  • integration tests for persistence, serialization, framework wiring, or service boundaries;
  • contract tests for independently changing producers and consumers;
  • end-to-end tests for a small number of critical journeys whose wiring is itself the risk.

Do not repeat the same assertion at every layer. Add another layer only when it proves a distinct failure mode.

Design for signal

  • Assert observable outcomes, state transitions, emitted effects, or stable contracts rather than private method calls.
  • Use representative boundary cases and invalid inputs derived from the contract, not arbitrary permutations.
  • Keep each failure diagnostic enough to identify the broken contract.
  • Keep snapshots small and intentional; review semantic changes instead of accepting broad snapshot churn.
  • Treat line coverage as a discovery signal, not proof of correctness.
  • Preserve established naming and structure unless they prevent the test from expressing its purpose.

Production code may receive a small testability seam when the requested scope permits it and the seam improves the real design. Do not expose private internals, add dependency injection machinery, or alter behavior solely to satisfy a test harness.

Keep execution reliable

Read references/reliable-test-design.md when tests involve shared fixtures, databases, files, networks, time, randomness, asynchronous work, concurrency, retries, or intermittent failures.

  • Control time and randomness at an owned boundary.
  • Wait for observable conditions instead of sleeping for guessed durations.
  • Isolate mutable state and clean it up even after failure.
  • Mock external ownership boundaries, not the internal collaboration being tested.
  • Never hide a flaky test with retries, larger timeouts, or skipped execution without identifying and recording the unresolved cause.

Execute proportionately

Run the narrowest affected test first, then the relevant suite, type checks, lint, or build checks according to repository practice and change risk. Do not run destructive integration tests, production traffic experiments, or tests that mutate shared external systems without explicit authorization and an approved environment.

Report:

  • the behavior and risk covered;
  • test level and why it is credible;
  • commands run and observed results;
  • failures that predated the change or remain unresolved;
  • important environments or conditions not exercised.

Combine skills narrowly

  • Use superior-code-review when tests are one risk area within a broader change-set review.
  • Use superior-debugging when a failing test is evidence of an unknown production or environment cause rather than a test-design problem.
  • Use superior-database when a migration, real-engine integration, transaction, or data-compatibility contract owns the behavior under test.
  • Use superior-performance when benchmark methodology, performance budgets, capacity checks, or regression thresholds are primary.
  • Use superior-reliability when controlled fault, degradation, recovery, failover, or restore testing is primary.
  • Use superior-delivery when pipeline and release verification owns the test environment or gate.
  • Use superior-logic when tests accompany changes to business rules, state transitions, persistence, or API behavior.
  • Use superior-api-security for threat-driven negative cases and security-control verification.
  • Use superior-accessibility, superior-responsive, or superior-ui when the asserted behavior is owned by those interface concerns.
  • Use superior-docs only when the test strategy, verification procedure, or delivered implementation changes durable project knowledge.

Do not broaden a focused test request into unrelated production refactoring or a full-suite rewrite.

评价

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

评论

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

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

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

0 / 1000 字

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

同一仓库的技能

Review or implement interface accessibility for semantics, keyboard operation, focus, contrast, status communication, zoom, and assistive technology. Use when accessibility is explicitly requested, required by the product contract, or a changed interaction creates substantial accessibility risk. Do not activate for every visual edit or use it as a generic design audit.

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

KodekaTeam/superior-skills232026年10月29日 更新

Implement, harden, or review defensive security controls for REST APIs, including authentication and authorization boundaries, validation, rate limiting, abuse prevention, resource limits, SSRF defenses, safe errors, logging, and security tests. Use when API security, endpoint hardening, threat review, rate limiting, token handling, or sensitive business-flow protection is an explicit concern. Do not use for ordinary endpoint logic without meaningful security scope or for offensive exploitation.

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

KodekaTeam/superior-skills232026年10月29日 更新

Design, implement, or assess project structure, module ownership, dependency boundaries, and safe file or folder organization. Use when project architecture, feature placement, separation of responsibilities, or architectural refactoring is a primary concern, including new framework projects. For a read-only assessment, do not modify files unless the user also requests changes; do not activate merely because ordinary feature work adds a file.

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

KodekaTeam/superior-skills232026年10月29日 更新

Review a code change, diff, commit, branch, or pull request for actionable defects, regressions, security risks, compatibility breaks, and missing verification. Use when code review is the primary requested outcome. Keep the review read-only unless the user explicitly asks to implement fixes; do not use as a substitute for implementation or a specialized visual audit.

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

KodekaTeam/superior-skills232026年10月29日 更新

Add, revise, or remove source-code comments while preserving executable behavior. Use for comment-only cleanup, documentation comments, TODO quality, and reducing narration. Do not use when the requested change modifies logic.

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

KodekaTeam/superior-skills232026年10月29日 更新

Write or revise user-facing product and marketing copy with a specific voice, verifiable claims, natural rhythm, and useful actions. Use for interface labels, onboarding, landing pages, help text, and product messaging. Do not use for code comments or neutral technical documentation unless tone editing is requested.

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

KodekaTeam/superior-skills232026年10月29日 更新

查看 KodekaTeam 的全部技能

报告此技能的问题