spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

[Feature]: UI-VERIFY task stub + browser-drive acceptance scenarios for UI-surface features

Open satwareAG-ironMike opened this issue 2 weeks ago • 5 comments

Title: [Feature]: UI-VERIFY task stub + browser-drive acceptance scenarios for UI-surface features

Component

Spec templates (BDD, Testing Strategy, etc.)

Problem Statement

The current spec-workflow templates cover capability-level acceptance ("the user can save the config") and produce code+test tasks, but nothing in SPECIFY -> TASKS -> IMPLEMENT asks for rendered-output evidence. Features with a UI surface get verified at the HTTP/API layer only, while the browser path stays unverified.

Observed in two independent production rollouts (described generically; details withheld):

  • API/contract suites fully green while the browser path was broken: multipart upload posts missing a required CSRF header - invisible to any HTTP-level test that does not reproduce the exact browser request shape.
  • A client-state defect: silent no-op on every second save - unreachable for API tests because the request/response pair is identical both times; only the rendered state diverges.
  • A permissions fatal that only manifested on the browser navigation path, caught because the run watched the browser console.

Pattern across all findings: 3 defects, 0 false positives, each proven with a capture (screenshot or network log). The blind layer is real and recurring.

Proposed Solution

Four small, conditional template additions (all opt-in, no effect on non-UI features):

  1. spec-template.md: an explicit UI Surface declaration field (include-if) plus a guidance comment: for UI-surface stories, at least one acceptance scenario's "Then" names the rendered output concretely (element labels, header texts, formatted values), never "looks correct".
  2. tasks-template.md: a conditional UI Verification task section, generated ONLY when spec.md declares a UI surface: drive the story's acceptance scenarios in a headless browser ([e.g., any browser automation CLI the project standardizes on]); assert rendered output against the scenario "Then" statements, preferring structural assertions (DOM/text) over visual judgement; a failed UI-VERIFY blocks the story Checkpoint.
  3. checklist-template.md: a conditional "UI Requirements Quality" category testing requirement QUALITY only (are expectations concrete/verifiable?), consistent with the checklist constitution's no-verification-items rule. Actual verification lives in the tasks.md stub.
  4. Findings contract (one note in the tasks template): report findings as step / expected / actual with the capture attached; one root cause = one fix; zero false positives - every claim carries its capture. UI validation outcomes fold into the existing quickstart.md validation convention; captures are archived next to the feature docs.

All wording stays tool-agnostic, following the templates' existing [e.g., ...] example style and conditional syntax (*(include if ...)*, ONLY if ...).

Use Cases

  • Any feature with rendered UI where client-state logic (toggle/save loops, upload flows, permission-gated views) must be proven in the browser, not just at the API layer.
  • Teams running automated acceptance evidence: the UI-VERIFY stub produces capture-backed outcomes next to the spec, the same role the integration suite plays for API stories.

Alternatives Considered

  • Extension-only route (a testing extension via the catalog): rejected as the sole vehicle because the gap is in the core workflow documents (spec/tasks/checklist templates) that every feature flows through; an extension cannot add conditional tasks to the standard tasks.md structure.
  • Mandating a specific browser tool: rejected; templates stay tool-agnostic.

Acceptance Criteria

  • Non-UI features generate byte-identical tasks/specs to today (the additions are strictly conditional).
  • A UI-surface feature yields a UI-VERIFY task section that blocks story completion until rendered-output assertions pass.
  • Checklist additions remain requirement-quality items only.

AI Disclosure

Drafted by an AI coding agent (OpenCode, GLM) under human direction at satwareAG; reviewed and approved by a human before submission. Field evidence anonymized to respect internal privacy boundaries.

satwareAG-ironMike avatar Nov 11 '26 11:11 satwareAG-ironMike

This would be a perfect candidate for a preset!

mnriem avatar Nov 11 '26 13:11 mnriem

Thanks @mnriem - took us straight to the right lane. We walked through the preset docs (overview, developing, publishing) and the mechanism covers everything the proposal needs:

  • The conditional UI Verification task section, the UI Surface spec field, and the UI Requirements Quality checklist category are template content - they carry over as tasks-template / spec-template / checklist-template contributions (append/wrap strategies), with the conditional *(include if ...)* syntax preserved verbatim. Non-UI features stay byte-identical.
  • On enforcement, we confirmed parity: the core workflow has no mechanical checkpoint gate, and our fork's blocking clause ("a failed UI-VERIFY blocks the story Checkpoint") is itself template instruction text - a preset preserves exactly that instruction-level enforcement, nothing is lost in translation.
  • The findings contract (step / expected / actual + capture, one root cause = one fix, zero false positives) ships inside the tasks-template contribution.

Our fork's implementation is the working reference: spec/tasks/checklist deltas + 6 contract tests in https://github.com/satwareAG/spec-kit/pull/193

We'll build the preset. One question so it lands in the right vehicle: standalone repo going through the Preset Submission issue flow (community catalog, discovery-only), or would a bundled first-party preset under presets/ via PR fit better?

AI disclosure: drafted by an AI coding agent (OpenCode, GLM) under human direction at satwareAG; reply strategy reviewed by a 5-seat AI council over 3 rounds.

satwareAG-ironMike avatar Nov 12 '26 06:11 satwareAG-ironMike

Please host the preset in your own GitHub repository. Thanks!

mnriem avatar Nov 12 '26 15:11 mnriem

Understood - thanks for the direction. The preset now lives in our own repository: https://github.com/satwareAG/spec-kit-preset-ui-verify (v0.1.0, MIT, installable via specify preset add from the pinned release archive). We will not pursue further involvement in this repository, including the community catalog.

We verified the release end-to-end against v1.4.0: install from the pinned ZIP URL, preset-layer resolution while installed, byte-parity with the source templates, and uninstall restoring core resolution.

AI disclosure: drafted by an AI coding agent (OpenCode, GLM) under human direction at satware AG.

satwareAG-ironMike avatar Nov 13 '26 05:11 satwareAG-ironMike

@satwareAG-ironMike I hope you mean that you will still update the catalog entry when you published never versions though?

mnriem avatar Nov 13 '26 16:11 mnriem