agentleFS
teltringhamteltringham/sdd-plugin/skills/sdd-ux-validate/SKILL.md

sdd-ux-validate

Skill0 starsChanged 8 months agoMITView on GitHub

Drive the implemented app via the configured driver, capture evidence per the story's assertion_ids (§2.9 outcome assertions), and emit per-assertion verdicts on MEASURABLE invariants. Invokes the sdd-ux-validator agent. Use after /sdd-implement when stories declare uxAcceptanceCriteria or assertion_ids.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 3 are distinctive, and 14 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 14

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use --auto when invoking from Mission Runner, CI, or any non-interactive context.

    line 26
  2. Distinctive:

    Interactive mode (default): ask the operator which to use.

    line 33
  3. Distinctive:

    If none found, report an error and exit non-zero.

    line 35
  4. Very specific:

    If the story ID is not found in userStories, exit non-zero with: Error: story "{id}" not found in {prd.json path}.

    line 37
  5. Very specific:

    Read the story's uxAcceptanceCriteria and assertion_ids fields.

    line 42
  6. Very specific:

    If BOTH are missing or empty, exit non-zero with: Error: story "{id}" has neither uxAcceptanceCriteria nor assertion_ids in {prd.json path}.

    line 43
  7. Very specific:

    Read the spec file at prd.json.specPath.

    line 49
  8. Very specific:

    If ux_test: is skip or absent (default is skip): exit non-zero with a clear error: Error: Spec opts out of ux_test (frontmatter says: skip).

    line 51
  9. Very specific:

    If ux_test: is required or optional: continue.

    line 54
  10. Very specific:

    Read .sdd/ux-test.yaml relative to repoRoot.

    line 59
  11. Very specific:

    If the file is missing: exit non-zero with: Error: .sdd/ux-test.yaml not found at {repoRoot}/.sdd/ux-test.yaml.

    line 60
  12. Very specific:

    If the file is present but invalid YAML or missing required fields: exit non-zero with: Error: .sdd/ux-test.yaml at …

    line 62
  13. Very specific:

    Read specRequirements[0] from the story as specRequirementId (the stable traceability ID).

    line 69
  14. Very specific:

    Read {runPath}/feedback.md and print the first paragraph as a one-line summary.

    line 90
  15. Very specific:

    Update prd.json: increment attempts for the story.

    line 91
  16. Very specific:

    When the story declares an assertion_id that has no entry in the map, the agent emits a manifest item with:

    line 150
  17. Distinctive:

    Every error message names the specific failure case and the file checked.

    line 194

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SDD UX Validate

Drive the implemented app, capture evidence per uxAcceptanceCriteria and the story's assertion_ids (§2.9), and write a feedback bundle with per-assertion verdicts on MEASURABLE invariants. Aesthetic invariants route to visual-review HITL — the validator does NOT grade taste, density, polish.

Arguments

$ARGUMENTS — required story ID (e.g., STORY-3). Positional.

--auto — optional flag. Replaces every interactive prompt (multi-PRD disambiguation in §1, missing-driver-prereq prompts) with fail-fast behavior so the Mission Runner can drive this skill non-interactively. Default: omitted (human-driven). See "Modes" below.

Modes

This skill runs in two modes that share §1–§7 (locate prd.json, validate story, validate spec opt-in, read driver config, resolve run path, invoke validator agent, print summary) and diverge at every operator-prompting branch:

  • Interactive (default) — §1 asks the operator to pick a PRD when multiple *.prd.json files exist; missing assertion-map entries surface as a warning the operator can elect to ignore.
  • Autonomous (--auto) — every prompt is replaced with fail-fast behavior:
    • §1 multi-PRD disambiguation: if multiple *.prd.json files exist in spec/active/, exit non-zero with Error: --auto requires exactly one *.prd.json in spec/active/. Found N: <list>. Pass the prd path explicitly via the consuming repo's wrapper or remove the extras.
    • §6 missing assertion-map entry: when an assertion_id listed on the story has no entry in the consuming repo's coverage map (see §8 below), the validator agent emits verdict: "unable-to-test" for that assertion with verdict_notes pointing at tests/visual/coverage.ts (or the configured map path). Per-assertion fail-fast is delegated to the agent and surfaced in the manifest.
    • JSON sidecar (manifest.json) is already written per §7 and the §6 manifest schema; in --auto mode, the sidecar is the primary consumable for the Mission Runner. Path: <repoRoot>/.sdd/ux-runs/STORY-{N}/run-{ts}/manifest.json.

Use --auto when invoking from Mission Runner, CI, or any non-interactive context. Default behavior is unchanged for human-driven /sdd-ux-validate.

Process

