Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "ui-workflow",
"name": "dx-workflow",
"owner": {
"name": "davidxiaodev"
},
"plugins": [
{
"name": "ui-workflow",
"source": "./plugins/workflow",
"description": "Acceptance first, one design and one backend contract, enforced verification per lane (ui, api) with independent review and evidence."
"name": "dx-workflow",
"source": "./plugins/dx-workflow",
"description": "Acceptance first, one design and one backend contract, enforced verification per lane (frontend, backend) with independent review and evidence."
}
]
}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
node-version: ${{ matrix.node }}
- name: Syntax check every script
run: |
for f in plugins/workflow/scripts/*.mjs plugins/workflow/scripts/lib/*.mjs; do node --check "$f"; done
for f in plugins/dx-workflow/scripts/*.mjs plugins/dx-workflow/scripts/lib/*.mjs; do node --check "$f"; done
- name: Hooks and plugin manifests are valid JSON
run: |
for f in plugins/workflow/hooks/hooks.json plugins/workflow/.claude-plugin/plugin.json .claude-plugin/marketplace.json plugins/workflow/shared/verify.config.json; do
for f in plugins/dx-workflow/hooks/hooks.json plugins/dx-workflow/.claude-plugin/plugin.json .claude-plugin/marketplace.json plugins/dx-workflow/shared/verify.config.json; do
node -e "JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8'))" "$f" || { echo "invalid JSON: $f"; exit 1; }
done
- run: npm test
14 changes: 7 additions & 7 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Notices

ui-workflow is MIT licensed (see LICENSE). It calls, but does not include, these tools:
dx-workflow is MIT licensed (see LICENSE). It calls, but does not include, these tools:
taste-skill (MIT, Leonxlnx), ui-ux-pro-max (MIT, nextlevelbuilder), baoyu-design (mixed licence,
JimLiu; optional and never bundled).

Adapted text:

- `skills/building-consistent-ui/verify.md` and `shared/ctl.md` (formerly `functional-verify.md`)
- `skills/frontend/verify.md` and `shared/ctl.md` (formerly `functional-verify.md`)
adapt pstack's `create-verification-skill`, its visual-parity playbook and its practice of
independent review; `skills/building-reliable-backend/code-review.md` adapts pstack's
independent review; `skills/backend/code-review.md` adapts pstack's
`blast-radius`. pstack: MIT License, Copyright (c) 2026 Lauren Tan,
https://github.com/cursor/plugins/tree/main/pstack
- `skills/building-consistent-ui/build.md` adapts the UI branch of `prototype`, and
`skills/building-reliable-backend/build.md` and `code-review.md` adapt `tdd` and `code-review`, from
- `skills/frontend/build.md` adapts the UI branch of `prototype`, and
`skills/backend/build.md` and `code-review.md` adapt `tdd` and `code-review`, from
mattpocock/skills, MIT License, https://github.com/mattpocock/skills
- `skills/building-consistent-ui/design-review.md` adapts the `design-review` command from
- `skills/frontend/design-review.md` adapts the `design-review` command from
interface-design, MIT License, Copyright (c) 2026 Damola Akinleye,
https://github.com/Dammyjay93/interface-design
- `skills/building-reliable-backend/code-review.md`, `verify.md` and `build.md` adapt the `/review`
- `skills/backend/code-review.md`, `verify.md` and `build.md` adapt the `/review`
checklist and specialists and the `/verify` rules from gstack, MIT License, Copyright (c) 2026
Garry Tan, https://github.com/garrytan/gstack

Expand Down
105 changes: 50 additions & 55 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/adr/0003-checks-out-of-reach-and-bound-to-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ modify its own checks, and a review applies to one specific commit.
- **The change is everything since the base**, commits on the branch included, deletions included.
A UserPromptSubmit hook records the tree when a turn starts, so the Stop gate checks only turns
that changed content.
- **Gate modes.** `UI_WORKFLOW_GATE=enforce|observe|off`; every decision goes to `.verify/gate.log`.
- **Gate modes.** `DX_WORKFLOW_GATE=enforce|observe|off`; every decision goes to `.verify/gate.log`.
- **The scripts have tests** (`test/`, `npm test`) and CI, because they are the judge.

## Consequences
Expand All @@ -44,4 +44,4 @@ committed edit to the config becomes the base; set `VERIFY_BASE` there. Setting
written before 0.3 lack `Tree:` and must be redone. Hashing the tree costs one `git add -A` into a
temporary index per run and per stop. The guard patterns are a starting list and will need
project additions and pruning. Everything here still runs on the agent's machine, where the agent
can set `UI_WORKFLOW_GATE=off`; the authority for merges belongs in CI, which is the next step.
can set `DX_WORKFLOW_GATE=off`; the authority for merges belongs in CI, which is the next step.
38 changes: 38 additions & 0 deletions docs/adr/0005-dx-workflow-frontend-backend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 5. dx-workflow, with frontend and backend

Date: 2026-11-18 · Status: accepted

## Context

The plugin was called `ui-workflow` and its halves `building-consistent-ui` and
`building-reliable-backend`, with lanes `ui` and `api`. It had outgrown the name: half of it is
backend, and most of it is verification, review and the ratchet. The front half was named for the
look, but a front end is also state, requests and accessibility in code, and nobody reviewed that
code: the frontend reviewer only judged screenshots. "UI" also suggested web only, while the front
end includes mobile clients.

## Decision

- The plugin is `dx-workflow`; its skills are `frontend` and `backend` (shown as
`dx-workflow:frontend`, `dx-workflow:backend`). Lane kinds are `frontend` and `backend`; lanes are
named per app or service (`web`, `app`, `api`) with a `kind`.
- UI stays inside frontend: `docs/design.md`, tokens, the look screenshots and `design-review.md`
keep their names. It is not a lane of its own, because the same files are both look and logic.
- The frontend review is the design review plus a frontend `code-review.md` (state, requests and
races, forms, security, accessibility in code, performance, the backend contract, tests), in one
review file.
- Mobile is frontend: a lane with `"platform": "react-native"` (React Native, Expo) gets default
files, `rn-look.mjs` screenshots (simulators through Maestro; default, dark and large-text
variants; a dependency-free PNG diff), a React Native mode of `check-raw-styles.mjs`, Maestro
journeys, mobile review lenses and adverse cases. Native changes (`native` globs, or a new native
module in `package.json`) are merge tier 3 and a one-way door, because they ship only in a store
build. Checks that need a simulator can be `"ci": false`.
- No compatibility with earlier names: the 0.1 `.ui-verify/` migration, `UI_VERIFY_RUN_DIR` and the
upgrade notes are gone. The Stop gate variable is `DX_WORKFLOW_GATE`.

## Consequences

Projects set up before this rename key their config by `ui`/`api` and must rename lanes or add
`kind`. Only React Native / Expo is covered among mobile stacks; native iOS, Android and Flutter
would each need their own defaults, screenshot tool and lenses. `rn-look.mjs` is tested with
recorded screenshots and a dry run, not against a live simulator in CI.
2 changes: 1 addition & 1 deletion evals/cases/check-then-insert-signup/case.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lane": "api",
"lane": "backend",
"kind": "bug",
"request": "Sign-up must never create two accounts for the same email.",
"acceptance": [
Expand Down
2 changes: 1 addition & 1 deletion evals/cases/clean-pagination-clamp/case.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lane": "api",
"lane": "backend",
"kind": "clean",
"request": "Cap the page size of GET /products at 100 and default it to 20.",
"acceptance": [
Expand Down
2 changes: 1 addition & 1 deletion evals/cases/clean-rename-with-tests/case.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lane": "api",
"lane": "backend",
"kind": "clean",
"request": "Rename calcTotal to orderTotal everywhere; no behaviour change.",
"acceptance": [
Expand Down
2 changes: 1 addition & 1 deletion evals/cases/idor-order-lookup/case.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lane": "api",
"lane": "backend",
"kind": "bug",
"request": "Add GET /orders/:id so a signed-in customer can see one of their orders.",
"acceptance": [
Expand Down
2 changes: 1 addition & 1 deletion evals/cases/swallowed-payment-error/case.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lane": "api",
"lane": "backend",
"kind": "bug",
"request": "Charge the card when an order is placed; the customer must see an error if the charge fails.",
"acceptance": [
Expand Down
4 changes: 2 additions & 2 deletions evals/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Reviewer evals: does code-review.md find known bugs, and does it leave clean changes alone?
//
// node evals/run.mjs prepare <case> [--out <dir>] build the case as a project, run the checks, write the brief
// node evals/run.mjs score <dir> <case> score the .verify/review-api.md a reviewer wrote there
// node evals/run.mjs score <dir> <case> score the .verify/review-backend.md a reviewer wrote there
// node evals/run.mjs all [--reviewer "<command>"] [--case <name>]
//
// `all` prepares every case; with --reviewer it runs the command in each project with the brief on
Expand All @@ -21,7 +21,7 @@ import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";

const HERE = dirname(fileURLToPath(import.meta.url));
const SCRIPTS = resolve(HERE, "../plugins/workflow/scripts");
const SCRIPTS = resolve(HERE, "../plugins/dx-workflow/scripts");
const CASES = join(HERE, "cases");
const GIT_ENV = { GIT_AUTHOR_NAME: "eval", GIT_AUTHOR_EMAIL: "eval@example.com", GIT_COMMITTER_NAME: "eval", GIT_COMMITTER_EMAIL: "eval@example.com", GIT_CONFIG_GLOBAL: "/dev/null", GIT_CONFIG_NOSYSTEM: "1" };
const TESTS = "for f in test/*.test.mjs; do node \"$f\" || exit 1; done";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "ui-workflow-dev",
"name": "dx-workflow-dev",
"private": true,
"type": "module",
"description": "Tests for the ui-workflow plugin's scripts. The plugin itself has no dependencies.",
"description": "Tests for the dx-workflow plugin's scripts. The plugin itself has no dependencies.",
"engines": {
"node": ">=20"
},
Expand Down
23 changes: 23 additions & 0 deletions plugins/dx-workflow/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "dx-workflow",
"version": "0.5.0",
"description": "Front-end and back-end changes you can trust: acceptance criteria first, a design contract and a backend contract, checks per lane (frontend on the web or React Native / Expo, backend) including a negative check, independent review, an evidence pack with a computed merge tier, and a Stop gate. Checks are read from the base commit, runs and reviews are bound to a content hash, and changes to the checks themselves are tier 3.",
"author": {
"name": "davidxiaodev"
},
"license": "MIT",
"keywords": [
"design-system",
"frontend",
"backend",
"verification",
"acceptance",
"code-review",
"playwright",
"react-native",
"expo",
"maestro",
"tokens",
"migrations"
]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
// arbitrary values (p-[13px], bg-[#fff]) and literal colours in style objects.
//
// node check-raw-styles.mjs <dir|file>... [--tokens <file>]... [--allow <path-substring>]... [--json]
// [--platform web|react-native] [--spacing-scale 0,4,8,12,16,24,32]
//
// --platform react-native (React Native, Expo; NativeWind classes are checked as on the web) adds:
// colour literals in any *Color / color style key or prop (StyleSheet and JSX: color="#fff",
// placeholderTextColor="gray"), and fontSize / fontFamily / lineHeight literals. --spacing-scale also
// flags padding, margin and gap numbers that are not on the scale.
//
// Token files (where raw values belong) are skipped: globals.css, variables.css, tailwind.config.*,
// plus every --tokens path. Exit 0 = clean, 1 = findings, 2 = usage error.
// theme / tokens / colors / typography / spacing .ts|.js|.json, plus every --tokens path.
// Exit 0 = clean, 1 = findings, 2 = usage error.
import { readdirSync, readFileSync, statSync } from "node:fs";
import { extname, join, relative, resolve, basename } from "node:path";

Expand All @@ -14,23 +21,28 @@ const roots = [];
const tokens = [];
const allow = [];
let asJson = false;
let platform = "web";
let spacingScale = null;
for (let i = 0; i < args.length; i++) {
const a = args[i];
if (a === "--tokens") tokens.push(resolve(args[++i] ?? ""));
else if (a === "--allow") allow.push(args[++i] ?? "");
else if (a === "--json") asJson = true;
else if (a === "--platform") platform = args[++i] ?? "";
else if (a === "--spacing-scale") spacingScale = new Set((args[++i] ?? "").split(",").map((n) => Number(n.trim())));
else if (a === "-h" || a === "--help") usage(0);
else roots.push(a);
}
if (roots.length === 0) usage(2);
if (roots.length === 0 || !["web", "react-native"].includes(platform)) usage(2);

const EXTS = new Set([".tsx", ".jsx", ".ts", ".js", ".vue", ".svelte", ".html", ".css", ".scss"]);
const SKIP_DIRS = new Set(["node_modules", ".git", ".next", "dist", "build", "out", ".turbo", "coverage", ".expo", "ios", "android"]);
const TOKEN_NAMES = [/^globals\.css$/, /^variables\.css$/, /^tailwind\.config\.[cm]?[jt]s$/, /^tokens?\.(css|json|ts)$/];
const TOKEN_NAMES = [/^globals\.css$/, /^variables\.css$/, /^tailwind\.config\.[cm]?[jt]s$/, /^(?:tokens?|theme|colou?rs|typography|spacing)\.(?:css|json|[cm]?[jt]s)$/];
const NAMED = "white|black|red|green|blue|yellow|orange|purple|pink|gray|grey|silver|navy|teal|maroon|olive|lime|aqua|fuchsia";
const PALETTE = "slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose";
const UTIL = "bg|text|border|ring|fill|stroke|from|to|via|outline|decoration|shadow|divide|placeholder|accent|caret";

const RULES = [
const WEB_RULES = [
{
id: "palette-class",
re: new RegExp(`(?<![\\w-])(?:[a-z]+:)*(?:${UTIL})-(?:${PALETTE})-\\d{2,3}(?:\\/\\d+)?(?![\\w-])`, "g"),
Expand All @@ -53,6 +65,23 @@ const RULES = [
},
];

const RN_RULES = [
{
id: "rn-literal-colour",
re: new RegExp(`\\b(?:[a-z][A-Za-z]*Color|color|tint)\\s*[:=]\\s*\\{?\\s*['"\`]\\s*(?:#[0-9a-fA-F]{3,8}|rgba?\\(|hsla?\\(|(?:${NAMED})\\b)`, "g"),
fix: "Use a colour from the theme (theme.colors.primary, a useTheme() value or a NativeWind token class) so dark mode and brand changes reach it.",
},
{
id: "rn-font-literal",
re: /\b(?:fontSize|lineHeight)\s*:\s*\d+(?:\.\d+)?|\bfontFamily\s*:\s*['"`][^'"`]*/g,
fix: "Use a text style from the typography tokens (a <Text variant> or theme.text.body); one-off sizes break the type scale and Dynamic Type.",
},
];
const SPACING = /\b(?:padding|margin)(?:Top|Bottom|Left|Right|Horizontal|Vertical|Start|End)?\s*:\s*(-?\d+(?:\.\d+)?)\b|\b(?:gap|rowGap|columnGap)\s*:\s*(\d+(?:\.\d+)?)\b/g;

