/nacl:tl-regression-testfrom nacl
Writes a failing test before a bug fix or feature implementation, ensuring test-author isolation. Useful in bug-fix and feature-dev workflows.
Ships in nacl. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an independent test author. Your single job is to write a test that must be RED on the current codebase. The reason for RED differs by mode:
The caller MUST pass mode=bug-fix (default) or mode=feature-dev. If mode is absent, default to bug-fix and proceed with the bug-fix path.
The skill that fixes a bug (or implements a feature) cannot also be a fair grader of "is my work verified by tests?" — it will tend to write tests that confirm whatever the implementation happens to do. To break that loop, tests are always written by a separate agent (this skill), invoked before the fix or implementation is applied. The natural verification is:
If step 2 is GREEN, the test is wrong and is discarded — the caller re-invokes this skill with sharper inputs.
package.json — read its scripts.test. Use the same import style and assertion library as existing tests. Do NOT introduce a new framework.scripts.test, return immediately with the appropriate NO_INFRA header (see Failure-mode reports below). Do NOT attempt to set up a test runner.test-spec.md) per invocation. Do not refactor neighboring tests, do not "improve" coverage along the way.The caller (typically /nacl:tl-fix) provides:
If any of the first four are missing, ask the caller to fill them in before proceeding. Do not guess.
package.json.scripts.test. If absent → return REGRESSION TEST HALTED — NO_INFRA.node:test, vitest, jest, playwright, etc.)assert.equal, expect(...).toBe(...), assert.deepStrictEqual, etc.)*.test.ts, *.spec.ts, etc.).The test must:
assert.equal(actual, currentBuggyOutput) — write assert.equal(actual, expectedOutput).app.inject); if it's at a function boundary, exercise the function.'returns 200 with empty body for POST /activate without Content-Type'. Bad: 'fix for empty-body activate works'.Run the new test in isolation against the current (still-broken) code. Use the runner's filter mechanism (e.g. node --test --test-name-pattern=..., vitest run -t "...") to run only this test.
═══════════════════════════════════════════
REGRESSION TEST WRITTEN
═══════════════════════════════════════════
Bug: [one-line summary from caller's input]
Test file: [absolute path]
Test name: [exact `it`/`test` name]
Framework: [node:test | vitest | jest | playwright | ...]
Runner: [scripts.test command]
Verification: [✓ RED — test fails against broken code as required]
Failure: [first 5-10 lines of the test failure output, to confirm it
actually caught the bug rather than failing for an unrelated
reason like a missing import]
Regression test: [repo-relative path of the test file]
Caller: Apply the fix now, then re-run the suite. The test must turn
GREEN. If it does not, the fix did not address the bug.
═══════════════════════════════════════════
The final Regression test: <path> line is mandatory — orchestrators (nacl-tl-fix, nacl-tl-conductor, nacl-tl-full) parse it verbatim and forward it into Task.verification_evidence in the graph (see ${CLAUDE_PLUGIN_ROOT}/nacl-core/SKILL.md § Task.verification_evidence). The path must be repo-relative (forward slashes, no leading ./ or /).
If NO_INFRA:
═══════════════════════════════════════════
REGRESSION TEST HALTED — NO_INFRA
═══════════════════════════════════════════
Workspace [path] has no scripts.test in package.json.
Cannot write a regression test without a test runner.
Caller: Skip the regression-test step. /nacl:tl-fix should classify
the fix as NO_INFRA and recommend /nacl:tl-dev TECH-### to
set up a runner.
═══════════════════════════════════════════
If the test is GREEN against broken code:
═══════════════════════════════════════════
REGRESSION TEST — DID NOT CAPTURE BUG
═══════════════════════════════════════════
The test I wrote PASSES against the broken code. It does not capture
the bug as described.
Test file: [path] (left in place for inspection — caller may delete or
refine)
Likely cause: [my honest guess — wrong assertion target, wrong scope, the
bug reproduces under different inputs than I used, etc.]
Caller: Refine the bug description (sharpen Current vs Expected,
provide a more specific input that triggers the bug) and
re-invoke /nacl:tl-regression-test mode=bug-fix.
═══════════════════════════════════════════
The caller (typically /nacl:tl-dev-be, /nacl:tl-dev-fe, or /nacl:tl-dev) provides:
.tl/tasks/UC###/test-spec.md (BE) or .tl/tasks/UC###/test-spec-fe.md (FE). For TECH tasks: .tl/tasks/TECH-###/test-spec.md..tl/tasks/UC###/acceptance.md.be | fe | tech (determines workspace and test conventions).If test-spec.md / test-spec-fe.md is absent → halt with FEATURE-TEST HALTED — NO_INFRA (same rationale: no spec means no basis for a test).
test-spec.md (or test-spec-fe.md) — extract each named test case and its assertion intent.acceptance.md — note which acceptance criteria the test cases map to.package.json.scripts.test. If absent → return FEATURE-TEST HALTED — NO_INFRA.The test must:
test-spec.md. Do not write a test that trivially passes because it tests nothing — assert a real outcome (return value, rendered element, HTTP status, emitted event, etc.).test-spec.md (the test name is the spec's test case name). This makes the failure set parseable by the caller.expect(fn).toThrow() unless the spec says the feature should throw. The test must fail because the feature is missing, not because the test deliberately checks for absence.Write the minimal set of test cases listed in test-spec.md. Do not invent additional coverage.
This step is shared with bug-fix mode. Run the new test(s) in isolation using the runner's filter mechanism.
test-spec.md appears in the failure set.FEATURE-TEST INVALID — NOT RED and stop. Do NOT proceed to hand off.═══════════════════════════════════════════
FEATURE-TEST WRITTEN
═══════════════════════════════════════════
Task: [UC### or TECH-###]
Test spec: [path to test-spec.md or test-spec-fe.md]
Acceptance: [path to acceptance.md]
Test file: [absolute path of the new test file]
Test names: [list of exact `it`/`test` names, one per line]
Framework: [node:test | vitest | jest | playwright | ...]
Runner: [scripts.test command]
Verification: [✓ RED — all new tests fail on current (unimplemented) code]
Failure: [first 5-10 lines of the failure output for the first test,
to confirm the failure is caused by the missing feature, not
by a tooling error]
Regression test: [repo-relative path of the test file]
Caller: Implement the feature now, then re-run the suite.
Each test above must turn GREEN. If any do not, the
implementation does not satisfy the spec.
═══════════════════════════════════════════
The final Regression test: <path> line is mandatory in both modes — orchestrators (nacl-tl-dev-be, nacl-tl-dev-fe, nacl-tl-dev, nacl-tl-conductor, nacl-tl-full) parse it verbatim and forward it into Task.verification_evidence in the graph (see ${CLAUDE_PLUGIN_ROOT}/nacl-core/SKILL.md § Task.verification_evidence). The path must be repo-relative (forward slashes, no leading ./ or /). If multiple test files were created in one invocation, emit one Regression test: line per file.
If NO_INFRA (missing scripts.test or missing test-spec.md):
═══════════════════════════════════════════
FEATURE-TEST HALTED — NO_INFRA
═══════════════════════════════════════════
[One of:]
Workspace [path] has no scripts.test in package.json.
— OR —
test-spec.md not found at [path]. Cannot write tests without a spec.
Caller: If no runner: open a TECH task to set up a test runner.
If no test-spec.md: ask /nacl:tl-plan to generate it.
═══════════════════════════════════════════
If a test passes immediately (feature already exists or test is too lenient):
═══════════════════════════════════════════
FEATURE-TEST INVALID — NOT RED
═══════════════════════════════════════════
One or more tests I wrote PASS on the current (unimplemented) codebase.
A test that passes before the feature exists is not a valid TDD test.
Passing test(s): [list of test names that passed]
Test file: [path] (left in place for inspection)
Likely cause: [my honest guess — assertion too broad, feature partially
exists, wrong import path resolves to a stub that satisfies
the check, etc.]
Caller: Sharpen the test-spec.md (tighten the assertion, use a more
specific input, or verify the feature truly does not exist) and
re-invoke /nacl:tl-regression-test mode=feature-dev.
═══════════════════════════════════════════
/nacl:tl-regression-test
mode=bug-fix
bug="POST /activate returns 500 when body is empty"
affected_files=["backend/src/routes/activate.ts"]
current_behavior="throws unhandled TypeError on missing req.body.token"
expected_behavior="returns 400 with { error: 'token required' }"
/nacl:tl-regression-test
mode=feature-dev
task_id=UC037
test_spec=.tl/tasks/UC037/test-spec.md
acceptance=.tl/tasks/UC037/acceptance.md
target_files=["backend/src/services/resume-parser.ts"]
layer=be
/nacl:tl-regression-test
mode=feature-dev
task_id=UC037
test_spec=.tl/tasks/UC037/test-spec-fe.md
acceptance=.tl/tasks/UC037/acceptance.md
target_files=["frontend/src/components/ResumeUpload.tsx"]
layer=fe
/nacl:tl-regression-test
mode=feature-dev
task_id=TECH-012
test_spec=.tl/tasks/TECH-012/test-spec.md
acceptance=.tl/tasks/TECH-012/acceptance.md
target_files=["backend/src/lib/rate-limiter.ts"]
layer=tech
Given UC037 has .tl/tasks/UC037/test-spec.md and .tl/tasks/UC037/acceptance.md:
Step 1 (READ SPEC): Read test-spec.md — suppose it names two test cases: 'parses PDF resume and returns structured fields' and 'returns 422 when file is not a PDF'. Read acceptance.md. Walk up from backend/src/services/resume-parser.ts (does not exist yet) to backend/package.json. Find scripts.test = "vitest run". Read backend/src/services/user.test.ts for style reference.
Step 2 (WRITE THE FAILING TEST): Create backend/src/services/resume-parser.test.ts. Two test cases importing resumeParser from ./resume-parser. The file does not exist — the import fails at runtime.
Step 3 (VERIFY RED): Run vitest run -t "parses PDF resume". Output: Error: Cannot find module './resume-parser'. Both test names appear in the failure set. RED confirmed.
Step 4 (REPORT): Emit FEATURE-TEST WRITTEN with file path, both test names, and the import failure as proof.
The caller (nacl-tl-dev-be) now implements resume-parser.ts and runs the suite. Both tests must turn GREEN.
/nacl:tl-fix, /nacl:tl-dev-be, /nacl:tl-dev-fe, or /nacl:tl-dev (with developer subagent_type), so it does not inherit the caller's reasoning. When invoked directly by the user, it runs in the main agent context — that is fine./nacl:tl-reopened (QA failure surfaces an uncovered bug), /nacl:tl-hotfix (hotfix to main needs a regression test before it ships).What SKILL.md sets; muted values are Claude Code's defaults
sonnetmediumnpx claudepluginhub itsalt/nacl --plugin nacl53 skills in this plugin
/ba-analyzeАнализ Excalidraw-доски бизнес-процесса: полнота, diff со snapshot, сравнение с Neo4j-графом.
Используй когда пользователь просит: проанализировать доску, проверить доску,
найти проблемы на доске, board analysis, nacl-ba-analyze.
/ba-contextDefine system boundaries in Neo4j graph: scope, stakeholders, external entities, data flows.— all data stored as graph nodes and edges.
Use when: define system scope with graph, system context diagram, or the user says "/nacl:ba-context".
/ba-entitiesCatalog business entities in Neo4j: stereotypes, attributes, states, CRUD matrix.Use when: model entities with graph, create entity catalog, or the user says "/nacl:ba-entities".
/ba-from-boardOrchestrator skill: unified BA-board workflow combining import_doc + analyze + sync.
Creates boards, imports client documents, analyzes completeness, syncs to Neo4j graph.
Invocation: /nacl:ba-from-board <command> [arguments]
/ba-fullFull BA model creation in Neo4j via 10-phase orchestration.
Chains all nacl-ba-* skills sequentially with user confirmation gates.Use when: create complete BA model with graph, full business analysis, or the user says "/nacl:ba-full".
/ba-glossaryBuild ubiquitous language glossary in Neo4j: terms, definitions, synonyms, links.Use when: create glossary with graph, define terms, or the user says "/nacl:ba-glossary".
Other plugins' skills for the same job