skills/brownfield/bf-create-tests/SKILL.md
Write tests for a batch of tasks BEFORE implementation. Detects the project's test framework and conventions, then writes tests covering happy paths, edge cases, and failure modes. All tests should fail initially since there's no implementation yet. Part of the brownfield skill family. Use when the user says /bf-create-tests or wants to write tests before implementing a task batch.
npx skillsauth add ricky-yosh/agent-workflows bf-create-testsInstall 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.
Write tests for a batch of tasks before implementation. Tests define the contract; implementation satisfies it later.
Read .aw/brownfield-progress/spec.txt and .aw/brownfield-progress/tasks.json — if either is missing, tell the user which skill to run first.
Pick the target tasks. Read .aw/brownfield-progress/next-task.json — if it exists, default to the task listed there (written by /bf-triage). Confirm with the user: "Triage picked Task N — writing tests for that. Want a different task instead?" If next-task.json doesn't exist, fall back to asking: "Which tasks are you writing tests for?" Show the remaining (not-done) tasks by number. Accept task numbers (e.g., "tasks 3-5"), a group reference, or "all remaining".
Decide if tests make sense. Read the selected tasks carefully and assess whether unit/integration tests would provide real value. Tests make sense when there is testable logic — data transformations, business rules, state machines, validation, parsing, calculations, model layer changes, API contracts. Tests do NOT make sense for tasks that are purely: UI/visual layout with no logic, configuration/wiring with no logic, build setting changes, documentation, copy/string changes, or simple glue code that delegates entirely to already-tested code. When borderline, lean toward writing tests.
If tests do not make sense, output exactly this and stop:
Does writing tests for this task make sense? No
If tests do make sense, continue to step 4. Your first output line must be:
Does writing tests for this task make sense? Yes
Scope test coverage to only the selected tasks. Read the task descriptions and steps to understand what behavior needs testing. If prior tasks are already done, you can reference classes and methods they introduced — tests for later tasks build on earlier work.
Detect the test framework. Look at the project's existing test files to identify what test framework, assertion library, and conventions are used. Follow the same patterns — file naming, directory structure, import style, assertion style.
Write the test code. Tests must:
After presenting the tests, include this summary table:
### Summary
| Test category | Coverage | Count |
|---|---|---:|
| Happy path tests | <what's covered> | <number> |
| Edge case tests | <what's covered> | <number> |
| Error handling tests | <what's covered> | <number> |
| Regression tests | <what's covered or "N/A"> | <number> |
| **Total** | | **<total>** |
The "Coverage" column briefly describes what that category covers for these specific tasks. The "Count" column is the number of test functions in that category. Only include the Regression tests row if there are regression-specific tests; otherwise show "N/A" with count 0.
Iterate until approved.
development
Write tests for a batch of tasks BEFORE implementation. Detects the project's test framework and language, then writes tests that cover happy paths, edge cases, and failure modes. All tests should fail initially since there is no implementation yet. Part of the gf (greenfield) skill family. Use when the user says /gf-write-tests or wants to write tests before implementing a feature or task batch.
testing
Generate readable testing notes after a feature is complete. Compares spec against implementation to produce a concise list of what was built, how to test it, and any scope gaps. Writes testing-notes.md to .aw/greenfield-progress/. Part of the gf (greenfield) skill family.
testing
Save current session work to .aw/greenfield-progress/progress.txt. Captures decisions (why, not just what) that git diff cannot show. Updates tasks.json to mark completed tasks. Part of the gf (greenfield) skill family.
testing
Gate the greenfield workflow on user verification after an implementation step. Reads the implementation digest, shows verification steps, and waits for the user to confirm before advancing. Part of the gf (greenfield) skill family.