Moonspec verify

From MoonLadderStudios/MoonMind · View interactive version

Moonspec verify is an AI agent skill from the GitHub repository MoonLadderStudios/MoonMind. Verify a completed implementation against the original instructions, a declarative source document, an issue brief, or an optional MoonSpec feature packet, plus AGENTS.md repo guidance and required tests. Use when the user asks to run or reproduce `/moonspec.verify`, perform a final read-only implem

How to use this skill

Skill file

MoonSpec Verify

Use this skill to perform the final MoonSpec verification workflow.

Read the acceptance policy before selecting

scope, evidence, verdict, reuse, or completion. This bundle owns that policy;

caller instructions and the selected source supply scope, explicit acceptance

requirements, and evidence.

Scope

Verify only. Do not modify source code, tests, specs, plans, tasks, docs, migrations, or configuration. Normal disposable test artifacts are acceptable only when already ignored by the project.

This skill answers:

Source Acceptance Matrix Verification

When artifacts/moonspec/source-acceptance.json or artifacts/moonspec/acceptance-assessment.json exists and its featureId, source, feature directory, issue reference, or requirement IDs match the selected verification baseline, evaluate every source row for that baseline under the shared acceptance policy. FULLY_IMPLEMENTED permits verified rows and valid Unverified disclosures, with no observed defect remaining. In source-direct verification mode, ignore stale or unrelated acceptance artifacts whose source metadata does not match the selected source.

Inputs

Stop only when no usable verification baseline can be located or the available baseline is genuinely too ambiguous to bound. Do not choose NO_DETERMINATION, BLOCKED, or ADDITIONAL_WORK_NEEDED solely because spec.md, plan.md, tasks.md, or other derived MoonSpec artifacts are absent. If an optional spec.md contains multiple stories and no narrower original instruction or declarative scope is available, report NO_DETERMINATION and recommend splitting the design with /moonspec.breakdown or selecting a narrower verification target.

Pre-Verify Hooks

Before verification, check for extension hooks:

  1. If .specify/extensions.yml exists, read it and look for hooks.before_verify.
  2. If the YAML cannot be parsed or is invalid, skip hook checking silently.
  3. Ignore hooks where enabled is explicitly false; hooks without enabled are enabled.
  4. Do not evaluate non-empty condition expressions. Treat hooks with no condition, null condition, or empty condition as executable. Skip hooks with non-empty conditions.
  5. For each executable hook:
## Extension Hooks

**Optional Pre-Hook**: {extension}
Command: `/{command}`
Description: {description}

Prompt: {prompt}
To execute: `/{command}`
## Extension Hooks

**Automatic Pre-Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}

Wait for the result of the hook command before proceeding to verification.

If no hooks are registered or .specify/extensions.yml does not exist, skip silently.

Setup

Resolve the verification baseline in this order:

  1. Explicit original implementation instructions or an explicitly referenced declarative document in the current request or workflow step.
  2. Issue-brief verification inputs.
  3. An explicitly provided spec.md or feature directory.
  4. An active feature directory discovered from repository context by running .specify/scripts/bash/check-prerequisites.sh --json --paths-only.

The first usable source defines the bounded scope. Later sources are supplemental context and traceability only. Workflow-stage prose such as "run the final gate", ad hoc verifier guidance such as "focus on API tests", or other process instructions are operational guidance, not source-direct authority; do not let them outrank an explicit feature directory, spec.md, original request, issue brief, declarative source document, or discovered active-feature source.

In source-direct verification mode:

  1. Preserve the original instruction text or declarative document path as the report's authority reference.
  2. Extract requirements, acceptance-critical behavior, constraints, stable claim IDs, explicit non-goals, and test expectations directly from that source.
  3. Bound verification to the requested change or the in-scope claims named by the instructions. Do not require unrelated claims from a broad document.
  4. Inspect production code and tests directly. Discover test commands from AGENTS.md, README, build configuration, CI configuration, and repository conventions when no plan or task packet is available.
  5. Do not require a MoonSpec feature directory, spec.md, plan.md, tasks.md, a source-acceptance artifact, or an assessment artifact.

