From nexa-claude-nextjs
Orchestrates the full per-use-case delivery pipeline: verifies spec and design exist, implements the use case, writes E2E tests, and evaluates coverage against the spec. Iterates automatically until quality gates pass. Specification and design must exist beforehand via /sprint-prepare, /use-case-spec, or /design-screens. This skill must only be invoked explicitly via /deliver-use-case or by /sprint-deliver — never inferred from user messages.
How this skill is triggered — by the user, by Claude, or both
Slash command
/nexa-claude-nextjs:deliver-use-caseThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Run the complete pipeline for $ARGUMENTS (a use case ID like `UC-XXX`).
Run the complete pipeline for $ARGUMENTS (a use case ID like UC-XXX).
docs/requirements.md (from /requirements)docs/entity_model.md (from /entity-model)If any prerequisite is missing, stop and tell the user which /command to run first.
Read and follow ${CLAUDE_PLUGIN_ROOT}/shared/readiness/PROJECT_READINESS.md.
Do not proceed until all items pass or the user explicitly waives failures.
docs/entity_model.md or prisma/schema.prisma during the pipeline — all entities must exist before this skill is invokedRead and follow ${CLAUDE_PLUGIN_ROOT}/shared/readiness/NEXA_RULES_GATE.md.
Read and follow ${CLAUDE_PLUGIN_ROOT}/shared/readiness/SPRINT_BRANCH_GATE.md.
Maintain docs/delivery/$ARGUMENTS-iterations.md throughout the pipeline. Create it before
Step 3; append a new section after every verification (E2E test run, coverage evaluation):
# $ARGUMENTS Delivery Log
## Iteration N — [timestamp]
- **Phase:** E2E Tests | Coverage Evaluation
- **Result:** PASSED | FAILED (N/M passed)
- **Failures:** [test name] — [classification: test bug / implementation bug] — [error summary]
- **Fixes:** [description of each fix applied]
Pass this file to every re-launched agent: "Read docs/delivery/$ARGUMENTS-iterations.md —
do NOT repeat fixes that already failed."
Hard stop before any pipeline step begins.
Identify every entity referenced in docs/use_cases/$ARGUMENTS.md (from scenario steps,
alternative flows, business rules, and postconditions). Verify:
docs/entity_model.mdprisma/schema.prismaIf any entity is missing from either file, stop immediately:
PIPELINE STOPPED: Missing entities for $ARGUMENTS
Missing from docs/entity_model.md: [entity names]
Missing from prisma/schema.prisma: [entity names]
Run /entity-model to update the entity model, then /prisma-migration to create the
database migration before re-running /deliver-use-case $ARGUMENTS.
Before the pipeline begins, record the current commit:
git rev-parse HEAD
Store as the rollback point for Failure Recovery.
Check both files exist:
docs/use_cases/$ARGUMENTS.mddocs/designs/$ARGUMENTS-design.htmldocs/requirements.md is a living document — /sprint-prepare updates it with refined
requirements before generating specs. All skills use the same canonical source.
If either artifact is missing, stop:
PIPELINE STOPPED: Missing artifacts for $ARGUMENTS
- Specification (docs/use_cases/$ARGUMENTS.md): [exists / MISSING]
- Frontend Design (docs/designs/$ARGUMENTS-design.html): [exists / MISSING]
If part of a sprint: re-run /sprint-prepare.
If standalone: run /use-case-spec $ARGUMENTS then /design-screens $ARGUMENTS.
Read and follow: ${CLAUDE_PLUGIN_ROOT}/skills/implement/SKILL.md
Verify:
npx next build succeedsnpx vitest run passesDefinition of Done check — after build and unit tests pass, read
${CLAUDE_PLUGIN_ROOT}/shared/readiness/DEFINITION_OF_DONE.md and verify every checklist
item against the code. Fix any Critical failures (DoD items that are entirely missing) before
proceeding. Log remaining Minor items to the delivery log.
Do not proceed until both build and unit tests pass and no Critical DoD items are outstanding.
Two phases: an isolated agent writes and self-fixes the tests; the main context independently verifies them. The main agent is the only authority that can declare tests as passing.
Spawn a typed playwright-test subagent (not general-purpose). The agent's system
prompt is its operating manual — the playwright-test SKILL is loaded as identity, not
as a referenced doc. The agent runs in a cold context: it has not seen the implementation
reasoning from earlier steps, so tests validate what was designed, not what was built.
Invoke via the Agent tool with subagent_type: "playwright-test". Prompt:
Write Playwright end-to-end tests for $ARGUMENTS.
Inputs:
docs/use_cases/$ARGUMENTS.mddocs/designs/$ARGUMENTS-design.htmldocs/delivery/$ARGUMENTS-iterations.md(prior fix attempts — do NOT repeat fixes that already failed)Follow your operating manual (
playwright-test/SKILL.md) to the letter. Return each test file created, test count, and whether your finalnpx playwright testrun showed pass or fail (with full error output if failing).
Do NOT trust the agent's reported results. Run the tests yourself:
npx playwright test (no filters)If Phase 2 fails, classify each failure:
locator.click: Target closed, expect(locator).toHaveText, element not found errors.Log the iteration to the delivery log (see Delivery Log), then act:
playwright-test subagent with the error context and
iteration history. Return to Phase 2.npx next build and
npx vitest run to confirm the fix doesn't break anything. Return to Phase 2.playwright-test
subagent for test bugs.After 2 iterations with tests still failing, stop and follow Failure Recovery.
After E2E tests pass, evaluate coverage against the spec. Up to 2 iterations.
Spawn a typed evaluate subagent (not general-purpose). The agent's system prompt
is its operating manual — the evaluate SKILL is loaded as identity, not as a referenced
doc. The agent runs in a cold context: it has not seen the implementation reasoning.
Invoke via the Agent tool with subagent_type: "evaluate". Prompt:
Review the Playwright tests for $ARGUMENTS against
docs/use_cases/$ARGUMENTS.mdanddocs/requirements.md.Your report must include:
- Coverage Matrix — table mapping every FR, MSS step, alternative flow, and business rule to the test that covers it. Verdict: Covered / Partial / Missing.
- Gap Analysis — for each Partial or Missing item: the FR ID or spec step, the expected behavior, and what the test should assert.
- Recommendations — prioritized gaps to fix with concrete guidance.
Severity rules:
- Missing — zero tests for an entire requirement or spec flow. Requires a fix.
- Partial — a significant behavioral branch is untested. Fix only if High-priority FR or a critical UC step; otherwise flag as observation.
- Observation — nice-to-have improvement. Do not fix.
PASS = every FR, MSS step, alternative flow, and business rule has at least one test, and no Partial on critical items. Missing edge case variations within a covered flow are observations, not gaps.
Do NOT flag as gaps:
- Testing the absence of un-built functionality
- Initial page state when tests implicitly validate by interacting with elements
- Error-recovery round-trips when both error and success paths are already tested individually
- Postconditions that are the natural default
Output format:
QA Review: $ARGUMENTS Coverage Matrix | Target | Spec/Req Flow | Test Coverage | Verdict | |--------|---------------|---------------|---------| Gap Analysis (only if Partial or Missing items exist) Recommendations (only for Missing and significant Partial)
Log the QA evaluation result to the delivery log under ## Coverage Evaluation Iterations.
If there are Missing items, re-launch the playwright-test subagent with the gap
analysis and iteration history as input. After it returns, independently verify tests pass
(same as Step 3 Phase 2).
Then return to Phase 1 for re-evaluation.
After 2 iterations with Missing items remaining, stop and follow Failure Recovery.
Update the Status in docs/use_cases/$ARGUMENTS.md from Implemented to Done.
This is the only point in the workflow where a UC is marked Done — it requires both a passing implementation (set to Implemented by TRACKING.md after implementation) and a passing coverage evaluation (this step).
Generate docs/delivery/$ARGUMENTS-traceability.md:
# Traceability Report: $ARGUMENTS
| Requirement | Spec Flow | Test File | Verdict |
|-------------|-----------|-----------|---------|
| FR-XXX | MSS Step N| `e2e/UC-XXX.spec.ts:L24` | VERIFIED |
| BR-XXX | AF-YYY | `e2e/UC-XXX.spec.ts:L45` | VERIFIED |
To find line numbers, grep the test file for BR/FR annotations introduced in the tests.
## Pipeline Complete: $ARGUMENTS
| Step | Status |
|-------------------------|--------|
| Artifact Check | ... |
| Entity Gate | ... |
| Implementation | ... |
| E2E Tests | ... |
| Coverage Evaluation | N / 2 |
Include a What was built section listing key artifacts (pages, API routes, services, tests)
and links to docs/delivery/$ARGUMENTS-iterations.md and docs/delivery/$ARGUMENTS-traceability.md.
To run a deep quality audit (i18n, accessibility, visual fidelity):
/audit $ARGUMENTS
Post the pipeline summary to the GitHub issue for $ARGUMENTS:
gh issue list --search "in:title $ARGUMENTS" --state all --json number,title -q '.[] | select(.title | startswith("$ARGUMENTS:")) | .number'
If found:
gh issue comment <issue-number> --body "<report>"
Include: pipeline status table, What was built list, and footer 🤖 Generated by /deliver-use-case.
If no issue found, skip and inform the user.
When any step exhausts its iteration limit, present:
DELIVERY FAILED: $ARGUMENTS
[failure details — failing tests, remaining gaps, or error summary]
Delivery log: docs/delivery/$ARGUMENTS-iterations.md
Roll back all changes from this delivery attempt? (Y/n)
Recommended: Roll back. Resets to the pre-delivery state for a clean retry.
Alternative: Keep code and tests, remove only the delivery log.
Warning: Step 2 will encounter existing code on the next attempt — review before re-running.
git reset --hard <saved-commit-hash>
Confirm all delivery changes have been reverted.
rm docs/delivery/$ARGUMENTS-iterations.md
npx claudepluginhub nexadevapp/nexa-claude-skills-marketplace --plugin nexa-claude-nextjsCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.