1. Locate and resolve prd.json

  • Find *.prd.json in spec/active/. If multiple exist:
    • Interactive mode (default): ask the operator which to use.
    • Autonomous mode (--auto): exit non-zero with Error: --auto requires exactly one *.prd.json in spec/active/. Found N: <list>. Pass the prd path explicitly via the consuming repo's wrapper or remove the extras.
  • If none found, report an error and exit non-zero.
  • Parse the file and identify the target story by the provided ID.
  • If the story ID is not found in userStories, exit non-zero with: Error: story "{id}" not found in {prd.json path}. Check the story ID.

2. Validate story has uxAcceptanceCriteria OR assertion_ids

  • Read the story's uxAcceptanceCriteria and assertion_ids fields.
  • If BOTH are missing or empty, exit non-zero with: Error: story "{id}" has neither uxAcceptanceCriteria nor assertion_ids in {prd.json path}. Add at least one for the validator to operate against. See spec-plugin-v1.md §2.9 for assertion_ids guidance.
  • Otherwise (one or both populated): continue. Both paths are supported and may co-exist on the same story (legacy uxAcceptanceCriteria + new §2.9 assertion_ids both produce manifest items).

3. Validate spec opt-in

  • Read the spec file at prd.json.specPath.
  • Parse the frontmatter and read the ux_test: field.
  • If ux_test: is skip or absent (default is skip): exit non-zero with a clear error: Error: Spec opts out of ux_test (frontmatter says: skip). File checked: {specPath}. Set \ux_test: required` or `ux_test: optional` in the spec frontmatter to enable.`
  • If ux_test: is required or optional: continue.

4. Read and validate .sdd/ux-test.yaml

  • Locate repoRoot from the prd.json (top-level repoRoot field).
  • Read .sdd/ux-test.yaml relative to repoRoot.
  • If the file is missing: exit non-zero with: Error: .sdd/ux-test.yaml not found at {repoRoot}/.sdd/ux-test.yaml. Create this file to configure the UX test driver.
  • If the file is present but invalid YAML or missing required fields: exit non-zero with: Error: .sdd/ux-test.yaml at {repoRoot}/.sdd/ux-test.yaml is invalid — {validation failure detail (missing required fields: driver, appLaunchCommand)}.
  • Required fields: driver (one of mac2, playwright, windows-stub), appLaunchCommand.

5. Resolve run path

  • Read specRequirements[0] from the story as specRequirementId (the stable traceability ID).
  • Construct the run path: {repoRoot}/.sdd/ux-runs/STORY-{specRequirementId}/run-{ISO timestamp}/ where ISO timestamp is new Date().toISOString() with colons replaced by hyphens.
  • Create the directory.

6. Invoke sdd-ux-validator agent

  • Delegate to the sdd-ux-validator agent via the Task tool with:
    • The full story object (id, title, uxAcceptanceCriteria, assertion_ids, uxTestIsolation if present)
    • The PRD's top-level assertions array (filtered or unfiltered — the agent filters internally to assertions whose id appears in the story's assertion_ids). Pass the full corpus from prd.json.assertions ?? []. When the PRD lacks an assertions field (Conflict 2 grandfather — legacy PRD), pass an empty array; the agent falls back to the legacy uxAcceptanceCriteria path automatically.
    • The resolved .sdd/ux-test.yaml config
    • The resolved assertion-map (per §8 below) — the consuming repo's assertion_id → spec file table. The agent uses this to dispatch each assertion_id from the story to the right test file. Missing entries produce verdict: "unable-to-test" for that assertion (see §8 for the full convention).
    • The runPath computed above
    • Model: sonnet (per feedback_model_delegation memory)
  • The agent drives the app, captures evidence per each criterion AND per each filtered assertion, and writes the artifact bundle. Per-assertion items emit verdict + assertion_id + verdict_notes (per W1b manifest schema); legacy criterion items emit uxResult only.

7. Print run path and summary

On success:

  • Print the run path: Run artifacts: {runPath}
  • Read {runPath}/feedback.md and print the first paragraph as a one-line summary.
  • Update prd.json: increment attempts for the story. Do NOT set passes: true — human review decides.

§8 — Assertion-map convention (ADR-008 Phase 4 bridge)

