silo-testing

A testing guide for the Silo repository. It explains how to write unit tests with Vitest, a JavaScript testing tool, and how to test program logic without rendering React components.

In plain words
What is it for?
It is for placing tests next to source files, extracting component logic into testable helpers, driving host state through the Valtio store, and checking contracts and edge cases.
Why use it?
It gives contributors a consistent way to test behavior and sets expectations for coverage before a change is considered finished.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/silo-code/silo/silo-testing
Any agent
npx skills add silo-code/silo --skill silo-testing
Clone the repo
git clone --depth 1 https://github.com/silo-code/silo

Made for: Claude Code, Codex.

Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 486 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00065 $0.00486
Opus 5 $0.00032 $0.00243
Sonnet 5 $0.00013 $0.00097
Haiku 4.5 $0.00006 $0.00049

Measured yesterday against content hash b2ade918a5f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

silo-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/silo-testing/SKILL.md · 32 lines

What it actually says

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.tsx next to the source it covers; the package vitest.config.ts picks up src/**/*.{test,spec}.{ts,tsx}. Run everything with pnpm test, or one package with pnpm --filter <pkg> exec vitest run <path>.
  • Pure-logic style. The suite tests logic, not rendered React (@testing-library/react is 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), and markdown-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 in beforeEach, exercise the service, assert on the store — see editor-service.test.ts and editor-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-viewType fallback, read-only Cut/Paste, and the single-view/diff/untitled hidden cases).
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 32 lines · 65 tokens per session scan A b2ade918a5f2

Subscribe to this mod's changes

silo-testing is a skill published in the GitHub repository silo-code/silo (53 stars, last pushed yesterday), licensed MIT. It adds 65 tokens to every session and 486 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.