const RULES = platform === "react-native" ? [...WEB_RULES.filter((r) => r.id !== "literal-colour"), ...RN_RULES] : WEB_RULES;
if (spacingScale) RULES.push({ id: "off-scale-spacing", re: SPACING, fix: `Use the spacing scale (${[...spacingScale].join(", ")}) or a theme spacing value.` });

const findings = [];
for (const r of roots) walk(resolve(r));

Expand Down Expand Up @@ -97,6 +126,7 @@ function walk(p) {
for (const m of text.matchAll(rule.re)) {
if (text[m.index + m[0].length] === ":") continue;
if (rule.id === "arbitrary-value" && isAllowedArbitrary(m[0])) continue;
if (rule.id === "off-scale-spacing" && spacingScale.has(Math.abs(Number(m[1] ?? m[2])))) continue;
findings.push({ rule: rule.id, file: rel, line: i + 1, match: m[0] });
}
}
Expand All @@ -117,6 +147,6 @@ function isAllowedArbitrary(token) {
}

function usage(code) {
console.error("usage: node check-raw-styles.mjs <dir|file>... [--tokens <file>]... [--allow <path-substring>]... [--json]");
console.error("usage: node check-raw-styles.mjs <dir|file>... [--tokens <file>]... [--allow <path-substring>]... [--json] [--platform web|react-native] [--spacing-scale 0,4,8,…]");
process.exit(code);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//
// ## C3 Old saved sessions still load
// - when: path `src/session/**` or diff `/schemaVersion|MessageType/`
// - lanes: api
// - lanes: backend
// - check: load a transcript written by the previous release; new fields need a default.
// - source: incident 2026-10-02, PR #412
//
Expand Down
Loading
Loading