wtf.steer-qa

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Steer QA

制定QA标准

Generate or refine
docs/steering/QA.md
— the QA standards document. This document is the canonical reference for test strategy, coverage requirements, test patterns, and the definition of done that every implementer and QA engineer must follow.
See
references/qa-template.md
for the expected document shape.
生成或完善
docs/steering/QA.md
——QA标准文档。这份文档是测试策略、覆盖要求、测试模式以及完成定义的权威参考,所有开发人员和QA工程师都必须遵循。
可参考
references/qa-template.md
了解文档的预期结构。

Process

流程

1. Check if the document already exists

1. 检查文档是否已存在

Use the Read tool to attempt reading
docs/steering/QA.md
.
If the file exists, call
AskUserQuestion
with:
  • question
    : "docs/steering/QA.md already exists. What would you like to do?"
  • header
    : "QA doc found"
  • options
    :
    [{label: "Refine it", description: "Review and improve the existing document"}, {label: "Exit", description: "Leave it as-is"}]
  • Refine it → read the current document, then skip to step 4 (use existing doc as context, only ask about gaps or outdated sections).
  • Exit → exit immediately.
If the file does not exist, continue to step 2.
使用Read工具尝试读取
docs/steering/QA.md
如果文件已存在,调用
AskUserQuestion
,参数如下:
  • question
    : "docs/steering/QA.md已存在。您想要进行什么操作?"
  • header
    : "已找到QA文档"
  • options
    :
    [{label: "完善它", description: "审阅并改进现有文档"}, {label: "退出", description: "保持原样"}]
  • 完善它 → 读取当前文档,然后跳至步骤4(以现有文档为上下文,仅询问关于空白或过时的部分)。
  • 退出 → 立即退出。
如果文件不存在,继续执行步骤2。

2. Research the codebase

2. 研究代码库

Use the Agent tool to extract QA facts directly from the codebase. Do not ask the user for things that can be read:
  • Test framework: test runner config (
    vitest.config.ts
    ,
    jest.config.js
    ,
    pytest.ini
    , etc.)
  • Test scripts:
    package.json
    scripts for
    test
    ,
    test:watch
    ,
    test:coverage
  • Coverage config: coverage thresholds in test config files
  • Test file conventions: where tests live, naming patterns (
    .test.ts
    ,
    .spec.ts
    ,
    _test.go
    , etc.)
  • Existing test types: are there unit, integration, and e2e tests? What tools?
  • CI config:
    .github/workflows/
    — what test gates run on PRs?
  • CLAUDE.md: extract any testing rules already defined there
  • Known flaky areas: any
    skip
    ,
    xit
    ,
    @pytest.mark.skip
    usage or TODO comments in tests
Also check
docs/steering/TECH.md
if it exists — extract testing-related constraints already documented there.
Synthesise findings. Produce a concrete draft of Test Strategy, Test Patterns, and Commands from research alone.
使用Agent工具直接从代码库中提取QA相关信息。对于可通过读取获取的信息,无需询问用户:
  • 测试框架:测试运行器配置文件(
    vitest.config.ts
    jest.config.js
    pytest.ini
    等)
  • 测试脚本
    package.json
    中用于
    test
    test:watch
    test:coverage
    的脚本
  • 覆盖配置:测试配置文件中的覆盖阈值
  • 测试文件约定:测试文件存放位置、命名模式(
    .test.ts
    .spec.ts
    _test.go
    等)
  • 现有测试类型:是否存在单元测试、集成测试和端到端测试?使用了哪些工具?
  • CI配置
    .github/workflows/
    ——PR上会运行哪些测试关卡?
  • CLAUDE.md:提取其中已定义的任何测试规则
  • 已知不稳定区域:测试中是否有
    skip
    xit
    @pytest.mark.skip
    的用法或TODO注释
同时检查
docs/steering/TECH.md
(如果存在)——提取其中已记录的与测试相关的约束条件。
综合整理研究结果。仅通过研究内容生成测试策略、测试模式和命令的具体草稿。

3. Interview the user for gaps only

3. 仅针对空白点询问用户

Only ask about what research could not determine. Work through questions one at a time using
AskUserQuestion
.
Topics that may need input:
  1. Coverage thresholds — "What is the minimum acceptable test coverage?"
    • Pre-fill with thresholds found in test config or CLAUDE.md.
  2. Definition of Done — "What must be true before any task can be merged?"
    • Pre-fill with DoD items from CLAUDE.md or existing task templates.
  3. Test environments — "What environments are available for testing? (local, staging, CI)"
    • Pre-fill with environments inferred from CI config or README.
  4. Known flaky areas — "Are there known areas that produce non-deterministic test failures?"
    • Pre-fill with skipped tests or TODO comments found in step 2.
  5. Mock strategy — "Are there any project-specific exceptions to the 'only mock at boundaries' rule?"
    • Pre-fill with mock patterns found in existing tests.
