skills/test-doc-sync/SKILL.md
Test documentation synchronization workflow. Use before committing behavior changes to ensure test comments/docstrings stay current. Triggers on: pre-commit, behavior changes, renamed functions, test documentation.
npx skillsauth add mdmagnuson-creator/yo-go test-doc-syncInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Load this skill when: committing behavior changes to ensure test comments and docstrings stay current.
⛔ CRITICAL: Run test doc sync before EVERY commit that includes behavior changes.
Trigger: After implementation complete, before
git add/git commit.Failure behavior: If stale test references remain after the sync process, do NOT commit. Fix the references first.
When code changes (renamed functions, changed behavior, updated strings), test comments and docstrings often become stale. This leaves misleading documentation that confuses future developers. Test doc sync catches and fixes these before they're committed.
Run git diff --cached (or git diff if not yet staged) and extract:
| Source | Keywords |
|--------|----------|
| Removed/renamed function names | showQRCode, handlePayment |
| Removed/renamed variable names | isLoading, userData |
| Changed string literals | "Submit", "Processing..." |
| Removed/modified comments | // handles QR display |
| Removed class/type names | PaymentForm, UserProfile |
Expand each keyword to catch variations:
| Original | Expanded to search |
|----------|-------------------|
| showQRCode | showQRCode, QR code, QR-code, qrcode, QRCode |
| handlePayment | handlePayment, payment handler, payment handling |
| isLoading | isLoading, loading state, is loading |
# Search for stale references in test files
grep -rn "<keywords>" tests/ e2e/ --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" | grep -v node_modules
Scope restrictions:
tests/, e2e/, __tests__/, *.test.*, *.spec.*node_modules/, dist/, build/, .next/| Match Count | Action | |-------------|--------| | 0 matches | Proceed to commit (no stale references) | | 1-5 matches | Auto-update comments/docstrings, show changes | | 6-15 matches | Show matches, ask user to confirm updates | | 16+ matches | Narrow search (too broad), ask user to specify scope |
Prioritization: Files already touched in this change are updated first.
Example update:
// Before (stale)
/**
* Tests the showQRCode function displays a QR code
*/
// After (updated)
/**
* Tests the displayQRImage function renders a QR image
*/
Before committing, verify no stale references remain:
# Final check - should return 0 matches
grep -rn "<original-keywords>" tests/ e2e/ --include="*.ts" --include="*.tsx" | grep -v node_modules | wc -l
If matches remain, either:
docs/test-debt.json with justification (explicit skip)Skip test doc sync ONLY when:
Log skips to docs/test-debt.json:
{
"testDocSkips": [{
"commit": "abc123",
"reason": "Infrastructure change only",
"skippedAt": "2026-03-03T10:30:00Z"
}]
}
Developer agent handles the actual test doc sync. Builder ensures:
data-ai
Generate verification contracts before delegating tasks to sub-agents, defining how success will be measured. Triggers on: verification contract, delegation contract, task verification, contract-first delegation.
testing
Verify that Vercel environment variables point to the correct Supabase project for each environment to prevent staging/production cross-wiring. Triggers on: vercel supabase check, environment alignment, env var check, supabase environment.
development
Manage codebase and database vectorization for semantic search. Use when initializing, refreshing, or querying the vector index. Triggers on: vectorize init, vectorize refresh, vectorize search, semantic search, vector index, enable vectorization.
testing
Patterns for XCUITest UI tests for native Apple apps (macOS/iOS). Use when writing or reviewing XCUITest tests for Swift apps. Triggers on: XCUITest, xcuitest, native app testing, Apple UI tests, SwiftUI tests, AppKit tests, UIKit tests.