silo-testing
Skill59 starsChanged 3 months agoMITView on GitHub
Use when writing or updating unit tests in the Silo repo. Covers the co-located Vitest setup, the pure-logic (no @testing-library/react) style and how to extract testable helpers, driving host state directly via the valtio store, and the contract-and-edges coverage expectations.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs-screenshotSkill
- silo-architecture-review-orchestratorSkill
- silo-architecture-reviewSkill
- silo-docs-syncSkill
- silo-domain-modelingSkill
- silo-release-publishSkill
- verifier-guiSkill
- graftSkill
- silo-extension-builderSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Vitest, co-located: Put *.test.ts / *.test.tsx next to the source it covers.
- Very specific: line 16
Run everything with pnpm test, or one package with pnpm --filter <pkg> exec vitest run <path>.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing in Silo
Every change that adds or changes behavior ships with unit tests in the same
change. Tests are part of the work, not a follow-up. Don't mark a task done
until pnpm test is green with coverage for what you added.
How testing works here:
- Vitest, co-located. Put
*.test.ts/*.test.tsxnext to the source it covers; the packagevitest.config.tspicks upsrc/**/*.{test,spec}.{ts,tsx}. Run everything withpnpm test, or one package withpnpm --filter <pkg> exec vitest run <path>. - Pure-logic style. The suite tests logic, not rendered React
(
@testing-library/reactis intentionally not a dependency). When the logic you're adding lives inside a component, extract it into a pure, exported helper and test that — e.g.view-switcher-model.ts(switcher show/segmented/ dropdown rules),markdown-preview/menu.ts(context-menu enablement), andmarkdown-preview/match.ts(file matching) were factored out of their components precisely so the rules are unit-testable. Components stay thin glue. - Host state can be driven directly: set up
store(the valtio proxy) and the relevant registries inbeforeEach, exercise the service, assert on the store — seeeditor-service.test.tsandeditor-registry.test.ts. - Cover the contract and the edges, not just the happy path: fallbacks,
no-ops/guards, disabled states, and "hidden/absent" cases (the editor
view-switching tests pin the priority tie-break, stale-
viewTypefallback, read-only Cut/Paste, and the single-view/diff/untitled hidden cases).
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.

