pn-test-generation

pn-test-generation is a skill for Cursor from perniemann/pnCore. It costs 38 tokens per session (414 once invoked), scanned A, original, MIT.

A test-writing guide that creates unit tests for individual functions and integration tests for interactions between parts of an application.

In plain words
What is it for?
Use it to create tests before implementation, backfill tests for existing code, and cover module, API, database, or feature behavior.
Why use it?
It helps add missing coverage and turns requirements or acceptance criteria into checks for observable behavior. It can also identify the project’s existing test tools and conventions.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the pn-core plugin — 133 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it to create tests before implementation, backfill tests for existing code, and cover module, API, database, or feature behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/perniemann/pncore/pn-test-generation
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.

Any agent
npx skills add perniemann/pnCore --skill pn-test-generation
Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 133 skills, 19 commands, 9 agents, 1 MCP server.

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 pn-test-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/perniemann/pncore/pn-test-generation/github.svg)](https://agentmods.dev/skills/perniemann/pncore/pn-test-generation)
Your own site
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-test-generation"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-test-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pn-test-generation

Your own site · 80×15
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-test-generation"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-test-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 414 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00038 $0.00414
Opus 5.5 $0.00015 $0.00166
Sonnet 5.5 $0.00008 $0.00083
Haiku 4.5 $0.00004 $0.00041

Measured 1mo ago against content hash b1235c9b86d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pn-test-generation 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 1mo 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.

packages/pn-core-mcp/content/skills/discipline/pn-test-generation/SKILL.md · 37 lines

What it actually says

Test generation

When to use

  • Adding test coverage to a module or function that has none.
  • Scaffolding tests from acceptance criteria, specs, or existing code before implementing (TDD setup).
  • Backfilling unit or integration tests for code that was written without them.
  • Detecting and matching the project's test framework (Vitest, Jest, Playwright, pytest, etc.).

Workflow

  1. Identify scope: Module, function, or feature to test. If specs or acceptance criteria exist, use them as the contract.
  2. Match framework: Detect or ask which test framework the project uses (Vitest, Jest, Playwright, Cypress, Mocha, pytest, etc.).
  3. Generate tests:
    • Unit: one describe/test block per function or behavior; arrange-act-assert structure.
    • Integration: cover interactions between modules, APIs, or DB; use real or mocked dependencies per project convention.
  4. Run tests: Execute the generated tests and fix failures (assertions, mocks, setup).
  5. Iterate: Adjust coverage or add edge cases if the user requests more.

Guardrails

  • Do not generate tests that only assert implementation details (e.g. private method calls). Test observable behavior and outcomes.
  • Use project conventions: file location (e.g. *.test.ts beside source or in __tests__/), naming, mocking style.
  • Avoid flaky tests: no arbitrary sleeps; use deterministic waits and explicit assertions.
  • When backfilling, prefer behavior over implementation; refactor code if needed to make it testable.

Output

  • Test file(s) in the correct location
  • Tests passing after generation (or a clear list of fixes needed)
  • Brief summary of what is covered and what is not
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. 1mo ago First seen · 37 lines · 38 tokens per session scan A b1235c9b86d6

Subscribe to this mod's changes

pn-test-generation is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 6d ago), licensed MIT. It adds 38 tokens to every session and 414 once invoked, about $0.0002 per session on Opus 5.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-09-03.