If the user provides issue-brief verification inputs, use issue-brief verification mode. Accept inputs expressed in prose or preset instructions such as:

In issue-brief verification mode:

  1. Read the original issue brief artifact and any supplied assessment artifact. An absent optional assessment does not replace or invalidate a usable original baseline.
  2. Use the original issue summary, description, acceptance criteria, and constraints as the verification baseline. The assessment is process context.
  3. Use a PARTIALLY_IMPLEMENTED assessment to prioritize gaps; verify the complete selected scope, retaining previously met requirements as regression constraints.
  4. An initial FULLY_IMPLEMENTED assessment only says implementation appears present. Reuse evidence, execute feasible missing checks, and disclose unavailable checks under the acceptance policy.
  5. Inspect production code and tests directly; do not treat the assessment itself as proof that new work is complete. Normalize issue-brief unverifiable and source-matrix UNVERIFIED to verification UNVERIFIED, preserving the stable source ID as requirementId and nonblank unverified.reason and unverified.verifiableBy. Reassess availability on the current candidate; neither spelling asserts a pass.
  6. Do not require spec.md, plan.md, tasks.md, or a standalone constitution file.

When verification follows a remediation attempt, rebuild every controlling

classification from the current repository head. A previous verifier report,

its remainingWork, and the original assessment are hypotheses and process

context only; they are not current implementation evidence. For every prior

PARTIAL, MISSING, or remaining-work item, inspect the current production

code and tests and replace the old status, evidence, line numbers, and notes

with current findings. Do not carry stale classifications into a new report. Reuse matching objective

evidence under the acceptance policy and explicitly record that reuse. If the current head differs from the head named

by the assessment or previous report, no gap may remain solely because the old

artifact said it existed or because the candidate is not on the base branch.

Verify the candidate state at the boundary where this skill is invoked. In a

pre-publication verification step, an uncommitted workspace, an absent pull

request, an open issue, and an unmerged candidate are expected inputs, not

implementation or documentation gaps. Do not require downstream commit, pull

request, merge, or issue-closure evidence before returning

FULLY_IMPLEMENTED. Gate on those outcomes only when the selected baseline

explicitly makes publication itself part of this verification step and the

workflow has already supplied the resulting publication evidence.

This sequencing rule does not waive an acceptance or safety prerequisite that

the source requires before a repository change, such as proving legacy tasks

have drained before removing their handlers. Verify that prerequisite or return

the bounded evidence handoff; do not perform an unauthorized deployment.

Source obligations and admission

Read the original qualified source statements before reconciling the assessment's

verificationMap. Apply the acceptance policy's extraction rules, preserving

conditions and nonblocking exceptions in sourceQuote; a matching digest or

historical ID does not establish a mandatory obligation. Verify required reporting

behavior separately from the external assurance it describes. Retire invented

subcriteria through scopeReconciliation, not by waiving a real source requirement.

Preserve explicit proof constraints. Probe capabilities and run the helper's

admission command; continue ready work, reuse busy owners, and disclose checks

outside reach as Unverified. Read current owner-supplied artifacts before

reissuing a blocker. Retain passed rows; collect only missing or invalidated proof.

Evidence policy

Apply the acceptance policy to every source

requirement and check. Mandatory criteria remain in scope; unavailable checks

use Unverified disclosures, and optional diagnostics remain advisory. Record

actual command results and exact missing evidence. Isolated implementation tests

must proceed independently of any separately authorized production operation.

If the user provides a specific spec.md or feature directory, use it and discover sibling artifacts from that directory when present.

To discover any active feature directory or optional derived context, run the prerequisite script from the repository root in paths-only mode. This discovery is non-blocking and must not replace an already selected source-direct, issue-brief, spec.md, or feature-directory baseline:

.specify/scripts/bash/check-prerequisites.sh --json --paths-only

If it succeeds, parse FEATURE_DIR, then discover whichever sibling artifacts exist:

