behaviour-spec

Create, review, and generate tests from strict Behaviour.spec.md specification files.

1|Updated Aug 18, 2026
One-click install
npx skills add https://github.com/davidsneighbour/clerkwork --skill behaviour-spec-davidsneighbour
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: behaviour-spec
Source: https://github.com/davidsneighbour/clerkwork/tree/main/skills/behaviour-spec
Command: npx skills add https://github.com/davidsneighbour/clerkwork --skill behaviour-spec-davidsneighbour

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams often write tests directly from implementation code, which bakes in existing bugs and leaves behaviour ambiguous. This Skill enforces a specification-first workflow where a strict Behaviour.spec.md file is the source of truth, blocking test generation until the specification is clear, complete, and testable. ## Core Features & Use Cases - Strict specification contract: Defines required sections, stable behaviour IDs (I001, B001, E001, A001), vocabulary rules, threshold rules, and forbidden vague wording for Behaviour.spec.md files. - Review gate with hard decisions: Reviews a specification and returns exactly one of ACCEPT, ACCEPT WITH ISSUES, or REJECT, with blocking open questions stopping test generation in strict mode. - Traceable test generation and validation: Generates or updates tests using the repository's existing tools (Vitest, Playwright, Astro, and others), supports expected-failing tests for clear spec mismatches, and reports coverage with file:line references. - Use Case: A developer adds a mobile menu to a header component, writes a Behaviour.spec.md from the template, asks the agent to review it, resolves a blocking question about the mobile viewport threshold, then generates Playwright tests mapped to each behaviour ID and validates them with the repository's existing test commands. ## Quick Start Use the behaviour-spec skill to review src/components/Header/Behaviour.spec.md and tell me whether it passes the review gate before generating any tests.

Frequently Asked Questions about behaviour-spec

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate tests from a behaviour specification?▼

Write a Behaviour.spec.md from the provided template, have it pass the review gate with no blocking open questions, then ask the agent to generate tests. Tests are created using the repository's existing test runner and mapped to spec IDs like B001.

What is a Behaviour.spec.md file?▼

A Behaviour.spec.md file is a strict specification artifact with required sections: Scope, Vocabulary, Invariants, Behaviours, Edge cases, Accessibility requirements, Test mapping, Non-goals, and Open questions. Every testable item gets a stable ID such as I001, B001, E001, or A001.

Does this work with Playwright or Vitest test frameworks?▼

Yes, the skill is framework-neutral and uses whatever test tools the repository already has, including Vitest for unit and component tests and Playwright for browser, keyboard, focus, and responsive behaviour. It never introduces new test frameworks without explicit approval.

Why does the review gate reject my behaviour specification?▼

In strict mode the specification is rejected when required sections are missing, behaviours lack IDs, triggers, or expected results, thresholds are undefined, wording is vague, or open questions affect test generation. Fix the blocking issues and re-review before generating tests.

When should I use expected failing tests?▼

Use expected failing tests only when the specification is clear, the expected result is defined, and the current implementation does not satisfy it. The failure must be traceable to a spec ID and use the repository's existing expected-failure convention; ambiguous behaviour blocks generation instead.