@ryuenn3123/agentic-senior-core 3.0.42 → 3.0.44
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/.agent-context/prompts/bootstrap-design.md +16 -18
- package/.agent-context/prompts/init-project.md +2 -2
- package/.agent-context/review-checklists/pr-checklist.md +3 -0
- package/.agent-context/rules/docker-runtime.md +9 -3
- package/.agent-context/rules/efficiency-vs-hype.md +5 -2
- package/.agent-context/rules/frontend-architecture.md +13 -10
- package/.agent-context/rules/performance.md +3 -1
- package/.cursor/rules/agentic-senior-core.mdc +1 -1
- package/.cursorrules +1 -1
- package/.gemini/instructions.md +1 -1
- package/.github/copilot-instructions.md +1 -1
- package/.github/instructions/agentic-senior-core.instructions.md +1 -1
- package/.instructions.md +1 -1
- package/.windsurf/rules/agentic-senior-core.md +1 -1
- package/.windsurfrules +1 -1
- package/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/GEMINI.md +1 -1
- package/lib/cli/commands/init.mjs +1 -0
- package/lib/cli/compiler.mjs +33 -0
- package/lib/cli/project-scaffolder/design-contract/validation.mjs +115 -0
- package/lib/cli/project-scaffolder/design-contract.mjs +99 -8
- package/lib/cli/project-scaffolder/prompt-builders.mjs +77 -29
- package/package.json +1 -1
- package/scripts/frontend-usability-audit.mjs +2 -0
- package/scripts/validate/config.mjs +13 -0
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Use this prompt for UI, UX, frontend layout, screen, Tailwind, animation, 3D, canvas, or redesign work.
|
|
4
4
|
|
|
5
|
-
Create or refine
|
|
6
|
-
- `docs/DESIGN.md` for human-readable design reasoning.
|
|
7
|
-
- `docs/design-intent.json` for machine-readable design intent, guardrails, and review signals.
|
|
5
|
+
Create or refine `docs/DESIGN.md` for human reasoning and `docs/design-intent.json` for machine-readable design intent, guardrails, and review signals.
|
|
8
6
|
|
|
9
7
|
This contract is a decision scaffold, not a style preset. We guide the agent; we do not pick the final style, stack, framework, palette, typography, layout paradigm, or animation library offline.
|
|
10
8
|
|
|
@@ -43,6 +41,7 @@ Rules:
|
|
|
43
41
|
- Output only the chosen anchor, specific reference point, and rationale.
|
|
44
42
|
- Forbid final anchors named dashboard, portal, cards, admin panel, SaaS shell, web app shell, or minimalist interface.
|
|
45
43
|
- Derive typography, spacing, density, color behavior, morphology, motion, and responsive composition from the chosen anchor.
|
|
44
|
+
- Translate the anchor non-literally first. Anchor artifacts are evidence for behavior, hierarchy, density, typography, state language, and motion, not automatic UI chrome.
|
|
46
45
|
- Use reduced-motion fallbacks instead of suppressing motion.
|
|
47
46
|
|
|
48
47
|
## Creative Ambition Floor
|
|
@@ -52,14 +51,20 @@ Before UI code, record:
|
|
|
52
51
|
- one morphology or composition choice that avoids interchangeable card stacks when the product allows it
|
|
53
52
|
- at least three at-a-glance product-specific signals for new screens or broad redesigns
|
|
54
53
|
|
|
55
|
-
Do not ship AI-safe UI. Record exact drift signals in `reviewRubric`; at minimum reject decorative grid wallpaper, default line backgrounds, soft glow backgrounds, generic abstract marks, and first-output composition with only local copy swapped in when they have no product function.
|
|
54
|
+
Do not ship AI-safe UI. Record exact drift signals in `reviewRubric`; at minimum reject decorative grid wallpaper, default line backgrounds, calibration-mark wallpaper, soft glow backgrounds, generic abstract marks, testing/demo/placeholder UI copy, terminal-only user flows, and first-output composition with only local copy swapped in when they have no product function. Treat measurement, calibration, crop, route, timeline, and inspection marks as task overlays or control affordances only; never promote them to the page background, hero backdrop, or first-output visual texture. If a conceptual anchor suggests a forbidden motif, the forbidden motif wins; express the anchor through workflow, hierarchy, density, typography, material behavior, state design, and interaction grammar instead of literal wallpaper.
|
|
56
55
|
|
|
57
56
|
## Brave Redesign Default
|
|
58
57
|
For UI design work, the agent owns the ambition decision. For broad screens, redesigns, or new visual systems, treat expressive motion, spatial hierarchy, distinctive composition, and product-specific interaction as the baseline even when the user did not say "rich". Do not reduce the request to a safer version of the existing UI, a static implementation, or a component-kit rearrangement because research or dependency selection feels inconvenient.
|
|
59
58
|
|
|
60
59
|
If the expressive path needs a new motion, 3D, canvas, scroll, or interaction library and web search is available, perform the official-doc research and record the decision. If web search is unavailable, use already-present dependencies or native browser capabilities while preserving the intended ambition, then mark library verification as pending.
|
|
61
60
|
|
|
62
|
-
Only downshift ambition after naming the concrete blocker: product fit, content density, performance budget, accessibility, device support, package conflict, security risk, or missing runtime capability. Pair every downshift with a replacement interaction quality that still changes composition, hierarchy, feedback, or memorability.
|
|
61
|
+
Only downshift ambition after naming the concrete blocker: product fit, content density, measured performance budget, accessibility, device support, package conflict, security risk, or missing runtime capability. A new dependency, package count, or vague performance concern is not a blocker by itself. Pair every downshift with a replacement interaction quality that still changes composition, hierarchy, feedback, or memorability.
|
|
62
|
+
|
|
63
|
+
## Design Flexibility Layer
|
|
64
|
+
|
|
65
|
+
`docs/design-intent.json` must separate locked outcomes from flexible expression. The machine contract keeps review invariants stable; it must not freeze exact aesthetic implementation unless repo evidence, accessibility validation, implementation constraints, or explicit user approval locks it.
|
|
66
|
+
|
|
67
|
+
Record `designFlexibilityPolicy`: lock user goals, runtime constraints, accessibility, production readiness, forbidden patterns, and approved continuity; keep exact palette primitives, font families, radius/shadow values, component-kit theme mapping, signature move implementation, and literal anchor artifacts flexible until validated or approved. Semantic roles are required; exact primitives are not automatically locked. Required experience outcomes are separate from candidate implementation moves. Libraries supply behavior, accessibility, primitives, and delivery speed; the project supplies final composition, theme, morphology, and visual language.
|
|
63
68
|
|
|
64
69
|
## AI Color and Template Residue Audit
|
|
65
70
|
AI color drift happens when a palette uses safe defaults before product meaning.
|
|
@@ -90,7 +95,7 @@ Before implementation, `docs/design-intent.json` must include top-level `derived
|
|
|
90
95
|
- `motionDerivationSource`
|
|
91
96
|
- `validationRule`
|
|
92
97
|
|
|
93
|
-
Every token must trace to `anchorReference`. If the rationale is "looks good", "common practice", "modern default", or "framework default",
|
|
98
|
+
Every semantic token role must trace to `anchorReference`. Exact primitive values stay flexible until repo evidence, accessibility validation, implementation constraints, or explicit user approval locks them. If the rationale is "looks good", "common practice", "modern default", or "framework default", derive the token again before UI code.
|
|
94
99
|
|
|
95
100
|
## Library Research Protocol
|
|
96
101
|
If web search is available:
|
|
@@ -103,8 +108,8 @@ If web search is unavailable:
|
|
|
103
108
|
- Use native CSS, browser APIs, or already-present dependencies.
|
|
104
109
|
- Set `libraryResearchStatus` to `pending-verification`.
|
|
105
110
|
|
|
106
|
-
Treat unresearched dependency choices as review findings.
|
|
107
|
-
|
|
111
|
+
Treat unresearched dependency choices as review findings. Dynamic UI Foundation Selection: do not default to shadcn/ui, Tailwind-only, native-only, or any component kit because it is familiar. Choose the foundation from product type, interaction complexity, accessibility needs, design ambition, team/runtime constraints, bundle/runtime cost, and current official docs.
|
|
112
|
+
Ready-made primitives are allowed when they improve behavior, accessibility, speed, or maintainability. The library supplies mechanics; the project supplies visual language. Reject default component-kit styling without product rationale, but do not reject a modern lightweight library solely because a dependency was needed.
|
|
108
113
|
## Zero-Based Redesign Protocol
|
|
109
114
|
|
|
110
115
|
When the user says "redesign from zero", "redesain dari 0", "ulang dari 0", or "research ulang":
|
|
@@ -146,9 +151,10 @@ The JSON is the source of truth for machine review. It must stay project-specifi
|
|
|
146
151
|
- confirmed project context and assumptions
|
|
147
152
|
- agent-chosen visual direction
|
|
148
153
|
- `motionPaletteDecision`
|
|
154
|
+
- `designFlexibilityPolicy`
|
|
149
155
|
- `conceptualAnchor`
|
|
150
156
|
- `derivedTokenLogic`
|
|
151
|
-
- `aiSafeUiAudit`
|
|
157
|
+
- `aiSafeUiAudit` and `productionContentPolicy`
|
|
152
158
|
- `tokenSystem`, `colorTruth`, `crossViewportAdaptation`, `motionSystem`, and `componentMorphology`
|
|
153
159
|
- `accessibilityPolicy`
|
|
154
160
|
- `designExecutionPolicy`
|
|
@@ -165,14 +171,6 @@ WCAG 2.2 AA is the hard floor. APCA may be used only as advisory perceptual tuni
|
|
|
165
171
|
|
|
166
172
|
Define a review rubric that names drift signals and separates taste from failure.
|
|
167
173
|
|
|
168
|
-
Block or flag
|
|
169
|
-
- inaccessible contrast, focus, target size, keyboard, auth, or dynamic-status behavior
|
|
170
|
-
- scale-only responsive behavior
|
|
171
|
-
- default component-kit styling without product rationale
|
|
172
|
-
- nonfunctional background effects, including decorative grid wallpaper
|
|
173
|
-
- grid or line backgrounds used as filler instead of product function
|
|
174
|
-
- palette choices that use readability as an excuse for safe defaults
|
|
175
|
-
- visual direction copied from unrelated memory or external references
|
|
176
|
-
- genericity findings that cannot name the exact drift signal
|
|
174
|
+
Block or flag inaccessible contrast/focus/target/keyboard/auth/status behavior, scale-only responsive behavior, default component-kit styling, nonfunctional background effects, grid or line filler, placeholder copy, terminal-only core flows, readability-as-safe-default palettes, copied visual direction, and genericity findings that cannot name the exact drift signal.
|
|
177
175
|
|
|
178
176
|
Wait for user approval before generating Figma or code assets when the user only asked for planning or design direction.
|
|
@@ -8,7 +8,7 @@ When a new project is created or initialized, the agent must automatically:
|
|
|
8
8
|
1. Read [AGENTS.md](../../AGENTS.md) to understand the canonical bootstrap chain and active entrypoints.
|
|
9
9
|
2. Resolve the smallest relevant rule set from [.agent-context/rules/](../rules/) instead of scanning the whole directory by default.
|
|
10
10
|
3. Review dynamic runtime signals from [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), repository evidence, task constraints, and live official documentation when runtime or ecosystem facts matter.
|
|
11
|
-
4. If Docker or Compose is in scope, load [docker-runtime.md](../rules/docker-runtime.md) and verify the latest official Docker guidance before authoring container assets.
|
|
11
|
+
4. If Docker or Compose is in scope, load [docker-runtime.md](../rules/docker-runtime.md) and verify the latest official Docker guidance before authoring container assets. Materialize the selected development/production assets rather than stopping at prose.
|
|
12
12
|
5. For unresolved framework or package setup, recommend the latest stable compatible dependency set and official framework setup flow from live official documentation before coding unless a documented compatibility constraint blocks it.
|
|
13
13
|
|
|
14
14
|
## Required Planning Mode
|
|
@@ -42,7 +42,7 @@ If the user specifies a framework, runtime, or architecture constraint, the agen
|
|
|
42
42
|
- Every module must follow [architecture.md](../rules/architecture.md).
|
|
43
43
|
- Every dependency must be justified per [efficiency-vs-hype.md](../rules/efficiency-vs-hype.md).
|
|
44
44
|
- Use official framework setup commands or canonical starter flows when they produce newer, better-supported dependency defaults than manual package assembly.
|
|
45
|
-
- If containerization is selected, Docker assets must follow [docker-runtime.md](../rules/docker-runtime.md) and the latest official Docker docs instead of stale blog-era patterns.
|
|
45
|
+
- If containerization is selected, Docker assets must follow [docker-runtime.md](../rules/docker-runtime.md) and the latest official Docker docs instead of stale blog-era patterns. Selected Docker lanes require files and runbooks, not docs-only acknowledgment.
|
|
46
46
|
|
|
47
47
|
## Runtime and Architecture Reference
|
|
48
48
|
|
|
@@ -81,10 +81,13 @@ Run this before declaring a task done. Apply only the sections relevant to the c
|
|
|
81
81
|
- [ ] Motion is treated as part of the design language for modern UI work, with reduced-motion and performance safeguards instead of defaulting to static screens.
|
|
82
82
|
- [ ] Broad redesigns pass the old-design regression test: the result is not the previous composition with animation, depth, media, or interaction density removed.
|
|
83
83
|
- [ ] UI work records an agent-chosen ambition level; broad screens and redesigns researched an expressive path first, and any downshift names a concrete blocker plus replacement interaction quality.
|
|
84
|
+
- [ ] UI foundation choices are dynamic and product-fit; no shadcn, native-only, Tailwind-only, or component-kit default was selected by habit or avoided from dependency fear.
|
|
85
|
+
- [ ] Design intent separates locked outcomes from flexible expression; candidate signature moves, exact token primitives, literal anchor artifacts, and component-kit skins were not treated as permanent requirements without evidence or user approval.
|
|
84
86
|
|
|
85
87
|
## 8. Dependencies And Runtime
|
|
86
88
|
|
|
87
89
|
- [ ] New dependencies are justified by capability, maintenance health, bundle/runtime cost, and current official docs.
|
|
90
|
+
- [ ] Dependency avoidance was not treated as a default virtue; lightweight maintained libraries were considered when they improve correctness, accessibility, UX, maintainability, or delivery speed.
|
|
88
91
|
- [ ] Official setup flows are preferred when they produce better-supported current defaults.
|
|
89
92
|
- [ ] Docker, framework, package, and ecosystem claims were checked live when they could be stale.
|
|
90
93
|
- [ ] Token optimization and memory continuity defaults remain enabled unless the user explicitly opts out.
|
|
@@ -20,7 +20,13 @@ Use this rule when Docker is enabled in project context.
|
|
|
20
20
|
- Development lane priorities: fast rebuild, hot reload support, debugger-friendly startup, local volume strategy.
|
|
21
21
|
- Production lane priorities: minimal image size, reproducible build, non-root runtime, strict startup command.
|
|
22
22
|
|
|
23
|
-
## 3.
|
|
23
|
+
## 3. Selection Means Asset Materialization
|
|
24
|
+
- If Docker is selected for development, create or refine `.dockerignore`, development Dockerfile stage(s), `compose.yaml`, and a runbook before claiming the setup is complete.
|
|
25
|
+
- If Docker is selected for production, create or refine production Dockerfile stage(s), `compose.prod.yaml` or a documented production Compose override, health checks or startup checks, exposed ports, and a deployment runbook before claiming the setup is complete.
|
|
26
|
+
- If Docker is selected for both lanes, keep development and production assets separate enough that hot reload, bind mounts, debug tooling, and production runtime hardening cannot blur into one unsafe path.
|
|
27
|
+
- If the user asks to author files without commands, write the assets and documented commands, but do not execute Docker build, Compose, or registry commands.
|
|
28
|
+
|
|
29
|
+
## 4. Security and Supply Chain
|
|
24
30
|
- Use minimal trusted base images with explicit versions.
|
|
25
31
|
- Use multi-stage builds for production images when possible.
|
|
26
32
|
- Avoid baking secrets into image layers.
|
|
@@ -28,13 +34,13 @@ Use this rule when Docker is enabled in project context.
|
|
|
28
34
|
- Use fresh base-image validation with `docker build --pull` and use `--no-cache` when a clean dependency refresh is required.
|
|
29
35
|
- Keep a `.dockerignore` strategy in mind so build contexts stay small and do not leak unnecessary files into the image.
|
|
30
36
|
|
|
31
|
-
##
|
|
37
|
+
## 5. Operational Clarity
|
|
32
38
|
- Docker instructions must document expected entrypoint and exposed ports.
|
|
33
39
|
- Local development command and production deployment command must be explicit.
|
|
34
40
|
- If Docker is not selected for the project, do not force containerization tasks.
|
|
35
41
|
- If Compose is used, document which file is the primary entrypoint, which services are dev-only versus production-facing, and why the chosen layout matches the current Docker docs rather than a legacy blog pattern.
|
|
36
42
|
|
|
37
|
-
##
|
|
43
|
+
## 6. Review Requirements
|
|
38
44
|
- Verify the generated Docker workflow matches selected runtime environment (Linux/WSL, Windows, macOS).
|
|
39
45
|
- Verify development and production instructions are not mixed into one unsafe image path.
|
|
40
46
|
- Ensure API and service health checks are compatible with container startup behavior.
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
The LLM may choose modern libraries and tooling when they fit the project. This rule does not prefer "no library", "always add a library", or any fixed dependency set.
|
|
6
6
|
|
|
7
|
-
New dependencies are allowed when they create a better practical tradeoff than custom implementation. The decision should be based on whether the dependency meaningfully improves efficiency, shortens delivery time, improves correctness, reduces maintenance burden, or avoids unnecessary in-house code.
|
|
7
|
+
New dependencies are allowed when they create a better practical tradeoff than custom implementation. The decision should be based on whether the dependency meaningfully improves efficiency, shortens delivery time, improves correctness, reduces maintenance burden, unlocks a stronger user experience, or avoids unnecessary in-house code.
|
|
8
|
+
|
|
9
|
+
Do not treat dependency avoidance as an engineering virtue by itself. A small, maintained, well-scoped library can be the simpler and safer choice than custom code, especially for accessibility primitives, animation, gestures, data visualization, parsing, protocol handling, security-sensitive helpers, or browser/runtime capabilities with tricky edge cases.
|
|
8
10
|
|
|
9
11
|
Before adding or recommending a dependency:
|
|
10
12
|
- check current official docs, release notes, and setup guidance when the ecosystem decision matters
|
|
@@ -14,5 +16,6 @@ Before adding or recommending a dependency:
|
|
|
14
16
|
- explain why the dependency is a better tradeoff than local implementation for the current task
|
|
15
17
|
- avoid packages that are stale, thinly maintained, too heavy for the job, or added only because they are popular
|
|
16
18
|
- keep dependency boundaries replaceable when the library would spread through many files
|
|
19
|
+
- do not reject a dependency only because it adds a package; reject it only when the project-fit, security, maintenance, compatibility, bundle/runtime, or ownership tradeoff is worse than the alternative
|
|
17
20
|
|
|
18
|
-
Reject offline dependency decisions, outdated tutorial versions, trend choices,
|
|
21
|
+
Reject offline dependency decisions, outdated tutorial versions, trend choices, dependency avoidance choices, and performance-fear choices that are not grounded in the current repo, brief, and delivery tradeoffs.
|
|
@@ -4,10 +4,7 @@ Load this rule for UI-facing work. Keep the loaded surface small.
|
|
|
4
4
|
|
|
5
5
|
## Activation
|
|
6
6
|
|
|
7
|
-
Use this rule for
|
|
8
|
-
- UI, UX, page, screen, component, layout, landing, dashboard, form, onboarding, animation, interaction
|
|
9
|
-
- redesign, reskin, visual refresh, responsive fix, hierarchy fix
|
|
10
|
-
- frontend deliverables inside fullstack or backend work
|
|
7
|
+
Use this rule for UI, UX, page, screen, component, layout, landing, dashboard, form, onboarding, animation, interaction, redesign, visual refresh, responsive fix, hierarchy fix, and frontend deliverables inside fullstack or backend work.
|
|
11
8
|
|
|
12
9
|
## Authority
|
|
13
10
|
|
|
@@ -16,16 +13,16 @@ Use this rule for:
|
|
|
16
13
|
- Treat `README.md` as overview/install/user context only when design or architecture rules conflict.
|
|
17
14
|
- Do not choose final style, framework, palette, typography, layout paradigm, or animation library offline.
|
|
18
15
|
- Research current official docs before adding a new UI, animation, scroll, 3D, canvas, charting, icon, styling, or primitive library.
|
|
16
|
+
- Dynamic UI Foundation: do not hardcode shadcn/ui, Tailwind-only, native-only, or any component library as the universal answer. Modern lightweight primitives, motion libraries, canvas/WebGL helpers, charting libraries, and styling tools are valid when product evidence, accessibility, interaction quality, maintainability, delivery speed, runtime constraints, and official docs support them.
|
|
19
17
|
- Keep design continuity opt-in. Repo evidence outranks memory residue.
|
|
20
18
|
|
|
21
19
|
## Required Design Contract
|
|
22
20
|
|
|
23
|
-
Before UI code, create or refine
|
|
24
|
-
- `docs/DESIGN.md`
|
|
25
|
-
- `docs/design-intent.json`
|
|
21
|
+
Before UI code, create or refine `docs/DESIGN.md` and `docs/design-intent.json`.
|
|
26
22
|
|
|
27
23
|
The contract must record:
|
|
28
24
|
- `motionPaletteDecision`
|
|
25
|
+
- `designFlexibilityPolicy`
|
|
29
26
|
- `conceptualAnchor`
|
|
30
27
|
- `derivedTokenLogic`
|
|
31
28
|
- `aiSafeUiAudit`
|
|
@@ -45,7 +42,11 @@ Use the rename test: if the UI can be renamed to another product category withou
|
|
|
45
42
|
|
|
46
43
|
Use the old-design regression test for broad redesigns: if the UI reads as the previous design with fewer details, removed animation, simplified sections, or a new palette on the same composition, revise before implementation is considered complete.
|
|
47
44
|
|
|
48
|
-
Background lines, grids, scanlines, noise, glows, blobs, abstract logos, and decorative geometry are invalid as wallpaper. Do not use grid or line backgrounds as first-output filler. Use them only for a named product function such as alignment, crop guidance, map/route orientation, timeline reading, measurement, status, or motion continuity.
|
|
45
|
+
Background lines, grids, scanlines, noise, glows, blobs, abstract logos, calibration marks, and decorative geometry are invalid as wallpaper. Do not use grid or line backgrounds as first-output filler. Use them only for a named product function such as alignment, crop guidance, map/route orientation, timeline reading, measurement, status, or motion continuity.
|
|
46
|
+
|
|
47
|
+
Measurement, calibration, crop, map, route, and inspection marks are task-bound overlays or control affordances. They must not become the page background, hero backdrop, or default visual texture. When a conceptual anchor and a forbidden visual motif conflict, the forbidden motif wins; translate the anchor into layout, hierarchy, density, typography, state behavior, materials, and interaction instead of literal decorative texture.
|
|
48
|
+
|
|
49
|
+
Production UI must read as ship-ready: no visible testing, demo, sample, placeholder, lorem, TODO, coming soon, or scaffold labels unless they are intentional product states. User-facing workflows need an operable UI path; terminal-only core flows are valid only for CLI, developer-tool, or runbook products.
|
|
49
50
|
|
|
50
51
|
## Dynamic Anchor Gate
|
|
51
52
|
|
|
@@ -55,6 +56,7 @@ If the user gives no current-task visual research or reference:
|
|
|
55
56
|
- Internally reject the safest dashboard, portal, card-grid, admin-shell, or minimalist-web-app mental model.
|
|
56
57
|
- Record one real-world anchor reference, one signature motion behavior, and one typographic decision with role contrast.
|
|
57
58
|
- Derive typography, spacing, morphology, motion, and responsive recomposition from that anchor.
|
|
59
|
+
- Translate the anchor into workflow, hierarchy, density, typography, state behavior, and interaction before using literal artifacts. Do not turn anchor artifacts into required chrome, wallpaper, decorative props, or component-kit theme objects without a named product function.
|
|
58
60
|
- Reject anchors described only by generic quality words such as modern, clean, premium, expressive, minimal, or bold.
|
|
59
61
|
|
|
60
62
|
## Motion, Palette, and 3D
|
|
@@ -66,9 +68,10 @@ If the user gives no current-task visual research or reference:
|
|
|
66
68
|
- Do not default to dark slate, cream/beige/tan, purple-blue gradients, monochrome palettes, cyber-neon terminals, or uniform card surfaces without product evidence.
|
|
67
69
|
- Treat motion, 3D, WebGL, canvas, scroll choreography, and animation libraries as first-class options.
|
|
68
70
|
- Omit rich motion or spatial UI only after naming the product-fit reason and the replacement interaction quality.
|
|
69
|
-
- For new screens or broad redesigns, research the expressive implementation path instead of defaulting to static native CSS. Use native or already-installed tools only when they can still deliver the chosen ambition, or when a concrete blocker is documented.
|
|
71
|
+
- For new screens or broad redesigns, research the expressive implementation path instead of defaulting to static native CSS. Use native or already-installed tools only when they can still deliver the chosen ambition, or when a concrete blocker is documented. Do not downshift because adding a package feels inconvenient; downshift only for a concrete product-fit, accessibility, security, compatibility, device, maintenance, or measured performance reason.
|
|
70
72
|
- Keep reduced-motion, keyboard, loading, performance, mobile, and non-3D fallbacks explicit.
|
|
71
|
-
|
|
73
|
+
- Use component kits or headless primitives for behavior and accessibility when they fit. Replace library-default visual language with project-specific composition, tokens, motion, state treatment, and morphology.
|
|
74
|
+
- Keep design-intent flexible: lock user goals, accessibility, production readiness, forbidden patterns, and approved continuity; keep exact palette primitives, font families, radius/shadow values, component skins, and candidate signature moves flexible until evidence or approval locks them.
|
|
72
75
|
## Zero-Based Redesign
|
|
73
76
|
|
|
74
77
|
If the user asks for a redesign from zero:
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Do not over-optimize by habit. Do reject obvious scale and runtime failures.
|
|
4
4
|
|
|
5
|
+
Performance is a decision input, not a blanket veto against modern libraries, motion, richer UI, or maintained tooling. Compare the real cost of the dependency or implementation against the cost of custom code, lost accessibility, weaker UX, duplicated maintenance, and slower delivery.
|
|
6
|
+
|
|
5
7
|
Hard rejections:
|
|
6
8
|
- repeated network, database, filesystem, or model calls inside loops without batching, limits, or caching rationale
|
|
7
9
|
- unbounded reads, renders, exports, or searches when the data can grow
|
|
@@ -9,4 +11,4 @@ Hard rejections:
|
|
|
9
11
|
- synchronous blocking work in request, UI, worker, or async paths where it can stall the product
|
|
10
12
|
- caches without invalidation, expiry, ownership, and staleness trade-offs
|
|
11
13
|
|
|
12
|
-
When performance matters, measure the real bottleneck, change the smallest useful thing, and verify the result.
|
|
14
|
+
When performance matters, measure the real bottleneck, change the smallest useful thing, and verify the result. Do not downshift product quality, UI ambition, or library fit from performance fear alone; name the concrete budget, bottleneck, device limit, or runtime evidence.
|
|
@@ -7,7 +7,7 @@ alwaysApply: true
|
|
|
7
7
|
|
|
8
8
|
Adapter Mode: thin
|
|
9
9
|
Adapter Source: .instructions.md
|
|
10
|
-
Canonical Snapshot SHA256:
|
|
10
|
+
Canonical Snapshot SHA256: 8a232b1dc9792849a9290898ef40dfff730c13cd0b443d217c0590ced04ed946
|
|
11
11
|
|
|
12
12
|
This repository is governed by a strict instruction contract.
|
|
13
13
|
Use [.instructions.md](../../.instructions.md) as the canonical policy source.
|
package/.cursorrules
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# .cursorrules - Legacy Thin Adapter
|
|
2
2
|
|
|
3
|
-
Generated by Agentic-Senior-Core CLI v3.0.
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v3.0.44
|
|
4
4
|
Adapter Mode: legacy-thin
|
|
5
5
|
Adapter Source: .agent-instructions.md when present; fallback .instructions.md
|
|
6
6
|
Canonical baseline: .instructions.md
|
package/.gemini/instructions.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Adapter Mode: thin
|
|
4
4
|
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256:
|
|
5
|
+
Canonical Snapshot SHA256: 8a232b1dc9792849a9290898ef40dfff730c13cd0b443d217c0590ced04ed946
|
|
6
6
|
|
|
7
7
|
This repository is governed by a strict instruction contract.
|
|
8
8
|
Use [.instructions.md](../.instructions.md) as the canonical policy source.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Adapter Mode: thin
|
|
4
4
|
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256:
|
|
5
|
+
Canonical Snapshot SHA256: 8a232b1dc9792849a9290898ef40dfff730c13cd0b443d217c0590ced04ed946
|
|
6
6
|
|
|
7
7
|
This repository is governed by a strict instruction contract.
|
|
8
8
|
Use [.instructions.md](../.instructions.md) as the canonical policy source.
|
|
@@ -6,7 +6,7 @@ applyTo: "**"
|
|
|
6
6
|
|
|
7
7
|
Adapter Mode: thin
|
|
8
8
|
Adapter Source: .instructions.md
|
|
9
|
-
Canonical Snapshot SHA256:
|
|
9
|
+
Canonical Snapshot SHA256: 8a232b1dc9792849a9290898ef40dfff730c13cd0b443d217c0590ced04ed946
|
|
10
10
|
|
|
11
11
|
This repository is governed by a strict instruction contract.
|
|
12
12
|
Use [.instructions.md](../../.instructions.md) as the canonical policy source.
|
package/.instructions.md
CHANGED
|
@@ -44,7 +44,7 @@ Load only relevant rule files. Do not read the entire rule directory by default.
|
|
|
44
44
|
|
|
45
45
|
Available rules: `naming-conv.md`, `architecture.md`, `security.md`, `performance.md`, `error-handling.md`, `testing.md`, `git-workflow.md`, `efficiency-vs-hype.md`, `api-docs.md`, `microservices.md`, `event-driven.md`, `database-design.md`, `realtime.md`, `frontend-architecture.md`, `docker-runtime.md`.
|
|
46
46
|
|
|
47
|
-
For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. For framework or package setup work, use the latest stable compatible dependency set and official setup flow unless a documented compatibility constraint blocks it. New dependencies are allowed when they improve efficiency, delivery time, correctness, or maintainability.
|
|
47
|
+
For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. For framework or package setup work, use the latest stable compatible dependency set and official setup flow unless a documented compatibility constraint blocks it. New dependencies are allowed when they improve efficiency, delivery time, correctness, accessibility, UX, or maintainability. Do not treat dependency avoidance or vague performance fear as a default reason to skip a modern maintained library.
|
|
48
48
|
|
|
49
49
|
Backend/API routing:
|
|
50
50
|
- Data/schema/persistence: `architecture.md`, `database-design.md`, `performance.md`, `testing.md`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Adapter Mode: thin
|
|
4
4
|
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256:
|
|
5
|
+
Canonical Snapshot SHA256: 8a232b1dc9792849a9290898ef40dfff730c13cd0b443d217c0590ced04ed946
|
|
6
6
|
|
|
7
7
|
This repository is governed by a strict instruction contract.
|
|
8
8
|
Use [.instructions.md](../../.instructions.md) as the canonical policy source.
|
package/.windsurfrules
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# .windsurfrules - Legacy Thin Adapter
|
|
2
2
|
|
|
3
|
-
Generated by Agentic-Senior-Core CLI v3.0.
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v3.0.44
|
|
4
4
|
Adapter Mode: legacy-thin
|
|
5
5
|
Adapter Source: .agent-instructions.md when present; fallback .instructions.md
|
|
6
6
|
Canonical baseline: .instructions.md
|
package/AGENTS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Adapter Mode: thin
|
|
4
4
|
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256:
|
|
5
|
+
Canonical Snapshot SHA256: 8a232b1dc9792849a9290898ef40dfff730c13cd0b443d217c0590ced04ed946
|
|
6
6
|
|
|
7
7
|
This repository is governed by a strict instruction contract.
|
|
8
8
|
Use [.instructions.md](.instructions.md) as the canonical policy source.
|
package/CLAUDE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Adapter Mode: thin
|
|
4
4
|
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256:
|
|
5
|
+
Canonical Snapshot SHA256: 8a232b1dc9792849a9290898ef40dfff730c13cd0b443d217c0590ced04ed946
|
|
6
6
|
|
|
7
7
|
This repository is governed by a strict instruction contract.
|
|
8
8
|
Use [.instructions.md](.instructions.md) as the canonical policy source.
|
package/GEMINI.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Adapter Mode: thin
|
|
4
4
|
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256:
|
|
5
|
+
Canonical Snapshot SHA256: 8a232b1dc9792849a9290898ef40dfff730c13cd0b443d217c0590ced04ed946
|
|
6
6
|
|
|
7
7
|
This repository is governed by a strict instruction contract.
|
|
8
8
|
Use [.instructions.md](.instructions.md) as the canonical policy source.
|
|
@@ -524,6 +524,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
524
524
|
detectedLabel: detectedRuntimeEnvironment.label,
|
|
525
525
|
detectionSource: detectedRuntimeEnvironment.source,
|
|
526
526
|
},
|
|
527
|
+
dockerStrategy: discoveryAnswers?.dockerStrategy || null,
|
|
527
528
|
operationMode: 'init',
|
|
528
529
|
tokenOptimization: {
|
|
529
530
|
enabled: isTokenOptimizationEnabled,
|
package/lib/cli/compiler.mjs
CHANGED
|
@@ -64,6 +64,8 @@ function buildAnchorCommitmentHeader(designIntent) {
|
|
|
64
64
|
const conceptualAnchor = designIntent.conceptualAnchor || {};
|
|
65
65
|
const derivedTokenLogic = designIntent.derivedTokenLogic || {};
|
|
66
66
|
const creativeCommitment = designIntent.designExecutionHandoff?.creativeCommitment || {};
|
|
67
|
+
const designFlexibilityPolicy = designIntent.designFlexibilityPolicy || {};
|
|
68
|
+
const expressionFlexibility = designIntent.designExecutionHandoff?.expressionFlexibility || {};
|
|
67
69
|
const anchorReference = conceptualAnchor.anchorReference || derivedTokenLogic.anchorReference;
|
|
68
70
|
const conceptualAnchorName = conceptualAnchor.name || anchorReference;
|
|
69
71
|
const signatureMove = conceptualAnchor.signatureMove
|
|
@@ -74,6 +76,12 @@ function buildAnchorCommitmentHeader(designIntent) {
|
|
|
74
76
|
const typographicDecision = conceptualAnchor.typographicDecision
|
|
75
77
|
|| creativeCommitment.typographicDecision
|
|
76
78
|
|| derivedTokenLogic.typographyDerivationSource;
|
|
79
|
+
const flexibleAxes = Array.isArray(designFlexibilityPolicy.flexibleExpressionAxes)
|
|
80
|
+
? designFlexibilityPolicy.flexibleExpressionAxes
|
|
81
|
+
: expressionFlexibility.flexibleAxes;
|
|
82
|
+
const lockedOutcomes = Array.isArray(expressionFlexibility.lockedOutcomes)
|
|
83
|
+
? expressionFlexibility.lockedOutcomes
|
|
84
|
+
: designFlexibilityPolicy.lockedOutcomeTypes;
|
|
77
85
|
|
|
78
86
|
if (!conceptualAnchorName && !anchorReference) {
|
|
79
87
|
return [
|
|
@@ -92,6 +100,8 @@ function buildAnchorCommitmentHeader(designIntent) {
|
|
|
92
100
|
`Signature Move: ${toSingleLine(signatureMove, 'MISSING - define one concrete authored move before UI implementation')}`,
|
|
93
101
|
`Motion Signature: ${toSingleLine(signatureMotion, 'MISSING - define timing/easing/choreography before UI implementation')}`,
|
|
94
102
|
`Typographic Decision: ${toSingleLine(typographicDecision, 'MISSING - define role contrast before UI implementation')}`,
|
|
103
|
+
`Locked Outcomes: ${toSingleLine(Array.isArray(lockedOutcomes) ? lockedOutcomes.join(', ') : '', 'user goals, accessibility, production readiness, forbidden patterns')}`,
|
|
104
|
+
`Flexible Expression: ${toSingleLine(Array.isArray(flexibleAxes) ? flexibleAxes.join(', ') : '', 'exact primitives, typeface, surface treatment, component skin, candidate moves')}`,
|
|
95
105
|
'If the UI output does not reflect these lines, stop and revise the design contract before continuing.',
|
|
96
106
|
].join('\n');
|
|
97
107
|
}
|
|
@@ -128,6 +138,27 @@ function buildLegacyRootAdapterContent(adapterFileName, toolLabel) {
|
|
|
128
138
|
].join('\n');
|
|
129
139
|
}
|
|
130
140
|
|
|
141
|
+
function buildContainerizationStrategySnapshot(dockerStrategy) {
|
|
142
|
+
const selectedDockerStrategy = String(dockerStrategy || '').trim();
|
|
143
|
+
const normalizedDockerStrategy = selectedDockerStrategy.toLowerCase();
|
|
144
|
+
const dockerSelected = Boolean(selectedDockerStrategy) && !normalizedDockerStrategy.startsWith('no docker');
|
|
145
|
+
const developmentRequired = dockerSelected
|
|
146
|
+
&& (normalizedDockerStrategy.includes('development') || normalizedDockerStrategy.includes('both'));
|
|
147
|
+
const productionRequired = dockerSelected
|
|
148
|
+
&& (normalizedDockerStrategy.includes('production') || normalizedDockerStrategy.includes('both'));
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
selected: selectedDockerStrategy || null,
|
|
152
|
+
developmentRequired,
|
|
153
|
+
productionRequired,
|
|
154
|
+
materializationRequired: dockerSelected,
|
|
155
|
+
requiredRuleFile: dockerSelected ? '.agent-context/rules/docker-runtime.md' : null,
|
|
156
|
+
commandExecutionPolicy: dockerSelected
|
|
157
|
+
? 'author-files-first-run-docker-commands-only-when-requested-or-approved'
|
|
158
|
+
: null,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
131
162
|
export async function writeSelectedPolicy(targetDirectoryPath, selectedProfileName) {
|
|
132
163
|
const policyFilePath = path.join(targetDirectoryPath, '.agent-context', 'policies', POLICY_FILE_NAME);
|
|
133
164
|
const parsedPolicy = JSON.parse(await fs.readFile(policyFilePath, 'utf8'));
|
|
@@ -149,6 +180,7 @@ export async function writeOnboardingReport({
|
|
|
149
180
|
setupDurationMs,
|
|
150
181
|
projectDetection,
|
|
151
182
|
runtimeEnvironment = null,
|
|
183
|
+
dockerStrategy = null,
|
|
152
184
|
operationMode = 'init',
|
|
153
185
|
tokenOptimization = undefined,
|
|
154
186
|
memoryContinuity = undefined,
|
|
@@ -199,6 +231,7 @@ export async function writeOnboardingReport({
|
|
|
199
231
|
ciGuardrailsEnabled: includeCiGuardrails,
|
|
200
232
|
setupDurationMs,
|
|
201
233
|
runtimeEnvironment,
|
|
234
|
+
containerizationStrategy: buildContainerizationStrategySnapshot(dockerStrategy),
|
|
202
235
|
tokenOptimization: resolvedTokenOptimization,
|
|
203
236
|
memoryContinuity: resolvedMemoryContinuity,
|
|
204
237
|
autoDetection: {
|
|
@@ -113,6 +113,36 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
if (!designIntentContract.designFlexibilityPolicy || typeof designIntentContract.designFlexibilityPolicy !== 'object') {
|
|
117
|
+
validationErrors.push('designIntent.designFlexibilityPolicy must exist.');
|
|
118
|
+
} else {
|
|
119
|
+
const designFlexibilityPolicy = designIntentContract.designFlexibilityPolicy;
|
|
120
|
+
if (designFlexibilityPolicy.mode !== 'locked-outcomes-flexible-expression') {
|
|
121
|
+
validationErrors.push('designIntent.designFlexibilityPolicy.mode must equal "locked-outcomes-flexible-expression".');
|
|
122
|
+
}
|
|
123
|
+
if (!hasNonEmptyString(designFlexibilityPolicy.contractRole)) {
|
|
124
|
+
validationErrors.push('designIntent.designFlexibilityPolicy.contractRole must be a non-empty string.');
|
|
125
|
+
}
|
|
126
|
+
if (!Array.isArray(designFlexibilityPolicy.lockedOutcomeTypes) || designFlexibilityPolicy.lockedOutcomeTypes.length < 4) {
|
|
127
|
+
validationErrors.push('designIntent.designFlexibilityPolicy.lockedOutcomeTypes must list the locked outcome categories.');
|
|
128
|
+
}
|
|
129
|
+
if (!Array.isArray(designFlexibilityPolicy.flexibleExpressionAxes) || designFlexibilityPolicy.flexibleExpressionAxes.length < 4) {
|
|
130
|
+
validationErrors.push('designIntent.designFlexibilityPolicy.flexibleExpressionAxes must list flexible expression axes.');
|
|
131
|
+
}
|
|
132
|
+
if (!hasNonEmptyString(designFlexibilityPolicy.tokenLockingRule)) {
|
|
133
|
+
validationErrors.push('designIntent.designFlexibilityPolicy.tokenLockingRule must be a non-empty string.');
|
|
134
|
+
}
|
|
135
|
+
if (!String(designFlexibilityPolicy.signatureMovePolicy || '').includes('candidate')) {
|
|
136
|
+
validationErrors.push('designIntent.designFlexibilityPolicy.signatureMovePolicy must separate candidate moves from required outcomes.');
|
|
137
|
+
}
|
|
138
|
+
if (!String(designFlexibilityPolicy.libraryVisualLanguagePolicy || '').includes('Libraries supply')) {
|
|
139
|
+
validationErrors.push('designIntent.designFlexibilityPolicy.libraryVisualLanguagePolicy must keep libraries from dictating visual language.');
|
|
140
|
+
}
|
|
141
|
+
if (!String(designFlexibilityPolicy.literalAnchorPolicy || '').includes('Translate anchors')) {
|
|
142
|
+
validationErrors.push('designIntent.designFlexibilityPolicy.literalAnchorPolicy must require non-literal anchor translation.');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
116
146
|
if (!designIntentContract.conceptualAnchor || typeof designIntentContract.conceptualAnchor !== 'object') {
|
|
117
147
|
validationErrors.push('designIntent.conceptualAnchor must exist.');
|
|
118
148
|
} else {
|
|
@@ -228,6 +258,20 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
228
258
|
validationErrors.push('designIntent.conceptualAnchor.visualRiskBudget.requireReducedMotionFallback must equal true.');
|
|
229
259
|
}
|
|
230
260
|
}
|
|
261
|
+
const literalTranslationPolicy = conceptualAnchor.literalTranslationPolicy;
|
|
262
|
+
if (!literalTranslationPolicy || typeof literalTranslationPolicy !== 'object') {
|
|
263
|
+
validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy must exist.');
|
|
264
|
+
} else {
|
|
265
|
+
if (literalTranslationPolicy.preferNonLiteralTranslation !== true) {
|
|
266
|
+
validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.preferNonLiteralTranslation must equal true.');
|
|
267
|
+
}
|
|
268
|
+
if (!hasNonEmptyString(literalTranslationPolicy.allowedLiteralUse)) {
|
|
269
|
+
validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.allowedLiteralUse must be a non-empty string.');
|
|
270
|
+
}
|
|
271
|
+
if (!String(literalTranslationPolicy.forbiddenLiteralUse || '').includes('decorative wallpaper')) {
|
|
272
|
+
validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.forbiddenLiteralUse must reject decorative wallpaper.');
|
|
273
|
+
}
|
|
274
|
+
}
|
|
231
275
|
if (
|
|
232
276
|
!Array.isArray(conceptualAnchor.requiredDerivedAxes)
|
|
233
277
|
|| !conceptualAnchor.requiredDerivedAxes.includes('typography')
|
|
@@ -291,6 +335,9 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
291
335
|
if (!String(aiSafeUiAudit.failureDefinition || '').includes('AI-safe')) {
|
|
292
336
|
validationErrors.push('designIntent.aiSafeUiAudit.failureDefinition must define AI-safe UI drift.');
|
|
293
337
|
}
|
|
338
|
+
if (!String(aiSafeUiAudit.failureDefinition || '').includes('placeholder copy')) {
|
|
339
|
+
validationErrors.push('designIntent.aiSafeUiAudit.failureDefinition must reject test/demo/placeholder UI copy.');
|
|
340
|
+
}
|
|
294
341
|
if (!String(aiSafeUiAudit.interchangeabilityTest || '').includes('renamed')) {
|
|
295
342
|
validationErrors.push('designIntent.aiSafeUiAudit.interchangeabilityTest must include the rename/interchangeability test.');
|
|
296
343
|
}
|
|
@@ -349,6 +396,27 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
349
396
|
}
|
|
350
397
|
}
|
|
351
398
|
|
|
399
|
+
if (!designIntentContract.productionContentPolicy || typeof designIntentContract.productionContentPolicy !== 'object') {
|
|
400
|
+
validationErrors.push('designIntent.productionContentPolicy must exist.');
|
|
401
|
+
} else {
|
|
402
|
+
const productionContentPolicy = designIntentContract.productionContentPolicy;
|
|
403
|
+
if (productionContentPolicy.status !== 'agent-must-complete-before-ui-implementation') {
|
|
404
|
+
validationErrors.push('designIntent.productionContentPolicy.status must require completion before UI implementation.');
|
|
405
|
+
}
|
|
406
|
+
if (!String(productionContentPolicy.userFacingCopyRule || '').includes('testing')) {
|
|
407
|
+
validationErrors.push('designIntent.productionContentPolicy.userFacingCopyRule must reject testing/demo/placeholder UI copy.');
|
|
408
|
+
}
|
|
409
|
+
if (!String(productionContentPolicy.terminalDependencyRule || '').includes('Terminal commands')) {
|
|
410
|
+
validationErrors.push('designIntent.productionContentPolicy.terminalDependencyRule must keep terminal commands out of core UI flows.');
|
|
411
|
+
}
|
|
412
|
+
if (!Array.isArray(productionContentPolicy.allowedExceptions) || productionContentPolicy.allowedExceptions.length < 3) {
|
|
413
|
+
validationErrors.push('designIntent.productionContentPolicy.allowedExceptions must list limited exceptions.');
|
|
414
|
+
}
|
|
415
|
+
if (productionContentPolicy.blockingByDefault !== true) {
|
|
416
|
+
validationErrors.push('designIntent.productionContentPolicy.blockingByDefault must equal true.');
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
352
420
|
if (!designIntentContract.tokenSystem || typeof designIntentContract.tokenSystem !== 'object') {
|
|
353
421
|
validationErrors.push('designIntent.tokenSystem must exist.');
|
|
354
422
|
} else {
|
|
@@ -368,6 +436,20 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
368
436
|
if (designIntentContract.tokenSystem.componentTokensConsumeSemantic !== true) {
|
|
369
437
|
validationErrors.push('designIntent.tokenSystem.componentTokensConsumeSemantic must equal true.');
|
|
370
438
|
}
|
|
439
|
+
const tokenLockingPolicy = designIntentContract.tokenSystem.tokenLockingPolicy;
|
|
440
|
+
if (!tokenLockingPolicy || typeof tokenLockingPolicy !== 'object') {
|
|
441
|
+
validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy must exist.');
|
|
442
|
+
} else {
|
|
443
|
+
if (tokenLockingPolicy.defaultLockState !== 'semantic-roles-locked-primitives-flexible') {
|
|
444
|
+
validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.defaultLockState must preserve semantic roles while keeping primitives flexible.');
|
|
445
|
+
}
|
|
446
|
+
if (!Array.isArray(tokenLockingPolicy.flexibleByDefault) || tokenLockingPolicy.flexibleByDefault.length < 4) {
|
|
447
|
+
validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.flexibleByDefault must list flexible primitive axes.');
|
|
448
|
+
}
|
|
449
|
+
if (!hasNonEmptyString(tokenLockingPolicy.promotionRule)) {
|
|
450
|
+
validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.promotionRule must be a non-empty string.');
|
|
451
|
+
}
|
|
452
|
+
}
|
|
371
453
|
const fallbackPolicy = designIntentContract.tokenSystem.fallbackPolicy;
|
|
372
454
|
if (!fallbackPolicy || typeof fallbackPolicy !== 'object') {
|
|
373
455
|
validationErrors.push('designIntent.tokenSystem.fallbackPolicy must exist.');
|
|
@@ -565,6 +647,10 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
565
647
|
'requireStructuredHandoff',
|
|
566
648
|
'requireRepoEvidenceAlignment',
|
|
567
649
|
'forbidScreenshotDependency',
|
|
650
|
+
'separateRequiredOutcomesFromCandidateMoves',
|
|
651
|
+
'forbidCandidateMovesAsLockedRequirements',
|
|
652
|
+
'forbidLibraryThemeAsVisualAuthority',
|
|
653
|
+
'forbidLiteralAnchorChromeWithoutProductFunction',
|
|
568
654
|
'requirePerSurfaceMutationOps',
|
|
569
655
|
'forbidUniformSiblingSurfaceTreatment',
|
|
570
656
|
'zeroBasedRedesignResetsPriorVisualsWhenRequested',
|
|
@@ -650,6 +736,23 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
650
736
|
if (!Array.isArray(designIntentContract.designExecutionHandoff.interactionStateMatrix) || designIntentContract.designExecutionHandoff.interactionStateMatrix.length < 1) {
|
|
651
737
|
validationErrors.push('designIntent.designExecutionHandoff.interactionStateMatrix must list key component state expectations.');
|
|
652
738
|
}
|
|
739
|
+
const expressionFlexibility = designIntentContract.designExecutionHandoff.expressionFlexibility;
|
|
740
|
+
if (!expressionFlexibility || typeof expressionFlexibility !== 'object') {
|
|
741
|
+
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility must exist.');
|
|
742
|
+
} else {
|
|
743
|
+
if (!Array.isArray(expressionFlexibility.lockedOutcomes) || expressionFlexibility.lockedOutcomes.length < 3) {
|
|
744
|
+
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.lockedOutcomes must list locked outcomes.');
|
|
745
|
+
}
|
|
746
|
+
if (!Array.isArray(expressionFlexibility.candidateSignatureMoves) || expressionFlexibility.candidateSignatureMoves.length < 1) {
|
|
747
|
+
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.candidateSignatureMoves must include at least one candidate move placeholder.');
|
|
748
|
+
}
|
|
749
|
+
if (!Array.isArray(expressionFlexibility.flexibleAxes) || expressionFlexibility.flexibleAxes.length < 4) {
|
|
750
|
+
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.flexibleAxes must list flexible implementation axes.');
|
|
751
|
+
}
|
|
752
|
+
if (!String(expressionFlexibility.lockingRule || '').includes('candidate')) {
|
|
753
|
+
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.lockingRule must explain when candidate moves become required.');
|
|
754
|
+
}
|
|
755
|
+
}
|
|
653
756
|
if (!Array.isArray(designIntentContract.designExecutionHandoff.taskFlowNarrative) || designIntentContract.designExecutionHandoff.taskFlowNarrative.length < 2) {
|
|
654
757
|
validationErrors.push('designIntent.designExecutionHandoff.taskFlowNarrative must describe the key UI task flow in sequence.');
|
|
655
758
|
}
|
|
@@ -683,6 +786,10 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
683
786
|
'requireBuildFromHandoff',
|
|
684
787
|
'requireGapNotesBeforeFallback',
|
|
685
788
|
'forbidGenericLayoutFallbackWithoutReason',
|
|
789
|
+
'requireLockedVsFlexibleDecisionReview',
|
|
790
|
+
'forbidCandidateMoveHardcoding',
|
|
791
|
+
'forbidTestingDemoCopyInUi',
|
|
792
|
+
'forbidTerminalOnlyUserFlows',
|
|
686
793
|
]) {
|
|
687
794
|
if (implementationGuardrails[requiredFlagName] !== true) {
|
|
688
795
|
validationErrors.push(`designIntent.designExecutionHandoff.implementationGuardrails.${requiredFlagName} must equal true.`);
|
|
@@ -723,6 +830,10 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
723
830
|
'ai-color-default-palette-without-product-role-behavior',
|
|
724
831
|
'interchangeable-product-renaming-test-fails',
|
|
725
832
|
'decorative-grid-or-glow-wallpaper-without-product-function',
|
|
833
|
+
'decorative-line-or-calibration-wallpaper-without-product-function',
|
|
834
|
+
'measurement-or-calibration-marks-used-as-page-background',
|
|
835
|
+
'testing-demo-or-placeholder-copy-shipped-to-ui',
|
|
836
|
+
'terminal-only-user-flow-without-product-reason',
|
|
726
837
|
'motion-or-3d-omitted-from-fear-without-fit-analysis',
|
|
727
838
|
]) {
|
|
728
839
|
if (!designIntentContract.reviewRubric.genericitySignals.includes(requiredSignal)) {
|
|
@@ -777,6 +888,10 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
777
888
|
'ai-color-default-palette-without-product-role-behavior',
|
|
778
889
|
'interchangeable-product-renaming-test-fails',
|
|
779
890
|
'decorative-grid-or-glow-wallpaper-without-product-function',
|
|
891
|
+
'decorative-line-or-calibration-wallpaper-without-product-function',
|
|
892
|
+
'measurement-or-calibration-marks-used-as-page-background',
|
|
893
|
+
'testing-demo-or-placeholder-copy-shipped-to-ui',
|
|
894
|
+
'terminal-only-user-flow-without-product-reason',
|
|
780
895
|
'motion-or-3d-omitted-from-fear-without-fit-analysis',
|
|
781
896
|
]) {
|
|
782
897
|
if (!designIntentContract.forbiddenPatterns.includes(requiredPattern)) {
|
|
@@ -12,14 +12,23 @@ const GENERICITY_DRIFT_SIGNALS = [
|
|
|
12
12
|
'brandless-clean-template-look',
|
|
13
13
|
'interchangeable-product-renaming-test-fails',
|
|
14
14
|
'decorative-grid-or-glow-wallpaper-without-product-function',
|
|
15
|
+
'decorative-line-or-calibration-wallpaper-without-product-function',
|
|
16
|
+
'measurement-or-calibration-marks-used-as-page-background',
|
|
17
|
+
'testing-demo-or-placeholder-copy-shipped-to-ui',
|
|
18
|
+
'terminal-only-user-flow-without-product-reason',
|
|
15
19
|
'safe-cream-slate-or-monochrome-palette-used-as-readability-excuse',
|
|
16
20
|
'generic-abstract-logo-or-iconography',
|
|
17
21
|
'timid-anchor-that-renames-dashboard-or-admin-shell',
|
|
18
22
|
'motion-suppressed-without-accessibility-or-performance-reason',
|
|
19
23
|
'motion-or-3d-omitted-from-fear-without-fit-analysis',
|
|
24
|
+
'modern-library-rejected-from-dependency-fear-without-tradeoff-analysis',
|
|
25
|
+
'component-library-selected-by-habit-without-product-fit',
|
|
20
26
|
'scale-only-responsive-layout',
|
|
21
27
|
'zero-based-redesign-kept-prior-visual-dna',
|
|
22
28
|
'restyle-instead-of-recomposition',
|
|
29
|
+
'literal-anchor-artifacts-used-as-required-ui-chrome',
|
|
30
|
+
'candidate-signature-move-treated-as-locked-implementation',
|
|
31
|
+
'library-theme-tokens-drive-visual-language',
|
|
23
32
|
];
|
|
24
33
|
|
|
25
34
|
const FORBIDDEN_PATTERN_SIGNALS = [
|
|
@@ -37,6 +46,8 @@ const VALID_BOLD_SIGNALS = [
|
|
|
37
46
|
'background-or-geometry-serves-product-function',
|
|
38
47
|
'motion-or-spatial-experience-derived-from-anchor',
|
|
39
48
|
'explicit-3d-canvas-fit-or-nonfit-decision',
|
|
49
|
+
'official-docs-backed-modern-library-choice',
|
|
50
|
+
'headless-or-component-primitive-restyled-to-product-language',
|
|
40
51
|
'responsive-recomposition-by-task-priority',
|
|
41
52
|
'purposeful-motion-with-reduced-motion-path',
|
|
42
53
|
];
|
|
@@ -172,7 +183,30 @@ function buildDesignIntentContractObject({
|
|
|
172
183
|
'ui-primitives-or-rich-media',
|
|
173
184
|
'typography-and-interaction',
|
|
174
185
|
],
|
|
175
|
-
finalDecisionAuthority: 'project-fit-accessibility-performance-maintainability-official-docs',
|
|
186
|
+
finalDecisionAuthority: 'project-fit-accessibility-performance-maintainability-delivery-speed-official-docs',
|
|
187
|
+
},
|
|
188
|
+
designFlexibilityPolicy: {
|
|
189
|
+
mode: 'locked-outcomes-flexible-expression',
|
|
190
|
+
contractRole: 'Use docs/design-intent.json as review invariants and handoff structure, not as a frozen visual recipe unless the user explicitly locks a decision.',
|
|
191
|
+
lockedOutcomeTypes: [
|
|
192
|
+
'confirmed-user-goals',
|
|
193
|
+
'repo-evidence-and-runtime-constraints',
|
|
194
|
+
'accessibility-and-production-readiness',
|
|
195
|
+
'forbidden-patterns-and-safety-gates',
|
|
196
|
+
'user-approved-brand-or-continuity-decisions',
|
|
197
|
+
],
|
|
198
|
+
flexibleExpressionAxes: [
|
|
199
|
+
'exact-palette-primitives',
|
|
200
|
+
'font-family-selection',
|
|
201
|
+
'radius-shadow-and-surface-treatment',
|
|
202
|
+
'component-kit-theme-mapping',
|
|
203
|
+
'signature-move-implementation',
|
|
204
|
+
'literal-anchor-artifacts',
|
|
205
|
+
],
|
|
206
|
+
tokenLockingRule: 'Semantic roles are required, but exact primitive values stay flexible until repo evidence, accessibility validation, implementation constraints, or explicit user approval locks them.',
|
|
207
|
+
signatureMovePolicy: 'Record the required experience outcome separately from candidate implementation moves; replace a candidate move when another move better fits the product.',
|
|
208
|
+
libraryVisualLanguagePolicy: 'Libraries supply behavior, accessibility, primitives, and delivery speed; they must not dictate final composition, theme, morphology, or visual language.',
|
|
209
|
+
literalAnchorPolicy: 'Translate anchors into workflow, hierarchy, density, typography, material behavior, state language, and interaction grammar before requiring literal props, marks, or chrome.',
|
|
176
210
|
},
|
|
177
211
|
conceptualAnchor: {
|
|
178
212
|
mode: 'required-when-no-external-research',
|
|
@@ -224,8 +258,14 @@ function buildDesignIntentContractObject({
|
|
|
224
258
|
mode: 'high-distinctiveness-with-accessibility-and-performance-guardrails',
|
|
225
259
|
allowRichMotionAndMicroInteraction: true,
|
|
226
260
|
rejectTimidDefaultWhenAnchorSupportsExpressiveUi: true,
|
|
261
|
+
rejectDependencyFearAsDownshiftReason: true,
|
|
227
262
|
requireReducedMotionFallback: true,
|
|
228
263
|
},
|
|
264
|
+
literalTranslationPolicy: {
|
|
265
|
+
preferNonLiteralTranslation: true,
|
|
266
|
+
allowedLiteralUse: 'Only use literal anchor artifacts when they serve a named product function, control, state, or task overlay.',
|
|
267
|
+
forbiddenLiteralUse: 'Do not turn anchor artifacts into decorative wallpaper, required chrome, default texture, or unavoidable theme props.',
|
|
268
|
+
},
|
|
229
269
|
requiredDerivedAxes: [
|
|
230
270
|
'typography',
|
|
231
271
|
'morphology',
|
|
@@ -260,21 +300,21 @@ function buildDesignIntentContractObject({
|
|
|
260
300
|
derivedTokenLogic: {
|
|
261
301
|
anchorReference: 'agent-defined-anchor-reference',
|
|
262
302
|
colorDerivationSource: 'Explain semantic color roles from anchorReference; reject generic palettes without anchor evidence.',
|
|
263
|
-
spacingDerivationSource: 'Explain
|
|
303
|
+
spacingDerivationSource: 'Explain spacing rhythm, density, and exceptions from anchorReference. Spacing grids are layout math, not decorative background lines.',
|
|
264
304
|
typographyDerivationSource: 'Explain display, body, metadata, and data roles from anchorReference.',
|
|
265
305
|
motionDerivationSource: 'Explain duration, easing, choreography, and reduced-motion from anchorReference.',
|
|
266
|
-
validationRule: 'Every token must trace to anchorReference;
|
|
306
|
+
validationRule: 'Every semantic token role must trace to anchorReference; keep exact primitive values flexible unless locked by repo evidence, accessibility validation, implementation constraints, or explicit user approval.',
|
|
267
307
|
},
|
|
268
308
|
motionPaletteDecision: {
|
|
269
309
|
productCategorySignal: 'agent-inferred-starting-heuristic',
|
|
270
310
|
densityDecisionSource: 'Choose motion density from task, content, brand, device, performance, and accessibility. Categories are heuristics.',
|
|
271
311
|
requiredInteractionStates: ['default', 'hover', 'focus-visible', 'active', 'disabled', 'loading', 'empty', 'error', 'success', 'transition'],
|
|
272
|
-
paletteAutopilotRisks: ['dark-slate-default', 'cream-beige-default', 'purple-blue-gradient-default', 'monochrome-template-default', 'uniform-card-surface-default', 'generic-grid-wallpaper-default', 'soft-glow-ai-template-default', 'cyber-neon-terminal-default'],
|
|
312
|
+
paletteAutopilotRisks: ['dark-slate-default', 'cream-beige-default', 'purple-blue-gradient-default', 'monochrome-template-default', 'uniform-card-surface-default', 'generic-grid-wallpaper-default', 'generic-line-wallpaper-default', 'calibration-mark-wallpaper-default', 'soft-glow-ai-template-default', 'cyber-neon-terminal-default'],
|
|
273
313
|
spatialDecision: 'State 3D/canvas/WebGL fit. If omitted, name product-fit reason and replacement interaction quality.',
|
|
274
314
|
},
|
|
275
315
|
aiSafeUiAudit: {
|
|
276
316
|
status: 'agent-must-complete-before-ui-implementation',
|
|
277
|
-
failureDefinition: 'AI-safe UI uses template cards, generic marks, decorative grid or line wallpaper, safe palettes, glow backgrounds, or copied scaffold composition.',
|
|
317
|
+
failureDefinition: 'AI-safe UI uses template cards, generic marks, decorative grid or line wallpaper, calibration-mark wallpaper, test/demo/placeholder copy, terminal-only user paths, safe palettes, glow backgrounds, or copied scaffold composition.',
|
|
278
318
|
interchangeabilityTest: `If this UI can be renamed from ${projectName} to another product category without changing composition, palette, iconography, and motion, revise it.`,
|
|
279
319
|
requiredProductSpecificSignals: [
|
|
280
320
|
'agent-defined-product-specific-data-treatment',
|
|
@@ -282,7 +322,7 @@ function buildDesignIntentContractObject({
|
|
|
282
322
|
'agent-defined-product-specific-morphology-iconography-or-spatial-structure',
|
|
283
323
|
],
|
|
284
324
|
paletteExplorationRule: 'Use a visually exploratory product-derived palette with WCAG contrast and status clarity.',
|
|
285
|
-
backgroundPatternRule: 'Lines, grids, scanlines, noise, glows, blobs, logos, and geometry must serve a named product function; never use grid or
|
|
325
|
+
backgroundPatternRule: 'Lines, grids, scanlines, noise, glows, blobs, logos, calibration marks, and geometry must serve a named product function; never use grid, line, or calibration-mark backgrounds as first-output filler. Measurement and inspection marks belong to task overlays or controls, not page wallpaper.',
|
|
286
326
|
aiColorAudit: {
|
|
287
327
|
status: 'agent-must-complete-before-ui-implementation',
|
|
288
328
|
failureDefinition: 'AI color drift uses safe defaults before deriving roles from the product anchor.',
|
|
@@ -302,21 +342,35 @@ function buildDesignIntentContractObject({
|
|
|
302
342
|
'spatial-or-3d-fit',
|
|
303
343
|
'performance-and-reduced-motion-fallback',
|
|
304
344
|
],
|
|
305
|
-
rejectionRule: 'State a product reason and replacement interaction quality before omitting 3D/canvas.',
|
|
345
|
+
rejectionRule: 'State a product reason and replacement interaction quality before omitting 3D/canvas. Package count or vague performance fear is not enough.',
|
|
306
346
|
reviewQuestion: 'Is the interaction as expressive as the product can responsibly support?',
|
|
307
347
|
},
|
|
308
348
|
reviewQuestion: 'What visible evidence proves this is product-specific?',
|
|
309
349
|
blockingByDefault: true,
|
|
310
350
|
},
|
|
351
|
+
productionContentPolicy: {
|
|
352
|
+
status: 'agent-must-complete-before-ui-implementation',
|
|
353
|
+
userFacingCopyRule: 'Visible UI copy must be product-ready and task-specific. Do not ship testing, demo, sample, placeholder, lorem, TODO, coming soon, or scaffold labels unless they are real product states.',
|
|
354
|
+
terminalDependencyRule: 'User-facing workflows must be operable through the UI unless the product is explicitly a CLI, developer tool, or operational runbook. Terminal commands belong in setup and deployment docs, not as the only path for core user tasks.',
|
|
355
|
+
allowedExceptions: [
|
|
356
|
+
'test-harness-only',
|
|
357
|
+
'documented-empty-state',
|
|
358
|
+
'admin-or-devtool-diagnostic-surface',
|
|
359
|
+
'explicit-user-requested-prototype',
|
|
360
|
+
],
|
|
361
|
+
reviewQuestion: 'Can this UI be shipped to real users without removing test/demo copy or terminal-only workflow dependencies?',
|
|
362
|
+
blockingByDefault: true,
|
|
363
|
+
},
|
|
311
364
|
libraryResearchStatus: 'pending-verification',
|
|
312
365
|
libraryDecisions: [
|
|
313
366
|
{
|
|
314
367
|
library: 'agent-defined-or-none',
|
|
315
|
-
purpose: '
|
|
368
|
+
purpose: 'Select UI-related libraries dynamically from product fit, accessibility, interaction quality, maintenance, and current official docs before imports.',
|
|
316
369
|
verifiedAt: null,
|
|
317
370
|
sourceUrl: null,
|
|
318
371
|
stableVersion: null,
|
|
319
372
|
fallbackIfUnavailable: 'Use native CSS, browser APIs, or existing dependencies.',
|
|
373
|
+
selectionPolicy: 'Do not default to shadcn, native-only, Tailwind-only, or dependency avoidance by habit.',
|
|
320
374
|
},
|
|
321
375
|
],
|
|
322
376
|
mathSystems: {
|
|
@@ -340,6 +394,12 @@ function buildDesignIntentContractObject({
|
|
|
340
394
|
forbidRawSpacingOutsidePrimitives: true,
|
|
341
395
|
requireDocumentedExceptionForLegacyBypass: true,
|
|
342
396
|
},
|
|
397
|
+
tokenLockingPolicy: {
|
|
398
|
+
defaultLockState: 'semantic-roles-locked-primitives-flexible',
|
|
399
|
+
lockedByDefault: ['semantic-role-purpose', 'accessibility-floor', 'state-role-meaning'],
|
|
400
|
+
flexibleByDefault: ['exact-color-values', 'font-family', 'radius-values', 'shadow-values', 'component-skin'],
|
|
401
|
+
promotionRule: 'Promote flexible tokens to locked only when user approval, repo evidence, accessibility validation, or implementation constraints require it.',
|
|
402
|
+
},
|
|
343
403
|
namingConstraints: {
|
|
344
404
|
forbidCurlyBracesInNames: true,
|
|
345
405
|
forbidDotsInNames: true,
|
|
@@ -413,6 +473,10 @@ function buildDesignIntentContractObject({
|
|
|
413
473
|
requireStructuredHandoff: true,
|
|
414
474
|
requireRepoEvidenceAlignment: true,
|
|
415
475
|
forbidScreenshotDependency: true,
|
|
476
|
+
separateRequiredOutcomesFromCandidateMoves: true,
|
|
477
|
+
forbidCandidateMovesAsLockedRequirements: true,
|
|
478
|
+
forbidLibraryThemeAsVisualAuthority: true,
|
|
479
|
+
forbidLiteralAnchorChromeWithoutProductFunction: true,
|
|
416
480
|
handoffFormatVersion: 'ui-handoff-v1',
|
|
417
481
|
requirePerSurfaceMutationOps: true,
|
|
418
482
|
forbidUniformSiblingSurfaceTreatment: true,
|
|
@@ -514,6 +578,26 @@ function buildDesignIntentContractObject({
|
|
|
514
578
|
notes: 'Refine states from project language and anchor; reject anonymous panels.',
|
|
515
579
|
},
|
|
516
580
|
],
|
|
581
|
+
expressionFlexibility: {
|
|
582
|
+
lockedOutcomes: [
|
|
583
|
+
'preserve-primary-user-goal',
|
|
584
|
+
'preserve-accessibility-floor',
|
|
585
|
+
'preserve-production-content-policy',
|
|
586
|
+
'preserve-forbidden-patterns',
|
|
587
|
+
],
|
|
588
|
+
candidateSignatureMoves: [
|
|
589
|
+
'agent-defined-candidate-move-not-locked-until-refined',
|
|
590
|
+
],
|
|
591
|
+
flexibleAxes: [
|
|
592
|
+
'palette-primitives',
|
|
593
|
+
'typeface-choice',
|
|
594
|
+
'surface-treatment',
|
|
595
|
+
'component-library-skin',
|
|
596
|
+
'motion-implementation',
|
|
597
|
+
'anchor-artifact-literalness',
|
|
598
|
+
],
|
|
599
|
+
lockingRule: 'A candidate move becomes required only after repo evidence, product function, accessibility need, or explicit user approval makes it necessary.',
|
|
600
|
+
},
|
|
517
601
|
taskFlowNarrative: [
|
|
518
602
|
`Entry: start ${projectName} from real evidence, not a generic opener.`,
|
|
519
603
|
'Resolution: define proof, feedback, recovery, and next action.',
|
|
@@ -541,6 +625,10 @@ function buildDesignIntentContractObject({
|
|
|
541
625
|
requireBuildFromHandoff: true,
|
|
542
626
|
requireGapNotesBeforeFallback: true,
|
|
543
627
|
forbidGenericLayoutFallbackWithoutReason: true,
|
|
628
|
+
requireLockedVsFlexibleDecisionReview: true,
|
|
629
|
+
forbidCandidateMoveHardcoding: true,
|
|
630
|
+
forbidTestingDemoCopyInUi: true,
|
|
631
|
+
forbidTerminalOnlyUserFlows: true,
|
|
544
632
|
},
|
|
545
633
|
},
|
|
546
634
|
reviewRubric: {
|
|
@@ -628,6 +716,7 @@ function buildDesignIntentContractObject({
|
|
|
628
716
|
'requireSignatureMove',
|
|
629
717
|
'rejectTemplateNeutralLayout',
|
|
630
718
|
'requireAiSafeUiAudit',
|
|
719
|
+
'requireProductionContentPolicy',
|
|
631
720
|
'requireAiColorAudit',
|
|
632
721
|
'rejectAiColorDefaults',
|
|
633
722
|
'requireMotionSpatialCourageAudit',
|
|
@@ -636,6 +725,8 @@ function buildDesignIntentContractObject({
|
|
|
636
725
|
'rejectAiSafeUiTemplateLook',
|
|
637
726
|
'requireThreeProductSpecificSignals',
|
|
638
727
|
'rejectDecorativeBackgroundPatternsWithoutProductFunction',
|
|
728
|
+
'rejectTestingDemoUiCopy',
|
|
729
|
+
'rejectTerminalOnlyUserFlows',
|
|
639
730
|
],
|
|
640
731
|
requiredDesignSections: DESIGN_REQUIRED_SECTIONS,
|
|
641
732
|
implementation: {
|
|
@@ -4,6 +4,36 @@ import {
|
|
|
4
4
|
} from './constants.mjs';
|
|
5
5
|
import { buildDesignIntentSeed } from './design-contract.mjs';
|
|
6
6
|
|
|
7
|
+
function buildDockerStrategyExecutionBlock(dockerStrategy) {
|
|
8
|
+
const selectedDockerStrategy = String(dockerStrategy || '').trim();
|
|
9
|
+
const normalizedDockerStrategy = selectedDockerStrategy.toLowerCase();
|
|
10
|
+
|
|
11
|
+
if (!selectedDockerStrategy || normalizedDockerStrategy.startsWith('no docker')) {
|
|
12
|
+
return [
|
|
13
|
+
'## Docker Execution Gate',
|
|
14
|
+
'Docker was not selected. Do not create container assets unless the user changes scope.',
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const requiredAssetFloor = [
|
|
19
|
+
'.dockerignore',
|
|
20
|
+
normalizedDockerStrategy.includes('development') || normalizedDockerStrategy.includes('both') ? 'compose.yaml for development' : null,
|
|
21
|
+
normalizedDockerStrategy.includes('production') || normalizedDockerStrategy.includes('both') ? 'compose.prod.yaml or a documented production Compose override' : null,
|
|
22
|
+
'Dockerfile stage(s) derived from the actual stack',
|
|
23
|
+
'docs/docker-runtime.md or a deployment runbook with ports, entrypoints, health checks, and source URLs',
|
|
24
|
+
].filter(Boolean).join(', ');
|
|
25
|
+
|
|
26
|
+
return [
|
|
27
|
+
'## Docker Execution Gate',
|
|
28
|
+
`Selected Docker strategy: ${selectedDockerStrategy}`,
|
|
29
|
+
'- Load .agent-context/rules/docker-runtime.md and verify current official Docker docs before authoring assets.',
|
|
30
|
+
'- Materialize Docker assets from the actual stack; do not stop at docs-only acknowledgement or runtime notes.',
|
|
31
|
+
'- Required asset floor: ' + requiredAssetFloor + '.',
|
|
32
|
+
'- Keep development and production lanes separate when both are selected.',
|
|
33
|
+
'- If the user asks to create files without commands, write the files and documented commands, but do not execute Docker build, Compose, or registry commands.',
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
|
|
7
37
|
export function buildProjectContextBootstrapPrompt({
|
|
8
38
|
discoveryAnswers,
|
|
9
39
|
initContext,
|
|
@@ -59,6 +89,8 @@ export function buildProjectContextBootstrapPrompt({
|
|
|
59
89
|
`- Additional runtime constraints: ${Array.isArray(initContext.additionalStackFileNames) && initContext.additionalStackFileNames.length > 0 ? initContext.additionalStackFileNames.map((stackFileName) => toTitleCase(stackFileName)).join(', ') : 'none'}`,
|
|
60
90
|
`- Additional architecture constraints: ${Array.isArray(initContext.additionalBlueprintFileNames) && initContext.additionalBlueprintFileNames.length > 0 ? initContext.additionalBlueprintFileNames.map((blueprintFileName) => toTitleCase(blueprintFileName)).join(', ') : 'none'}`,
|
|
61
91
|
'',
|
|
92
|
+
...buildDockerStrategyExecutionBlock(discoveryAnswers.dockerStrategy),
|
|
93
|
+
'',
|
|
62
94
|
'## Key Features',
|
|
63
95
|
featuresList,
|
|
64
96
|
'',
|
|
@@ -123,27 +155,29 @@ export function buildDesignBootstrapPrompt({
|
|
|
123
155
|
'4. designPhilosophy',
|
|
124
156
|
'5. visualDirection',
|
|
125
157
|
'6. externalResearchIntake',
|
|
126
|
-
'7.
|
|
127
|
-
'8.
|
|
128
|
-
'9.
|
|
129
|
-
'10.
|
|
130
|
-
'11.
|
|
131
|
-
'12.
|
|
132
|
-
'13.
|
|
133
|
-
'14.
|
|
134
|
-
'15.
|
|
135
|
-
'16.
|
|
136
|
-
'17.
|
|
137
|
-
'18.
|
|
138
|
-
'19.
|
|
139
|
-
'20.
|
|
140
|
-
'21.
|
|
141
|
-
'22.
|
|
142
|
-
'23.
|
|
143
|
-
'24.
|
|
144
|
-
'25.
|
|
145
|
-
'26.
|
|
146
|
-
'27.
|
|
158
|
+
'7. designFlexibilityPolicy',
|
|
159
|
+
'8. conceptualAnchor',
|
|
160
|
+
'9. derivedTokenLogic',
|
|
161
|
+
'10. motionPaletteDecision',
|
|
162
|
+
'11. aiSafeUiAudit',
|
|
163
|
+
'12. productionContentPolicy',
|
|
164
|
+
'13. libraryResearchStatus',
|
|
165
|
+
'14. libraryDecisions',
|
|
166
|
+
'15. mathSystems',
|
|
167
|
+
'16. tokenSystem',
|
|
168
|
+
'17. colorTruth',
|
|
169
|
+
'18. crossViewportAdaptation',
|
|
170
|
+
'19. motionSystem',
|
|
171
|
+
'20. componentMorphology',
|
|
172
|
+
'21. accessibilityPolicy',
|
|
173
|
+
'22. designExecutionPolicy',
|
|
174
|
+
'23. designExecutionHandoff',
|
|
175
|
+
'24. reviewRubric',
|
|
176
|
+
'25. contextHygiene',
|
|
177
|
+
'26. forbiddenPatterns',
|
|
178
|
+
'27. requiredDesignSections',
|
|
179
|
+
'28. implementation',
|
|
180
|
+
'29. repoEvidence when onboarding or detector evidence exists',
|
|
147
181
|
'',
|
|
148
182
|
'## Mechanical Gates',
|
|
149
183
|
'1. Do not copy external style guides.',
|
|
@@ -158,12 +192,13 @@ export function buildDesignBootstrapPrompt({
|
|
|
158
192
|
'10. Define viewport mutation rules for mobile, tablet, and desktop. Shrinking desktop is failure.',
|
|
159
193
|
'11. Keep structured execution representation-first: surface plan, component graph, content-priority map, viewport mutation plan, and interaction-state matrix.',
|
|
160
194
|
'12. Make design-intent.json carry designExecutionPolicy and designExecutionHandoff, not prose-only policy.',
|
|
195
|
+
'12a. Make design-intent.json carry designFlexibilityPolicy so locked outcomes, candidate moves, and flexible expression axes stay separate.',
|
|
161
196
|
'13. Keep semantic review focused on contract fidelity, distinctiveness, hierarchy, state behavior, and viewport mutation.',
|
|
162
197
|
'14. Treat WCAG 2.2 AA as the hard floor. Use APCA only as advisory tuning.',
|
|
163
198
|
'15. Cover focus visibility, focus appearance, target size, accessible authentication, keyboard access, and dynamic status/state access.',
|
|
164
199
|
'16. Do not depend on screenshot capture, browser automation, or image diffs as the default quality path.',
|
|
165
200
|
'17. Make one memorable visual bet before code.',
|
|
166
|
-
'18. Do not ship AI-safe UI, decorative grid wallpaper, generic SaaS gradients, or default component-kit styling without product rationale.',
|
|
201
|
+
'18. Do not ship AI-safe UI, decorative grid, line, scanline, or calibration-mark wallpaper, generic SaaS gradients, or default component-kit styling without product rationale.',
|
|
167
202
|
'19. Use visually exploratory, product-derived palettes while preserving WCAG contrast and status clarity.',
|
|
168
203
|
'20. Complete the AI color audit before code.',
|
|
169
204
|
'21. Treat motion, 3D, canvas, WebGL, scroll choreography, and modern animation libraries as first-class options.',
|
|
@@ -175,24 +210,34 @@ export function buildDesignBootstrapPrompt({
|
|
|
175
210
|
'27. Reject anchors described only as modern, clean, premium, expressive, minimal, or bold.',
|
|
176
211
|
'28. Set conceptualAnchor.anchorReference and make derivedTokenLogic.anchorReference match exactly.',
|
|
177
212
|
'29. Fill derivedTokenLogic before code. If a token cannot trace to anchorReference, revise it.',
|
|
213
|
+
'29a. Lock semantic roles before exact values. Do not freeze fonts, color primitives, radius, shadows, or component-kit theme treatment unless repo evidence, accessibility validation, implementation constraints, or explicit user approval requires it.',
|
|
178
214
|
'30. Research current official docs before importing any new UI-related library.',
|
|
179
|
-
'31.
|
|
180
|
-
'32.
|
|
181
|
-
'33.
|
|
182
|
-
'34.
|
|
215
|
+
'31. Do not default to shadcn/ui, Tailwind-only, native-only, or any component kit by habit; choose the UI foundation from product fit, accessibility, interaction quality, runtime constraints, and official docs.',
|
|
216
|
+
'32. If research is unavailable, set libraryResearchStatus to pending-verification and use native CSS, browser APIs, or existing dependencies only when they can preserve the intended ambition.',
|
|
217
|
+
'33. Do not reject modern lightweight libraries solely because they add a dependency; package count or vague performance fear is not a blocker by itself.',
|
|
218
|
+
'34. Define reviewRubric and require genericity findings to name the actual drift signal.',
|
|
219
|
+
'35. Separate taste from failure. Bold accessible work is valid.',
|
|
220
|
+
'36. For zero-based redesign, create visualResetStrategy and reset composition, hierarchy, palette/typography, motion or interaction, and responsive information architecture.',
|
|
221
|
+
'37. Treat productionContentPolicy as blocking: remove visible testing, demo, sample, placeholder, lorem, TODO, coming soon, and scaffold copy unless it is a real product state.',
|
|
222
|
+
'38. Do not make core user workflows terminal-only unless the product is explicitly a CLI, developer tool, or operational runbook.',
|
|
223
|
+
'39. Separate required experience outcomes from candidate implementation moves. Candidate signature moves are proposals until product evidence, accessibility, or user approval makes them required.',
|
|
224
|
+
'40. Translate conceptual anchors non-literally first. Do not turn anchor artifacts into required chrome, decorative props, wallpaper, or theme objects unless they serve a named product function.',
|
|
183
225
|
'',
|
|
184
226
|
'## Creative Ambition Floor',
|
|
185
227
|
'Before implementation, the design contract must name one authored visual bet, one product-derived palette move, one signature motion/spatial/interaction behavior, and one morphology or composition choice that would not appear in a generic AI template.',
|
|
186
228
|
'The ambition floor is not a fixed aesthetic. Quiet, dense, utilitarian, or text-heavy interfaces are allowed when the product requires them, but they still need a project-specific visual decision and a real reason for omitting richer motion, 3D, canvas, WebGL, scroll choreography, or animation libraries.',
|
|
229
|
+
'Measurement, calibration, crop, route, timeline, and inspection marks may be used only as task-bound overlays or control affordances. They must not become page wallpaper, hero texture, or first-output background filler.',
|
|
187
230
|
'Use reduced-motion fallbacks instead of suppressing motion.',
|
|
188
231
|
'',
|
|
189
232
|
'## Token Derivation Audit',
|
|
190
233
|
'Before implementation, docs/design-intent.json must include derivedTokenLogic.anchorReference plus colorDerivationSource, spacingDerivationSource, typographyDerivationSource, motionDerivationSource, and validationRule.',
|
|
191
|
-
'Every token must be explainable from anchorReference. If the rationale is only looks good, common practice, modern default, or framework default, derive the token again before UI code.',
|
|
234
|
+
'Every semantic token role must be explainable from anchorReference. If the rationale is only looks good, common practice, modern default, or framework default, derive the token again before UI code.',
|
|
235
|
+
'Keep exact primitive values flexible until repo evidence, accessibility validation, implementation constraints, or explicit user approval locks them.',
|
|
192
236
|
'',
|
|
193
237
|
'## Library Research Protocol',
|
|
194
238
|
'If web search is available, verify every new UI, animation, scroll, 3D, canvas, chart, icon, styling, or primitive library against current official docs and record source URL, fetched date, stable compatible version, purpose, risk, and fallback.',
|
|
195
|
-
'If web search is unavailable or fails, set libraryResearchStatus to pending-verification, record LIBRARY_TO_VERIFY notes, and use native CSS, browser APIs, or already-present project dependencies until verification is possible.',
|
|
239
|
+
'If web search is unavailable or fails, set libraryResearchStatus to pending-verification, record LIBRARY_TO_VERIFY notes, and use native CSS, browser APIs, or already-present project dependencies only when they can preserve the intended ambition until verification is possible.',
|
|
240
|
+
'Select UI foundations dynamically. Use ready-made primitives or component kits for mechanics when they fit, but replace library-default visual language with project-specific composition, tokens, motion, state treatment, and morphology.',
|
|
196
241
|
'',
|
|
197
242
|
'## Project Inputs',
|
|
198
243
|
`- Project name: ${discoveryAnswers.projectName}`,
|
|
@@ -216,6 +261,7 @@ export function buildDesignBootstrapPrompt({
|
|
|
216
261
|
'5. Encode structured design execution as policy: representation strategy, surface plan, component graph, content-priority map, viewport mutation plan, interaction-state matrix, semantic review focus, and structured handoff requirements.',
|
|
217
262
|
'6. Encode an explicit structured handoff inside docs/design-intent.json: surface plan, component graph, content-priority map, viewport mutation plan, interaction-state matrix, task-flow narrative, and signature move rationale.',
|
|
218
263
|
'7. Encode a stable review rubric: required dimensions, genericity signals, valid bold signals, and reporting rules that separate taste from real failure.',
|
|
264
|
+
'7a. Encode designFlexibilityPolicy and designExecutionHandoff.expressionFlexibility so future agents know what is locked and what can change.',
|
|
219
265
|
'8. Make the handoff executable without screenshot dependency. The contract must still guide high-precision UI generation from repo evidence and changed code alone.',
|
|
220
266
|
'9. Preserve repoEvidence.designEvidenceSummary when onboarding or detector evidence exists instead of discarding it.',
|
|
221
267
|
'10. If repoEvidence.designEvidenceSummary.structuredInspection exists, use it as stronger evidence for class surfaces, inline style bypasses, and expression-backed UI structure before defaulting to generic assumptions.',
|
|
@@ -225,7 +271,9 @@ export function buildDesignBootstrapPrompt({
|
|
|
225
271
|
'14. Preserve conceptualAnchor so prompt-only UI work has one cohesive non-template concept instead of a mixed collection of bold but unrelated visual decisions.',
|
|
226
272
|
'15. Record conceptualAnchor.agentResearchMode, specificReferencePoint, signatureMotion, typographicDecision, visualRiskBudget, motionRiskBudget, and cohesionChecks so the final UI cannot quietly fall back to a timid dashboard/admin mental model.',
|
|
227
273
|
'16. Preserve derivedTokenLogic, libraryResearchStatus, and libraryDecisions so token choices and dependency uncertainty stay visible before implementation.',
|
|
228
|
-
'
|
|
274
|
+
'16a. Preserve designFlexibilityPolicy so the machine contract guides consistency without freezing literal anchor artifacts, exact token primitives, or component-kit visual language.',
|
|
275
|
+
'17. Preserve productionContentPolicy so UI output is ship-ready and not a testing-looking scaffold.',
|
|
276
|
+
'18. After the contract exists, use it as a first-class source for future UI tasks.',
|
|
229
277
|
'',
|
|
230
278
|
].join('\n');
|
|
231
279
|
}
|
package/package.json
CHANGED
|
@@ -94,6 +94,8 @@ const REQUIRED_BOOTSTRAP_DESIGN_SNIPPETS = [
|
|
|
94
94
|
'WCAG 2.2 AA is the hard floor',
|
|
95
95
|
'APCA may be used only as advisory perceptual tuning',
|
|
96
96
|
'unresearched dependency choices',
|
|
97
|
+
'Dynamic UI Foundation Selection',
|
|
98
|
+
'A new dependency, package count, or vague performance concern is not a blocker by itself.',
|
|
97
99
|
'default component-kit styling without product rationale',
|
|
98
100
|
'genericity findings that cannot name the exact drift signal',
|
|
99
101
|
];
|
|
@@ -334,6 +334,7 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
334
334
|
'Creative Ambition Floor',
|
|
335
335
|
'AI Color and Template Residue Audit',
|
|
336
336
|
'Motion and 3D Courage Rule',
|
|
337
|
+
'Design Flexibility Layer',
|
|
337
338
|
'visually exploratory, product-derived palettes',
|
|
338
339
|
'decorative grid wallpaper',
|
|
339
340
|
'`aiSafeUiAudit`',
|
|
@@ -346,6 +347,9 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
346
347
|
'WCAG 2.2 AA is the hard floor',
|
|
347
348
|
'APCA may be used only as advisory perceptual tuning',
|
|
348
349
|
'unresearched dependency choices',
|
|
350
|
+
'Dynamic UI Foundation Selection',
|
|
351
|
+
'locked outcomes from flexible expression',
|
|
352
|
+
'A new dependency, package count, or vague performance concern is not a blocker by itself.',
|
|
349
353
|
'default component-kit styling without product rationale',
|
|
350
354
|
'genericity findings that cannot name the exact drift signal',
|
|
351
355
|
],
|
|
@@ -398,6 +402,7 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
398
402
|
'structure-first-scaffold',
|
|
399
403
|
'colorTruth',
|
|
400
404
|
'motionPaletteDecision',
|
|
405
|
+
'designFlexibilityPolicy',
|
|
401
406
|
'aiSafeUiAudit',
|
|
402
407
|
'aiColorAudit',
|
|
403
408
|
'motionSpatialCourageAudit',
|
|
@@ -419,6 +424,8 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
419
424
|
'seedBehaviorsRequireRefinement',
|
|
420
425
|
'accessibilityPolicy',
|
|
421
426
|
'designExecutionPolicy',
|
|
427
|
+
'separateRequiredOutcomesFromCandidateMoves',
|
|
428
|
+
'forbidCandidateMovesAsLockedRequirements',
|
|
422
429
|
'seedRefinementRequiredBeforeUiImplementation',
|
|
423
430
|
'requirePerSurfaceMutationOps',
|
|
424
431
|
'forbidUniformSiblingSurfaceTreatment',
|
|
@@ -443,6 +450,7 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
443
450
|
'taskFlowNarrative',
|
|
444
451
|
'signatureMoveRationale',
|
|
445
452
|
'implementationGuardrails',
|
|
453
|
+
'expressionFlexibility',
|
|
446
454
|
'reviewRubric',
|
|
447
455
|
'genericityAutoFail',
|
|
448
456
|
'genericitySignals',
|
|
@@ -452,6 +460,9 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
452
460
|
'offline-prescribed-style-used-as-final-direction',
|
|
453
461
|
'unresearched-library-or-framework-choice',
|
|
454
462
|
'single-safe-typographic-family-without-role-contrast-or-rationale',
|
|
463
|
+
'modern-library-rejected-from-dependency-fear-without-tradeoff-analysis',
|
|
464
|
+
'component-library-selected-by-habit-without-product-fit',
|
|
465
|
+
'official-docs-backed-modern-library-choice',
|
|
455
466
|
'hardComplianceFloor',
|
|
456
467
|
'advisoryContrastModel',
|
|
457
468
|
'contextHygiene',
|
|
@@ -540,6 +551,8 @@ export const REQUIRED_DEPENDENCY_FRESHNESS_AUTOMATION_SNIPPETS = [
|
|
|
540
551
|
'latest stable compatible dependency version',
|
|
541
552
|
'official scaffolder or setup command',
|
|
542
553
|
'Only step down to an older dependency version after documenting',
|
|
554
|
+
'Do not treat dependency avoidance as an engineering virtue by itself.',
|
|
555
|
+
'performance-fear choices',
|
|
543
556
|
],
|
|
544
557
|
},
|
|
545
558
|
{
|