If discovery fails because no active feature exists, the feature directory is absent, or derived artifacts such as plan.md or tasks.md are missing, continue with any usable selected baseline already available. Derived-artifact discovery failure is not itself a verification failure.

If shell arguments contain single quotes, use shell-safe escaping such as 'I'\''m Groot', or double quotes when possible.

Workspace Projection Preflight

Before running full-suite verification commands, ensure the repository view is not contaminated by a MoonMind active skill projection:

test ! -L .agents/skills
test ! -L .gemini/skills
test ! -e skills_active || test -L skills_active
git status --porcelain -- .agents/skills .gemini/skills skills_active

If .agents/skills or .gemini/skills is an active projection symlink, repair the checkout view before running full-suite evidence. Prefer restoring the tracked repository files or using a clean reclone/worktree. If repair is not possible in the current runtime, stop with verdict BLOCKED, include the diagnostic ENVIRONMENT_CONTAMINATED_BY_SKILL_PROJECTION, set recoverableInCurrentRuntime: false, set recommendedNextAction: blocked, and do not report NO_DETERMINATION merely because MoonMind's active projection masked tracked skill files.

Real repo-authored .agents/skills directories are valid source input and must not be deleted, moved, or treated as the active selected skill snapshot.

Load Verification Sources

In source-direct verification mode, read:

In MoonSpec feature-directory mode, read when present:

Do not use copied source requirement text in spec.md as evidence that behavior exists.

In issue-brief verification mode, read:

Do not use the issue brief, assessment, or generated handoff text as evidence that behavior exists.

Canonical Claim Coverage

When a canonical source document is present, report first-class Canonical Claim Coverage over stable canonical claims from that source while preserving the existing Source Document Drift section.

Build the claim inventory from the canonical source document's stable claim headings and durable claim anchors, such as DOC-REQ-*, CONTRACT-*, INV-*, NON-GOAL-*, QUALITY-*, and TEST-*. Use temporary DESIGN-REQ-* values only as source-issue traceability, not as stable canonical claim IDs. Preserve source issue traceability or related coverage IDs when the canonical document provides it, but do not treat traceability prose as proof of behavior.

For each in-scope canonical claim, classify the result with separate fields for:

Each claim row must include evidence or a source-linked Unverified disclosure in these fields:

Classify gaps separately:

Record source drift in the report; required in-scope documentation corrections are ordinary remaining implementation work.

Use durable evidence references instead of pasting large source, code, test, artifact, or log content into the report.

Verification Inventory

Build an internal inventory before inspecting code:

For each row, track:

Inspect Evidence

Persist the inventory in the verification artifact instead of leaving it only in

agent context. Each row carries a stable requirement ID, the production boundary,

executable check commands, required capability, expected terminal evidence and

the exact candidate commit or checkpoint. In issue-brief mode, reuse the

assessment requirements verification map; fill missing historical entries from

visible source requirements before executing checks. Never change acceptance

scope to fit the available environment.

Apply the acceptance policy's setup recovery and attempt accounting. Persist

readiness, setup actions, original errors, and resume commands with the inventory;

reuse supplied history and honor the owning workflow's limits. Missing historical

setup records do not establish exhausted attempts or prevent safe repository

fixes. Use available repository and managed container capabilities before

classifying a controlling dependency as unavailable. Preserve the same saved

candidate on infrastructure failures and distinguish evidence retry from code

remediation. Do not repeat an unchanged rejected setup. Browser tooling follows

the browser-independent defaults below and is never an implicit prerequisite.

Inspect production code before tests so behavior is verified directly.

Use repository search to find:

Evidence rules:

Run Verification Commands

Run commands when available and safe:

Record exact command results as PASS, FAIL, or NOT RUN.

Follow the repository's managed-agent test boundary when AGENTS.md defines

one. Before running tests, inspect that guidance for the documented managed-run

signal and required delegated test command. When the current workspace meets

that signal, confirm the required command is available and route every covered

test through it. Do not run an equivalent host-local test command or install a

test runner into the agent host; results from a path the repository forbids are

invalid verification evidence. A missing host-local runner does not make a

