add-tests

A command for adding the smallest sufficient regression test to one existing in-progress task. Regression tests check that an earlier behavior does not break again.

In plain words
What is it for?
Adding task-scoped tests when a specific in-progress task already defines the behavior that needs coverage.
Why use it?
It imposes task, scope, evidence, and assertion rules so added tests remain tied to approved work and do not weaken verification.

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/nicelight/devrails-26/add-tests
Clone the repo
git clone --depth 1 https://github.com/nicelight/DevRails-26
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 784 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.00014 $0.00784
Opus 5 $0.00007 $0.00392
Sonnet 5 $0.00003 $0.00157
Haiku 4.5 $0.00001 $0.00078

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

Security

Grade A, and why

add-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 3d 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.

skills/_shared/references/commands/add-tests.md · 81 lines

What it actually says

/add-tests - Improve task-scoped coverage

<input_contract> Require one explicit TASK-NNN-TN-FT-NNN-WN that:

  • resolves uniquely through .memory-bank/tasks/index.json;
  • has status: in_progress;
  • has an outcome/AC/REQ/spec boundary covering the proposed test behavior.

Read the task record, .memory-bank/workflows/tier-policy.md#tier-obligations, #closure-authority, #hard-write-boundary when applicable, linked specs/verification targets, implementation evidence, and project-native test configuration needed for the chosen check. </input_contract>

<hard_invariants>

  • Reuse the existing task ID, lifecycle, tier, protocol, and evidence paths. Do not create synthetic testing tasks, a second lifecycle, or new task fields.
  • Test files outside advisory touched_files are allowed only for the same outcome and inside hard allowed/forbidden scopes; record the deviation.
  • Do not weaken assertions, disable failures, introduce decorative tests, or substitute screenshots for behavior proof.
  • Do not create or modify .memory-bank/testing/; accepted shared testing-spec changes route through /spec-redesign, Foundation detail through /foundation-to-tasks, and feature detail through /feature-to-tasks.
  • /add-tests does not own task closure or scheduler transitions. </hard_invariants>

<operator_decisions> If useful coverage requires a new product behavior, contract, state/data, security/compatibility rule, task-boundary/tier change, external dependency, or verification-policy choice not already settled, stop and surface the exact decision.

Interactive flow asks the operator and resumes only after the owning feature/spec/task plan is durably repaired. Unattended flow returns the blocker to the scheduler without choosing and names /feature-to-tasks FT-<NNN>, /spec-redesign, or /feature-doctor FT-<NNN> as the applicable resume route. A recommendation is not an accepted decision. </operator_decisions>

<agent_discretion> The agent chooses exploration order, tools, test level, test shape, fixtures, and proportional flakiness checks. Select the narrowest credible proof: a unit, integration/contract, e2e, or existing project-native check according to the actual behavior and regression risk. No requirement exists to fill every test category or put browser/e2e first. </agent_discretion>

<required_outputs>

  • scoped test changes;
  • exact commands/results and substantive artifacts in the existing task's tier-selected paths:
    • T0/T1 -> .protocols/<TASK_ID>/run.md;
    • T2/T3 -> full protocol state plus .tasks/<TASK_ID>/ evidence;
  • recorded actual test files, advisory deviations, hard-scope compliance, flakiness evidence when relevant, and remaining blockers. </required_outputs>

<handoff_contract> Return immediately to /exe, /verify, the scheduler, or the explicit task owner under .memory-bank/workflows/tier-policy.md#closure-authority. Out-of-scope coverage routes to normal /feature-to-tasks FT-<NNN> planning instead of being smuggled into the current task. </handoff_contract>

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. 3d ago First seen · 81 lines · 14 tokens per session scan A 8c7bb8c95773

Subscribe to this mod's changes

add-tests is a command published in the GitHub repository nicelight/DevRails-26 (22 stars, last pushed 5d ago), licensed MIT. It adds 14 tokens to every session and 784 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.