Files
ai-proj-helper/skills-req/req-test-gate-plugin/skills/references/details.md
T
johnQ 237631147a chore(skill): 清理全部 23 条历史校验警告
- 11 个超 20KB 的 SKILL.md 拆分,大章节移入 references/details.md
- 7 处非标准字段(arguments/user_invocable)移入 metadata
- 修 req-dev 4 条相对链接;validate 跳过行内代码避免 ![](...) 误报
- validate-skills.py: 23 warns -> 0 warns,0 errors
2026-10-31 22:21:07 +08:00

91 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# skills 详细内容
## 测试报告 - {需求标题}
| 字段 | 值 |
|------|-----|
| 需求 | REQ-XXXX |
| 类型 | {code/skill/ops} |
| 时间 | {YYYY-MM-DD HH:MM} |
| 门禁版本 | test-gate v2 |
### 前置条件 (Gate 1)
- CR 状态: ✅ 已通过
- 开发任务: ✅ 全部完成 ({N}/{N})
### 测试执行 (Gate 2)
| 序号 | 阶段 | 测试项 | 命令/方法 | 结果 | 备注 |
|------|------|--------|----------|------|------|
| T1 | 2A | 后端编译 | ... | ✅/❌/⏭️ | ... |
| IT1 | 2C | 前端代理连通 | ... | ✅/❌/⏭️ | ... |
| SM1 | 2D | 健康检查 | ... | ✅/❌/⏭️ | ... |
| PC1 | 2E | 结构完整性 | ... | ✅/❌/⏭️ | ... |
### 跳过的测试
⏭️ {测试项}: {原因}
(无则写「无」)
### 质量验证 (Gate 3)
{子代理结果摘要,或「未触发(ops 类型)」}
### 回归贡献 (Gate 5)
{贡献的回归用例数,或「无需贡献」或「⏭️ 跳过: 过渡期」}
### 总结
通过: {N}/{M} | 跳过: {K} | 结论: ✅ 通过 / ❌ 未通过
```
### 文档质量门禁(被 `/req next` 检查)
- 含测试项表格(`|` 分隔符 ≥ 3 行)
- 含通过/失败结论(`✅ 通过` 或 `❌ 未通过`)
- 总字符数 ≥ 200
- 门禁版本标记(`test-gate v2` 或 `test-gate v2.1`)
## Harness Engineering — 工程约束方法论
**项目级基础设施**的建立和维护方法论,与上述需求级门禁互补。
> 详见 [harness-engineering.md](harness-engineering.md) 完整文档。
### 核心理念
**建立自动化护栏防止新违规,同时允许渐进式清理遗留问题。**
三大支柱:
1. **Ratchet** — 遗留违规数只能减不能增 → [ratchet-pattern.md](ratchet-pattern.md)
2. **约定建立** — 每个 bug 修复后立即建立约定和检测 → [convention-flow.md](convention-flow.md)
3. **门禁层级** — 按项目成熟度逐级引入 → [project-bootstrap.md](project-bootstrap.md)
### `/harness` 命令集(手动可用 + 自动嵌入)
| 命令 | 手动 | 自动触发 |
|------|------|---------|
| `/harness assess` | 随时 | 首次 `/req dev` |
| `/harness init [level]` | 随时 | — |
| `/harness convention [name]` | 随时 | `/req cr` + bug 类型需求 |
| `/harness report` | 随时 | `/req test` Gate 0B |
### 模板
`templates/` 目录提供可复用的脚本模板:
- [ratchet-script.md](templates/ratchet-script.md) — Ratchet 脚本模板(check/baseline/report 三命令)
- [convention-script.md](templates/convention-script.md) — 约定检测脚本模板(grep 模式匹配)
- [gates-doc.md](templates/gates-doc.md) — GATES.md 文档模板
- [pre-commit-config.md](templates/pre-commit-config.md) — husky + lint-staged 配置(Node.js/Go/Monorepo)
### 与需求级门禁的关系
```
Harness(项目级护栏) req-test-gate(需求级门禁)
├── .husky/ pre-commit ├── Gate 0A: scope 分级
├── CI lint workflow ├── Gate 0B: 运行 harness 的 check-*.sh ←─ 连接点
├── scripts/check-*.sh ├── Gate 1: 前置条件
├── CLAUDE.md 约定 ├── Gate 2: 测试执行
│ ├── Gate 3: 质量验证
│ ├── Gate 4: 文档持久化
│ └── Gate 5: 回归贡献
```
> Harness 不使用 Gate 编号。它的产出物(check-*.sh 脚本)通过 Gate 0B 接入 req-test-gate 流程。