tidy-tests
Skill1.2k starsChanged 19 days agoMITView on GitHub
Restructure the tests of one LeafWiki package, file or feature for readability — split oversized test files by capability, turn copy-pasted cases into table-driven (matrix) tests, introduce a default fixture with overrides — without changing what is tested. Produces proof that no case and no coverage was lost. Use for dedicated test-cleanup PRs (e.g. "split router_test.go", "tidy the pages tests"); pass the package or file as argument.
1 other project uses a version of this.
Trending
Less talk lately.thin dataabout the whole repository
Most recently taken up by
- choegyumin/agent-skillstheir own version, first seen Oct 26, 2026
Who's talking about perber/leafwiki
- @chrisshort.net“perber/leafwiki: LeafWiki - Self-hosted wiki. Single Go binary, SQLite, Markdown on disk. No external …”Bluesky · Jul 11, 2026 · 2 likes
- YunoHost-Apps/leafwiki_ynh“Upgrade to v0.14.2”GitHub · Oct 22, 2026
- YunoHost-Apps/leafwiki_ynh“Upgrade to v0.14.1”GitHub · Oct 9, 2026
- shukiv/jabali-panel“More docker apps suggest”GitHub · Jun 14, 2026
- kuaizhongqiang/AgentRouter“[P2] 集成 LeafWiki 作为内置 Wiki:静默子进程 + MCP 工具,不 Fork 源码”GitHub · Jun 4, 2026
The biggest 5 of 5 mentions linking to the repository that our crawl found. Each line is their own headline.
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- choegyumin/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- developSkill
- docs-reviewSkill
- runSkill
- worktree-cleanupSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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
- Distinctive: line 36
Don't table cases with different setup or different assertions.
- Distinctive: line 53
Coverage: after ≥ before (per package).
- Very specific: line 58
No assertion weakened (e.g.
- Very specific: line 63
Run the reviewer agent on the diff with the before/after case lists and coverage numbers.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Tidy tests
A behaviour-preserving refactoring of test code only. The rules are in
docs/development/conventions.md ("Tests"). Production code is not touched — if a test can
only be simplified by changing production code, note it and stop there.
1. Baseline (before any edit)
Record, for the target package(s):
go test ./<pkg>/... -count=1 -v 2>&1 | grep -E '^(=== RUN|--- (PASS|FAIL|SKIP))' > before-cases.txt
go test ./<pkg>/... -count=1 -coverprofile=before.cov && go tool cover -func=before.cov | tail -1Frontend: npx vitest run <path> --reporter=verbose > before-cases.txt and
npm run test:coverage -- <path>. Keep these files outside the repo (scratch directory).
2. Plan the restructuring
List what you will change and why, grouped:
- Split a file over ~800 lines by capability (e.g.
router_test.go→router_pages_test.go,router_auth_test.go, …, shared setup inrouter_fixture_test.go). - Tables: groups of tests with the same setup and assertion that differ only in input and expected output. Name every row.
- Fixture: one default fixture per package with explicit overrides;
t.Cleanupfor every opened store; build only what each test needs. - Names to
Test<Type>_<Scenario>_<Expectation>; dead helpers removed.
Don't table cases with different setup or different assertions. No generic assertion DSL. Show the plan to the person if it touches more than one package.
3. Restructure in small steps
One kind of change per step, each meant to become its own commit (test: split router tests by slice, test: table-drive slug
validation, …), the suite green after each. Commit each step locally (Conventional Commits, suite green before each);
don't push. The PR is capped at ~1,000 changed lines; a big
file is split over several PRs.
4. Prove nothing was lost
go test ./<pkg>/... -count=1 -v 2>&1 | grep -E '^(=== RUN|--- (PASS|FAIL|SKIP))' > after-cases.txt
go test ./<pkg>/... -count=1 -coverprofile=after.cov && go tool cover -func=after.cov | tail -1- Coverage after ≥ before (per package).
- Cases: map every test from
before-cases.txtto a test or table row in the new code. Old test functions that became rows have a different name; the mapping goes into the PR description as a table (old name → new location). A case without a mapping is a lost case: restore it. - No assertion weakened (e.g. exact comparison replaced by "not empty"), no
t.Skipadded. - Lint and format:
golangci-lint run ./<pkg>/...; frontendnpm run lint,npm run format.
5. Review
Run the reviewer agent on the diff with the before/after case lists and coverage numbers.
A lost case or lower coverage is blocking. Don't push or open a PR without the person's OK.
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.

