Factory Tests logo

Factory Tests

Community
MikeFishbeinAtherial
factory-tests

Stage 3 of the Software Factory, and a standalone skill - turn tasks, features, or a whole component into acceptance criteria and tests that PROVE the work is correct, so a coding loop can check itself instead of asking you to trust it. Behavior + evidence formula, four test tiers, mandatory error paths. Works on a factory PLAN.md, a single task, or any feature description. Triggers - "define tests", "acceptance criteria", "how do I know it works", "factory tests".

Overview

PublisherMikeFishbeinAtherial
Repositoryinfinite-headcount
Skill namefactory-tests
Stars
50
Forks
5
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by MikeFishbeinAtherial on GitHub. Read the source before you install it.

Installation

Install the Factory Tests AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/MikeFishbeinAtherial/infinite-headcount/tree/main/factory-tests
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Factory Tests in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Factory Tests on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Factory Tests is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Frequently asked questions

What does the Factory Tests AI skill do?

Stage 3 of the Software Factory, and a standalone skill - turn tasks, features, or a whole component into acceptance criteria and tests that PROVE the work is correct, so a coding loop can check itself instead of asking you to trust it. Behavior + evidence formula, four test tiers, mandatory error paths. Works on a factory PLAN.md, a single task, or any feature description. Triggers - "define tests", "acceptance criteria", "how do I know it works", "factory tests".

Why use Factory Tests on TypingMind?

Because you install it once and use it with any model. Factory Tests is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Factory Tests in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/MikeFishbeinAtherial/infinite-headcount/tree/main/factory-tests. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Factory Tests?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Factory Tests?

As many as you like. As long as a model supports skills, you can use Factory Tests with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Factory Tests AI skill free?

Yes. It is published on GitHub by MikeFishbeinAtherial under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