derive-tests

Extract load-bearing rules from documented intent and generate a coverage map with proposed test cases.

579|76|Updated Oct 29, 2026
Ready to run
npx skills add https://github.com/phuryn/product-engineering --skill derive-tests-phuryn
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: derive-tests
Source: https://github.com/phuryn/product-engineering/tree/main/ai-shipping/skills/derive-tests
Command: npx skills add https://github.com/phuryn/product-engineering --skill derive-tests-phuryn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? You have documented system behavior but no clear picture of what tests verify it. Gaps between docs and code go unnoticed until production breaks them. This Skill bridges that gap by reading your intent documentation, auditing what tests actually exist, and building a coverage map that pins load-bearing rules before they drift. ## Core Features & Use Cases - Intent-to-Tests Workflow: Transform documented flows, permissions, and automation rules into concrete test cases organized by type (unit, integration, guarded-live, manual). - Coverage Mapping: Build a single source of truth showing which rules are verified today, which are proposed, and which have no test at all. - Check-Only Mode: Validate an existing coverage map against current docs and tests without rewriting files—useful for release gates and map maintenance. - Use Case: Your product has documented that only organization admins can delete teams. You run derive-tests on the permissions docs and codebase; it finds the authorization rule, discovers no test asserts it, and proposes a concrete unit test with both allow and deny cases. ## Quick Start Tell an AI agent: Apply the derive-tests skill to audit what tests verify the checkout flow documented in our flows.md file, or ask it to check whether our existing coverage map is current against the latest docs and test suite.

Frequently Asked Questions about derive-tests

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

FAQPage Schema
How do I create a test coverage map from system documentation?▼

Read your documented flows, permissions, and automation rules to extract deterministic load-bearing boundaries (authorization, validation, idempotency, side effects). For each rule, build a row naming the rule, expected behavior, evidence source, test type, and current status (existing/proposed/none). Group rows by doc or flow for clarity.

What counts as a load-bearing rule worth testing?▼

Test rules whose violation crosses a consequential boundary: authorization allow/deny cases, input validation at sinks, job idempotency, fail-closed defaults (error, timeout, cache-miss), side-effect conditions (when emails send, writes commit), and public-data-only constraints. Skip cosmetic behavior; test rules whose failure harms someone other than the actor.

When should I use check-only mode instead of generating a new coverage map?▼

Use check-only mode to validate an existing coverage map without rewriting it. This is useful for release gates, map maintenance by hand, or checking whether the map has drifted from current docs and tests. Check mode reads files but writes nothing.

What is the difference between existing, proposed, and none coverage status?▼

Existing coverage means a test in the repo asserts the rule today; proposed coverage is a recommended test that doesn't exist yet; none means the rule is documented but has no test at all. Gaps (none status) are the backlog where the next AI edit can silently break a boundary.

How do I distinguish between a unit test and an integration test for my coverage map?▼

A unit test is pure and deterministic with no external services; an integration test wires real dependencies the product runs for testing (local database, mocked provider). Use unit tests where decision logic can be isolated. Use integration when the rule lives in middleware, RLS, or auth-guard wiring only a real dependency can exercise.

What should I do if system documentation is thin or missing?▼

Apply the document-app skill first to write down intent before deriving tests from it. derive-tests reads flows.md, permissions.md, and automation.md most heavily. If intent is absent, say so rather than inventing rules to test; the gap is in the docs, not the tests.