Skip any topic already answered by research.
仅询问研究无法确定的内容。使用
AskUserQuestion
逐个提出问题。
可能需要输入的主题:
  1. 覆盖阈值 — "可接受的最低测试覆盖率是多少?"
    • 预先填充从测试配置或CLAUDE.md中找到的阈值。
  2. 完成定义 — "任务在合并前必须满足哪些条件?"
    • 预先填充从CLAUDE.md或现有任务模板中找到的完成定义项。
  3. 测试环境 — "有哪些可用的测试环境?(本地、预发布、CI)"
    • 预先填充从CI配置或README中推断出的环境信息。
  4. 已知不稳定区域 — "是否存在已知会产生非确定性测试失败的区域?"
    • 预先填充步骤2中发现的跳过测试或TODO注释。
  5. 模拟策略 — "对于‘仅在边界处模拟’的规则,是否有任何项目特定的例外情况?"
    • 预先填充从现有测试中发现的模拟模式。
跳过任何已通过研究得到答案的主题。

4. Draft the document

4. 起草文档

Using
references/qa-template.md
as the shape reference, fill in all sections with gathered context. Replace every
[PLACEHOLDER]
with real content derived from the codebase.
Writing rules:
  • Coverage thresholds are stated as enforced minimums, not targets
  • Test commands must be exact and match what CI actually runs
  • Definition of Done items are written as checkboxes — concrete and binary
  • Known Flaky Areas is honest, not aspirational — flag real issues
references/qa-template.md
为结构参考,使用收集到的上下文填充所有章节。将每个
[PLACEHOLDER]
替换为从代码库中获取的真实内容。
写作规则:
  • 覆盖阈值需明确为强制执行的最小值,而非目标值
  • 测试命令必须准确,与CI实际运行的命令一致
  • 完成定义项需以复选框形式呈现——具体且可明确判断
  • 已知不稳定区域需如实记录,而非理想化描述——标记实际存在的问题

5. Review with user

5. 与用户审阅

Show the draft. Then call
AskUserQuestion
with
question: "Does this reflect the QA standards accurately?"
,
header: "Review"
, and
options: [{label: "Looks good — save it", description: "Write to docs/steering/QA.md"}, {label: "I have changes", description: "I want to adjust something first"}]
.
Apply edits, then proceed.
展示草稿。然后调用
AskUserQuestion
,参数为
question: "这份文档是否准确反映了QA标准?"
header: "审阅"
options: [{label: "看起来不错——保存它", description: "写入docs/steering/QA.md"}, {label: "我需要修改", description: "我想先调整一些内容"}]
应用修改后,继续执行下一步。

6. Write the document

6. 写入文档

bash
mkdir -p docs/steering
Write the final content to
docs/steering/QA.md
.
Commit the file:
bash
git add docs/steering/QA.md
git commit -m "docs: add QA standards steering document"
Print the file path.
bash
mkdir -p docs/steering
将最终内容写入
docs/steering/QA.md
提交文件:
bash
git add docs/steering/QA.md
git commit -m "docs: add QA standards steering document"
打印文件路径。

7. Offer wiki sync

7. 提供Wiki同步选项

Call
AskUserQuestion
with:
  • question
    : "Would you like to sync this to the GitHub wiki?"
  • header
    : "Wiki sync"
  • options
    :
    [{label: "Yes — push to wiki", description: "Publish QA.md as a wiki page"}, {label: "Not now", description: "Skip wiki sync"}]
If yes:
bash
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
git clone https://github.com/$REPO.wiki.git /tmp/wiki-sync
cp docs/steering/QA.md /tmp/wiki-sync/WTF-QA.md
cd /tmp/wiki-sync && git add WTF-QA.md && git commit -m "Sync: QA standards" && git push
rm -rf /tmp/wiki-sync
调用
AskUserQuestion
,参数如下:
  • question
    : "是否要将此文档同步到GitHub Wiki?"
  • header
    : "Wiki同步"
  • options
    :
    [{label: "是——推送到Wiki", description: "将QA.md发布为Wiki页面"}, {label: "暂时不用", description: "跳过Wiki同步"}]
如果选择
bash
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
git clone https://github.com/$REPO.wiki.git /tmp/wiki-sync
cp docs/steering/QA.md /tmp/wiki-sync/WTF-QA.md
cd /tmp/wiki-sync && git add WTF-QA.md && git commit -m "Sync: QA standards" && git push
rm -rf /tmp/wiki-sync

8. Offer to continue

8. 提供后续操作选项

Call
AskUserQuestion
with:
  • question
    : "What's next?"
  • header
    : "Next step"
  • options
    :
    [{label: "Create VISION.md", description: "Run 
    steer-vision
    to document the product vision"}, {label: "Create TECH.md", description: "Run
    steer-tech
    to document the technical guidelines"}, {label: "Create DESIGN.md", description: "Run
    steer-design
     to document the design guidelines"}, {label: "Stop here", description: "Exit — no further action"}]
Route to the appropriate skill based on the answer.
调用
AskUserQuestion
,参数如下:
  • question
    : "接下来要做什么?"
  • header
    : "下一步"
  • options
    :
    [{label: "创建VISION.md", description: "运行
    steer-vision
    记录产品愿景"}, {label: "创建TECH.md", description: "运行
    steer-tech
    记录技术指南"}, {label: "创建DESIGN.md", description: "运行
    steer-design
    记录设计指南"}, {label: "到此为止", description: "退出——无进一步操作"}]
根据用户的回答,调用相应的Skill。",