AgentSkillsCN

criteria-test-loop

以成功标准和测试驱动编码流程;适用于漏洞修复、带有测试的特性开发,以及算法层面的调整。优先追求“朴素而正确”的实现,再在此基础上进行优化。

SKILL.md
--- frontmatter
name: criteria-test-loop
description: Drive coding by success criteria and tests; use for bugfixes, features with tests, and algorithmic changes. Emphasize naive-correct first, then optimize.

Criteria Test Loop

Quick start

  • Define success criteria or tests.
  • Implement the naive correct version.
  • Iterate until tests pass.
  • Optimize only after correctness.

Procedure

  1. Convert the request into explicit success checks.
  2. Write or select tests that prove success.
  3. Implement the simplest correct solution.
  4. Run or reason through tests; fix failures.
  5. Optimize while preserving the tests.

Output format

  • Success criteria: bullets.
  • Tests: new or existing.
  • Result: pass/fail and notes.
  • Optimization (optional): what changed and why.

Guardrails

  • Do not optimize before correctness.
  • Keep the test loop tight and explicit.
  • If tests are missing, add the smallest set that proves success.