testing — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited testing (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Write the test first. Watch it fail. Write minimal code to pass.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRSTIf you didn't watch the test fail, you don't know if it tests the right thing.
Write code before the test? Delete it. Start over.
Always:
Exceptions (ask first):
Thinking "skip TDD just this once"? Stop. That's rationalization.
Write one minimal test showing what should happen.
// Good: Clear name, tests real behavior, one thing
test('rejects empty email', async () => {
const result = await submitForm({ email: '' });
expect(result.error).toBe('Email required');
});// Bad: Vague name, tests mock not code
test('form works', async () => {
const mock = jest.fn().mockResolvedValue('success');
await submitForm(mock);
expect(mock).toHaveBeenCalled();
});Requirements:
MANDATORY. Never skip.
npm test path/to/test.test.tsConfirm:
Test passes? You're testing existing behavior. Fix the test.
Write the simplest code to pass the test.
// Good: Just enough to pass
function validateEmail(email: string): string | null {
if (!email?.trim()) return 'Email required';
return null;
}// Bad: Over-engineered
function validateEmail(
email: string,
options?: {
allowEmpty?: boolean;
customRegex?: RegExp;
onValidate?: (email: string) => void;
}
): ValidationResult {
// YAGNI - don't add features not tested
}Don't add features, refactor other code, or "improve" beyond the test.
MANDATORY.
npm test path/to/test.test.tsConfirm:
Test fails? Fix code, not test.
After green only:
Keep tests green. Don't add behavior.
Next failing test for next feature.
All of these mean: Delete code. Start over with TDD.
| Excuse | Reality |
|---|---|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
| "Need to explore first" | Fine. Throw away exploration, start with TDD. |
| "Test hard = skip it" | Hard to test = hard to use. Simplify design. |
| "TDD will slow me down" | TDD faster than debugging. |
| "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is debt. |
"I'll write tests after to verify it works"
Tests written after code pass immediately. Passing immediately proves nothing:
Test-first forces you to see the test fail, proving it actually tests something.
| Type | Purpose | Dependencies |
|---|---|---|
| Unit | Single function/method | Mock externals |
| Integration | Multiple components | Real dependencies |
| E2E | Full user workflow | Full system |
Always test:
Skip testing:
Before marking complete:
Can't check all boxes? You skipped TDD. Start over.
Bug: Empty email accepted
RED
test('rejects empty email', async () => {
const result = await submitForm({ email: '' });
expect(result.error).toBe('Email required');
});Verify RED
$ npm test
FAIL: expected 'Email required', got undefinedGREEN
function submitForm(data: FormData) {
if (!data.email?.trim()) {
return { error: 'Email required' };
}
// ...
}Verify GREEN
$ npm test
PASSREFACTOR - Extract validation if needed.
| Problem | Solution |
|---|---|
| Don't know how to test | Write desired API first. Write assertion first. |
| Test too complicated | Design too complicated. Simplify interface. |
| Must mock everything | Code too coupled. Use dependency injection. |
| Test setup huge | Extract helpers. Still complex? Simplify design. |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.