test unavailable while the documented delegated capability exists. If that

capability is missing or rejects the job, preserve its explicit evidence and

classify the environment according to AGENTS.md.

Browser-independent verification

Apply the acceptance policy's browser-independent defaults in every mode. Browser

checks are optional diagnostics unless the controlling source, caller, or

applicable root or scoped AGENTS.md instructions explicitly require a browser

acceptance gate or human visual signoff for this verification run. Preserve that

explicit authority. Merely naming a browser suite in guidance or generic docs

does not make it an acceptance requirement. Missing browsers, Playwright,

browser installation, screenshots, live UI access, or human visual review must never

block the default verifier or fail its workflow. Record unavailable browser

checks as advisory NOT RUN; do not put them in Remaining Work or choose a

non-passing verdict or stop action solely for that reason.

Use executed server/API, client-contract, component, and other non-browser

integration checks to prove the same requested behavior across its real

producers and consumers. Reuse valid candidate-bound evidence where available.

Keep functional defects and missing controlling non-browser evidence actionable;

passing unit helpers alone do not prove an end-to-end requirement. Describe

visual diagnostic limits honestly without requiring a browser to close them.

Discover Docker Test Options

In every verification mode, inspect the repository's testing documentation,

test scripts, build targets, CI jobs, Dockerfiles, and Compose files for Docker

build and test paths relevant to the changed area. Follow references from

AGENTS.md and README to the actual testing playbook and entrypoint; a mention

of CI or an absent local compiler is not enough to classify a check as unavailable.

Use an applicable testing Skill if it is in the resolved active snapshot at

$MOONMIND_ACTIVE_SKILLS_DIR; outside a managed run, use the host's available

Skills and repository conventions. If no testing Skill is selected, continue

discovery from repository documentation and scripts without broadening or

mutating the active Skill set. Keep repository-specific commands and image

choices in those sources, not in this verifier.

Distinguish the agent's local tools from its authorized execution substrate.

In MoonMind, inspect the exposed container tool contract and CLI help, and use

the repository's managed test entrypoint or

moonmind container run --spec <job.json> --request-id <stable-phase-id>

with a job specification derived from documented test commands and approved

image sources. The API-owned Docker Backend supplies the daemon and toolchain;

neither a local Docker executable nor a daemon socket in the agent is required.

Outside MoonMind, use documented Docker or Compose test commands when the host

authorizes direct Docker access. Preserve test isolation, workspace access

policy, bounded resources, and cleanup in either host. Do not bypass the managed

boundary, guess image references, provision credentials, or alter deployment

configuration to make a test runnable.

For generic jobs, persist a stable request ID for the verification phase,

candidate revision or workspace checkpoint, and workload specification. Reuse

that ID when retrying the same job after a client timeout or continuation;

recover the existing job and its terminal evidence instead of creating another

submission identity. Use a new ID when the candidate, phase, or workload changes.

When an applicable authorized container path exists, attempt the targeted build

or test and inspect its terminal result and logs. CLI help, a submitted job ID,

static checks, and a process wrapper's success are not test completion evidence.

For a missing prerequisite, record the owning service's readiness/admission

diagnostic or the explicit missing capability, image configuration, or authority

that prevents submission. A missing local toolchain, an unselected testing Skill,

or a previous report's environment claim alone does not establish that Docker

testing is unavailable. Do not repeat an unchanged rejected request; complete

independent checks and preserve its evidence for the handoff.

Record the discovered entrypoint, execution substrate, exact command, candidate

revision or workspace checkpoint, terminal job/test result and log/artifact refs,

or the concrete pre-submission blocker in Test Results and Diagnostics. Complete

this discovery before using NOT RUN, recoverableInCurrentRuntime: false,

needs_human, or blocked on the grounds that build or test tooling is unavailable.

Use NOT RUN with exact owning-boundary failure evidence after attempting supported, authorized setup and execution paths.

Use the acceptance policy when interpreting unavailable assets,

services, credentials, or tooling. A mandatory criterion still out of reach is

Unverified; optional diagnostics are advisory limitations.

