speclens-ui
v0.1.0-beta.0
Published
UI semantic governance runner with E2E evidence.
Downloads
142
Readme
SpecLens UI
SpecLens UI turns team UI standards into executable, accountable, baseline-aware semantic governance rules.
It is not a visual diff platform, accessibility engine, design system portal, or monitoring platform. It is a lightweight governance runner that attaches to real E2E scenarios and reports UI conformance issues with evidence, ownership, and baseline status.
Current Status
- Stages 1-7 are implemented and covered by
scripts/core-smoke.mjsplus the real project pilot. - Dev runtime check is implemented through
speclens-ui dev-checkfor local dev server pages. - Stage 7 was validated against
E:\Work\admin-list\apps\admin-pro-healthwith 3 real routes, baseline, CI handoff check and retrospective output.
Core Capabilities
- Rule runner with rule level override and rule options.
- Stable issue fingerprint, required issue evidence and baseline classification.
- JSON, Markdown, JUnit and CI summary reports.
- CI exit strategy, defaulting to
new-errors. - Playwright-compatible adapter and scenario runner.
- Dev runtime CLI that opens local dev pages in a real browser and writes scenario results, reports and baseline status.
- Built-in MVP UI governance rules.
- Presets, custom rules and accountable suppressions.
- Pilot JSON Schema output for manifest, scenario-results and review records.
- Pilot manifest template and validation for 3-page business project trials.
- Pilot scenario-results serialization for E2E runner handoff.
- Pilot aggregation API for 3-page business project trials.
- Pilot readiness check CLI for manifest, scenario results, report and review records.
- Pilot retrospective generation from reports and validated review records.
speclens-ui pilot-initCLI for generating a pilot manifest.speclens-ui pilot-validateCLI for pilot plan/input readiness checks.speclens-ui pilot-checkCLI for validating pilot handoff artifacts before CI or retrospective.speclens-ui pilot-reportCLI for CI report generation from serialized scenario results.speclens-ui pilot-retroCLI for retrospective Markdown generation.
CLI
Initialize local guard settings in a business project:
speclens initSmart integration
Use recommendations before editing config:
speclens init --recommend
speclens init --recommend --jsonUse diagnostics when local setup fails:
speclens doctor
speclens doctor --jsoninit --recommend prints scenario candidates only. It never writes .speclens/config.mjs.
doctor diagnoses setup health. It does not install dependencies, start dev servers, or repair config.
Run watch mode to monitor file changes and check UI in real-time:
speclens dev --watchRun one-time check for the local dev server:
speclens check --base-url http://127.0.0.1:5173Run one local development page in a real browser:
speclens-ui dev-check \
--project my-admin \
--base-url http://127.0.0.1:5173 \
--url /overview \
--headedRun a multi-page dev runtime config:
speclens-ui dev-check \
--config .speclens/speclens.dev.config.mjsUse --update-baseline only when intentionally accepting the current dev runtime result as baseline.
Performance budgets
Heavy design-review checks can be bounded with performance:
export default {
ruleProfile: 'design-review',
performance: {
ruleTimeoutMs: 5000,
maxIssuesPerRule: 50,
maxElementsPerRule: 5000,
governanceTopN: 100,
},
}Built-in heavy design rules cooperate with these budgets inside browser-side DOM scans. If a rule truncates, reports include telemetry so reviewers know the result was bounded.
Generate JSON Schema for external validation:
speclens-ui pilot-schema \
--name scenario-results \
--out .speclens/schemas/scenario-results.schema.jsonCreate a pilot manifest:
speclens-ui pilot-init \
--project my-business-app \
--out .speclens/speclens-pilot.jsonValidate pilot manifest before E2E implementation:
speclens-ui pilot-validate \
--manifest .speclens/speclens-pilot.json \
--min-scenarios 3Validate pilot input before report generation:
speclens-ui pilot-validate \
--input .speclens/scenario-results.json \
--min-scenarios 3 \
--require-ownersGenerate report artifacts and CI exit code:
speclens-ui pilot-report \
--input .speclens/scenario-results.json \
--project my-business-app \
--baseline .speclens/baseline.json \
--out .speclens/reports \
--ci-strategy new-errorsCheck pilot handoff artifacts before CI or retrospective:
speclens-ui pilot-check \
--manifest .speclens/speclens-pilot.json \
--input .speclens/scenario-results.json \
--report .speclens/reports/speclens-report.json \
--reviews .speclens/pilot-review-records.json \
--min-scenarios 3 \
--require-ownersGenerate retrospective Markdown:
speclens-ui pilot-retro \
--report .speclens/reports/speclens-report.json \
--reviews .speclens/pilot-review-records.json \
--out .speclens/reports/speclens-retrospective.mdUse --update-baseline only when intentionally accepting the current pilot result as baseline.
Documentation
- 落地方案
- 项目边界
- 架构设计
- 规则系统
- E2E 接入
- Baseline 与报告
- 任务清单
- MVP 验收
- 阶段 7 试点执行手册
- 开发运行时检查
- 本地 UI 运行时守门工具 (Local Dev Guard)
- 本地 UI 守门工具详细功能设计与任务清单
Verification
npm run build
npm run smokeThe smoke script validates core rules, baseline, reporters, Playwright adapter, dev runtime check, extension points, suppression, pilot manifest, pilot JSON Schema output, pilot scenario-results serialization, CI summary, pilot report artifacts, pilot retrospective generation, review record validation, and the dev-check, pilot-schema, pilot-init, pilot-validate, pilot-check, pilot-report and pilot-retro CLI commands.
