derive-tests

derive-tests is a command for Claude Code from phuryn/pm-skills. It costs 55 tokens per session (1,658 once invoked), scanned A, original, MIT.

A command that turns an app’s written requirements into a map of test coverage, showing existing tests, proposed cases, and unverified gaps.

In plain words
What is it for?
Use it after documenting the app to map tests for important user flows, permissions, backend functions, and automation, then choose a CI check before merging code.
Why use it?
It makes missing tests visible and separates checks that can be automated from those needing a protected live environment or a person’s review. It produces test cases and a map, not the finished test suite.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the pm-ai-shipping plugin — 2 skills, 5 commands shipped together

About the project

phuryn/pm-skills is a marketplace of reusable skills, commands, and plugins that guide AI assistants through product-management work such as discovery, strategy, planning, metrics, launches, and growth. It is for product managers and teams using Claude Code, Cowork, or compatible assistants. The catalogue entries are the project's own workflows and extensions.

phuryn/pm-skills · 26,001 stars · on GitHub · productcompass.pm

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/phuryn/pm-skills/derive-tests
Clone the repo
git clone --depth 1 https://github.com/phuryn/pm-skills

Made for: Claude Code.

Or install pm-ai-shipping, the plugin that ships this one along with the rest of its 2 skills, 5 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for derive-tests

README.md
[![agentmods](https://agentmods.dev/badge/commands/phuryn/pm-skills/derive-tests.svg)](https://agentmods.dev/commands/phuryn/pm-skills/derive-tests)
Your own site
<a href="https://agentmods.dev/commands/phuryn/pm-skills/derive-tests"><img src="https://agentmods.dev/badge/commands/phuryn/pm-skills/derive-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,658 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.01658
Opus 5 $0.00028 $0.00829
Sonnet 5 $0.00011 $0.00332
Haiku 4.5 $0.00006 $0.00166

Measured 6d ago against content hash d6727d5569b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

derive-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

pm-ai-shipping/commands/derive-tests.md · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/derive-tests -- Turn Intent Into Tests

The docs say what the system should do. An audit finds where the code doesn't. Tests are what stop that gap from reopening after the next AI edit. This command reads the documented intent, turns each load-bearing rule into a concrete test case, sorts them into what to automate, what needs a guarded live run, and what stays manual — then recommends the CI gate that keeps main honest.

This produces a coverage map (tests.md) and concrete test cases, not a finished suite — you or the next agent implement the deterministic ones.

Invocation

/derive-tests
/derive-tests the checkout flow
/derive-tests supabase/functions

Prerequisite: documented intent

Tests are derived from the docs, so the docs come first. If documentation/*.md is missing or thin, run /document-app (and /derive-tests reads flows.md, permissions.md, and automation.md most heavily). You cannot map coverage to rules you never wrote down — where intent is absent, say so rather than inventing rules to test.

The workflow

1. Read the intent — and the tests that already exist

Read the applicable system docs (architecture, flows, permissions, variables, and any of emails, cron, seo, automation that exist). Apply the shipping-artifacts skill for what each doc should contain, and the intended-vs-implemented skill for the discipline of treating docs as claims to verify, not proof.

Then inventory the existing test suite — the test files, what they actually assert, and what runs in CI today. The map you produce must distinguish coverage that exists now from coverage you're proposing; skipping this step yields a falsely-green map that claims rules are pinned when nothing checks them. If there are no tests, say so plainly — that is itself a finding.

2. Extract the rules worth testing

Pull out the load-bearing, deterministic rules — the ones whose violation crosses a trust, data, money, tenant, or privacy boundary:

Read the full file on GitHub · 115 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 115 lines · 55 tokens per session scan A d6727d5569b1

Subscribe to this mod's changes

derive-tests is a command published in the GitHub repository phuryn/pm-skills (26,001 stars, last pushed 2mo ago), licensed MIT. It adds 55 tokens to every session and 1,658 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.