--- name: immune-system description: Build and run an immune system that proves a product works through its real front doors (CLI, terminal UI, desktop app, web, API) on every platform it ships to, finds what is missing as well as what is broken, and turns every confirmed bug into a permanent check. At scale it runs a bug machine, hundreds of agents that hunt, reproduce, review, fix and guard bugs through a state machine of plain files. Use when a project needs testing beyond unit tests, before a release, after a burst of agent-written code, when a bug keeps coming back, or when the user asks for specialized immune cells or a bug hunt. --- # Immune system A test system modelled on an immune system: patrols that recognise known bugs, scouts that find what is missing, a check that kills false alarms, and a memory that makes every confirmed bug impossible to miss again. The names are the metaphor; each agent below also says its job in plain words. Unit tests prove that functions behave. They do not prove that the product **works**: that the thing a user installs starts on their machine, draws its screen, edits their file without breaking it, survives a flaky network, and comes back tomorrow with their data intact. This skill builds the system that proves that, and the roster of immune cells that runs it. Its job is to find defects, not to report green. An immune system is **grown for one project**, the way a project's `EMPRYO.md` is: an agent studies the product and builds the checks, the runner and the cells that fit it. Nothing here is copied in as is. The cells SoulStack installs are **stem cells**: general versions that know the method and turn into this project's cells the first time they run here. ## Growing it for a project 1. **Dive deep into the product first.** Read the code map, the docs, the git history, the issues and memory; run the product yourself through every front door. Write down: - its **front doors**: CLI, headless/JSON mode, terminal UI, desktop app, web app, API, installer; - the **platforms** it ships to, and which of them you can reach from here (this machine, containers, a VM, a remote machine over SSH); - the **one thing worth faking**: usually the paid or non-deterministic dependency (an AI model, a payment provider, a third-party API). Fake that at the network boundary and nothing else; - the **load-bearing capabilities**: the 10 to 20 things whose loss is an outage, each with one sentence saying what breaks for the user. 2. **Research the arsenal, as of today.** For this product's stack and platforms, look up the current (this month's) tools for driving and seeing it: browser and Electron drivers, pty and terminal emulators, API recorders, network fakes, profilers, log and crash collectors, accessibility and visual checkers, container and VM runners. Search with the month and year in the query, read changelogs, and prefer the newest stable tool. Include security: dependency and malicious-package scanners, secret scanners, signature and provenance checks, for the `natural-killer` cell. Pick what gives each T cell eyes and hands on the real product, write the choices and why in `immune/README.md` (Arsenal), and install them. 3. **Scaffold `immune/`** following [reference/design.md](reference/design.md): a runner, one driver per front door, one target per platform, checks grouped by family, goldens, a speed ledger kept outside the repo, findings, and exploration notes. 4. **Write the first checks** with [reference/checks.md](reference/checks.md): one smoke check per front door per platform (it starts, it answers, it exits the way it should), then one check per load-bearing capability. 5. **Wire one entry point.** `immune` is the front door of the immune system: every run goes through it (`immune` full, `immune:smoke` seconds, `immune:list`, `immune:guard` the coverage ratchet, `immune:report` the dashboard). Name them the way the `project` tool looks for scripts in Empryo. 6. **Build the immune app.** The immune system has a face: a small local web app in `immune/app/` that shows the developer everything and lets them run it. Start from this skill's `app/` (a dependency-free Node server plus `index.html`, `app.css`, `app.js`, `theme.css`) and make it the project's own: - **Design it with the project's design system.** Replace `theme.css` with the project's tokens, fonts and themes (if it has none, build one first with the `ensoul` skill). It must look like the product it guards, in every theme and mode, and be checked with screenshots like any UI. - **Views**: Health (verdict, counts, the family × platform × front door grid, red, coverage holes, a strip of recent runs), Runs (every kept run, expandable), Cells (grown or stem, what each does), Findings, Explorations, and Machine when the project runs the bug machine (board, records, one record's life, triage with keys, cycles). Add views the project needs (speed trends, screenshots, security). - **Run from the app**: buttons for the commands in `immune/app/immune.config.json`, with the log streamed live; the page refreshes itself when results change. - **Data**: every run writes `immune/results/