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 skills add gg-mo/repo-hygiene --skill testing-new-codegit clone --depth 1 https://github.com/gg-mo/repo-hygieneWrote 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/gg-mo/repo-hygiene/testing-new-code)<a href="https://agentmods.dev/skills/gg-mo/repo-hygiene/testing-new-code"><img src="https://agentmods.dev/badge/skills/gg-mo/repo-hygiene/testing-new-code/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/gg-mo/repo-hygiene/testing-new-code"><img src="https://agentmods.dev/badge/skills/gg-mo/repo-hygiene/testing-new-code.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00056 | $0.01029 |
| Opus 5.5 | $0.00022 | $0.00412 |
| Sonnet 5.5 | $0.00011 | $0.00206 |
| Haiku 4.5 | $0.00006 | $0.00103 |
Grade A, and why
testing-new-code 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 3mo 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 — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Testing New Code
Overview
In a repo using repo-hygiene, new code paths get tests before they're committed. The default is YES; "tests-after-if-asked" is the wrong default. Manual sanity checks are not tests — they leave no regression net for the next change.
Core principle: Untested code is one unrelated refactor away from broken.
REQUIRED BACKGROUND: If superpowers:test-driven-development is already active in this session, follow its RED-GREEN-REFACTOR cycle and consider this skill satisfied. Use this skill only when TDD is not driving the workflow.
When To Use
- Wrote a new function with any branching or business logic
- Fixed a bug (regression test required — see below)
- Changed behavior of an existing function
- Added a public API entry point (CLI, HTTP, GraphQL, exported function)
When NOT to Use (Genuine Triviality Only)
- Pure renames, formatting, or type-annotation-only changes
- Modifying a pass-through wrapper already tested at a higher layer
- Adding a constant
- Documentation-only changes
- Test code itself
Not a valid exception: "It's only 3 lines." Three lines of business logic still need a test.
Bug Fixes Require Regression Tests
A bug fix without a regression test is incomplete. Verify the red-green cycle:
- Write the test against the pre-fix code → should FAIL
- Apply the fix → test should PASS
- Revert the fix once → test should fail again (proves it covers the bug)
- Re-apply the fix → test passes (final state)
If the test passes with the fix reverted, it isn't covering the bug.
Where Do Tests Live?
Mirror the repo's existing convention. If the repo has no tests yet, default to:
| Language | Default |
|---|---|
| JavaScript / TypeScript | *.test.ts or *.spec.ts next to source, or __tests__/ sibling |
| Python | tests/test_<module>.py at repo root |
| Go | *_test.go next to source |
| Rust | #[cfg(test)] mod tests { ... } in same file; tests/ for integration |
| Java / Kotlin | src/test/... mirroring source |
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.
- 3mo ago First seen · 107 lines · 56 tokens per session scan A 6fc211a17598
testing-new-code is a skill published in the GitHub repository gg-mo/repo-hygiene (3 stars, last pushed 6mo ago), licensed MIT. It adds 56 tokens to every session and 1,029 once invoked, about $0.0002 per session on Opus 5.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.
testing-new-code compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| testing-new-codegg-mo/repo-hygiene | Skill | 3 | 6mo ago | MIT | A | 56 | Claude Code |
| testing-principlesshinpr/claude-code-workflows | Skill | 725 | yesterday | MIT | A | 49 | Claude Code |
| plangreglas75/zuvo | Skill | 7 | today | MIT | A | 53 | Claude Code |
| engineering-craftmickeyyaya/evolve-loop | Skill | 8 | today | Apache-2.0 | A | 40 | Claude Code |
| tddmickeyyaya/evolve-loop | Skill | 8 | today | Apache-2.0 | A | 47 | Claude Code |
| unbiased-reviewkarsten-s-nielsen/mad-scientist-skills | Skill | 3 | 1mo ago | MIT | A | 84 | Claude Code |
| testing-guideakaszubski/autonomous-dev | Skill | 35 | 10d ago | none | A | 74 | Claude Code |