ADR-008 Phase 4 step 1 requires a per-repo bridge that maps each assertion_id (declared in the PRD's top-level assertions array) to the test file that asserts it. Without this map, the validator agent cannot decide which test to run for a given story's assertion_ids. This section documents the convention; the consuming repo authors the map.

Where to author the map

The map lives in the consuming repo at:

<repoRoot>/tests/visual/coverage.ts

This follows an already-shipped downstream convention (don't reinvent when a working convention exists). The map is authored by hand, NOT auto-discovered. A spec without an entry is silently skipped (verdict: unable-to-test); a wrong entry is a normal test failure.

Map shape

A TypeScript module that exports a COVERAGE array:

export interface CoverageEntry {
  /** Assertion ID as declared in the PRD's top-level `assertions` array. */
  assertionId: string;
  /** Spec file relative to tests/visual/scenarios/. */
  specFile: string;
  /** Optional — the specific test name within the spec, when a spec
   *  has multiple sub-tests covering different assertions. If absent,
   *  ALL tests in the spec run for this assertion. */
  testName?: string;
  /** Brief description for evidence JSON; should match the assertion's
   *  description from prd.json but can be shorter. */
  description: string;
}

export const COVERAGE: CoverageEntry[] = [
  // ...entries...
];

The validator agent reads this file via the runner shipped in the consuming repo (tests/visual/ux-validation-runner.ts in Outpost). The agent does NOT parse arbitrary directory layouts — the convention is one map file at the path above.

Outpost example (the canonical reference)

From outpost/tests/visual/coverage.ts (commit b502f1a, 2026-05-15):

{
  assertionId: "ASSERT-041",
  specFile: "tutorial-step-1-spotlight.spec.ts",
  description:
    "Tutorial step 1 spotlight overlaps the chat composer rect by >=50% of the composer area (fresh-install state).",
}

The story STORY-59 in Outpost's PRD declares assertion_ids: ["ASSERT-041"]. The validator dispatches to tests/visual/scenarios/tutorial-step-1-spotlight.spec.ts and rolls the per-test verdict up into the per-assertion manifest.json item.

Missing-entry behavior

When the story declares an assertion_id that has no entry in the map, the agent emits a manifest item with:

  • verdict: "unable-to-test"
  • assertion_id: "<the-id>"
  • verdict_notes: "No coverage entry for <the-id> in <repoRoot>/tests/visual/coverage.ts. Add an entry mapping this assertion to a spec file before re-running."

This makes the gap visible in the manifest rather than silently passing or hard-erroring. The Mission Runner can read the manifest, count unable-to-test items, and route to a remediation step.

Mode interaction

  • Interactive mode (default): missing-entry surfacing is informational; the operator can choose to proceed.
  • Autonomous mode (--auto): the manifest is the contract; the Mission Runner branches on unable-to-test counts.

Output contract

The agent has populated in runPath:

  • manifest.json — one item per criterion or assertion, validated against templates/ux/manifest.schema.json. Items emitted from the §2.9 assertion path carry verdict (pass | fail | inconclusive | unable-to-test), assertion_id, and optional verdict_notes alongside the existing evidence fields. Legacy items (uxAcceptanceCriteria path) carry uxResult only.
  • criteria.json — the criteria array as-written from the story
  • screenshots/{stateId}.png — one per named state
  • ax/{stateId}.json — AX tree snapshot per named state
  • diffs/{stateId}.png — pixel diff against baseline (if baseline exists)
  • comments.json — initially empty array (filled by operator review)
  • feedback.md — plain-language summary; verdict first, per-criterion sections, "Paths and artifacts" trailing

State updates to prd.json:

  • attempts is incremented for the story.
  • passes is NOT automatically set — the operator must review feedback.md and the artifact bundle.

In --auto mode:

  • Multi-PRD disambiguation is fail-fast (see §1).
  • Missing assertion-map entries surface as verdict: "unable-to-test" in manifest.json (see §8). The Mission Runner reads the manifest and branches on unable-to-test counts.
  • The manifest.json sidecar at <repoRoot>/.sdd/ux-runs/STORY-{N}/run-{ts}/manifest.json is the primary consumable.

Error message reference

ConditionExitMessage
Story not found in prd.jsonnon-zeroError: story "{id}" not found in {path}. Check the story ID.
Story has neither uxAcceptanceCriteria nor assertion_idsnon-zeroError: story "{id}" has neither uxAcceptanceCriteria nor assertion_ids in {path}. Add at least one for the validator to operate against. See spec-plugin-v1.md §2.9 for assertion_ids guidance.
Spec opts out (ux_test: skip or missing)non-zeroError: Spec opts out of ux_test (frontmatter says: skip). File checked: {specPath}. Set \ux_test: required` or `ux_test: optional` in the spec frontmatter to enable.`
.sdd/ux-test.yaml missingnon-zeroError: .sdd/ux-test.yaml not found at {path}. Create this file to configure the UX test driver.
.sdd/ux-test.yaml invalid or missing required fieldsnon-zeroError: .sdd/ux-test.yaml at {path} is invalid — {detail}.
--auto with multiple *.prd.json in spec/active/non-zeroError: --auto requires exactly one *.prd.json in spec/active/. Found N: <list>. Pass the prd path explicitly via the consuming repo's wrapper or remove the extras.

Every error message names the specific failure case and the file checked.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.