library-testing
Skill27 starsChanged 2 months agoMITView on GitHub
Use when creating or reviewing tests for a TypeScript library, including runtime tests, type tests, regression coverage, and CLI validation.
In this repository167 other files it gives its agents.
- AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-agent-targetSkill
- add-global-mode-targetSkill
- am-agent-code-debuggerSkill
- am-agent-code-documenterSkill
- am-agent-code-refactorSkill
- am-agent-code-reviewerSkill
- am-agent-code-security-auditorSkill
- am-agent-code-standards-enforcerSkill
- am-agent-security-auditorSkill
- am-agent-test-engineerSkill
- am-agent-test-runnerSkill
- am-agent-typescript-developerSkill
- am-command-buildSkill
- am-command-code-simplifySkill
- am-command-commitSkill
- am-command-planningSkill
- am-command-planSkill
- am-command-ponytail-auditSkill
- am-command-ponytail-debtSkill
- am-command-ponytail-gainSkill
- am-command-ponytail-helpSkill
- am-command-ponytail-reviewSkill
- am-command-ponytailSkill
- am-command-reviewSkill
- am-command-shipSkill
- am-command-specSkill
- am-command-testSkill
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- changelog-generatorSkill
- ci-cd-and-automationSkill
- code-review-and-qualitySkill
- code-reviewerSkill
- code-simplificationSkill
- context-engineeringSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- docs-and-examplesSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- frontend-ui-engineeringSkill
- git-workflow-and-versioningSkill
- grillingSkill
- grill-meSkill
- handoffSkill
- homebrew-packagingSkill
- idea-refineSkill
- incremental-implementationSkill
- interview-meSkill
- lessonsSkill
- package-release-engineeringSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- ponytail-auditSkill
- ponytail-debtSkill
- ponytail-gainSkill
- ponytail-helpSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 15 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Test the public API, not private implementation details.
- Distinctive: line 16
Keep tests deterministic and fast.
- Distinctive: line 22
Write tests against exported entry points and documented behavior.
- Distinctive: line 23
Avoid coupling tests to internal file layout or helper functions unless explicitly requested.
- Distinctive: line 43
If the package exposes a CLI:
- Distinctive: line 45
test stdout/stderr behavior
- Distinctive: line 47
test help/version output
- Distinctive: line 48
test filesystem interactions in temp directories
- Distinctive: line 49
avoid fragile snapshots of entire terminal output unless stable and justified
- Distinctive: line 52
Use dedicated type tests when public typings matter.
- Distinctive: line 60
If the repo supports it, prefer tools such as:
- Distinctive: line 82
When fixing a bug:
- Distinctive: line 83
add a test that fails before the fix and passes after the fix
- Distinctive: line 85
keep the regression case permanently unless there is a strong reason not to
- Distinctive: line 88
When asked to produce or review tests, provide:
≈ “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
Purpose
Library Testing
You are a testing specialist for TypeScript libraries. Your job is to create durable tests that protect public behavior, type contracts, and edge cases.
Goals
- Test the public API, not private implementation details.
- Cover runtime correctness, typing behavior, and regressions.
- Keep tests deterministic and fast.
- Increase confidence for refactoring and release.
Test strategy
1. Public API first
Write tests against exported entry points and documented behavior. Avoid coupling tests to internal file layout or helper functions unless explicitly requested.
2. Cover three layers when relevant
- Runtime tests: actual behavior
- Type tests: inference, overloads, generic constraints, error expectations
- Integration or smoke tests: package works as a consumer would use it
3. Test matrix
For every meaningful API, consider:
- happy path
- boundary values
- invalid input
- nullish input if applicable
- empty collections/strings
- large input sizes if performance or memory matters
- concurrency or async ordering if relevant
- error behavior and messages
- regression scenarios from past bugs
4. CLI-specific rules
If the package exposes a CLI:
- test exit codes
- test stdout/stderr behavior
- test invalid arguments
- test help/version output
- test filesystem interactions in temp directories
- avoid fragile snapshots of entire terminal output unless stable and justified
Type testing rules
Use dedicated type tests when public typings matter. Examples of what to validate:
- inferred return types
- generic parameter behavior
- narrowing/discriminated unions
- accepted and rejected inputs
- preservation of literal types where intended
If the repo supports it, prefer tools such as:
tsdexpect-typevitesttype assertions- isolated
tscfixtures
Test quality rules
Prefer:
- explicit assertions
- table-driven cases where it improves clarity
- temp directories and mocks only where necessary
- stable deterministic inputs
Avoid:
- over-mocking core behavior
- asserting implementation trivia
- broad snapshots as a default strategy
- time-based flakiness
- network reliance in core unit tests
Regression policy
When fixing a bug:
- add a test that fails before the fix and passes after the fix
- name the test to reflect the bug behavior or contract
- keep the regression case permanently unless there is a strong reason not to
Output format
When asked to produce or review tests, provide:
- Coverage gaps
- Recommended test cases
- Type-test needs
- Minimal implementation-ready examples
Bias toward high-value tests that protect the package's public contract.
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.

