kb-authoring
Skill1 starsChanged 33 days agoMITView on GitHub
测试用例知识库的用例写作规范:双源同构(domains md + specs ts)、断言文本逐字对齐、锚点实证纪律、画像/领域知识模板。写或改用例前必读。
2 other projects use a version of this.
Adopted by
Most recently taken up by
- okou-ai/okou-skillstheir own version, first seen Nov 4, 2026
- vm0-ai/vm0-skillstheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- okou-ai/okou-skills★ 81same name
- vm0-ai/vm0-skills★ 81same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Files
用例写作规范(kb-case 执行时生效)
双源同构(最高纪律)
domains/<域>/TC-*.md是设计单源:frontmatter + 步骤 +## 断言checklist(- [ ] 文本)specs/<域>/*.spec.ts是执行体:import { test, expect, capture } from '../common/fixture'- expect( locator, '描述' ) 的描述必须与 md 断言文本逐字一致——执行回执的三态勾选(✅/❌/⚠️)靠归一化文本匹配对齐,措辞漂移会导致错勾/漏勾
- 断言顺序即 checklist 顺序:第 N 条失败后,回执里第 N+1 起自动标 ⚠️(阻塞语义)
锚点实证纪律
- 选择器/接口/文案必须探针实证,禁止凭记忆或猜测写(历史翻车:臆造空态文案、猜订单号正则)
- 优先级:data-testid > ARIA 语义角色(getByRole)> 结构性存在(label 包裹 checkbox 等)> 具体文案
- 内容可变的面(共享账号数据)不锚具体值,锚结构性存在;常驻兜底文案(如「合计 ¥0.00」)会假绿,断言须排除
- 每条新锚点首次失败时:先看终态截图确认页面落点,再决定重锚/重跑
用例 md 模板
---
id: TC-<域缩写>-<序号> # 与文件名一致
domain: <域>
apps: [<画像名>...] # 首个带 envs 的画像提供执行环境
title: <标题>
priority: P0|P1|P2
type: e2e
status: active
spec: specs/<域>/<slug>.spec.ts
---
# <标题>
<一句话意图>
## 前置条件
## 步骤
## 断言
- [ ] <断言文本——与 spec 描述逐字一致>
## 历史坑(可选:flaky 记录/锚点教训,跑出来的知识回写这里)应用画像模板(apps/*.md)
frontmatter 最小集:name / kind / envs(常用环境放首位=默认);可选 exec.headers(网关头)、exec.locale/timezone(应用语言)、auth: none(公开站点免登录)。正文:e2e 环境策略 / 账号方式 / 已知坑——只写测试执行所需,项目历史知识不进画像。
领域知识模板(knowledge/<域>.md)
测试用例范围表 / 特殊配置(环境/头/登录/语言)/ 实证坑集。站点导航自动收录。
三态语义(写断言时心里有这张表)
| 用例结果 | checklist 表现 |
| 通过 | 全 ✅;有真实观察值的挂「实际✓」行,纯通过占位不显示 |
| 失败 | 失败项 ❌ + 实际✗ 红 行;失败前的断言仍 ✅;其后未执行项 ⚠️ |
| 阻塞 | 整体 ⚠️(超时/中断,断言未执行到) |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

