强制优先

danielvm-git2026-10-27查看 1772复制 1932

将 F.I.R.S.T 测试质量评分标准(依据 CONVENTIONS.md §Tests)应用于测试套件或单个测试。当 develop-tdd 正在编写测试、需要检查测试质量、或用户提到 F.I.R.S.T 或“测试质量”时使用。

Download (.md)

📘如何使用这个技能

  1. 1
    复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
  2. 2
    打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
  3. 3
    粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
  4. 4
    直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景

💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。

SKILL.md1853 chars
---
name: enforce-first
model: haiku
description: "Apply the F.I.R.S.T test quality rubric (per CONVENTIONS.md §Tests) to a test suite or individual tests. Use when develop-tdd is writing tests, when test quality needs to be checked, or when user mentions F.I.R.S.T or \"test quality\"."
disable-model-invocation: true
---

# Enforce FIRST
> **HARD GATE** — **HARD GATE** — Before shipping, ALL enforcement checks must pass: lint, typecheck, tests, coverage gates. Do NOT disable or skip checks to get to green.


Apply the F.I.R.S.T rubric per CONVENTIONS.md §Tests to evaluate and improve tests.

This skill is typically invoked internally by `develop-tdd` during the test-writing phase. It can also be run standalone on an existing test suite.

## Modes

- Default: full F.I.R.S.T audit (all 5 criteria)
- --quick: Check Fast, Independent, and Self-Validating criteria only (per CONVENTIONS.md §Tests). Used by build-epic step 6 as a mechanical gate after audit-code. Skips Repeatable and Timely which require contextual judgment.

## The F.I.R.S.T Rubric

See CONVENTIONS.md §Tests for the canonical F.I.R.S.T rubric definition, checklists, and fix patterns.

Mechanical self-check (runs before reporting audit complete):

```bash
grep -q '## Tests (F.I.R.S.T' CONVENTIONS.md
grep -qE 'Fast|Independent|Repeatable|Self-Validating|Timely' CONVENTIONS.md
```

Each criterion must be explicitly addressed in the audit report with pass/fail per test file reviewed.

## Applying the rubric

For each failing criterion:
1. Identify which tests violate it
2. Describe the fix
3. Apply the fix
4. Re-run the suite to confirm it still passes

Report: "F.I.R.S.T audit complete. X criteria passed, Y fixed."

## Verify

→ verify: `grep -q '## Tests (F.I.R.S.T' CONVENTIONS.md && grep -qE 'Self-Validating|Repeatable' skills/enforce-first/SKILL.md && echo OK`
来源:skillsdirectory

评论0

登录后参与评论

还没有评论,来抢沙发吧