@hxp-tools/godplans 0.0.0-stage → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1202 -0
- package/LICENSE +21 -0
- package/PROMPT.md +4006 -0
- package/README.md +245 -2
- package/bin/godplans.js +93 -0
- package/docs/ARCHITECTURE.md +136 -0
- package/docs/RELEASING.md +107 -0
- package/docs/assets/badge-approved.svg +12 -0
- package/docs/assets/badge-done.svg +11 -0
- package/docs/assets/badge-graded.svg +12 -0
- package/docs/assets/badge-validated.svg +10 -0
- package/docs/assets/hero.svg +37 -0
- package/docs/assets/quest-map.svg +53 -0
- package/evals/README.md +295 -0
- package/evals/cases/brownfield-cli/EXPECTATIONS +15 -0
- package/evals/cases/brownfield-cli/INPUT/package.json +9 -0
- package/evals/cases/brownfield-cli/INPUT/src/cli.js +4 -0
- package/evals/cases/brownfield-cli/INPUT/src/format.js +3 -0
- package/evals/cases/brownfield-cli/INPUT/test/cli.test.js +7 -0
- package/evals/cases/brownfield-cli/REQUEST.baseline.md +10 -0
- package/evals/cases/brownfield-cli/REQUEST.md +10 -0
- package/evals/cases/compliance-refusal/EXPECTATIONS +4 -0
- package/evals/cases/compliance-refusal/REQUEST.baseline.md +9 -0
- package/evals/cases/compliance-refusal/REQUEST.md +8 -0
- package/evals/cases/greenfield-saas/EXPECTATIONS +21 -0
- package/evals/cases/greenfield-saas/REQUEST.baseline.md +11 -0
- package/evals/cases/greenfield-saas/REQUEST.md +11 -0
- package/evals/cases/nested-pillars/EXPECTATIONS +12 -0
- package/evals/cases/nested-pillars/REQUEST.baseline.md +10 -0
- package/evals/cases/nested-pillars/REQUEST.md +11 -0
- package/evals/cases/observability-evidence/EXPECTATIONS +10 -0
- package/evals/cases/observability-evidence/REQUEST.baseline.md +10 -0
- package/evals/cases/observability-evidence/REQUEST.md +11 -0
- package/evals/cases/product-business/EXPECTATIONS +18 -0
- package/evals/cases/product-business/REQUEST.baseline.md +13 -0
- package/evals/cases/product-business/REQUEST.md +14 -0
- package/evals/cases/product-form-routing/EXPECTATIONS +13 -0
- package/evals/cases/product-form-routing/REQUEST.baseline.md +11 -0
- package/evals/cases/product-form-routing/REQUEST.md +11 -0
- package/evals/cases/prose-integrity/EXPECTATIONS +19 -0
- package/evals/cases/prose-integrity/REQUEST.baseline.md +19 -0
- package/evals/cases/prose-integrity/REQUEST.md +20 -0
- package/evals/cases/replan-preserves-history/EXPECTATIONS +9 -0
- package/evals/cases/replan-preserves-history/INPUT/.godplans/PLAN.mdx +115 -0
- package/evals/cases/replan-preserves-history/INPUT/package.json +5 -0
- package/evals/cases/replan-preserves-history/REQUEST.baseline.md +10 -0
- package/evals/cases/replan-preserves-history/REQUEST.md +10 -0
- package/evals/cases/stale-prepublication/EXPECTATIONS +10 -0
- package/evals/cases/stale-prepublication/REQUEST.baseline.md +12 -0
- package/evals/cases/stale-prepublication/REQUEST.md +13 -0
- package/evals/cases/stale-source-evidence/EXPECTATIONS +10 -0
- package/evals/cases/stale-source-evidence/INPUT/package.json +8 -0
- package/evals/cases/stale-source-evidence/REQUEST.baseline.md +11 -0
- package/evals/cases/stale-source-evidence/REQUEST.md +12 -0
- package/evals/cases/weekend-library/EXPECTATIONS +19 -0
- package/evals/cases/weekend-library/REQUEST.baseline.md +10 -0
- package/evals/cases/weekend-library/REQUEST.md +11 -0
- package/evals/cases-roster.txt +19 -0
- package/evals/external/GRADE.schema.json +39 -0
- package/evals/external/README.md +42 -0
- package/evals/external/RUBRIC.md +32 -0
- package/evals/metrics/context-cost.json +154 -0
- package/evals/outcomes/README.md +65 -0
- package/evals/outcomes/cases/tenant-notes-api/REQUEST.baseline.md +14 -0
- package/evals/outcomes/cases/tenant-notes-api/REQUEST.md +13 -0
- package/evals/outcomes/cases/tenant-notes-api/VERIFY.sh +13 -0
- package/evals/outcomes/results/2026-07-23-tenant-notes-api-codex/README.md +93 -0
- package/evals/outcomes/results/2026-07-23-tenant-notes-api-codex/treatment/plan/PLAN.json +547 -0
- package/evals/runners/claude-baseline.sh +4 -0
- package/evals/runners/claude-grade.sh +3 -0
- package/evals/runners/claude.sh +4 -0
- package/evals/runners/codex-baseline.sh +181 -0
- package/evals/runners/codex-builder.sh +96 -0
- package/evals/runners/codex-godaudits.sh +84 -0
- package/evals/runners/codex.sh +147 -0
- package/evals/runners/gemini-baseline.sh +4 -0
- package/evals/runners/gemini-grade.sh +3 -0
- package/evals/runners/gemini.sh +4 -0
- package/evals/runners/vendor-cli.sh +257 -0
- package/evals/runners/vendor-grade.sh +82 -0
- package/install.sh +323 -0
- package/package.json +91 -4
- package/requirements/skills-ref.txt +2 -0
- package/scripts/build-catalog.js +114 -0
- package/scripts/build-prompt.sh +257 -0
- package/scripts/context-metrics.js +118 -0
- package/scripts/eval-external.js +226 -0
- package/scripts/eval-matrix.sh +172 -0
- package/scripts/eval-outcome.js +143 -0
- package/scripts/eval.sh +321 -0
- package/scripts/lint-parity.js +331 -0
- package/scripts/lint.sh +743 -0
- package/scripts/outcome-summary.js +126 -0
- package/scripts/release-check.sh +108 -0
- package/scripts/release-prepare.js +41 -0
- package/scripts/summarize-eval.js +91 -0
- package/scripts/summarize-matrix.js +101 -0
- package/scripts/version-sync.js +65 -0
- package/skills/godplans/SKILL.md +192 -0
- package/skills/godplans/references/agent-memory.md +168 -0
- package/skills/godplans/references/architecture.md +189 -0
- package/skills/godplans/references/build.md +130 -0
- package/skills/godplans/references/business.md +252 -0
- package/skills/godplans/references/code-quality.md +165 -0
- package/skills/godplans/references/compliance.md +59 -0
- package/skills/godplans/references/database.md +157 -0
- package/skills/godplans/references/deploy.md +146 -0
- package/skills/godplans/references/discovery.md +297 -0
- package/skills/godplans/references/doc-set.md +243 -0
- package/skills/godplans/references/exemplar.md +228 -0
- package/skills/godplans/references/launch.md +162 -0
- package/skills/godplans/references/llm.md +132 -0
- package/skills/godplans/references/observe.md +178 -0
- package/skills/godplans/references/plan-format.md +340 -0
- package/skills/godplans/references/product.md +130 -0
- package/skills/godplans/references/repo.md +184 -0
- package/skills/godplans/references/roadmap.md +158 -0
- package/skills/godplans/references/security.md +156 -0
- package/skills/godplans/references/seo.md +133 -0
- package/skills/godplans/references/stack.md +133 -0
- package/skills/godplans/references/style-genome.md +198 -0
- package/skills/godplans/references/ui.md +153 -0
- package/skills/godplans/references/ux.md +150 -0
- package/skills/godplans/schemas/PLAN.schema.json +275 -0
- package/skills/godplans/schemas/PLAN.v1.schema.json +258 -0
- package/skills/godplans/scripts/plan-halflife.sh +76 -0
- package/skills/godplans/scripts/style-stats.py +630 -0
- package/skills/godplans/scripts/validate-plan.sh +1709 -0
- package/skills/godplans/templates/PLAN.template.mdx +269 -0
- package/tests/agent-memory-guidance.sh +32 -0
- package/tests/build-catalog.sh +81 -0
- package/tests/codex-runner.sh +139 -0
- package/tests/eval-harness.sh +377 -0
- package/tests/evidence-harnesses.sh +243 -0
- package/tests/fixtures/plan-json-v1-1.13.0.json +472 -0
- package/tests/install-regression.sh +246 -0
- package/tests/lib/plan-schema-check.js +163 -0
- package/tests/lint-selftest.sh +582 -0
- package/tests/package-contents.sh +143 -0
- package/tests/portable-prompt.test.sh +261 -0
- package/tests/release-tooling.sh +204 -0
- package/tests/run.sh +14 -0
- package/tests/script-usage.sh +37 -0
- package/tests/style-stats.sh +170 -0
- package/tests/validate-plan.sh +1970 -0
- package/tests/vendor-runner.sh +291 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Style genome (code DNA) planning module
|
|
2
|
+
|
|
3
|
+
Fixes the project's coding style genome (naming, comments, structure, control flow, error posture, idioms) in PLAN.mdx before the first commit exists. The orchestrator loads this module for every archetype (style genome is never excluded or deferred; a zero-code content site scales it down to its formatter and linter configs), in the domain-pass order after seo and before agent-memory, because the quality-pillar wiring that agent-memory plans depends on the genome this module defines. In brownfield mode this module also governs the read-only fingerprint pass.
|
|
4
|
+
|
|
5
|
+
## Lineage
|
|
6
|
+
|
|
7
|
+
Descends from codedna (hannsxpeter/codedna), the skill that fingerprints a codebase's style so new or AI-written code is indistinguishable from the original author's. codedna works after the fact: Map extracts a CODEDNA.md profile from existing code, Match writes code that blends in, Check flags AI tells in diffs. godplans inverts the direction: for greenfield projects the genome is authored at plan time, so there is never anything to retro-extract. The discipline that carries over intact: layered evidence ordered cheapest and most authoritative first (tooling configs, then measured frequencies, then close-read voice), the specificity gate (a rule true of almost any repo gets sharpened or cut), the enforced-vs-observed split, the AI-tells catalog used as a pre-presentation self-check, and the rule that local file dialect wins over the global profile.
|
|
8
|
+
|
|
9
|
+
Two of those carry as artifacts rather than as advice. The AI-tells catalog is reproduced in full below, because a planner told to write an anti-tells appendix without the catalog is selecting from a list it does not have. And `scripts/style-stats.py`, vendored by copy from codedna, measures the frequencies R-DNA-5 and R-DNA-20 ask for, because a numeric function-size norm produced by eyeballing five files is an adjective with a number painted on it.
|
|
10
|
+
|
|
11
|
+
Ported by copy in both directions: godplans depends on nothing from codedna at runtime, codedna depends on nothing from godplans, and a fix travels between the repositories as an edit rather than a reference.
|
|
12
|
+
|
|
13
|
+
## Decisions to force
|
|
14
|
+
|
|
15
|
+
Ordered hardest to reverse first.
|
|
16
|
+
|
|
17
|
+
1. Error-handling strategy.
|
|
18
|
+
- Question: exceptions, Result/Either, error-return, or let-it-throw, and where validation lives.
|
|
19
|
+
- Why hard to reverse: the choice propagates through every function signature and call site; migrating a throwing codebase to Result touches everything.
|
|
20
|
+
- Options: typed custom errors thrown at boundaries (default for TS and Python apps); Result everywhere (default for Rust, or TS teams already on neverthrow); error-return (Go).
|
|
21
|
+
- Default: one strategy project-wide, validate at trust boundaries only, never re-validate internally.
|
|
22
|
+
2. Module shape and file organization.
|
|
23
|
+
- Question: feature folders or layer folders, barrel files or direct imports, where helpers live.
|
|
24
|
+
- Why hard to reverse: import paths fossilize into every file, and mass-moving them poisons git blame.
|
|
25
|
+
- Options: feature folders (default for apps); layer folders (defensible for small API services); barrels only if the project's bundler tree-shakes them.
|
|
26
|
+
- Default: feature folders, no barrel files, helpers co-located until shared by a second feature.
|
|
27
|
+
3. Naming genome and domain glossary.
|
|
28
|
+
- Question: casing per identifier kind, one verb dialect (get vs fetch vs load per semantic), and the canonical domain nouns (user vs account vs member).
|
|
29
|
+
- Why hard to reverse: names leak into public APIs, database columns, file paths, and URLs, each with its own migration cost.
|
|
30
|
+
- Options: language-community casing norms (default) vs a house deviation, which must be recorded as observed and justified.
|
|
31
|
+
- Default: community casing, get for synchronous access and fetch for network calls, glossary nouns fixed to match the data model section's entity names.
|
|
32
|
+
4. Enforced tooling layer.
|
|
33
|
+
- Question: which formatter and linter, checked in at commit zero.
|
|
34
|
+
- Why hard to reverse: adopting a formatter later means one giant unreviewable reformat commit.
|
|
35
|
+
- Options: the stack's dominant formatter (Prettier or Biome, Black plus Ruff, gofmt, rustfmt); anything else needs a written reason.
|
|
36
|
+
- Default: dominant formatter, configs committed before the first source file.
|
|
37
|
+
5. Test conventions.
|
|
38
|
+
- Question: framework, co-located *.test.ts vs a tests/ tree, describe/it vs flat functions, case-naming style.
|
|
39
|
+
- Why hard to reverse: location and naming get mirrored across every module; moving them later is a repo-wide rename.
|
|
40
|
+
- Options: co-located (default for apps and libraries) vs tests/ tree (default for Python and Go, where the ecosystem expects it).
|
|
41
|
+
- Default: co-located test files, with the framework chosen here (the stack module's twelve dimensions do not include a test runner).
|
|
42
|
+
6. Comment and documentation contract.
|
|
43
|
+
- Question: density target, why-vs-what rule, doc-comment scope.
|
|
44
|
+
- Why hard to reverse: reversible on paper but never actually reversed; drift compounds silently, and AI contributions default to over-commenting.
|
|
45
|
+
- Options: sparse why-only comments (default); doc comments on public API only (default) vs everything (only for published libraries).
|
|
46
|
+
- Default: sparse comments that explain why, doc comments on public API only.
|
|
47
|
+
|
|
48
|
+
## Plan requirements
|
|
49
|
+
|
|
50
|
+
- R-DNA-1 Enforced layer at commit zero. PLAN.mdx names the formatter and linter config files committed before any source file, and the exact format/lint commands recorded in package.json scripts, Makefile, or CI. The genome section never restates a rule those tools settle (indentation, quotes, semicolons); it says "run X".
|
|
51
|
+
Criterion: WHEN the style genome section is emitted, THE PLAN SHALL list the enforced config files and their exact check commands, and SHALL contain no convention line that a named formatter already rewrites.
|
|
52
|
+
- R-DNA-2 Naming casing per identifier kind.
|
|
53
|
+
Criterion: WHEN the genome section is emitted, THE PLAN SHALL state casing for functions, methods, types/classes, constants, variables, files, and (where applicable) CSS classes, with no kind left implicit.
|
|
54
|
+
- R-DNA-3 Word-choice genome. One verb dialect per semantic, boolean prefixes (is/has/should), plural collections, private-member marker, event-handler convention (onClick vs handleClick), an explicit abbreviation whitelist (cfg, ctx, res), and a target name length or terseness norm.
|
|
55
|
+
Criterion: WHEN naming is planned, THE PLAN SHALL fix each of these as a single choice, not a menu.
|
|
56
|
+
- R-DNA-4 Comment and documentation contract. Density target stated as an expectation (for example "most functions carry no comment"), the why-not-what rule, register (terse lowercase fragments vs capitalized sentences, impersonal vs first person), doc-comment scope and format, TODO/FIXME convention, and an explicit ban or allowance on section banners and dividers.
|
|
57
|
+
Criterion: WHEN the genome section is emitted, THE PLAN SHALL state density, register, doc scope, and the banner rule explicitly.
|
|
58
|
+
- R-DNA-5 Structural genome. Expected function size given as a number (for example "median under 10 lines"), the extraction threshold (when a helper is warranted vs inlined, and whether repetition is tolerated over premature abstraction), in-file ordering, module shape (feature vs layer, barrels yes or no), and paradigm (composition vs inheritance, functional vs OO).
|
|
59
|
+
Criterion: WHEN structure is planned, THE PLAN SHALL include a numeric function-size norm and a stated extraction threshold, not adjectives.
|
|
60
|
+
- R-DNA-6 Control-flow posture. Early returns vs nesting, ternary tolerance, loops vs higher-order functions, switch vs lookup maps, async style (async/await vs .then, Promise.all usage).
|
|
61
|
+
Criterion: WHEN the genome section is emitted, THE PLAN SHALL fix each control-flow habit as a single project-wide choice.
|
|
62
|
+
- R-DNA-7 Error posture. The single error strategy chosen in Decisions, the defensiveness policy (validate at trust boundaries only, or stated otherwise), custom error types vs generic throws, error-message tone, and logging density and style on errors.
|
|
63
|
+
Criterion: WHEN error handling is planned, THE PLAN SHALL name one strategy and one defensiveness policy and SHALL cross-reference the Decisions entry that committed them.
|
|
64
|
+
- R-DNA-8 Types conventions. Explicit vs inferred return types, interface vs type, any/unknown tolerance, non-null assertions, enums vs union literals, nullability convention.
|
|
65
|
+
Criterion: IF the stack is statically typed, THE PLAN SHALL fix each of these; IF not, THE PLAN SHALL drop R-DNA-8 in the module disposition (`dropped-by archetype`) naming the untyped stack.
|
|
66
|
+
- R-DNA-9 Import conventions. Default vs named exports, ordering and grouping (deferred to the linter config when enforced there), relative vs alias paths, barrel re-export policy.
|
|
67
|
+
Criterion: WHEN imports are planned, THE PLAN SHALL either defer a rule to a named linter config or state it as an observed convention, never both.
|
|
68
|
+
- R-DNA-10 Test conventions. Framework, file location and naming, structure (describe/it vs flat), case-naming style, mocking and fixture posture.
|
|
69
|
+
Criterion: WHEN the genome section is emitted, THE PLAN SHALL fix test location and naming so the first test file written matches every later one.
|
|
70
|
+
- R-DNA-11 Idiom registry. The canonical shared helpers the project will have (the cn(), the formatDate, the custom assert) named with their intended file paths, plus the parallel-utility ban: introducing a second utility with overlapping purpose fails review.
|
|
71
|
+
Criterion: WHEN idioms are planned, THE PLAN SHALL name each canonical helper with a path and SHALL state the parallel-utility ban as a review-failing rule.
|
|
72
|
+
- R-DNA-12 Domain glossary. The nouns and verbs of the domain fixed so synonyms are never interchangeable (user vs account vs member; fetch vs load).
|
|
73
|
+
Criterion: WHEN the glossary is emitted, THE PLAN SHALL list each canonical term with its banned synonyms, consistent with the data model's entity names.
|
|
74
|
+
- R-DNA-13 Reference shapes. The standard shape of the project's recurring units (a component, a handler, an endpoint, a CLI subcommand as applicable) described as a pattern the first instance will establish.
|
|
75
|
+
Criterion: WHEN the archetype has a recurring unit, THE PLAN SHALL describe its standard shape in enough detail that two agents writing two instances produce structurally identical files.
|
|
76
|
+
- R-DNA-14 CODEDNA.md as a day-one artifact. A task emits CODEDNA.md at scaffold time: leads with a TL;DR of about 10 rules, marks every rule enforced or observed, is stamped with version and date, and carries the obligation to back-fill real 2-4 line snippets as the first modules land.
|
|
77
|
+
Criterion: WHEN tasks are generated, THE PLAN SHALL contain a wave-one task that writes CODEDNA.md before the first feature task, with these properties in its acceptance lines.
|
|
78
|
+
- R-DNA-15 Specificity gate. Every genome rule passes the substitution test.
|
|
79
|
+
Criterion: IF a genome line would read identically for a different project, THE PLAN SHALL sharpen it with a project-specific value or delete it; "uses descriptive names" and its relatives never ship.
|
|
80
|
+
- R-DNA-16 Agent instruction wiring. The genome contract ships as pillar content, never as loader additions: an idempotent marker block (codedna:start / codedna:end) is planned inside agents/quality.md (the pillar that bundles testing, errors, and style per the agent-memory module), pointing at CODEDNA.md and instructing agents to self-check against the AI-tells section before finishing. AGENTS.md stays pinned to its four canonical elements and CLAUDE.md stays a one-line redirect (agent-memory.md R-MEM-2 and R-MEM-15); the standard AGENTS.md loading protocol already routes agents to the quality pillar, so no extra wiring is needed there.
|
|
81
|
+
Criterion: WHEN agent-memory files are planned, THE PLAN SHALL place the genome pointer block inside agents/quality.md, editable only between its markers, and SHALL NOT add genome content to AGENTS.md, CLAUDE.md, or other per-tool rule files.
|
|
82
|
+
- R-DNA-17 Anti-AI-tells appendix. The genome states where this project deliberately deviates from AI defaults: comment sparseness, name terseness, non-defensiveness, no docstring boilerplate, no explainer voice, no banners or decorative characters, no leftover scaffolding.
|
|
83
|
+
Criterion: WHEN the genome section is emitted, THE PLAN SHALL include an anti-tells list containing only deviations this project actually makes, so checks never flag code that matches.
|
|
84
|
+
- R-DNA-18 Enforcement loop. A Check step against CODEDNA.md on every diff: a pre-commit hook or a review-time instruction, with findings rated by severity and rewritten in house style before merge.
|
|
85
|
+
Criterion: WHEN tasks are generated, THE PLAN SHALL contain a task wiring the diff-check step, and the genome section SHALL name where the check runs.
|
|
86
|
+
- R-DNA-19 Freshness protocol. The genome document carries version and date; the plan names the refresh triggers (new linter, framework migration, convention-changing refactor) and mandates re-ratification after them; a known-inconsistencies ledger records real exceptions with the rule that local file dialect wins over the global profile.
|
|
87
|
+
Criterion: WHEN the genome section is emitted, THE PLAN SHALL state the refresh triggers and the local-dialect-wins rule.
|
|
88
|
+
- R-DNA-20 Brownfield fingerprint before authorship.
|
|
89
|
+
Criterion: WHEN mode is brownfield, THE PLAN SHALL derive the genome from layered evidence (configs as enforced ground truth, measured frequencies such as naming histograms and comment density, then a close-read sample quoted in 2-4 line snippets, skipping vendored and generated paths), and SHALL record the dominant pattern plus real exceptions rather than inventing conventions the code does not exhibit.
|
|
90
|
+
- R-DNA-21 Measured, not eyeballed. The numeric norms in this section come from `python3 scripts/style-stats.py <target>`, whose output the plan quotes: comment density per language, naming-casing histograms per identifier kind, median and p90 function length, median identifier length, quote and indentation habits, and documentation coverage. In brownfield the target is the existing tree, and the measured run is the second evidence layer between the configs and the close read. In greenfield there is nothing to measure, so the section states the target numbers as choices and names the run that will confirm them once the first modules land. The confirming run executes in the planned project, which has no `scripts/style-stats.py`, so it uses `python3 .godplans/style-stats.py`: a byte-for-byte copy of the skill's script that Phase 7 saves beside the validator companion whenever the plan schedules this run.
|
|
91
|
+
Criterion: IF mode is brownfield, THE PLAN SHALL quote measured values from the stats run for at least comment density, function-length median, and the casing histogram of the two most common identifier kinds, and every numeric norm in the genome SHALL trace to one of them; IF mode is greenfield, THE PLAN SHALL state each numeric norm as a chosen target and SHALL name the confirming run and the wave it happens in.
|
|
92
|
+
- R-DNA-22 Config map before prose. The plan lists the enforced-layer config files it found or will commit, and next to each, the specific conventions that tool settles (line width, indentation, quotes, semicolons, trailing commas, import ordering, and any lint rule that rewrites rather than warns). That map is what makes R-DNA-1 checkable: a genome line covering a mapped convention is a duplicate with a second source of truth, and it is cut.
|
|
93
|
+
Criterion: WHEN the genome section is emitted, THE PLAN SHALL contain a config map naming each enforced file and the conventions it settles, and no genome rule SHALL restate a convention the map assigns to a tool.
|
|
94
|
+
- R-DNA-23 Anti-tells selected from the catalog. The anti-tells appendix required by R-DNA-17 selects from the numbered catalog in this module and cites the catalog number for each entry, keeping only the tells this project actually deviates from, with the project-specific value that makes each one checkable ("comments: most functions carry none, not one per block").
|
|
95
|
+
Criterion: WHEN the anti-tells appendix is emitted, THE PLAN SHALL cite a catalog number and a project-specific value for every entry, and SHALL omit every catalog entry the project does not actually deviate on, so no check can flag conforming code.
|
|
96
|
+
- R-DNA-24 The check runs as a command. The enforcement loop required by R-DNA-18 names an executable Verify command, not a prose instruction to review carefully. At minimum the formatter and linter check commands run in the hook and in CI; where a diff-level style check is available (a codedna Check invocation, a custom script, or a review-time checklist wired into the PR template with a machine-checked presence test), the plan names it and where it runs.
|
|
97
|
+
Criterion: WHEN the enforcement task is emitted, THE PLAN SHALL give it a Verify command whose exit code proves the check is wired, and SHALL NOT satisfy R-DNA-18 with an instruction that no command can fail.
|
|
98
|
+
|
|
99
|
+
### AI tells catalog
|
|
100
|
+
|
|
101
|
+
The reference list R-DNA-17 and R-DNA-23 select from. Carried in full rather than cited, so the planner is choosing from the catalog rather than remembering it.
|
|
102
|
+
|
|
103
|
+
AI defaults to maximally explicit, maximally defensive, uniformly consistent, and eager to explain. Real authors are selectively terse, selectively defensive, characteristically inconsistent, and sparing with explanation. The appendix records where this project is deliberately the opposite of the default, and nothing else, because a tell that does not describe this project produces false positives, and a false tell costs as much trust as a missed one.
|
|
104
|
+
|
|
105
|
+
1. **Over-commenting**: a comment above nearly every block.
|
|
106
|
+
2. **Narrating the obvious**: a comment that restates the line below it.
|
|
107
|
+
3. **Names longer than the house norm**: `responseData` and `handleButtonClickEvent` where the author writes `res` and `onClick`.
|
|
108
|
+
4. **Defensive boilerplate**: try/catch blocks, null checks, and re-validation the author would not write.
|
|
109
|
+
5. **Over-abstraction, or under**: a one-line helper, or a factory the project does not warrant, against an author who inlines; the reverse for an author who extracts early.
|
|
110
|
+
6. **Uniform consistency**: every rule applied perfectly, flattening the characteristic local dialect of individual files.
|
|
111
|
+
7. **Docstrings on everything**: `@param` and `@returns` blocks that restate the signature.
|
|
112
|
+
8. **Explainer voice**: "Now we iterate", first-person plural, full sentences in a terse repository.
|
|
113
|
+
9. **Section banners and dividers** in a repository that has none.
|
|
114
|
+
10. **Emoji and decorative Unicode** in a repository that has none.
|
|
115
|
+
11. **Restating the prompt or the plan** in comments.
|
|
116
|
+
12. **Leftover scaffolding**: demo main blocks, debug logging, completed TODO markers.
|
|
117
|
+
13. **Parallel utilities and vocabulary drift**: a second `formatDate`, or `fetch` and `load` used interchangeably.
|
|
118
|
+
14. **Belt-and-suspenders typing**: explicit return types everywhere in an inferring codebase, redundant casts.
|
|
119
|
+
15. **Verbose logging and error messages** in a codebase that logs sparingly.
|
|
120
|
+
|
|
121
|
+
## Task seeds
|
|
122
|
+
|
|
123
|
+
- [ ] GP-xxx Commit enforced style layer
|
|
124
|
+
- Files: .editorconfig, .prettierrc or biome.json or pyproject.toml, eslint.config.js, package.json, .github/workflows/ci.yml
|
|
125
|
+
- Acceptance: formatter and linter configs exist at repo root; package.json scripts (or Makefile) define format and lint commands; CI runs the lint command; a non-JavaScript stack puts the R-DNA-1 commands in Verify
|
|
126
|
+
- Verify: npx prettier --check . && npx eslint .
|
|
127
|
+
- Requirements: R-DNA-1
|
|
128
|
+
- [ ] GP-xxx Author CODEDNA.md style genome
|
|
129
|
+
- Files: CODEDNA.md
|
|
130
|
+
- Acceptance: opens with a TL;DR of about 10 rules; every rule tagged enforced or observed; version and date stamp present; naming table covers all identifier kinds; anti-AI-tells section present
|
|
131
|
+
- Verify: grep -q 'codedna' CODEDNA.md && grep -cE '(enforced|observed)' CODEDNA.md
|
|
132
|
+
- Requirements: R-DNA-2, R-DNA-3, R-DNA-4, R-DNA-5, R-DNA-6, R-DNA-7, R-DNA-8, R-DNA-9, R-DNA-14, R-DNA-15, R-DNA-17
|
|
133
|
+
- [ ] GP-xxx Wire genome into the quality pillar
|
|
134
|
+
- Files: agents/quality.md
|
|
135
|
+
- Acceptance: agents/quality.md contains a codedna:start / codedna:end block pointing at CODEDNA.md; block instructs a self-check against the AI-tells section before finishing any change; AGENTS.md and CLAUDE.md carry no genome content
|
|
136
|
+
- Verify: grep -q 'codedna:start' agents/quality.md && ! grep -qi 'codedna' AGENTS.md && ! grep -qi 'codedna' CLAUDE.md
|
|
137
|
+
- Requirements: R-DNA-16
|
|
138
|
+
- [ ] GP-xxx Seed canonical helpers and domain glossary
|
|
139
|
+
- Files: src/lib/cn.ts, src/lib/assert.ts (per idiom registry), CODEDNA.md glossary section
|
|
140
|
+
- Acceptance: each registry helper exists at its planned path; glossary lists canonical terms with banned synonyms; no second utility duplicates a registry helper's purpose
|
|
141
|
+
- Verify: test -f src/lib/cn.ts && ! grep -rl 'formatDate2\|classNames(' src/
|
|
142
|
+
- Requirements: R-DNA-11, R-DNA-12, R-DNA-13
|
|
143
|
+
- [ ] GP-xxx Wire the diff-check enforcement loop
|
|
144
|
+
- Files: .husky/pre-commit or .pre-commit-config.yaml, CONTRIBUTING.md
|
|
145
|
+
- Acceptance: pre-commit runs the format check and the CODEDNA.md diff-check instruction; CONTRIBUTING.md documents the review-time check with severity ratings
|
|
146
|
+
- Verify: grep -q CODEDNA CONTRIBUTING.md && grep -qs CODEDNA .husky/pre-commit .pre-commit-config.yaml
|
|
147
|
+
- Requirements: R-DNA-18, R-DNA-19
|
|
148
|
+
- [ ] GP-xxx Fingerprint existing codebase (brownfield only)
|
|
149
|
+
- Files: CODEDNA.md
|
|
150
|
+
- Acceptance: enforced layer read from existing configs, not re-derived; measured frequencies recorded from the stats run (casing histograms, comment density, function-length median and p90, quote style); each observed rule paired with a quoted 2-4 line snippet; known inconsistencies recorded with the local-dialect-wins rule
|
|
151
|
+
- Verify: grep -q "$(printf '\140\140\140')" CODEDNA.md && grep -q 'Known inconsistencies' CODEDNA.md
|
|
152
|
+
- Requirements: R-DNA-20, R-DNA-21, R-DNA-19
|
|
153
|
+
|
|
154
|
+
- [ ] GP-xxx Record the measured style baseline
|
|
155
|
+
- Files: CODEDNA.md, .godplans/style-stats.json
|
|
156
|
+
- Acceptance: `python3 .godplans/style-stats.py . --json` output is stored; CODEDNA.md quotes comment density, function-length median and p90, and the casing histogram for functions and variables; every numeric norm in the genome traces to one of those values
|
|
157
|
+
- Verify: python3 .godplans/style-stats.py . --json > .godplans/style-stats.json && grep -q median CODEDNA.md
|
|
158
|
+
- Requirements: R-DNA-21, R-DNA-5
|
|
159
|
+
|
|
160
|
+
- [ ] GP-xxx Publish the enforced-layer config map
|
|
161
|
+
- Files: CODEDNA.md
|
|
162
|
+
- Acceptance: each committed formatter and linter config is listed with the conventions it settles; no genome rule restates a mapped convention; the section says "run X" for each mapped tool
|
|
163
|
+
- Verify: grep -q 'Enforced by tooling' CODEDNA.md && ! grep -niE '^- (indentation|semicolons|quote style):' CODEDNA.md
|
|
164
|
+
- Requirements: R-DNA-22, R-DNA-1
|
|
165
|
+
|
|
166
|
+
## Self-audit rubric
|
|
167
|
+
|
|
168
|
+
Score the plan's style genome section 0-100.
|
|
169
|
+
|
|
170
|
+
- Enforced layer settled (11): configs and exact commands named at commit zero; the config map assigns each mapped convention to its tool; zero formatter-settled rules restated in prose.
|
|
171
|
+
- Measured evidence (10): brownfield numeric norms quoted from the stats run and traceable to it; greenfield norms stated as choices with a named confirming run and wave. Zero when a number appears with no measurement and no declared choice behind it.
|
|
172
|
+
- Naming genome complete (13): casing covers every identifier kind; verb dialect, boolean prefixes, private markers, handler convention, and abbreviation whitelist each fixed to one choice.
|
|
173
|
+
- Comment contract (7): density, register, doc scope, and banner rule all explicit; why-not-what stated.
|
|
174
|
+
- Structural genome (9): numeric function-size norm, stated extraction threshold, module shape, and paradigm all committed.
|
|
175
|
+
- Control flow and error posture (11): every control-flow habit fixed; one error strategy and one defensiveness policy, cross-referenced to Decisions.
|
|
176
|
+
- Types, imports, tests (9): each fixed or dropped with a stated reason; no rule both deferred to a linter and restated as prose.
|
|
177
|
+
- Idiom registry and glossary (9): helpers named with paths, parallel-utility ban stated, glossary terms consistent with the data model.
|
|
178
|
+
- Day-one CODEDNA.md and wiring (9): wave-one task emits the stamped profile before feature work; the marker block is planned inside agents/quality.md, with AGENTS.md and CLAUDE.md left untouched.
|
|
179
|
+
- Anti-AI-tells appendix (7): selects from the catalog with numbers cited; lists only real project deviations; would produce no false tells.
|
|
180
|
+
- Enforcement loop and freshness (5): the check has an executable Verify command rather than a review instruction; refresh triggers and local-dialect-wins rule stated.
|
|
181
|
+
|
|
182
|
+
Any dimension at zero, or a total under 85, sends the section back for revision before the plan is emitted.
|
|
183
|
+
|
|
184
|
+
## Anti-patterns refused
|
|
185
|
+
|
|
186
|
+
- Generic genome: rules like "uses descriptive names" that read identically for any repo. Refusal: apply the specificity gate; sharpen with a project value or delete the line.
|
|
187
|
+
- Formatter parroting: prose conventions restating what Prettier, Black, or gofmt already rewrite. Refusal: the genome says "run X" and spends its lines only on what no tool enforces.
|
|
188
|
+
- Retro-extraction deferral: "we will extract the style once there is code." Refusal: CODEDNA.md is a wave-one scaffold task; the genome exists before the first source file.
|
|
189
|
+
- Paper genome: a profile document nothing enforces. Refusal: the plan must wire the diff-check step (R-DNA-18) or the enforcement rubric dimension scores zero.
|
|
190
|
+
- Uniform-consistency enforcement: flattening characteristic inconsistencies into one rule, itself a catalogued AI tell. Refusal: plan a known-inconsistencies ledger and the local-dialect-wins rule instead.
|
|
191
|
+
- Vocabulary drift and parallel utilities: a second formatDate, user and account used interchangeably. Refusal: idiom registry with named paths plus a glossary with banned synonyms; duplicates fail review.
|
|
192
|
+
- Docstring-everything boilerplate: @param/@returns on every function by default. Refusal: doc scope is an explicit decision; the default is public API only.
|
|
193
|
+
- Brownfield invention: writing a genome from taste instead of evidence. Refusal: layered fingerprint first (configs, then measured frequencies, then close read with quoted snippets); numbers are evidence to interpret, and when they disagree with the code, trust the code.
|
|
194
|
+
- Stale genome: a profile whose date predates a deliberate style shift, silently mismatching new code. Refusal: stamp version and date, name refresh triggers, mandate re-ratification after them.
|
|
195
|
+
- False tells: an anti-tells list so generic that checks flag correct code. Refusal: the appendix contains only deviations this project actually makes, each citing its catalog number; a false tell is as unhelpful as a missed one.
|
|
196
|
+
- Eyeballed numbers: "median under 10 lines" produced by reading five files and estimating. Refusal: brownfield numbers come from the stats run and are quoted; greenfield numbers are declared as targets with the run that will confirm them.
|
|
197
|
+
- Unrunnable enforcement: an enforcement task whose Verify is a reminder to review the diff carefully. Refusal: the command's exit code proves the check is wired, or R-DNA-18 is not satisfied.
|
|
198
|
+
- Prose that duplicates the config map: a genome rule restating a convention the map already assigns to a formatter. Refusal: the map is the source of truth for enforced conventions and the genome spends its lines only on what no tool settles.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# UI implementation planning module
|
|
2
|
+
|
|
3
|
+
Plans how the user interface gets built as code so that a post-hoc UI implementation audit scores top marks by construction. The orchestrator loads this module during the domain pass for any archetype that renders a UI (saas-dashboard, marketing-site, mobile-app, component library); headless api-service, cli, and ml-pipeline archetypes exclude it with a stated reason. Boundaries: experience design, journey heuristics, and copy tone belong to ux.md; generic code quality belongs to code-quality.md and the bundle budget to build.md (R-BUILD-15); all security sinks (dangerouslySetInnerHTML, v-html, innerHTML, CSP) belong to security.md and may only be cross-referenced here, never planned here.
|
|
4
|
+
|
|
5
|
+
## Lineage
|
|
6
|
+
|
|
7
|
+
This module inverts uiauditor (github.com/hannsxpeter/auditor-suite/tree/main/skills/uiauditor), the read-only UI implementation auditor grounded in WCAG 2.2, WAI-ARIA APG, Core Web Vitals, MDN, and ECMA-402. What carries over: its ten dimensions and their weights (accessibility highest under every combination), its accessibility floor (any A11Y Critical drops the whole audit one band below any other Critical), its eight enumerated always-Critical conditions, its paper-control hunt (declared-but-unwired protections are findings, not credit), its calibrate-to-paradigm rule (Tailwind config IS the token source; React Native is judged on native primitives, not semantic HTML), and its ban on platitudes. Where the auditor finds keyboard lockouts after the fact, this module makes the plan specify native elements, wired states, and zero-count verification greps before the first component exists.
|
|
8
|
+
|
|
9
|
+
## Decisions to force
|
|
10
|
+
|
|
11
|
+
Hardest to reverse first. Each must land in the plan's Decisions section as a grounded decision, a flagged hypothesis with a validation plan, or a named open question with a recommended default.
|
|
12
|
+
|
|
13
|
+
1. Rendering model: SPA, SSR, RSC, islands, or static? Hard to reverse because hydration strategy, data fetching, LCP shape, and every client/server component boundary descend from it; migrating models rewrites the routing and data layer. Options: static or islands for content-led sites, SSR/RSC for data-led apps, SPA only when an app shell genuinely needs it. Default: server-first (SSR/RSC or islands), client interactivity opted in per component, never at a route root.
|
|
14
|
+
2. Styling model and token source of truth: Tailwind config, tokens.json, theme.ts, or CSS custom properties? Hard to reverse because the token source defines what "on scale" means for every color, space, and size ever written; switching models touches every component file. Options as listed; exactly one source wins. Default: the framework-native choice (Tailwind config if Tailwind, CSS custom properties otherwise), with a written no-raw-literals rule.
|
|
15
|
+
3. Design system: consume an existing one or author primitives? Hard to reverse because component API surface propagates into every feature; swapping later is a full-UI migration. Options: consume (Radix, shadcn/ui, Material, platform-native), author a thin primitive layer, or hybrid. Default: consume headless primitives and own the styling, unless the archetype is a component library.
|
|
16
|
+
4. Localization: in scope from day one or explicitly excluded? Hard to reverse because retrofitting string externalization touches every user-facing string including alt and aria-label, and layouts sized for English clip German. Options: full i18n now, catalog-only now (externalize strings, single locale), or excluded with reason. Default: catalog-only now if any multi-locale future is plausible; excluded with reason otherwise.
|
|
17
|
+
5. Native or cross-platform surface: web only, React Native/Expo, or react-native-web shared code? Hard to reverse because primitives differ at the root (Pressable vs button, FlatList vs ul); web assumptions baked into shared components are a rewrite. Default: web only unless the product requirement names a native surface; if shared, plan platform branches explicitly.
|
|
18
|
+
6. Web Components and shadow DOM: used or not? Hard to reverse because token plumbing, slot semantics, and focus delegation across the shadow boundary must be designed in, not patched on. Default: no shadow DOM unless embedding into foreign pages is a requirement.
|
|
19
|
+
7. Theming and dark mode: shipped, planned-for, or excluded? Hard to reverse because a retrofit means auditing every color in the codebase; half-hardcoded themes are the named decorative-token failure. Default: if any theming is plausible, route all colors through tokens now and set color-scheme, even if only one theme ships.
|
|
20
|
+
8. Overlay primitive: one shared dialog/drawer/popover component or per-feature implementations? Hard to reverse in practice because focus management bugs multiply per copy and converge only through a painful consolidation. Default: one shared primitive built on native dialog with showModal(), portal-rendered, before any feature needs it.
|
|
21
|
+
|
|
22
|
+
## Plan requirements
|
|
23
|
+
|
|
24
|
+
R-UI-1. PLAN.mdx must declare the UI stack contract as decisions: framework, rendering model, styling model, the single design-token source, the design system consumed or authored, whether Web Components/shadow DOM are used, and the UI paradigm and maturity target.
|
|
25
|
+
Criterion: WHEN the UI domain is applicable, THE PLAN SHALL record all seven stack-contract facts in the Decisions section before the first UI task is defined.
|
|
26
|
+
|
|
27
|
+
R-UI-2. PLAN.mdx must state the native-element-first rule: buttons are button, links are a[href] (navigation vs action decides which), inputs are native, disclosure is details/summary, modals are dialog opened with showModal(); div/span reconstructions of interactive controls are banned.
|
|
28
|
+
Criterion: WHEN any task creates interactive controls, THE PLAN SHALL include the native-element-first rule and a Verification task whose acceptance is a zero count of onClick handlers on div/span elements.
|
|
29
|
+
|
|
30
|
+
R-UI-3. PLAN.mdx must define the accessible-name and labeling contract: every control class has a named accessible-name source (visible text, aria-label, aria-labelledby, or wrapping label); form fields get programmatic labels (never placeholder-only or tooltip-only); images get an alt policy (informative alt text, decorative aria-hidden, image SVGs role=img with a name); load-bearing media gets captions or transcripts.
|
|
31
|
+
Criterion: WHEN forms or media appear in scope, THE PLAN SHALL specify the name source per control class and the alt/captions policy, each tied to a task with a grep-verifiable acceptance such as "count of input elements without an associated label is zero".
|
|
32
|
+
|
|
33
|
+
R-UI-4. PLAN.mdx must set the ARIA and keyboard discipline: ARIA only where a native element does not suffice, widget roles always carrying their mandatory states (tab with aria-selected, checkbox with aria-checked), all ID references resolving, no aria-hidden on or wrapping focusables, APG keyboard models (arrows, Home/End, Escape) named for every planned custom widget, no positive tabindex anywhere, and a skip link first in the tab order.
|
|
34
|
+
Criterion: WHEN a custom widget is planned, THE PLAN SHALL name its APG pattern and keyboard model in the task acceptance, and a Verification task SHALL assert a zero count of positive tabindex values.
|
|
35
|
+
|
|
36
|
+
R-UI-5. PLAN.mdx must plan overlay focus management as one shared primitive: initial focus set on open, focus trapped while open, focus restored to the trigger on close, native dialog with showModal() or role=dialog plus aria-modal, Escape dismisses, rendered through a portal; SPA route changes move focus to the new content.
|
|
37
|
+
Criterion: WHEN any dialog, drawer, popover, or menu is in scope, THE PLAN SHALL contain a shared-overlay-primitive task that every later overlay task depends on, and SHALL ban dialog.show() for modal use.
|
|
38
|
+
|
|
39
|
+
R-UI-6. PLAN.mdx must plan focus visibility globally: a :focus-visible style in the design system, a ban on outline:none or box-shadow:none on :focus without a visible replacement, and a check that no reset or later cascade rule strips it.
|
|
40
|
+
Criterion: WHEN global styles are planned, THE PLAN SHALL include a :focus-visible baseline task with acceptance "no outline:none without adjacent replacement styling".
|
|
41
|
+
|
|
42
|
+
R-UI-7. PLAN.mdx must plan motion preferences: all animation gated by prefers-reduced-motion, animating transform and opacity only (never width, top, or margin), and pause/stop/extend controls on any auto-advancing content (carousels, tickers, auto-dismiss toasts).
|
|
43
|
+
Criterion: IF the plan includes any animation or auto-advancing content, THE PLAN SHALL gate it behind prefers-reduced-motion in a task acceptance and SHALL give auto-advancing surfaces an explicit pause control.
|
|
44
|
+
|
|
45
|
+
R-UI-8. PLAN.mdx must plan status messaging and shell basics: form errors surfaced via aria-describedby plus aria-invalid, aria-live or role=status regions wired to the exact code paths that update status text, semantic input types with autocomplete tokens and inputmode, html lang set, and a viewport meta that never blocks zoom.
|
|
46
|
+
Criterion: WHEN forms or async status exist, THE PLAN SHALL wire error and status surfaces to real state in task acceptances, and a Verification task SHALL assert a zero count of user-scalable=no and maximum-scale=1.
|
|
47
|
+
|
|
48
|
+
R-UI-9. PLAN.mdx must define document and heading structure per route: one h1, no skipped heading levels, a single main with header/nav/footer landmarks and no content stranded outside a landmark, valid nesting (no interactive-in-interactive, no duplicate ids), per-route descriptive titles, and charset/viewport/lang/favicon/manifest in the shell.
|
|
49
|
+
Criterion: WHEN routes are enumerated, THE PLAN SHALL assign each route an h1 and title in its task acceptance and SHALL define the landmark skeleton once in a shell task.
|
|
50
|
+
|
|
51
|
+
R-UI-10. PLAN.mdx must choose the styling architecture: the cascade strategy (@layer, CSS modules, or scoped styles), !important banned as a mechanism, a z-index scale instead of magic numbers, logical properties (margin-inline, inset-inline-start) for RTL safety, Flexbox/Grid as the layout primitives (no float or absolute-position scaffolding), and print styles when document/report/invoice surfaces exist.
|
|
52
|
+
Criterion: WHEN the styling model is declared, THE PLAN SHALL name the cascade strategy and z-index scale as decisions, and IF report-like surfaces exist THE PLAN SHALL include an @media print task.
|
|
53
|
+
|
|
54
|
+
R-UI-11. PLAN.mdx must mandate the component state-matrix convention: every data-fetching or mutating view designs loading, empty, error, AND success branches wired to real state (no declared-but-never-rendered branches); controlled inputs always paired with onChange; stable non-index keys on reorderable/filterable lists; overlays through portals; error boundaries around data-driven trees; hydration directives chosen deliberately (client:visible or client:idle below the fold; use client never at a route root).
|
|
55
|
+
Criterion: WHEN a view fetches or mutates data, THE PLAN SHALL list all four state branches in that task's acceptance, and a Verification task SHALL assert a zero count of key={index} on mutable lists.
|
|
56
|
+
|
|
57
|
+
R-UI-12. PLAN.mdx must set the responsive contract: mobile-first, reflow to one column at 320 CSS px with no horizontal scroll (WCAG 1.4.10), fluid max-width containers instead of fixed pixel widths, breakpoints coherent and above content min-widths, width/height or aspect-ratio reserved on all images, iframes, embeds, and late-injected slots, touch targets at least 24x24 CSS px, no hover-only affordances, click/keyboard alternatives to drag, rem/em for resizable text, and safe-area insets on notched devices.
|
|
58
|
+
Criterion: WHEN layout tasks are planned, THE PLAN SHALL state the 320px reflow requirement and dimension-reservation rule as task acceptances, not as aspirations in prose.
|
|
59
|
+
|
|
60
|
+
R-UI-13. PLAN.mdx must set the render-path performance plan: the likely LCP element identified per key route and prioritized (fetchpriority=high or the framework priority prop, never lazy-loaded above the fold), critical fonts preloaded with font-display, heavy below-fold work code-split, below-fold images loading=lazy, long lists virtualized, and heavy synchronous work kept off event handlers. The plan states that CWV numbers remain Suspected until measured in a real environment; it plans the risk away, it does not claim the metric.
|
|
61
|
+
Criterion: WHEN key routes are enumerated, THE PLAN SHALL name each route's expected LCP element and its prioritization in a task acceptance, and SHALL NOT assert numeric CWV outcomes as facts.
|
|
62
|
+
|
|
63
|
+
R-UI-14. PLAN.mdx must establish token discipline: one design-token source of truth, a no-raw-literals rule (no raw hex/rgb, no arbitrary pixel spacing, no arbitrary Tailwind values like w-[327px] off the configured scale), and a reuse-the-primitive rule (no hand-rolled duplicates of an existing component; no importing the DS Button then restyling it inline per use).
|
|
64
|
+
Criterion: WHEN the token source is declared, THE PLAN SHALL include a Verification task grepping for raw hex literals and arbitrary-value utilities outside the token source, with an expected count of zero.
|
|
65
|
+
|
|
66
|
+
R-UI-15. PLAN.mdx must plan theming end to end when theming or dark mode is in scope: every color routed through tokens that fully swap under the theme, color-scheme set, no subtree bypassing the theme provider; IF shadow DOM is used, the plan states how tokens cross the shadow boundary (custom properties inherited through :host, ::part surfaces named).
|
|
67
|
+
Criterion: IF theming is planned, THE PLAN SHALL require the dark theme to swap every color token in a task acceptance, refusing half-hardcoded themes by construction.
|
|
68
|
+
|
|
69
|
+
R-UI-16. PLAN.mdx must plan the asset pipeline: modern image formats with srcset/sizes decided at authoring time, per-icon imports or a sprite (never whole-library icon imports), SVGs optimized (no editor cruft, no embedded rasters), fonts subset and preloaded with font-display, a complete favicon/app-icon/manifest set, and iframes carrying title, sandbox, and loading=lazy.
|
|
70
|
+
Criterion: WHEN assets are in scope, THE PLAN SHALL state the image format and icon import strategy as decisions and give the shell task a favicon/manifest acceptance.
|
|
71
|
+
|
|
72
|
+
R-UI-17. PLAN.mdx must plan localization before strings are written when i18n is applicable: all user-facing strings including alt and aria-label in a message catalog from day one, ICU or Intl.PluralRules pluralization (never if n === 1), Intl.DateTimeFormat/NumberFormat for dates/numbers/currency, dir derived from locale with directional icons mirrored, layouts sized for 30 percent text expansion, no text baked into images.
|
|
73
|
+
Criterion: IF i18n is applicable, THE PLAN SHALL include a message-catalog task that precedes all feature UI tasks; IF not applicable, THE PLAN SHALL drop R-UI-17 in the module disposition (`dropped-by archetype`) with the reason.
|
|
74
|
+
|
|
75
|
+
R-UI-18. PLAN.mdx must plan native primitives when a native or cross-platform surface exists: Pressable/Button/TextInput over tap-handler Views, accessibilityLabel/Role/State on every custom control, FlatList or SectionList with a stable keyExtractor (never .map() inside ScrollView), safe-area insets, explicit Platform.select branches where behavior differs, and a ban on web-only assumptions (div, CSS hover, px literals) in shared code.
|
|
76
|
+
Criterion: IF a native toolkit is in scope, THE PLAN SHALL carry these as task acceptances including "zero .map() renders inside ScrollView"; IF not, THE PLAN SHALL drop R-UI-18 in the module disposition (`dropped-by form`) with the reason.
|
|
77
|
+
|
|
78
|
+
R-UI-19. PLAN.mdx must ban paper controls in its own text: no declared-but-unwired protections anywhere in the plan (a spinner not tied to a pending state, an aria-live region nothing writes to, tokens declared while components hardcode literals, a skip link to a missing id, a dark theme half-hardcoded). Every planned protection names its wiring and a mechanical check.
|
|
79
|
+
Criterion: WHEN any protection is planned, THE PLAN SHALL pair it with a wiring acceptance phrased as a countable condition (for example "count of unlabeled inputs is zero"), never as an intention.
|
|
80
|
+
|
|
81
|
+
R-UI-20. PLAN.mdx must trace the eight always-Critical audit conditions to tasks: keyboard lockout on a load-bearing control, core control with no accessible name, focus trap with no escape, zoom disabled, load-bearing media without captions/transcript, accessibility theater on a load-bearing surface, no reflow at 320px, and a load-bearing form broken at implementation level (frozen controlled input, submit losing input). Each maps to at least one task acceptance, and the final Verification phase includes a UI sweep task running the zero-count greps.
|
|
82
|
+
Criterion: WHEN the Verification phase is written, THE PLAN SHALL contain a UI sweep task whose acceptance enumerates zero-count checks covering all eight always-Critical conditions applicable to the project.
|
|
83
|
+
|
|
84
|
+
R-UI-21. PLAN.mdx plans WCAG 2.2 Level AA pointer and focus criteria: interactive targets meet the 24 by 24 CSS px minimum with adequate spacing (2.5.8 Target Size Minimum) and the stated mobile target contract; the focused element is never fully hidden by sticky headers or overlays (2.4.11 Focus Not Obscured, Minimum), and the focus indicator is never removed without an equivalent, with sufficient area and contrast (2.4.13 Focus Appearance as the AAA reference); and the conformance target (from ux.md decision 4, WCAG 2.2 AA by default, plus AODA or Section 508 where the audience requires it) is named.
|
|
85
|
+
Criterion: WHEN interactive UI is planned THE PLAN SHALL carry the conformance target ux.md decision 4 sets (WCAG 2.2 AA by default) and require target-size, focus-not-obscured, and focus-appearance acceptances with a Verify line (a grep or test for undersized targets, focus hidden under sticky elements, and removed or too-faint focus styles).
|
|
86
|
+
|
|
87
|
+
## Task seeds
|
|
88
|
+
|
|
89
|
+
- [ ] GP-xxx Declare the UI stack contract and build the document shell
|
|
90
|
+
- Files: .godplans/PLAN.mdx, src/app/layout.tsx (or src/index.html)
|
|
91
|
+
- Acceptance: html lang set; charset, viewport, per-route title wired; favicon and manifest referenced; zero occurrences of user-scalable=no or maximum-scale=1; single main landmark with header/nav/footer
|
|
92
|
+
- Verify: grep -q 'lang=' src/app/layout.tsx && ! grep -rEn 'user-scalable=no|maximum-scale=1' src/
|
|
93
|
+
- Requirements: R-UI-1, R-UI-8, R-UI-9
|
|
94
|
+
- [ ] GP-xxx Build the shared overlay primitive
|
|
95
|
+
- Files: src/components/ui/overlay.tsx
|
|
96
|
+
- Acceptance: native dialog opened with showModal() (or role=dialog plus aria-modal); focus set on open, trapped while open, restored to trigger on close; Escape dismisses; rendered via portal; zero uses of dialog.show() for modal surfaces
|
|
97
|
+
- Verify: grep -En 'showModal|aria-modal' src/components/ui/overlay.tsx && ! grep -rn '\.show()' src/components/ui/
|
|
98
|
+
- Requirements: R-UI-5, R-UI-11
|
|
99
|
+
- [ ] GP-xxx Establish global focus, motion, and token baseline
|
|
100
|
+
- Files: src/styles/globals.css, tailwind.config.ts (or tokens source)
|
|
101
|
+
- Acceptance: :focus-visible style defined; zero outline:none declarations without adjacent replacement; prefers-reduced-motion gate present; z-index scale defined as tokens; color-scheme declared
|
|
102
|
+
- Verify: grep -n 'focus-visible' src/styles/globals.css && grep -n 'prefers-reduced-motion' src/styles/globals.css
|
|
103
|
+
- Requirements: R-UI-6, R-UI-7, R-UI-10, R-UI-14
|
|
104
|
+
- [ ] GP-xxx Build the form field primitive with the full labeling contract
|
|
105
|
+
- Files: src/components/ui/field.tsx
|
|
106
|
+
- Acceptance: label associated via for/id or wrapping label; errors wired through aria-describedby plus aria-invalid to real validation state; type, autocomplete, and inputmode accepted and forwarded; no placeholder-only labeling path exists
|
|
107
|
+
- Verify: grep -En 'aria-describedby|aria-invalid|autocomplete' src/components/ui/field.tsx
|
|
108
|
+
- Requirements: R-UI-3, R-UI-8
|
|
109
|
+
- [ ] GP-xxx Scaffold the state matrix for data views
|
|
110
|
+
- Files: src/components/views/*.tsx
|
|
111
|
+
- Acceptance: every data-fetching view renders loading, empty, error, and success branches tied to real state; zero key={index} on mutable lists; error boundary wraps each data-driven tree; controlled inputs paired with onChange
|
|
112
|
+
- Verify: ls src/components/views/*.tsx >/dev/null && ! grep -rEn 'key=\{(index|i)\}' src/components/
|
|
113
|
+
- Requirements: R-UI-11, R-UI-19
|
|
114
|
+
- [ ] GP-xxx Wire the LCP and asset baseline per key route
|
|
115
|
+
- Files: src/app/(routes)/*, public/
|
|
116
|
+
- Acceptance: named LCP element per key route carries fetchpriority=high or the framework priority prop; zero loading=lazy above the fold; all img/iframe/embed carry width/height or aspect-ratio; critical fonts preloaded with font-display set
|
|
117
|
+
- Verify: grep -rEn 'fetchpriority|priority' src/app/ && grep -rn 'font-display' src/styles/
|
|
118
|
+
- Requirements: R-UI-12, R-UI-13, R-UI-16
|
|
119
|
+
- [ ] GP-xxx Run the UI verification sweep (final Verification phase)
|
|
120
|
+
- Files: .godplans/PLAN.mdx
|
|
121
|
+
- Acceptance: zero onClick on div/span; zero positive tabindex; zero unlabeled inputs; zero raw hex literals outside the token source; zero aria-hidden on focusable ancestors; sweep results recorded under the task
|
|
122
|
+
- Verify: test -d src && ! grep -rEn '<(div|span)[^>]*onClick' src/ && ! grep -rEn 'tabindex="[1-9]' src/
|
|
123
|
+
- Requirements: R-UI-2, R-UI-4, R-UI-14, R-UI-19, R-UI-20
|
|
124
|
+
|
|
125
|
+
## Self-audit rubric
|
|
126
|
+
|
|
127
|
+
Score the plan's UI sections 0-100. A section below 85 gets revised before emission.
|
|
128
|
+
|
|
129
|
+
| Dimension | Points | Full marks require |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| Stack contract and calibration | 8 | All seven stack-contract facts decided; requirements phrased in the project's own framework and styling model, not a generic ideal |
|
|
132
|
+
| Accessibility contract | 22 | R-UI-3 through R-UI-8 all present as task acceptances; all eight always-Critical conditions traced to tasks; no accessibility item left as prose intention |
|
|
133
|
+
| Semantic document structure | 12 | Native-element-first rule stated; per-route h1/title/landmark assignments; shell task with lang/charset/viewport/favicon/manifest |
|
|
134
|
+
| Styling architecture | 10 | Cascade strategy and z-index scale decided; logical properties mandated; print styles planned when report surfaces exist |
|
|
135
|
+
| Component state and correctness | 12 | Four-branch state matrix on every data view; keys, portals, error boundaries, and hydration directives in acceptances |
|
|
136
|
+
| Responsive contract | 10 | 320px reflow, fluid containers, dimension reservation, 24px targets, and pointer alternatives as countable acceptances |
|
|
137
|
+
| Render-path performance | 9 | LCP element named and prioritized per key route; fonts, code-splitting, lazy-loading, and virtualization planned; no CWV numbers asserted as fact |
|
|
138
|
+
| Design system and theming | 8 | One token source, no-raw-literals and reuse-the-primitive rules, full-swap theming when planned, shadow-boundary plumbing when applicable |
|
|
139
|
+
| Asset pipeline | 5 | Image format and icon import strategy decided; fonts subset and preloaded; favicon/manifest complete; iframe attributes planned |
|
|
140
|
+
| Conditional coverage | 4 | I18N and NATIVE each either planned per R-UI-17/R-UI-18 or dropped with a stated reason in the module disposition |
|
|
141
|
+
|
|
142
|
+
## Anti-patterns refused
|
|
143
|
+
|
|
144
|
+
- Paper controls: a protection declared but never wired (aria-live nothing writes to, spinner with no pending state, skip link to a missing id). Refusal: every planned protection carries a countable wiring acceptance or it does not enter the plan.
|
|
145
|
+
- ARIA over the wrong element: role=button patched onto a div instead of using button. Refusal: the plan fixes accessibility at the markup; native element plus real label, ARIA only where native does not suffice.
|
|
146
|
+
- The prop's promise: trusting a component named AccessibleModal to be accessible. Refusal: acceptances test behavior (focus moved, trap wired, Escape works), never the component's name.
|
|
147
|
+
- Happy-path-only views: data views planned with success branches only. Refusal: no data view task passes review without loading, empty, error, and success in its acceptance.
|
|
148
|
+
- Decorative tokens: a token file declared while components hardcode the literal next to it. Refusal: token adoption is verified by a zero-count grep for raw literals, not by the file's existence.
|
|
149
|
+
- Framework-blind calibration: holding Tailwind to a tokens.json bar or React Native to semantic HTML. Refusal: requirements are instantiated in the declared stack contract's own idiom.
|
|
150
|
+
- Platitude requirements: "improve accessibility", "make it responsive", "optimize performance" as plan lines. Refusal: every requirement names the exact change, the safe pattern, and the check that confirms it; platitudes fail the substitution test and are cut.
|
|
151
|
+
- Self-defeating performance: loading=lazy on the LCP hero, use client at a route root, a lazy route still statically imported. Refusal: the LCP element is named per route and its task acceptance forbids these patterns explicitly.
|
|
152
|
+
- Display-none responsive: a mobile experience that is only the desktop nav hidden. Refusal: the responsive contract demands reflow and adapted interaction at 320px, verified as an acceptance, not a hidden element.
|
|
153
|
+
- Suspected-as-fact: the plan promising CWV numbers, real pixel contrast, or screen-reader behavior it cannot verify statically. Refusal: runtime facts stay labeled as risks to plan away and measure later; the plan never claims a measurement it has not made.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# UX and user journeys planning module
|
|
2
|
+
|
|
3
|
+
Plans the experience layer of PLAN.mdx: actors, journeys, states, workflows, and the standards that make them auditable. The orchestrator loads this module for every archetype with a human-facing, developer-facing, or workflow surface (saas-dashboard, marketing-site, mobile-app, cli, api-service DX, internal tools); it is excluded only when no such surface exists, with the reason stated in the applicability matrix.
|
|
4
|
+
|
|
5
|
+
## Lineage
|
|
6
|
+
|
|
7
|
+
Descends from uxauditor, the read-only end-to-end experience auditor that scores 11 dimensions (Nielsen's 10 heuristics, WCAG 2.2 AA, journeys, Lean process analysis, IA, interaction design, UX writing, Baymard forms research, AARRR activation, RAIL/Doherty performance, deceptive.design trust) and writes a severity-ranked uxaudit.md. The discipline that carries over: experience is defined beyond UI (CLIs, APIs, and back-office workflows count), every claim needs file-level evidence and must pass the substitution test, journeys trace to one named actor, and process flows get Lean manufacturing treatment (TIMWOODS waste, Theory of Constraints bottlenecks, multi-actor integrity). This module inverts every check uxauditor would run after the fact into a plan-time obligation, so the emitted plan pre-answers the audit.
|
|
8
|
+
|
|
9
|
+
## Decisions to force
|
|
10
|
+
|
|
11
|
+
Hardest to reverse first. Each must land in the plan's Decisions section as a grounded decision, a flagged hypothesis with a validation plan, or a named open question with a recommended default.
|
|
12
|
+
|
|
13
|
+
1. Primary actor and jobs-to-be-done.
|
|
14
|
+
- Question: who is the one primary actor, what are their functional, emotional, and social jobs, and what is the context of use (ISO 9241-11)?
|
|
15
|
+
- Hard to reverse because every journey, label, default, and step budget derives from this; swapping personas later invalidates the journey maps and the IA.
|
|
16
|
+
- Options: single named actor with all three job types stated (default); multiple actors only when the product is genuinely multi-sided, each journey still tracing to exactly one. "Users" as an actor is refused.
|
|
17
|
+
2. Workflow state machine for multi-actor processes.
|
|
18
|
+
- Question: for every approval, queue, or handoff, what are the states, transitions, roles per transition, and exception paths?
|
|
19
|
+
- Hard to reverse because state machines accumulate live data; adding a join or exception path after items exist means migrations and stranded records.
|
|
20
|
+
- Options: explicit state machine with start/end states, a join for every branch, exception paths, and server-side role checks per transition (default); a plain status field only for single-actor products with no handoffs.
|
|
21
|
+
3. Domain vocabulary.
|
|
22
|
+
- Question: what is the one term per concept and one label per action, product-wide?
|
|
23
|
+
- Hard to reverse because terms leak into URLs, API fields, database columns, docs, and user memory; renaming later touches all of them.
|
|
24
|
+
- Options: a vocabulary table committed in the plan (default); deferring naming to build time (refused, this is how "Sign in" and "Log in" ship in the same product).
|
|
25
|
+
4. Accessibility conformance target.
|
|
26
|
+
- Question: which WCAG level, and which constraints does it impose on tokens and components?
|
|
27
|
+
- Hard to reverse because contrast ratios live in design tokens and focus behavior lives in every component; retrofitting AA across a shipped component set is a rewrite.
|
|
28
|
+
- Options: WCAG 2.2 AA (default); AAA for public-sector or accessibility-critical products; below AA only with a stated legal-risk acceptance.
|
|
29
|
+
5. Activation event and value-wall policy.
|
|
30
|
+
- Question: what single event means the user first experienced core value, and which walls (account, email verification, credit card, sales call) stand before it?
|
|
31
|
+
- Hard to reverse because auth architecture, pricing pages, and funnel instrumentation are built around it.
|
|
32
|
+
- Options: value before account where feasible (default for tools and content); account-first only when data ownership demands it, stated as a decision with rationale.
|
|
33
|
+
6. Navigation and IA model.
|
|
34
|
+
- Question: does the structure match the user's mental model, and what are the global, local, and utility navigation surfaces?
|
|
35
|
+
- Hard to reverse because IA shapes routing, deep links, and breadcrumbs; reorganizing after launch breaks bookmarks and muscle memory.
|
|
36
|
+
- Options: task-based IA in user vocabulary (default); org-chart mirroring (refused as a named anti-pattern).
|
|
37
|
+
7. Consent and cancellation symmetry.
|
|
38
|
+
- Question: is cancel as easy as signup, is "Reject all" symmetric with "Accept all", and is all pricing shown before commitment?
|
|
39
|
+
- Hard to reverse because billing flows, consent storage, and legal exposure (GDPR, ROSCA and state automatic-renewal laws, EU DSA Art. 25; the FTC click-to-cancel rule was vacated on 8 July 2025 and is not cited as law) harden around the first implementation.
|
|
40
|
+
- Options: symmetry written into the plan as grep-verifiable requirements (default); anything less is a compliance and trust finding waiting to happen.
|
|
41
|
+
|
|
42
|
+
## Plan requirements
|
|
43
|
+
|
|
44
|
+
1. R-UX-1: PLAN.mdx names one primary actor per journey with their functional, emotional, and social jobs-to-be-done and a context-of-use statement (device, environment, frequency, expertise).
|
|
45
|
+
Criterion: WHEN the plan is emitted THE PLAN SHALL contain a named primary actor with all three job types and a context-of-use line, and every journey SHALL reference exactly one named actor.
|
|
46
|
+
2. R-UX-2: PLAN.mdx maps 2-4 primary journeys end to end (signup to first value, the main recurring task, a recovery or upgrade path, checkout or conversion where applicable), each with a numbered step list and a step budget.
|
|
47
|
+
Criterion: WHEN a core goal is planned THE PLAN SHALL enumerate its steps with a maximum step count and SHALL flag any step that re-enters data the system already holds.
|
|
48
|
+
3. R-UX-3: PLAN.mdx specifies the full state matrix: every async action gets loading, pending, disabled, and success states; every screen gets an empty state answering what this is, why it is empty, what to do next, and what it looks like full; every error, expired, and zero-result state names a forward action.
|
|
49
|
+
Criterion: IF a screen or async action is listed in the plan THE PLAN SHALL enumerate its states, and no error or empty state SHALL lack a forward action.
|
|
50
|
+
4. R-UX-4: PLAN.mdx sets feedback budgets: input acknowledged within ~100ms, completion or visible progress within ~400ms (RAIL/Doherty), skeletons or optimistic UI for unavoidable waits, and progress position shown in every multi-step flow.
|
|
51
|
+
Criterion: WHEN an async or multi-step interaction is planned THE PLAN SHALL state the 100ms/400ms budgets and the wait treatment for each flow that can exceed them.
|
|
52
|
+
5. R-UX-5: PLAN.mdx defines the destructive-action policy: undo for destructive actions, a clearly marked exit from every state, no modal or wizard traps, and confirmations reserved for genuinely costly irreversible actions only.
|
|
53
|
+
Criterion: IF an action is destructive THE PLAN SHALL specify its undo or recovery path, and IF a confirmation is planned THE PLAN SHALL name the irreversible cost it guards.
|
|
54
|
+
6. R-UX-6: PLAN.mdx commits a vocabulary table: one term per concept, one label per action product-wide, buttons naming the action or outcome (never "Submit", "OK", "Click here"), labels in user language not internal jargon, plus a documented voice with context-adaptive tone.
|
|
55
|
+
Criterion: WHEN the plan is emitted THE PLAN SHALL contain a vocabulary table and a voice-and-tone note, and no planned label SHALL use a banned generic term.
|
|
56
|
+
7. R-UX-7: PLAN.mdx writes the error-message standard: plain language stating what happened, why, how to fix it, and what happens next; shown at the field; never raw codes or stack traces; user input always preserved.
|
|
57
|
+
Criterion: WHEN error handling is planned THE PLAN SHALL include this standard as acceptance criteria on every task that renders errors.
|
|
58
|
+
8. R-UX-8: PLAN.mdx declares the conformance target from decision 4 (WCAG 2.2 AA by default) with its concrete consequences: contrast tokens at >=4.5:1 text and >=3:1 UI, full keyboard operability with no traps, visible focus indicators on everything focusable (no outline removal without replacement), focus order following visual order, targets >=24x24px (44-48px primary), reduced-motion respected, 200% zoom reflow without horizontal scroll, no blocking of paste or autofill in auth, no redundant entry of provided information.
|
|
59
|
+
Criterion: WHEN the plan is emitted THE PLAN SHALL state the conformance target and SHALL attach these constraints to the design-token and component tasks.
|
|
60
|
+
9. R-UX-9: PLAN.mdx specifies the form standard per Baymard: persistent visible labels above fields (never placeholder-as-label), inline validation on blur with errors adjacent to the field, minimal field count with nothing the system holds or can derive, correct type and inputmode per field, standard autocomplete tokens, format-tolerant normalization (Postel's Law), explicit optional/required marking, double-submit guards, and never clearing a form on error.
|
|
61
|
+
Criterion: IF any form is planned THE PLAN SHALL apply this standard as acceptance criteria on the form task.
|
|
62
|
+
10. R-UX-10: For every multi-actor process, PLAN.mdx models the explicit state machine: start and end states, a join for every branch, exception paths, and no unreachable states.
|
|
63
|
+
Criterion: WHEN a workflow with approvals, queues, or handoffs is planned THE PLAN SHALL include its state diagram (mermaid) with every transition labeled with the role allowed to perform it.
|
|
64
|
+
11. R-UX-11: PLAN.mdx plans workflow integrity mechanics: server-side role checks on every transition, timeout/escalation/SLA for stalled items, optimistic locking or a conflict path for concurrent edits, status visibility for waiting parties (where the item is, who holds it, what happens next), and in-product reassignment, recall, and rollback, never database surgery.
|
|
65
|
+
Criterion: IF two or more actors touch the same item THE PLAN SHALL specify all five mechanics as task acceptance criteria.
|
|
66
|
+
12. R-UX-12: PLAN.mdx classifies every workflow step as value-added, necessary-non-value, or waste (TIMWOODS); removes or parallelizes serial approvals; automates deterministic rule-based human steps; and names the expected bottleneck with the design that relieves it.
|
|
67
|
+
Criterion: WHEN a process is planned THE PLAN SHALL contain the step classification table and SHALL name one expected bottleneck with its mitigation.
|
|
68
|
+
13. R-UX-13: PLAN.mdx plans the IA around the actor's mental model: navigation labels with information scent in user vocabulary, breadcrumbs on deep pages, a current-location indicator, and, where content volume warrants, typo- and synonym-tolerant search with a useful zero-results state.
|
|
69
|
+
Criterion: WHEN navigation is planned THE PLAN SHALL show the nav structure and SHALL trace at least two realistic "find X" tasks through it.
|
|
70
|
+
14. R-UX-14: PLAN.mdx defines the activation event (first hands-on core value), counts planned steps from signup to it, and removes non-essential walls (forced account, email verification, credit card, sales call) before value; first-run drives the core action with templates or sample data, never a feature tour or a blank canvas.
|
|
71
|
+
Criterion: WHEN onboarding is planned THE PLAN SHALL name the activation event, state the signup-to-activation step count, and justify every wall that remains.
|
|
72
|
+
15. R-UX-15: PLAN.mdx plans the retention loop: saved state as a reason to return, a trigger-action-reward-investment habit loop where the product warrants one, and value-driven (not spammy) re-engagement.
|
|
73
|
+
Criterion: IF the product expects repeat use THE PLAN SHALL name the return trigger and the saved state that makes returning worthwhile.
|
|
74
|
+
16. R-UX-16: PLAN.mdx sets performance and responsiveness budgets: LCP <=2.5s, INP <=200ms, CLS <=0.1 at p75 as field targets measured after launch (CrUX or RUM), with a pre-launch Lighthouse CI gate on LCP, CLS, and Total Blocking Time as the INP proxy (never asserted from static code); explicit dimensions or aspect-ratio on all media; viewport meta with zoom enabled; no horizontal scroll at 320px; touch targets sized for thumbs; a loading state for every async action.
|
|
75
|
+
Criterion: WHEN the plan is emitted THE PLAN SHALL state these budgets, SHALL route the lab gate to the final Verification phase with the exact command, and SHALL name the field source that measures p75 after launch.
|
|
76
|
+
17. R-UX-17: PLAN.mdx writes an anti-deceptive-design policy covering the deceptive.design taxonomy: cancellation as easy as signup, "Reject all" as prominent and as few clicks as "Accept all", total pricing and fees shown before commitment, no pre-checked opt-ins or upsells, no fake scarcity or manufactured social proof, granular revocable consent, privacy-favoring defaults with collection explained at the point of collection, and real organization and contact credibility signals.
|
|
77
|
+
Criterion: IF the product has billing, consent, or subscription flows THE PLAN SHALL include this policy as acceptance criteria on those tasks.
|
|
78
|
+
18. R-UX-18: PLAN.mdx plans component-state completeness and hierarchy: hover, focus, active, disabled, loading, empty, and error states designed for every interactive element; interactive elements look interactive and non-interactive elements never masquerade as buttons; exactly one dominant primary action per screen; expert accelerators (keyboard shortcuts, bulk actions, saved defaults) that never block novices.
|
|
79
|
+
Criterion: WHEN a component library or screen inventory is planned THE PLAN SHALL require the seven states per interactive component and one primary action per screen.
|
|
80
|
+
19. R-UX-19: PLAN.mdx plans cross-channel continuity and endings: state and context survive channel and device switches (web to email to app), multi-step flows show remaining progress (Zeigarnik), and each journey ends on a designed satisfying note (Peak-End).
|
|
81
|
+
Criterion: IF a journey crosses channels or devices THE PLAN SHALL state how context survives the handoff, and every mapped journey SHALL name its designed ending.
|
|
82
|
+
20. R-UX-20: For non-GUI surfaces (CLI, API, SDK), PLAN.mdx applies the same discipline calibrated to the surface: exit codes and error messages follow the error standard, help output teaches the next step, destructive commands get confirmation or a dry-run flag, and API errors are specific and recovery-oriented.
|
|
83
|
+
Criterion: IF the product has a developer-facing surface THE PLAN SHALL define its experience requirements rather than exempting it from UX planning.
|
|
84
|
+
|
|
85
|
+
## Task seeds
|
|
86
|
+
|
|
87
|
+
- [ ] GP-xxx Implement shared async-state primitives (loading, empty, error, success)
|
|
88
|
+
- Files: src/components/states/AsyncBoundary.tsx, src/components/states/EmptyState.tsx, src/components/states/ErrorState.tsx
|
|
89
|
+
- Acceptance: EmptyState requires title, reason, and action props; ErrorState requires a forward action prop; no component renders bare "No data" text
|
|
90
|
+
- Verify: ! grep -rn 'No data' src/components && grep -q action src/components/states/EmptyState.tsx
|
|
91
|
+
- Requirements: R-UX-3, R-UX-7
|
|
92
|
+
- [ ] GP-xxx Build the signup-to-activation journey within its step budget
|
|
93
|
+
- Files: src/routes/signup/, src/routes/onboarding/, src/lib/activation.ts
|
|
94
|
+
- Acceptance: activation event emitted once, server-side after the outcome commits, from one named function (through the R-BIZ-20 tracking wrapper when that requirement lands); no credit-card or email-verification gate before the activation route; first-run seeds sample data
|
|
95
|
+
- Verify: grep -q "trackActivation" src/lib/activation.ts && ! grep -rn "verifyEmailBefore" src/routes/onboarding/
|
|
96
|
+
- Requirements: R-UX-2, R-UX-14
|
|
97
|
+
- [ ] GP-xxx Implement the form standard on all input surfaces
|
|
98
|
+
- Files: src/components/forms/Field.tsx, src/components/forms/Form.tsx
|
|
99
|
+
- Acceptance: every Field renders a visible label element; autocomplete tokens set for name, email, tel, and address fields; validation fires on blur; submit handler guards double submission
|
|
100
|
+
- Verify: grep -q '<label' src/components/forms/Field.tsx && test -z "$(grep -rl 'placeholder=' src/components/forms | xargs -r grep -L '<label')"
|
|
101
|
+
- Requirements: R-UX-9, R-UX-8
|
|
102
|
+
- [ ] GP-xxx Implement the workflow state machine with server-side role checks
|
|
103
|
+
- Files: src/server/workflow/machine.ts, src/server/workflow/transitions.ts
|
|
104
|
+
- Acceptance: every transition names allowed roles and is checked server-side; stalled items have a timeout escalation; concurrent edits hit optimistic-lock version checks; reassign and recall exposed as endpoints
|
|
105
|
+
- Verify: grep -q "assertRole" src/server/workflow/transitions.ts && grep -q "version" src/server/workflow/machine.ts
|
|
106
|
+
- Requirements: R-UX-10, R-UX-11
|
|
107
|
+
- [ ] GP-xxx Apply the accessibility token and focus contract
|
|
108
|
+
- Files: src/styles/tokens.css, src/components/
|
|
109
|
+
- Acceptance: no outline:none without a replacement focus style; contrast tokens documented at >=4.5:1; prefers-reduced-motion media query present; no user-scalable=no anywhere
|
|
110
|
+
- Verify: ! grep -rn "user-scalable=no" src/ && grep -q "prefers-reduced-motion" src/styles/tokens.css
|
|
111
|
+
- Requirements: R-UX-8, R-UX-18
|
|
112
|
+
- [ ] GP-xxx Implement the error-message catalog
|
|
113
|
+
- Files: src/lib/errors/catalog.ts, src/lib/errors/render.tsx
|
|
114
|
+
- Acceptance: every user-facing error maps a code to what/why/fix/next copy; raw codes never rendered; form state preserved on error
|
|
115
|
+
- Verify: grep -q "whatHappened" src/lib/errors/catalog.ts && ! grep -rn "err.code}" src/components
|
|
116
|
+
- Requirements: R-UX-7, R-UX-3
|
|
117
|
+
- [ ] GP-xxx Verify cancellation symmetry and pricing transparency
|
|
118
|
+
- Files: src/routes/billing/, src/routes/settings/subscription/
|
|
119
|
+
- Acceptance: cancel reachable in no more clicks than subscribe; total price with fees rendered before payment; no defaultChecked on upsell inputs
|
|
120
|
+
- Verify: ! grep -rn "defaultChecked" src/routes/billing/ && grep -q "totalWithFees" src/routes/billing/
|
|
121
|
+
- Requirements: R-UX-17
|
|
122
|
+
|
|
123
|
+
## Self-audit rubric
|
|
124
|
+
|
|
125
|
+
Score the UX sections of the draft plan 0-100. Below 85 total, revise before emission.
|
|
126
|
+
|
|
127
|
+
- Actor, jobs, and context of use (10): full marks require one named primary actor with functional, emotional, and social jobs, a context-of-use statement, and every journey tracing to one actor.
|
|
128
|
+
- Journeys and step budgets (14): 2-4 journeys mapped end to end with numbered steps, a budget per goal, no re-entry of held data, cross-channel handoffs and designed endings stated.
|
|
129
|
+
- State matrix and error standard (14): every async action and screen has enumerated states, every dead end has a forward action, the error-message standard and 100ms/400ms budgets appear as task acceptance criteria.
|
|
130
|
+
- Accessibility plan (13): the decision 4 conformance target (WCAG 2.2 AA by default) declared with contrast, keyboard, focus, target, motion, zoom, and redundant-entry constraints attached to concrete token and component tasks.
|
|
131
|
+
- Process and workflow integrity (13): state machines drawn with roles per transition, all five integrity mechanics specified, steps classified Lean with a named bottleneck.
|
|
132
|
+
- Forms and input (8): the full Baymard standard applied as acceptance criteria on every form task.
|
|
133
|
+
- IA and navigation (8): nav structure shown, labels in user vocabulary, two find-X traces recorded, search and zero-results planned where warranted.
|
|
134
|
+
- Onboarding and activation (8): activation event named, signup-to-value step count stated, every remaining wall justified, retention loop planned.
|
|
135
|
+
- Performance budgets (6): CWV targets stated with the lab gate routed to the Verification phase by exact command and the p75 field source named; layout-stability and responsive rules on tasks.
|
|
136
|
+
- Trust and anti-deception (6): the anti-deceptive-design policy present and bound to billing, consent, and subscription tasks.
|
|
137
|
+
|
|
138
|
+
## Anti-patterns refused
|
|
139
|
+
|
|
140
|
+
- UX theater: a spinner tied to nothing, a confirmation guarding nothing costly, a progress bar that does not reflect progress. Refusal: every state element in the plan names the real condition it reflects; interstitials that add a step without preventing irreversible harm are cut.
|
|
141
|
+
- Platitude planning: "improve usability", "make it intuitive", "enhance onboarding" as plan lines. Refusal: apply the substitution test; any line that fits every project is replaced with a file-level, criterion-bearing requirement or deleted.
|
|
142
|
+
- Persona-free planning: journeys for "users" in general. Refusal: no journey enters the plan without exactly one named actor and job; missing actors become discovery questions, not assumptions.
|
|
143
|
+
- Placeholder-as-label forms: labels that vanish on input, whole forms clearing on error. Refusal: the Baymard standard is non-negotiable acceptance criteria on every form task.
|
|
144
|
+
- Roach motel: easy in, hard out; asymmetric consent; hidden costs. Refusal: cancellation symmetry, pricing transparency, and Reject-all parity are written as grep-verifiable acceptance criteria, not values statements.
|
|
145
|
+
- Feature-tour onboarding: first-run walks the interface instead of driving the core action. Refusal: onboarding tasks must reach the activation event; tours, blank canvases, and premature data collection are rejected at plan time.
|
|
146
|
+
- Wall-before-value: account, verification, or card gates with no stated justification. Refusal: every wall before activation is either justified in the Decisions section or removed from the flow.
|
|
147
|
+
- Database-surgery recovery: workflows where stuck items need an engineer and a SQL console. Refusal: reassignment, recall, and rollback are planned as product features on every multi-actor workflow.
|
|
148
|
+
- Prediction-as-verdict: asserting CWV numbers, real contrast, or runtime focus order from static plans. Refusal: numeric claims are budgets with a named post-build verification command in the final Verification phase, never facts.
|
|
149
|
+
- Leaf-scattering: duplicating micro-rules across dozens of tasks instead of shared standards. Refusal: standards (errors, forms, states, vocabulary) are defined once and referenced by Requirements: lines, mirroring the auditor's systemic-root-cause clustering.
|
|
150
|
+
- Surface denial: skipping UX planning because the product is a CLI or API. Refusal: the experience lens calibrates to the actual surface; only a product with no human-facing, developer-facing, or workflow surface excludes this module, with the reason recorded.
|