test

A command that runs tests for natural-language artifacts, such as agent instructions or skills, using Markdown specification files. TDD means test-driven development: writing expected checks before or alongside the implementation.

In plain words
What is it for?
Use it to discover specifications in .nlpm-test/, test one specification or a directory of them, and receive scored results for the matching artifacts.
Why use it?
It helps check whether written AI instructions meet defined requirements instead of relying only on manual review.

Command

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/xiaolai/nlpm/test
Clone the repo
git clone --depth 1 https://github.com/xiaolai/nlpm
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 528 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 $0.00026 $0.00528
Opus 5 $0.00013 $0.00264
Sonnet 5 $0.00005 $0.00106
Haiku 4.5 $0.00003 $0.00053

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

Security

Grade A, and why

test 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.

commands/test.md · 74 lines

What it actually says

User Input

$ARGUMENTS

Workflow

Step 1: Discover Specs

Input Behavior
(empty) Glob for .nlpm-test/*.spec.md in cwd
path to a .spec.md file Test that single spec
path to a directory Glob for *.spec.md in that directory

If no specs found → "No test specs found. Create specs in .nlpm-test/ directory. See skills/nlpm/testing/SKILL.md for the spec format."

Display discovered specs:

Found {N} spec(s):
  .nlpm-test/my-agent.spec.md → agents/my-agent.md
  .nlpm-test/core-skill.spec.md → skills/core/SKILL.md

Step 2: Load Config

Read .claude/nlpm.local.md if exists. Extract score_threshold (default: 70). This is used as the fallback min_score when specs don't specify one.

Step 3: Run Tests

For each spec, dispatch the nlpm:tester agent with:

  • The spec file content
  • The artifact file content (if it exists)
  • The scoring rubric reference

Batch specs in groups of up to 3 (each spec requires reading 2 files + analysis).

Step 4: Report

NLPM Test Report

Spec                              Artifact                    Result   Checks
─────────────────────────────────────────────────────────────────────────────────
{for each spec}

Overall: {passed} passed, {failed} failed, {red} red

{if any RED:}
RED (write these artifacts next):
  {artifact_path} — spec exists but artifact doesn't

{if any FAIL:}
FAIL (fix these):
  1. {artifact_path} — {specific failure description}

{if all PASS:}
All specs pass. GREEN.

Error Handling

  • Spec has no artifact: frontmatter → "Spec missing artifact: field: {spec_path}"
  • Spec references invalid type → "Unknown artifact type '{type}' in {spec_path}. Valid: agent, skill, command, rule, hook, prompt"
  • Malformed YAML frontmatter in spec → "Malformed spec: {spec_path}"
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 · 74 lines · 26 tokens per session scan A 5caa28fbd377

Subscribe to this mod's changes

test is a command published in the GitHub repository xiaolai/nlpm (133 stars, last pushed 2d ago), licensed ISC. It adds 26 tokens to every session and 528 once invoked, about $0.0001 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.