Classify Items

Use these statuses:

Rules:

Verdict

Choose exactly one verdict:

Prefer ADDITIONAL_WORK_NEEDED over NO_DETERMINATION when a concrete missing code or test gap is visible. Use BLOCKED only for environment failures; it says nothing about implementation completeness.

Do not choose a blocking verdict solely because advisory validation cannot run.

Use FULLY_IMPLEMENTED when the acceptance policy is satisfied, including when

some criteria are Unverified because they are outside the verifier's reach.

Missing evidence the verifier can still obtain uses NO_DETERMINATION with an

evidence retry. Use needs_human only for an actual human-owned authority or

information decision. These stopping verdicts preserve uncertainty about

completeness; they are not assertion failures.

When the verdict is ADDITIONAL_WORK_NEEDED, include a structured Remaining Work section that remediation steps can consume. Each item must identify:

Distinguish implementation gaps from verification gaps:

Emit concrete remainingWork for every ADDITIONAL_WORK_NEEDED result. Each item must be bounded enough for a remediation step to act on without reinterpreting the whole report.

Continuation Decision

Include the continuation decision and its evidence in the report. When structured

JSON is requested, use recommendedNextAction and

recoverableInCurrentRuntime alongside verdict and remainingWork:

reattempt_current_step, needs_human, or blocked.

Correct the inconsistent verdict or action using the evidence; do not expect

the caller to silently replace a contradictory decision with a default.

work is bounded, authorized, and executable by a separate remediation step.

The verifier remains read-only; it must not rerun itself to implement the fix.

verification attempt can obtain different controlling evidence.

blocked when no authorized execution path can currently proceed. Explain

what must change and preserve the evidence and concrete remaining work.

Before requesting another attempt, identify the concrete change or controlling

check that an authorized remediation step can actually execute. Distinguish

repository work from prerequisites such as a missing container-test capability,

or live deployment access. Complete feasible

repository work; criteria that remain out of the verifier's reach are

Unverified, so once only those remain, return FULLY_IMPLEMENTED. Do not spend

another attempt repeating a check that cannot run here.

Unverified does not grant permission. An actual missing authorization or operator

decision needed to act on the selected operation remains a needs_human handoff;

do not perform that action or report its authorized completion until supplied.

For an assessment or plan row marked needs_human, use verification row status

NO_DETERMINATION and recommendedNextAction: needs_human, preserving the exact

decision, owner, and action. Do not copy needs_human into the acceptance row status. Do not invent an

authority gate from unavailable deployment evidence, physical testing, or test

signoff: those remain Unverified disclosures when outside the verifier's reach.

Separately scoped release approvals do not gate implementation completion.

Keep Unverified criteria visible in the report and handoff with their reason and

who could verify them. Missing test tooling is an environment limitation, not

proof that an implementation or assertion failed.

An explicit needs_human or blocked decision for ADDITIONAL_WORK_NEEDED or

NO_DETERMINATION stops automatic verifier retry and implementation remediation.

It does not discard verified progress or authorize publication; the caller's

existing publication policy governs any draft or checkpoint handoff. The caller

owns plan-node routing and must honor this stop decision without substituting a

retry merely because budget remains. Never encode a remediation node, publication

node, or pull request destination in recommendedNextAction.

recoverableInCurrentRuntime describes the current verifier's ability to recover;

false alone is not a stop decision. A read-only verifier can identify work that

a separate authorized remediation step can complete. If the action is omitted,

the caller retains its verdict-based default; omission is not an explicit stop.

Evidence binding

For current structured judgments of every verdict, include validatedRefs.acceptance using the complete

acceptance/v1 contract in the acceptance policy.

Capture subject and scope before checks and confirm content is unchanged afterward.

Preserve source/base identity separately. Bind each mandatory requirement to actual

command/artifact evidence or a valid Unverified disclosure: stable requirementId,

status: UNVERIFIED, nonblank unverified.reason and unverified.verifiableBy,

and no evidence refs. A dirty workspace needs its content digest or durable

checkpoint; never use HEAD alone. Report candidate success separately from target

