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.
npx agentmods add skills/atuljha23/holocron/test-patternsnpx skills add atuljha23/holocron --skill test-patternsgit clone --depth 1 https://github.com/atuljha23/holocronWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/atuljha23/holocron/test-patterns)<a href="https://agentmods.dev/skills/atuljha23/holocron/test-patterns"><img src="https://agentmods.dev/badge/skills/atuljha23/holocron/test-patterns.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00041 | $0.00680 |
| Opus 5 | $0.00020 | $0.00340 |
| Sonnet 5 | $0.00008 | $0.00136 |
| Haiku 4.5 | $0.00004 | $0.00068 |
Grade A, and why
test-patterns 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 3d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test patterns
A test's job is to fail when the behavior is wrong. Most mediocre tests pass whether the code is right or not.
Rules of thumb
Assert behavior, not implementation
Bad:
expect(spy).toHaveBeenCalled()
Good:
expect(response.body.status).toBe('completed')
expect(db.getUser(id).lastSeenAt).toBe(mockNow)
Spy-assertions fail on refactor and protect nothing. Behavior-assertions fail when the user-visible contract breaks.
One logical check per test
Many expect lines can add up to one assertion of one outcome — that's fine. What's not fine: one test that covers three unrelated behaviors so nobody can tell what broke when it fails.
Arrange-Act-Assert
it('rejects stale tokens', () => {
// Arrange
const token = signToken({ exp: yesterday() })
// Act
const result = verify(token)
// Assert
expect(result.ok).toBe(false)
expect(result.reason).toBe('expired')
})
Table-driven when the shape repeats
test.each([
['empty', '', 'required'],
['too short', 'ab', 'min_length'],
['has space', 'a b', 'invalid_char'],
['ok', 'alice', null],
])('validateUsername(%s=%j)', (_, input, expected) => {
expect(validateUsername(input).error).toBe(expected)
})
Fixtures > inline setup
If three tests set up the same validUser, extract it. If the setup is 20 lines, it's probably doing too much — mock less, use a real test DB.
Name tests as specs
The test name is a sentence the reader can understand without opening the code. it('rejects stale tokens') > it('test2').
Integration > unit for risk hotspots
Unit tests are great for pure logic. For "this endpoint returns the right data for this user" you want an integration test that hits a real database, a real router, and a real serializer. Mocks hide the bugs you actually ship.
Framework-specific pointers
Testing Library (React/Vue/Svelte)
- Query by role/label first,
getByTestIdlast. userEventoverfireEvent.- Avoid testing props/state; test what the user sees.
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.
- 3d ago First seen · 88 lines · 41 tokens per session scan A b05573f6d092
test-patterns is a skill published in the GitHub repository atuljha23/holocron (2 stars, last pushed 4mo ago), licensed MIT. It adds 41 tokens to every session and 680 once invoked, about $0.0002 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-31.
Other skills, from other repositories
batch-orchestration
Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees. Use for migrations, refactors, codemods, and any change touching 10+ files with the same pattern.
design-engineering
Apply interface craft when building or reviewing UI - motion, easing, timing, springs, component feel, and visual foundations. Use when building a component, animation, transition, hover or press state, modal, drawer, toast, or when polishing an interface so it feels right. Says "make this feel better", "add an…
context-optimizer
Optimize token usage and context management. Use when sessions feel slow, context is degraded, or you're running out of budget.
deslop
Remove AI-generated code slop, unnecessary comments, and over-engineering from the current branch diff. Cleans up boilerplate, simplifies abstractions, strips defensive code, and in skill-file mode lints SKILL.md files for quality. Use when cleaning up code, simplifying, removing boilerplate, before committing, or…
bug-capture
Capture a user-reported defect as a durable GitHub issue written in the project's own domain language. Explores the codebase in parallel for context but never leaks file paths or line numbers into the issue. Use when the user reports a bug conversationally, runs a QA pass, or says "file an issue", "log this as a bug"…
compact-guard
Smart context compaction with state preservation. Saves critical files, task progress, and working state before compaction, restores after. Use before manual compact or when auto-compact triggers.