Factory Tests 标志

Factory Tests

社区
MikeFishbeinAtherial
factory-tests

软件工厂第 3 阶段,也可作为独立技能使用——将任务、功能或整个组件转化为验收标准和测试,用以证明工作确实正确,让编码循环可以自行检查,而不是要求您盲目信任它。采用“行为 + 证据”公式,涵盖四个测试层级,并强制包含错误路径。可用于工厂 PLAN.md、单项任务或任何功能描述。触发词——“定义测试”“验收标准”“我怎么知道它能正常工作”“工厂测试”。

Add to TypingMind

概览

发布者MikeFishbeinAtherial
代码仓库infinite-headcount
技能名称factory-tests
星标数
50
复刻数
5
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 MikeFishbeinAtherial 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Factory Tests AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/MikeFishbeinAtherial/infinite-headcount/tree/main/factory-tests
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MikeFishbeinAtherial/infinite-headcount.git /tmp/infinite-headcount
mkdir -p .claude/skills
cp -r /tmp/infinite-headcount/factory-tests .claude/skills/factory-tests
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Factory Tests,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Factory Tests。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Factory Tests 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Factory Tests

The factory's one rule: if you can't check it by running something, it isn't done — it's a hope. This skill turns "build X" into "build X, and here is the command and the observable result that proves X works," so an unattended coding loop can grade itself honestly all night.

Three ways in:

  • Factory mode (default via /factory): read factory/PLAN.md, fill every task's acceptance criteria: _pending factory-tests_ hole, add a component-level contract at the top.
  • Single task/feature: user describes one thing ("the login form", "task B3") → produce criteria + tests for just that.
  • Whole component/app: produce the component-level contract — the 15-30 assertions that define done for the entire build.

The formula: behavior + evidence

Every acceptance criterion is one sentence with three parts — the setup, the action, the observable result:

Given <input/state>, when , then .

  • Bad: "Handles Instagram URLs." "Login works." "Handles errors gracefully."
  • Good: "Given a public Instagram reel URL, when the CLI runs, then it exits successfully and the report folder contains report.md and a video file."
  • Good: "Given a wrong password, when the user submits the login form, then they see 'wrong email or password' and are NOT taken to the dashboard."

If a criterion doesn't name the action and the observable, a verifier will rubber-stamp it. Rewrite until it does.

For non-technical users: criteria are written in plain language first — you should be able to read every criterion and picture yourself checking it by hand. The test code that automates the check is the loop's job, not yours.

The four test tiers (organize by cost + trustworthiness)

Tag every criterion with a tier. The tier decides when it runs during the overnight loop — this line goes verbatim into the handoff:

TierWhatWhen the loop runs itExample
1 — Offline (free, always trustworthy)Pure logic: parsers, calculators, formatters, validation. Golden tests (known input → exact expected output, saved to a file). All error paths.Every pass."Given the URL youtu.be/abc, the router returns source=youtube, id=abc."
2 — Live, gated (costs pennies or minutes)Your code against real external services, switched on by an env var (e.g. RUN_LIVE=1). Fixtures you control — your own uploads, your own test account. Never random public URLs.End of each stage + once before final sign-off."Given the 5-second fixture video, when transcription runs live, then the output is schema-valid with timestamps inside the video's duration."
3 — End-to-end smoke (cheap, catches wiring)One run of the real thing: CLI on a fixture file, one API round-trip, one page load + action in a real browser.Every pass if offline; stage ends if it needs live services."When the CLI runs on fixture.mp4, then the report folder appears with all expected files."
4 — Canary (tests the world, not your code)Is the external dependency itself still alive and unchanged?Never blocks the loop. Failure = log it, flag it, move on. An agent "fixing" your working code at 2am because some platform changed something will wreck the codebase."yt-dlp can still download from YouTube today."

Error paths are not optional

An unattended loop lives in the error paths — wrong input, dead URL, empty file, timeout, someone clicking the wrong button. For every task, write at least one criterion for the most likely failure, with the exact expected behavior ("shows message X", "exits with code 2", "creates nothing"). A contract that only describes the happy path will pass review and then die on first contact with a real user — you.

Testing AI/LLM output (when the build calls a model)

Exact-match tests don't work on model output. Assert properties instead: the output matches the expected schema, values are in legal ranges (timestamps inside the video, prices non-negative), required parts are non-empty. For quality ("is this summary good?"), write a short rubric — 2-4 axes, a named good example, a 0-1 threshold — and have a fresh agent grade against it. Properties gate correctness; the rubric gates taste.

Component-level contract

Above the per-task criteria sits the whole-build contract: 15-30 assertions that define done for everything (fewer gets rubber-stamped). Sources: the brief's "Done looks like" section, every task's criteria rolled up, the error paths, and 2-3 assertions nothing else covers (performance floor, data never lost on refresh, works in the browser the user actually uses).

Output

Factory mode edits factory/PLAN.md in place:

markdown
### A1. <task title>
- ...
- acceptance criteria:
  - [tier 1] Given ..., when ..., then ...
  - [tier 1, error] Given ..., when ..., then ...
  - [tier 3] Given ..., when ..., then ...
- test notes: <where tests live, fixtures needed, gate var if tier 2>

...and adds ## Contract (the component-level assertions) at the top of PLAN.md. Standalone mode outputs the same shapes to chat or the file the user names.

Two standing rules to embed wherever the criteria go:

  1. Every bug found later gets a criterion here first, then the fix. The contract grows to match reality.
  2. The builder never grades its own work — criteria are checked by running them, and final judgment belongs to a fresh reviewer (factory-review) that never saw the code being written.

Close out (factory mode)

Update factory/STATE.md → stage 4, next action "walkthrough + handoff with factory-handoff". If factory/STATE.md doesn't exist (standalone use), create it first with a minimal version of the schema described in factory/SKILL.md. Offer factory-explain — with plan and proof now written, this is the ideal moment for the user to see the whole build as a picture before it costs a night of compute.

常见问题

Factory Tests AI 技能有什么作用?

软件工厂第 3 阶段,也可作为独立技能使用——将任务、功能或整个组件转化为验收标准和测试,用以证明工作确实正确,让编码循环可以自行检查,而不是要求您盲目信任它。采用“行为 + 证据”公式,涵盖四个测试层级,并强制包含错误路径。可用于工厂 PLAN.md、单项任务或任何功能描述。触发词——“定义测试”“验收标准”“我怎么知道它能正常工作”“工厂测试”。

为什么在 TypingMind 中使用 Factory Tests?

因为您只需安装一次,就能搭配任何模型使用。Factory Tests 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Factory Tests?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/MikeFishbeinAtherial/infinite-headcount/tree/main/factory-tests。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Factory Tests?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Factory Tests 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Factory Tests 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Factory Tests AI 技能免费吗?

是的。MikeFishbeinAtherial 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