tdd-workflow — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited tdd-workflow (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 it. Refactor.
Hard gate: Never write implementation code before a failing test exists. No exceptions.
test: add failing test for <feature># Python example
def test_calculate_spread():
result = calculate_spread(home_score=105, away_score=98)
assert result == 7 # RED: function doesn't exist yet// JavaScript/TypeScript example
test('calculateSpread returns point difference', () => {
expect(calculateSpread(105, 98)).toBe(7); // RED: not implemented
});feat: implement <feature>If GREEN fails: your implementation is incomplete. Debug before moving to REFACTOR. Never skip RED → always verify test fails before implementation. Never modify tests to make them pass — fix the implementation.
def calculate_spread(home_score: int, away_score: int) -> int:
return home_score - away_score # Minimal. Done.refactor: clean up <feature>After REFACTOR, if you discovered anything non-obvious during the cycle:
Write it to your project notes using your persistent insight format. Before writing, scan existing notes for the same tag — MERGE or UPDATE if an entry already exists, do not add a duplicate. Duplicate domain insights dilute the core insights and cause confusion.
Skip if nothing surprising happened. Don't force it.
# Install
pip install pytest
uv pip install pytest # if using uv
# Run tests
pytest # all tests
pytest tests/test_module.py # specific file
pytest -k "test_name" # specific test
pytest --tb=short # short traceback# Run tests
npm test # Jest
npx vitest # Vitest
npm test -- --watch # watch mode
npm test -- --coverage # coverage reportBefore marking any feature complete:
# Python
pytest --cov=. --cov-report=term-missing
# JavaScript (Jest)
npm test -- --coverageIf you're writing tests for existing code (characterization tests):
test: add characterization tests for <module>Legacy Code Exception: If modifying code that has no existing tests and is too complex to test from scratch:
| Situation | What to do |
|---|---|
| Tempted to write code first | Stop. Write the test first. |
| Test passes immediately | The test is wrong — check your assertion or the code already exists |
| Can't figure out what to test | Write the function signature in a comment, then write what the caller expects |
| Test is too hard to write | The function is too large — break it into smaller pieces |
| "Just a simple function" | Still write the test first. Simple tests take 60 seconds. |
| Feature has multiple behaviors | One test per behavior. Don't test everything in one test. |
test_returns_none_when_input_empty not test_functionresult is not None passes even when the result is garbage. Write assertions that would fail if the implementation returned a plausible-but-wrong value (e.g., assert exact value, not just truthiness).scope="function" in pytest), avoid time.sleep() in assertions, and never depend on test ordering.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.