Skip to content
AI & Agents
Skill

/tests-for-old-code

Add end-to-end tests to code that has none, in tiers by confidence, and run every test before handing it over. Use before refactoring untested code, after inheriting a project, or when the user says "add tests for this flow", "write e2e tests for login" or "we have no tests for

From plugin
skills
18515 skills

Claude Code

$ npx -y skills add off-grid-ai/skills --skill tests-for-old-code --agent claude-code

SKILL.md

tests-for-old-code.SKILL.md
name: tests-for-old-code
description: Add end-to-end tests to code that has none, in tiers by confidence, and run every test before handing it over. Use before refactoring untested code, after inheriting a project, or when the user says "add tests for this flow", "write e2e tests for login" or "we have no tests for X".

Tests for old code

Old code has no spec, so the tests pin down what it does today. Hold every test to `test-like-a-user`: real screens and real calls, faking only the network edge and the device.

1. Understand the flow

Ask what flow to cover if it isn't clear. Then find its entry points (routes, screens, handlers), what it calls and what it writes, and one existing test to copy the style and runner from. Use `learn-this-codebase` if there's no map.

2. Plan in tiers

  • **Tier 1, sure:** the main path, with behaviour you can see in the code. These must pass.
  • **Tier 2, likely:** edge cases and errors where the intended behaviour is a guess. Ask the user up to 3 yes/no questions to settle them.
  • **Tier 3, hints:** security, performance and anything you can't run here. A checklist, not code.

Show the plan and ask which tiers to write.

3. Write, run, fix

For each tier the user chose: 1. Write it in the project's runner and style, next to its other tests. 2. Run it. 3. If it fails, read the error and fix the test, up to 3 times. If the code is what's wrong, stop and tell the user: that's a bug you found, not a test to bend. 4. Still failing after 3 tries: move it to Tier 3 with what you learned.

Never loosen an assertion or raise a timeout to get green.

4. Hand over

A short report: each test, its tier, pass or moved, and what it covers. Tier 3 items as a checklist. Any bugs found, first.

Read more
@wednesday-solutions
Ships withskills

These are the skills I use every day. I built Off Grid AI on my own with them, and it reached 250,000+ downloads on 7 platforms without spending a dollar on ads. Install them and your AI works the way mine does.

Stars on GitHub

Momentum

stars in total
185
Star history of wednesday-solutions/ai-agent-skills on GitHub, a chart by star-history.com

Other skills on skills.

audit-a-module

audit-a-module

Health check one module or service and recommend what to do with it: leave it, clean it up, refactor it with care, or don't touch…

blast-radius

blast-radius

Before editing a file or symbol, find everything that depends on it, score how risky the change is, and stop for approval when…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw4w393k
@openclaw@openclawInstall Skill

Questions about tests-for-old-code.

Which coding agents can use tests-for-old-code?
tests-for-old-code installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.