- Home
- Skills
- Testing & Debugging
- Behavior Spec Writer
Works with the AI Agents you already use
Behavior Spec Writer
Turn vague specs into a verifiable BDD test matrix with GIVEN/WHEN/THEN scenarios for happy paths and edge cases.
$9
Behavior Spec Writer
Example session with this skill installed
Make specs/export-users/spec.md testable. Expand the acceptance criteria and write the test matrix.
- Read your context and instructions
- Compiled the behavior spec writer
I read spec.md (3 scenarios) and package.json (test framework: vitest, command npm test). I expanded the acceptance criteria to 8 scenarios covering the happy path, boundaries, errors and repetition, and wrote testing.md.
Refined acceptance criteria (spec.md)
- GIVEN 3 active and 1 deactivated user WHEN an admin exports THEN the CSV has a header plus 3 data rows.
- GIVEN no users WHEN an admin exports THEN the CSV contains only the header row.
- GIVEN exactly 50,000 active users WHEN an admin exports THEN the export succeeds.
- GIVEN 50,001 active users WHEN an admin exports THEN the export fails with "limit exceeded" and no file is produced.
- GIVEN an email containing a comma or a double quote WHEN exporting THEN the field is quoted and quotes are doubled.
- GIVEN a non-admin user WHEN they request an export THEN the system responds 403 and exports nothing.
- GIVEN the database times out mid-export WHEN an admin exports THEN the user sees a retryable error and no partial file is delivered.
- GIVEN the same export requested twice WHEN both complete THEN both files have identical content.
testing.md
| ID | Type | GIVEN | WHEN | THEN | Coverage |
|---|---|---|---|---|---|
| TC1 | happy | 3 active + 1 deactivated | admin exports | header + 3 rows | integration |
| TC2 | edge | no users | admin exports | header only | unit |
| TC3 | edge | exactly 50,000 active | admin exports | succeeds | integration |
| TC4 | error | 50,001 active | admin exports | "limit exceeded", no file | integration |
| TC5 | edge | email with comma and quote | serialize | quoted, quotes doubled | unit |
| TC6 | error | non-admin | requests export | 403, nothing exported | integration |
| TC7 | error | DB timeout | admin exports | retryable error, no partial file | integration |
| TC8 | idempotency | same export twice | both complete | identical content | unit |
How to run: npm test (vitest, read from package.json).
Next steps
- Review TC3 and TC4: they need a generator for 50,000 and 50,001 rows.
- When the cases look right, turn them into tests with
spec-to-tests.
PASS
Connects securely to your tools. The creator never sees your data.
About this skill
Vague acceptance criteria lead to brittle code and missed edge cases. This skill transforms high-level requirements into a verifiable GIVEN/WHEN/THEN test suite. It forces a rigorous assessment of boundary conditions and error states before a single line of test code is written.
What it does
- Requirement expansion converts basic acceptance criteria into at least 6 detailed GIVEN/WHEN/THEN scenarios.
- Edge case discovery identifies boundary conditions like empty states, timeouts, and permission failures.
- Matrix generation creates a structured
testing.mdfile mapping scenarios to specific test types. - Tech stack detection reads your project manifest to ensure test instructions match your actual frameworks.
- Gap analysis flags contradictory requirements or insufficient detail as blocking issues.
How it works
- The skill audits
spec.mdand related design docs to extract current requirements. - It inspects your project configuration to identify existing test runners and libraries.
- It updates
spec.mdwith expanded BDD scenarios and generates a comprehensivetesting.mdmatrix.
Frameworks & tools
This skill adapts to your environment by reading package.json, pyproject.toml, or similar manifests. It supports Gherkin-style BDD syntax and works with any testing stack including Jest, Pytest, Playwright, or Vitest.
Why this beats prompting it yourself
Generic prompts often miss non-happy path scenarios like idempotency or dependency failures. This skill enforces a strict minimum of six scenarios across four specific categories, ensuring coverage that manual prompting usually overlooks.
Use cases
- Generating a test plan for a new feature from a rough proposal.
- Hardening a spec before a handoff from design to engineering.
- Auditing existing requirements for missing error handling and boundary checks.
Known limitations
Requires a spec.md file to function. It will not write executable test code unless specifically requested, focusing instead on the behavioral logic and test plan.
Requires an existing spec.md file. Does not generate executable test code by default. Execution stops if fewer than 3 scenarios are viable.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 19 days ago