completion. Do not overwrite the initial assessment with this later result.

Report

Return a Markdown report in the response. Do not write a file unless the user explicitly asks for one.

Use this structure:

# MoonSpec Verification Report

**Feature**: [name or spec path]
**Spec**: [absolute path]
**Original Request Source**: spec.md `Input`
**Verdict**: FULLY_IMPLEMENTED | ADDITIONAL_WORK_NEEDED | NO_DETERMINATION | BLOCKED
**Confidence**: HIGH | MEDIUM | LOW

## Test Results

| Suite | Command | Result | Notes |
|-------|---------|--------|-------|
| Unit | [command] | PASS/FAIL/NOT RUN | [notes] |
| Integration | [command] | PASS/FAIL/NOT RUN | [notes] |

## Requirement Coverage

| Requirement | Evidence | Status | Notes |
|-------------|----------|--------|-------|
| FR-001 | [file/test/reference] | VERIFIED/PARTIAL/MISSING/CONFLICT/UNVERIFIED/NO_DETERMINATION | [notes] |

## Acceptance Scenario Coverage

| Scenario | Evidence | Status | Notes |
|----------|----------|--------|-------|

## Story Scope, Principles, And Source Claim Coverage

| Item | Evidence | Status | Notes |
|------|----------|--------|-------|
| DOC-REQ-001 / AGENTS.md principle | [file/test/reference] | VERIFIED/PARTIAL/MISSING/CONFLICT/UNVERIFIED/NO_DETERMINATION | [notes] |

## Canonical Claim Coverage

| Claim | Code Evidence | Test Evidence | Artifact Evidence | Implementation Status | Verification Status | Drift Status | Gap Reason |
|-------|---------------|---------------|-------------------|-----------------------|---------------------|--------------|------------|
| DOC-REQ-001 | [file:line or symbol] | [test path/name or command] | [artifact/ref] | VERIFIED/PARTIAL/MISSING/CONFLICT/UNVERIFIED/NO_DETERMINATION | VERIFIED/PARTIAL/MISSING/CONFLICT/UNVERIFIED/NO_DETERMINATION | NONE/POSSIBLE_DOC_DRIFT/DEFINITE_DOC_DRIFT | [clear reason or empty when fully evidenced] |

## Original Request Alignment

- [Pass/fail summary against the verbatim original request]

## Source Document Drift

| Doc Claim | Observed Behavior | Evidence | Severity |
|-----------|-------------------|----------|----------|
| [docs/ path + claim] | [verified behavior] | [file/test/reference] | definite/possible |

## Unverified Criteria

| Criterion | Reason | Verifiable By |
|-----------|--------|---------------|

## Gaps

- [Blocking gaps first]

## Remaining Work

- [Ordered, concrete code or test changes required before completion]

For source-direct verification mode, set:

- **Feature**: concise source scope or declarative document path
- **Spec**: N/A (source-direct verification mode)
- **Original Request Source**: original instructions or absolute declarative document path

For issue-brief verification mode, set:

- **Feature**: issue reference
- **Spec**: N/A (issue-brief verification mode)
- **Original Request Source**: issue brief artifact path

Use this structured form for each Remaining Work item:

Gap Type: implementation | verification | documentation | environment

Remaining Work: [bounded work]

Suggested Evidence: [files, tests, commands, or artifact refs]

Recoverable In Current Runtime: true | false


## Decision

- Recommended Next Action: advance | reattempt_current_step | needs_human | blocked
- Recoverable In Current Runtime: true | false
- [Final recommendation and smallest credible next step if not complete]

Keep the report evidence-backed and concise. Cite file paths and line numbers when possible.

Post-Verify Hooks

After reporting, check .specify/extensions.yml for hooks.after_verify using the same parsing, filtering, and condition rules as pre-verify hooks. For each executable hook:

## Extension Hooks

**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}

Prompt: {prompt}
To execute: `/{command}`
## Extension Hooks

**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}

If no hooks are registered or .specify/extensions.yml does not exist, skip silently.

Key Rules

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.