pdfnative-mcp testing.instructions.md

A set of testing rules for pdfnative-mcp, a tool service for working with PDF files. It defines commands and checks for code, examples, PDF/A validity, and catalogue compatibility.

In plain words
What is it for?
It is for writing or debugging tests and validating PDF generation, examples, tool schemas, error codes, and project types.
Why use it?
It helps detect broken APIs, removed capabilities, invalid PDF output, lint errors, and failing examples.

Instructions file for GitHub Copilot

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 instructions/nizoka/pdfnative-mcp/testing
Clone the repo
git clone --depth 1 https://github.com/Nizoka/pdfnative-mcp

Made for: GitHub Copilot.

Per session 499 This file is loaded in full into every session.
When invoked 499 The same file — it is already loaded in full.
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 $0.00499 $0.00499
Opus 5 $0.00249 $0.00249
Sonnet 5 $0.00100 $0.00100
Haiku 4.5 $0.00050 $0.00050

Measured 2d ago against content hash d1cb27d3eb9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pdfnative-mcp testing.instructions.md 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 2d 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.

.github/instructions/testing.instructions.md · 43 lines

What it actually says

Testing Standards

Framework

  • vitest
  • Commands:
    • npm run test
    • npm run test:watch
    • npm run test:coverage
    • npm run typecheck:all
    • npm run examples:check (runs every examples/*.json live; multi-step examples are chained)
    • npm run validate:pdfa (veraPDF, 26-file corpus — 24 validated incl. 3 negative canaries, 2 page-tree outputs skipped; VERAPDF_REQUIRED=1 to fail closed)
    • npm run lint (eslint src --max-warnings 0 — warnings fail)

Catalogue parity

  • tests/catalogue-parity.test.ts compares the live tools/list structure with tests/_fixtures/tool-shape.json.
  • After a deliberate schema change: npm run build && node scripts/tool-shape.mjs --write, then review the fixture diff under docs/API_STABILITY.md §5. Never refresh it to silence an accidental change.
  • tests/catalogue-superset.test.ts compares the live catalogue with the frozen tests/_fixtures/tool-shape.v1.5.0.json: no tool / property / enum value removed, no new required, no tighter bound; the accepted 1.5.0 → 1.6.0 deltas are enumerated in the test and must each still occur. Never regenerate the 1.5.0 fixture.
  • tests/error-codes.test.ts inventories every ToolError code in src/ and asserts AGENTS.md §6 documents it and a test names it.

Test focus

  • Validate tool success and tool error paths.
  • Validate schema constraints for each MCP tool.
  • Validate sandbox protections in output.ts:
    • path traversal blocked
    • absolute paths blocked
    • NUL byte blocked
    • non-.pdf extension blocked
    • file output blocked when sandbox env var is unset

Style

  • Use describe/it structure.
  • One behavior per test.
  • Avoid brittle snapshot tests for binary output.
  • For generated PDF bytes, validate structure markers (%PDF- and EOF) and expected mode/metadata.

Quality gate

  • All tests must pass.
  • Coverage must not regress in touched modules.
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. 2d ago First seen · 43 lines · 499 tokens per session scan A d1cb27d3eb9e

Subscribe to this mod's changes

pdfnative-mcp testing.instructions.md is an instructions file published in the GitHub repository Nizoka/pdfnative-mcp (2 stars, last pushed 9d ago), licensed MIT. It adds 499 tokens to every session, about $0.0025 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-31.