Ck test

From DangQuangSE/team-development-skills · View interactive version

Ck test is an AI agent skill from the GitHub repository DangQuangSE/team-development-skills. Standalone testing skill — owns writing and running tests, verifying behavior, and two-pass TDD orchestration. Default mode analyzes changed scope and runs the relevant tests; `--unit`/`--integration`/`--e2e`/`--all` scope by test type; `--verify` reruns exactly the prior failures; `--all-phases <pl

How to use this skill

Skill file

ck:test — Standalone Verification & TDD Orchestration

ck:test owns all verification. It never touches production code and never calls ck:fix itself — a failure always hands control back to the user.

Modes (pick exactly one; --tdd further requires --prepare or --verify):


Step 1 — Quality Gate Check

Skip only for --tdd --prepare, or for --unit/--tdd --verify explicitly orchestrated by the active ck:cook phase after its Phase Checkpoint recorded tests=yes. This scoped exception lets tests and quality remain independent user choices; it does not apply to standalone test requests.

For every other mode, resolve the phase(s) in scope and verify each has a valid, current quality receipt:

python {ck-quality-skill-root}/scripts/receipt.py verify plans/{slug}/quality/{phase}-receipt.json

Resolve {ck-quality-skill-root} from the installed ck:quality skill directory for the active client; do not hardcode skills/ or .claude/skills/.

A missing or invalid receipt stops the run before any test is written or executed:

BLOCKED: phase implementation has not passed the Code Quality Gate.
Run or resume /ck:cook for the current phase.

Step 2 — Resolve Scope

Step 3 — Run Tester

If a named tester agent is available, spawn it with: scope, mode, existing test conventions (read 2-3 sibling test files first), and — for --tdd --verify — the prepared RED_READY artifact's exact test file contents. Otherwise execute the tester process inline. The inline path follows every ownership constraint and writes the same report; it exists so the skill remains standalone on Codex and Antigravity.

tester may create or edit only test code, fixtures, mocks, and test helpers. It never touches production code, never weakens an assertion to make a test pass, never deletes a failing test, and never marks a test passed without having run it.

Step 4 — Run and Verdict

Run the relevant suite(s) for the resolved scope (not necessarily the whole repo, unless --all-phases).

| Mode | Verdict values |

|---|---|

| --tdd --prepare | RED_READY (every new test fails only because the implementation doesn't exist yet) or BLOCKED (a test fails for an unrelated reason, e.g. a syntax error in the test itself) |

| default / --unit / --integration / --e2e / --all / --verify / --all-phases / --tdd --verify | PASSED or FAILED |

--tdd --verify additionally reports FAILED (category WEAKENED_TEST) if any prepared test's assertions were loosened, deleted, or its scope narrowed without a corresponding, justified change to the acceptance criteria — regardless of whether the suite otherwise passes.

Step 5 — Report and Handoff

Write the report to plans/{slug}/tests/{phase}-test-report.json (matching references/test-report-schema.json); --tdd --prepare writes plans/{slug}/tests/{phase}-tdd-ready.json (matching references/tdd-ready-schema.json) instead. --all-phases writes one report per swept phase — never one aggregate file covering multiple phases — then prints a one-line PASSED/FAILED summary per phase.

Update the phase's testing.status (JSON) or Quality and Testing State section (Markdown) to mirror the verdict: PASSED → passed, FAILED → failed, BLOCKED → blocked_on_quality. ck:test owns this field; nothing else writes it. Field shape and allowed values are defined once in ck-plan-json/rules/plan-design.md § Quality and Testing State — don't redefine them here.

On FAILED, stop — do not call ck:fix automatically. Print:

[ck:test] {mode} → FAILED
Report: plans/{slug}/tests/{phase}-test-report.json
Next: /ck:fix --from-test plans/{slug}/tests/{phase}-test-report.json, then /ck:test --verify {phase}

On RED_READY, print the artifact path and hand control back to ck:cook:

[ck:test] --tdd --prepare → RED_READY
Artifact: plans/{slug}/tests/{phase}-tdd-ready.json
Next: /ck:cook {phase-file} --tdd

On PASSED, print a short summary (passed/failed/skipped counts) and the report path; no further action is implied.

Constraints


Report shape: references/test-report-schema.json. TDD-prepare artifact shape: references/tdd-ready-schema.json.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.