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.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- sdd-adrSkill
- sdd-implementSkill
- sdd-initSkill
- sdd-iterateSkill
- sdd-monitorSkill
- sdd-planSkill
- sdd-reviewSkill
- sdd-runSkill
- sdd-specSkill
- sdd-standupSkill
- sdd-statusSkill
- sdd-triageSkill
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
- Very specific: line 26
Use --auto when invoking from Mission Runner, CI, or any non-interactive context.
- Distinctive: line 33
Interactive mode (default): ask the operator which to use.
- Distinctive: line 35
If none found, report an error and exit non-zero.
- Very specific: line 37
If the story ID is not found in userStories, exit non-zero with: Error: story "{id}" not found in {prd.json path}.
- Very specific: line 42
Read the story's uxAcceptanceCriteria and assertion_ids fields.
- Very specific: line 43
If BOTH are missing or empty, exit non-zero with: Error: story "{id}" has neither uxAcceptanceCriteria nor assertion_ids in {prd.json path}.
- Very specific: line 49
Read the spec file at prd.json.specPath.
- Very specific: line 51
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).
- Very specific: line 54
If ux_test: is required or optional: continue.
- Very specific: line 59
Read .sdd/ux-test.yaml relative to repoRoot.
- Very specific: line 60
If the file is missing: exit non-zero with: Error: .sdd/ux-test.yaml not found at {repoRoot}/.sdd/ux-test.yaml.
- Very specific: line 62
If the file is present but invalid YAML or missing required fields: exit non-zero with: Error: .sdd/ux-test.yaml at …
- Very specific: line 69
Read specRequirements[0] from the story as specRequirementId (the stable traceability ID).
- Very specific: line 90
Read {runPath}/feedback.md and print the first paragraph as a one-line summary.
- Very specific: line 91
Update prd.json: increment attempts for the story.
- Very specific: line 150
When the story declares an assertion_id that has no entry in the map, the agent emits a manifest item with:
- Distinctive: line 194
Every error message names the specific failure case and the file checked.
≈ “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.
Files
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.jsonfiles 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.jsonfiles exist inspec/active/, exit non-zero withError: --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_idlisted on the story has no entry in the consuming repo's coverage map (see §8 below), the validator agent emitsverdict: "unable-to-test"for that assertion withverdict_notespointing attests/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--automode, the sidecar is the primary consumable for the Mission Runner. Path:<repoRoot>/.sdd/ux-runs/STORY-{N}/run-{ts}/manifest.json.
- §1 multi-PRD disambiguation: if multiple
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.jsoninspec/active/. If multiple exist:- Interactive mode (default): ask the operator which to use.
- Autonomous mode (
--auto): exit non-zero withError: --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
uxAcceptanceCriteriaandassertion_idsfields. - 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:isskipor 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:isrequiredoroptional: continue.
4. Read and validate .sdd/ux-test.yaml
- Locate
repoRootfrom the prd.json (top-levelrepoRootfield). - Read
.sdd/ux-test.yamlrelative torepoRoot. - 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 ofmac2,playwright,windows-stub),appLaunchCommand.
5. Resolve run path
- Read
specRequirements[0]from the story asspecRequirementId(the stable traceability ID). - Construct the run path:
{repoRoot}/.sdd/ux-runs/STORY-{specRequirementId}/run-{ISO timestamp}/where ISO timestamp isnew Date().toISOString()with colons replaced by hyphens. - Create the directory.
6. Invoke sdd-ux-validator agent
- Delegate to the
sdd-ux-validatoragent via the Task tool with:- The full story object (id, title, uxAcceptanceCriteria, assertion_ids, uxTestIsolation if present)
- The PRD's top-level
assertionsarray (filtered or unfiltered — the agent filters internally to assertions whoseidappears in the story'sassertion_ids). Pass the full corpus fromprd.json.assertions ?? []. When the PRD lacks anassertionsfield (Conflict 2 grandfather — legacy PRD), pass an empty array; the agent falls back to the legacy uxAcceptanceCriteria path automatically. - The resolved
.sdd/ux-test.yamlconfig - The resolved assertion-map (per §8 below) — the consuming repo's
assertion_id → spec filetable. The agent uses this to dispatch eachassertion_idfrom the story to the right test file. Missing entries produceverdict: "unable-to-test"for that assertion (see §8 for the full convention). - The
runPathcomputed above - Model: sonnet (per
feedback_model_delegationmemory)
- 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 emituxResultonly.
7. Print run path and summary
On success:
- Print the run path:
Run artifacts: {runPath} - Read
{runPath}/feedback.mdand print the first paragraph as a one-line summary. - Update prd.json: increment
attemptsfor the story. Do NOT setpasses: 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.tsThis 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 onunable-to-testcounts.
Output contract
The agent has populated in runPath:
manifest.json— one item per criterion or assertion, validated againsttemplates/ux/manifest.schema.json. Items emitted from the §2.9 assertion path carryverdict(pass | fail | inconclusive | unable-to-test),assertion_id, and optionalverdict_notesalongside the existing evidence fields. Legacy items (uxAcceptanceCriteria path) carryuxResultonly.criteria.json— the criteria array as-written from the storyscreenshots/{stateId}.png— one per named stateax/{stateId}.json— AX tree snapshot per named statediffs/{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:
attemptsis incremented for the story.passesis NOT automatically set — the operator must reviewfeedback.mdand the artifact bundle.
In --auto mode:
- Multi-PRD disambiguation is fail-fast (see §1).
- Missing assertion-map entries surface as
verdict: "unable-to-test"inmanifest.json(see §8). The Mission Runner reads the manifest and branches onunable-to-testcounts. - The
manifest.jsonsidecar at<repoRoot>/.sdd/ux-runs/STORY-{N}/run-{ts}/manifest.jsonis the primary consumable.
Error message reference
| Condition | Exit | Message |
| Story not found in prd.json | non-zero | Error: story "{id}" not found in {path}. Check the story ID. |
| Story has neither uxAcceptanceCriteria nor assertion_ids | non-zero | Error: 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-zero | 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.` |
| .sdd/ux-test.yaml missing | non-zero | Error: .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 fields | non-zero | Error: .sdd/ux-test.yaml at {path} is invalid — {detail}. |
--auto with multiple *.prd.json in spec/active/ | non-zero | 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. |
Every error message names the specific failure case and the file checked.
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
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.

