← ClaudeAtlas

rcode-prove-itlisted

Test-first development.
hanzlahabib/rcode · ★ 0 · AI & Automation · score 71
Install: claude install-skill hanzlahabib/rcode
@.rcode/references/karpathy-guidelines.md ## Overview Test-first cycle: red (failing test that captures the requirement) → green (smallest code that passes) → refactor (clean up with the test as safety net). For bugs: reproduce-the-bug-as-a-test before fixing — the test then guards against regression. The skill assumes a JS/TS project with Jest, Playwright, or node:test; the choice is detected from the project's `package.json`. ## Workflow 1. **Detect the test runner.** Read `package.json` `devDependencies` and `scripts.test`. Order of preference: `playwright` for E2E flows, `jest` or `vitest` for unit, `node --test` for zero-dep projects (rcode uses this). 2. **For a new feature:** describe the behaviour in one sentence. Write the test that captures it. Run — confirm it fails for the right reason. 3. **For a bug fix:** reproduce the bug as a failing test BEFORE looking at the code. The test must fail in the way the user reports. 4. **Write the smallest code** that makes the test green. Resist the urge to handle cases not in the test. 5. **Refactor with the test as safety net.** Rename, simplify, deduplicate. The test stays green. 6. **Add edge-case tests** in a second pass. Common missing cases: empty input, boundary values, error paths, concurrent access. 7. **Commit:** `test: add failing test for X` → `feat/fix: implement X` → optional `refactor: simplify Y`. Three commits, three diffs. ## Output Format ``` Detected runner: <jest|playwright|node:test|vitest> Step 1