@ryuenn3123/agentic-senior-core 3.0.37 → 3.0.38

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.
Files changed (58) hide show
  1. package/.agent-context/prompts/bootstrap-design.md +108 -146
  2. package/.agent-context/rules/frontend-architecture.md +92 -108
  3. package/.agent-context/state/README.md +26 -0
  4. package/.cursor/mcp.json +10 -0
  5. package/.cursor/rules/agentic-senior-core.mdc +48 -0
  6. package/.cursorrules +22 -88
  7. package/.gemini/instructions.md +25 -16
  8. package/.github/copilot-instructions.md +25 -16
  9. package/.github/instructions/agentic-senior-core.instructions.md +47 -0
  10. package/.instructions.md +98 -207
  11. package/.windsurf/rules/agentic-senior-core.md +43 -0
  12. package/.windsurfrules +22 -88
  13. package/AGENTS.md +23 -26
  14. package/CLAUDE.md +43 -0
  15. package/CONTRIBUTING.md +5 -2
  16. package/GEMINI.md +43 -0
  17. package/README.md +24 -7
  18. package/lib/cli/backup.mjs +4 -4
  19. package/lib/cli/commands/init/project-context.mjs +101 -0
  20. package/lib/cli/commands/init/runtime-environment.mjs +59 -0
  21. package/lib/cli/commands/init/setup-decisions.mjs +83 -0
  22. package/lib/cli/commands/init.mjs +33 -250
  23. package/lib/cli/commands/optimize.mjs +1 -1
  24. package/lib/cli/commands/upgrade.mjs +32 -7
  25. package/lib/cli/compiler.mjs +59 -17
  26. package/lib/cli/constants.mjs +5 -0
  27. package/lib/cli/detector.mjs +4 -0
  28. package/lib/cli/preflight.mjs +3 -3
  29. package/lib/cli/project-scaffolder/design-contract/validation.mjs +789 -0
  30. package/lib/cli/project-scaffolder/design-contract.mjs +119 -924
  31. package/lib/cli/project-scaffolder/prompt-builders.mjs +69 -84
  32. package/lib/cli/utils/filesystem.mjs +79 -0
  33. package/lib/cli/utils/managed-surface.mjs +237 -0
  34. package/lib/cli/utils/prompting.mjs +44 -0
  35. package/lib/cli/utils.mjs +33 -335
  36. package/package.json +21 -2
  37. package/scripts/clean-local-artifacts.mjs +76 -0
  38. package/scripts/docs-quality-drift-report.mjs +5 -0
  39. package/scripts/frontend-usability-audit.mjs +23 -19
  40. package/scripts/governance-weekly-report.mjs +37 -15
  41. package/scripts/single-source-lazy-loading-audit.mjs +24 -0
  42. package/scripts/sync-thin-adapters.mjs +99 -129
  43. package/scripts/v3-purge-audit.mjs +5 -0
  44. package/scripts/validate/config.mjs +10 -0
  45. package/scripts/validate/coverage-checks.mjs +55 -0
  46. package/.agent-context/marketplace/trust-tiers.json +0 -114
  47. package/.agent-context/state/benchmark-analysis.json +0 -431
  48. package/.agent-context/state/benchmark-evidence-bundle.json +0 -1040
  49. package/.agent-context/state/benchmark-history.json +0 -75
  50. package/.agent-context/state/benchmark-trend-report.csv +0 -5
  51. package/.agent-context/state/benchmark-trend-report.json +0 -140
  52. package/.agent-context/state/benchmark-writer-judge-matrix.json +0 -462
  53. package/.agent-context/state/memory-continuity-benchmark.json +0 -132
  54. package/.agent-context/state/onboarding-report.json +0 -102
  55. package/.agent-context/state/quality-trend-report.json +0 -89
  56. package/.agent-context/state/token-optimization-benchmark.json +0 -130
  57. package/.agent-context/state/weekly-governance-report.json +0 -329
  58. package/lib/cli/compatibility.mjs +0 -124
@@ -1,168 +1,130 @@
1
1
  # Bootstrap Dynamic Design Contract
2
2
 
3
- When a user requests UI, UX, frontend layout, screen, Tailwind, animation, or redesign work, create or refine:
4
- - `docs/DESIGN.md` for human-readable design reasoning
5
- - `docs/design-intent.json` for machine-readable design intent, guardrails, and review signals
3
+ Use this prompt for UI, UX, frontend layout, screen, Tailwind, animation, 3D, canvas, or redesign work.
6
4
 
7
- This contract is a decision scaffold, not a style preset. It must guide the LLM to choose well from the current repo, current user brief, current project docs, and live official documentation when a technology or library claim matters.
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.
8
8
 
9
- ## Core Rule
9
+ 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
10
 
11
- We guide the agent; we do not pick the final style, stack, framework, palette, typography, layout paradigm, or animation library offline.
11
+ ## Authority
12
12
 
13
- The agent must:
14
- 1. Read [AGENTS.md](../../AGENTS.md), this prompt, [frontend-architecture.md](../rules/frontend-architecture.md), current UI code, current project docs, and existing design docs before UI edits.
15
- 2. If `docs/DESIGN.md` or `docs/design-intent.json` exists, refine them instead of replacing them blindly.
13
+ - Treat `.agent-context/` and current project docs as technical authority.
14
+ - Treat `README.md` as overview, install, and user-facing context only. Do not use it as coding, architecture, or design authority when `.agent-context/` gives a stricter rule.
15
+ - Use current repo evidence, product copy, route names, component names, user goals, and existing constraints as the source of truth.
16
+ - Treat prior-chat visuals, unrelated project memory, benchmark screenshots, and famous-product aesthetics as tainted context unless the user explicitly approves continuity.
17
+ - Keep external references non-copying; extract constraints only.
18
+ - Before choosing a new UI, animation, scroll, 3D, canvas, chart, icon, styling, or component library, research current official docs.
19
+
20
+ ## Required Order
21
+
22
+ 1. Read `AGENTS.md`, this prompt, `../rules/frontend-architecture.md`, current UI code, current project docs, and existing design docs.
23
+ 2. Refine existing `docs/DESIGN.md` and `docs/design-intent.json`; do not replace them blindly.
16
24
  3. If either design doc is missing, create it before UI implementation.
17
- 4. Use current repo evidence, product copy, route names, component names, user goals, and existing constraints as the source of truth.
18
- 5. Treat prior-chat visuals, unrelated project memory, benchmark screenshots, and famous-product aesthetics as tainted context unless the user explicitly asks for continuity.
19
- 6. When choosing a new UI, animation, styling, or component library, research current official docs and choose the latest stable compatible option for this project. Do not rely on offline defaults.
20
- 7. Keep external references non-copying: extract constraints and reasoning only, never clone the surface.
21
- 8. Record a Motion/Palette Decision before UI implementation; product categories are heuristics, not style presets, so override them with task, content density, brand intent, device/performance, and accessibility evidence.
25
+ 4. Record `motionPaletteDecision` before UI code; product categories are heuristics, not style presets.
26
+ 5. Encode `repoEvidence.designEvidenceSummary` when onboarding or detector evidence exists.
27
+ 6. Keep both design docs synchronized after implementation.
22
28
 
23
29
  ## Creative Commitment Gate
24
30
 
25
- Before broad compliance review or UI implementation, commit to one concrete creative direction and record it in `docs/DESIGN.md` plus `docs/design-intent.json`. This commitment must include:
26
- - one conceptual anchor from a specific physical, editorial, architectural, cinematic, industrial, scientific, or interaction domain
27
- - one signature motion behavior that is more specific than "smooth transitions"
28
- - one typographic decision that creates meaningful role contrast instead of a uniform safe type system
31
+ Before broad compliance review or UI implementation, record an agent-chosen visual direction in both design docs:
32
+ - one concrete real-world anchor reference
33
+ - one signature motion behavior more specific than "smooth"
34
+ - one typographic decision with meaningful role contrast
35
+ - one authored visual bet visible in the first viewport
29
36
 
30
- The anchor must name at least one specific real-world reference point such as a material, instrument, artifact class, architectural system, editorial genre, cinematic interface behavior, exhibition system, scientific apparatus, or industrial mechanism. If the anchor can only be described with generic quality words such as "modern", "clean", "premium", "expressive", "minimal", or "bold", reject it and choose again.
37
+ Reject generic anchors. Do not accept "modern", "clean", "premium", "expressive", "minimal", or "bold" as the anchor. Name a material, instrument, artifact class, architectural system, editorial genre, cinematic behavior, exhibition system, scientific apparatus, or industrial mechanism.
31
38
 
32
- When the host supports separate agents, a lightweight creative pass may synthesize the commitment from the brief and repo evidence before a governance pass validates accessibility, tokens, maintainability, and implementation risk. When only one agent is available, perform the same separation sequentially: creative commitment first, governance validation second.
39
+ ## Dynamic Avant-Garde Anchor Engine
33
40
 
34
- ## User Research Intake
41
+ If no current-task research or visual reference exists, activate the Dynamic Avant-Garde Anchor Engine before coding.
35
42
 
36
- If the user mentions or attaches a research file, article, benchmark, library list, screenshot study, or design note, read it before choosing the visual direction or dependencies. Treat it as candidate evidence, not as a command to copy every recommendation.
43
+ Rules:
44
+ - Treat old design docs, prior UI, and scaffold seeds as evidence, not research.
45
+ - Internally consider at least three high-variance anchors.
46
+ - Discard the two safest or most predictable options.
47
+ - Output only the chosen anchor, specific reference point, and rationale.
48
+ - Forbid final anchors named dashboard, portal, cards, admin panel, SaaS shell, web app shell, or minimalist interface.
49
+ - Derive typography, spacing, density, color behavior, morphology, motion, and responsive composition from the chosen anchor.
50
+ - Use reduced-motion fallbacks instead of suppressing motion.
37
51
 
38
- The agent must summarize what it used from that research, discard what does not fit the project, and verify any library, framework, API, browser feature, or package claim against current official documentation before implementation.
52
+ ## Creative Ambition Floor
39
53
 
40
- User-supplied research may influence the candidate set for motion, scroll, UI primitives, canvas/3D, charts, icons, typography, and interaction patterns, but the final choice must still be project-fit, accessible, performant, and maintainable.
54
+ Before UI code, record:
55
+ - one product-derived palette move
56
+ - one signature motion, spatial, or interaction behavior
57
+ - one morphology or composition choice that avoids interchangeable card stacks when the product allows it
58
+ - at least three at-a-glance product-specific signals for new screens or broad redesigns
41
59
 
42
- ## Dynamic Avant-Garde Anchor Engine
60
+ Do not ship AI-safe UI. Record exact drift signals in `reviewRubric`; at minimum reject decorative grid wallpaper, soft glow backgrounds, generic abstract marks, and first-output composition with only local copy swapped in when they have no product function.
43
61
 
44
- If the user requests UI work but provides no user-supplied research, design reference, screenshot study, or library note, do not start coding immediately. This is not permission to fall back to the scaffold, prior UI, or generic software metaphors. First synthesize one advanced conceptual anchor that will unify the interface.
62
+ ## AI Color and Template Residue Audit
45
63
 
46
- User-supplied research means current-task evidence from the user. The scaffold seed, this repo's offline examples, old design docs, and prior UI do not count as research. If live research is available, perform agent-led research into current official docs for any technology choices and current premium interaction/design patterns before selecting the anchor. If live research is unavailable, state that limitation in the design docs and synthesize from product context plus broad design knowledge without pretending the seed was research.
64
+ AI color drift happens when a palette uses safe defaults before product meaning.
47
65
 
48
- Do not use basic software UI labels as the final anchor, including "dashboard", "portal", "cards", "admin panel", "SaaS shell", "web app shell", or "minimalist interface".
66
+ Complete the AI color audit before coding:
67
+ - Explain what product evidence or anchorReference makes the palette fit.
68
+ - Name the color roles that carry task, status, data, or navigation meaning.
69
+ - Name one color behavior that would not transfer cleanly to another product category.
70
+ - Use visually exploratory, product-derived palettes while preserving WCAG contrast and status clarity.
49
71
 
50
- The agent must internally consider at least three substantially different, high-variance candidate anchors, discard the two most obvious, safest, or easiest-to-predict options, then record only the surviving anchor, its concrete real-world reference point, and concise rationale. Do not expose hidden deliberation or the rejected candidate list.
72
+ Cream, slate, monochrome, purple-blue gradients, cyber-neon terminals, pale editorial surfaces, soft glow atmospheres, and dark control rooms are autopilot risks, not banned palettes.
51
73
 
52
- The final anchor must come from broad non-template domains such as complex physical engineering, high-end industrial design, cinematic spatial interfaces, experimental editorial structure, advanced architecture, scientific instrumentation, advanced data visualization, exhibition/wayfinding systems, or premium interactive web experiences. These are search domains, not style presets.
74
+ ## Motion and 3D Courage Rule
53
75
 
54
- Write the chosen anchor into `docs/design-intent.json` as `conceptualAnchor`, including agentResearchMode, sourceDomain, specificReferencePoint, rationale, signatureMotion, typographicDecision, derivedTokenLogic, visualRiskBudget, motionRiskBudget, and cohesionChecks. Typography, spacing, density, color behavior, morphology, motion, and responsive composition must logically derive from that single anchor. If a later design choice does not follow from the anchor, revise the contract before coding.
76
+ Motion, 3D, canvas, WebGL, scroll choreography, and modern animation libraries are first-class UI options when they improve understanding, exploration, feedback, hierarchy, memorability, or confidence.
55
77
 
56
- Motion is not a garnish. Default to a rich motion plan: fluid transitions, spatial reveals, scroll choreography, micro-interactions, and modern motion libraries are expected when they strengthen the anchor and product experience. Keep reduced-motion fallbacks instead of suppressing motion, and solve performance deliberately instead of using safety language as a reason to stay static.
78
+ Use modern, expressive interaction when it improves hierarchy, feedback, confidence, or memorability.
57
79
 
58
- ## Token Derivation Audit
80
+ If rich motion or spatial UI is omitted, record the product, content-density, performance, accessibility, or device reason and the replacement interaction quality. "Not necessary" is not enough.
59
81
 
60
- Before implementation, `docs/design-intent.json` must include top-level `derivedTokenLogic` with `anchorReference`, `colorDerivationSource`, `spacingDerivationSource`, `typographyDerivationSource`, `motionDerivationSource`, and `validationRule`.
82
+ If 3D or canvas is used, record product role, interaction model, fallback path, runtime/library choice, loading state, keyboard path, and reduced-motion behavior.
61
83
 
62
- After writing `docs/design-intent.json`, audit the token plan:
63
- - Why these colors instead of another palette? Answer in one sentence that references the anchorReference.
64
- - Why this spacing rhythm? Answer in one sentence that references the anchorReference.
65
- - Why this motion timing and easing? Answer in one sentence that references the anchorReference.
84
+ ## Token Derivation Audit
66
85
 
67
- If the answer is "looks good", "common practice", "modern default", "Tailwind default", or a generic framework habit, the token is wrong. Derive it again from the chosen anchor before writing UI code.
86
+ Before implementation, `docs/design-intent.json` must include top-level `derivedTokenLogic`:
87
+ - `anchorReference`
88
+ - `colorDerivationSource`
89
+ - `spacingDerivationSource`
90
+ - `typographyDerivationSource`
91
+ - `motionDerivationSource`
92
+ - `validationRule`
93
+
94
+ Every token must trace to `anchorReference`. If the rationale is "looks good", "common practice", "modern default", or "framework default", revise the token before code.
68
95
 
69
96
  ## Library Research Protocol
70
97
 
71
98
  If web search is available:
72
- - Research current official docs for each library, framework API, animation package, scroll tool, 3D/canvas helper, charting tool, icon package, or UI primitive claim.
73
- - Record source URL, fetched date, stable compatible version, purpose, risk, and fallback in `docs/design-intent.json`.
74
- - Set `libraryResearchStatus` to `verified` only when each external library decision has current official evidence.
99
+ - Verify each new UI-related library against current official docs.
100
+ - Record source URL, fetched date, stable compatible version, purpose, risk, and fallback in `libraryDecisions[]`.
101
+ - Set `libraryResearchStatus` to `verified` only when every external library decision has evidence.
75
102
 
76
- If web search is unavailable or fails:
77
- - Do not hallucinate dependency APIs, package names, versions, or imports.
78
- - Write `LIBRARY_TO_VERIFY: [name] - requires live research before implementation` in the design notes.
79
- - Use only native CSS, browser APIs, or already-present project dependencies you can verify from local repo files.
80
- - Set `libraryResearchStatus` to `pending-verification` and give every `libraryDecisions[]` entry a `fallbackIfUnavailable`.
103
+ If web search is unavailable:
104
+ - Do not hallucinate package names, APIs, versions, or imports.
105
+ - Use native CSS, browser APIs, or already-present dependencies.
106
+ - Set `libraryResearchStatus` to `pending-verification`.
81
107
 
82
- Do not write imports from a new library until that library decision is verified or the user explicitly accepts a pending verification blocker.
108
+ Treat unresearched dependency choices as review findings.
83
109
 
84
110
  ## Zero-Based Redesign Protocol
85
111
 
86
- If the user says "redesign from zero", "redesain dari 0", "ulang dari 0", "research ulang", or equivalent reset language, activate reset mode.
87
-
88
- In reset mode:
89
- - Existing UI and existing design docs are content, behavior, accessibility, and repo-evidence inputs only. They are not visual continuity sources.
90
- - Replace or materially rewrite `docs/DESIGN.md` and `docs/design-intent.json` before implementation so the new contract cannot inherit old palette, typography, layout, navigation shape, component morphology, motion signature, or image placement by accident.
91
- - Define a `visualResetStrategy` that names the old visual DNA being discarded and the new direction being selected from current brief, repo evidence, and live official documentation.
92
- - The implementation must change composition, hierarchy, palette/typography, motion/interaction, and responsive information architecture. A palette swap, dark-mode flip, or same hero with new colors is failure.
93
- - Keep product data, copy requirements, routes, accessibility needs, and required local assets intact unless the user explicitly says they may be removed.
94
- - If a modern UI, animation, scroll, 3D, canvas, chart, or icon library is useful, research current official docs and record the selected library, source URL, fetched date, reason, performance risk, and reduced-motion/accessibility fallback.
95
-
96
- ## Design Quality Bar
97
-
98
- The UI must feel authored by a strong UI/UX designer, not assembled from default cards and safe framework chrome.
99
- The UI must not look like a first-pass AI template. "Readable" and "safe" are not enough when the brief calls for an authored product experience.
100
-
101
- ## Creative Ambition Floor
102
-
103
- For new screens and broad redesigns, the agent must make one authored visual bet before coding. This can be a spatial structure, material logic, data treatment, motion language, typographic contrast, image system, or interaction model, but it must be visible in the first viewport and it must come from the chosen product anchor.
104
-
105
- The ambition floor is not a license to decorate. It is a check against timid AI-template output. The design may still be quiet, dense, utilitarian, or text-heavy when the product needs that, but it must have a clear authored decision that a generic scaffold would not produce.
112
+ When the user says "redesign from zero", "redesain dari 0", "ulang dari 0", or "research ulang":
113
+ - Treat existing UI as content, behavior, accessibility, and asset evidence only.
114
+ - Rewrite or materially update both design docs before UI code.
115
+ - Add `visualResetStrategy`.
116
+ - Reset composition, hierarchy, palette/typography, motion or interaction, and responsive information architecture.
117
+ - Do not ship a palette swap, dark-mode flip, or same hero with new colors.
106
118
 
107
- Before implementation, record:
108
- - one product-derived palette move that does not rely on cream, slate, purple-blue gradient, monochrome, or cyber-neon defaults
109
- - one signature motion, spatial, or interaction behavior that is more specific than "smooth"
110
- - one morphology or composition choice that breaks away from interchangeable card stacks when the product allows it
111
-
112
- If the agent chooses not to use rich motion, 3D, canvas, WebGL, scroll choreography, or an animation library, it must name the product, content-density, performance, accessibility, or device constraint that makes omission better. "Not necessary", "keep it simple", or "avoid complexity" is insufficient without that evidence.
113
-
114
- ## AI Color and Template Residue Audit
115
-
116
- AI color drift happens when a screen reaches for safe defaults before it understands the product: cream editorial surfaces, dark slate dashboards, purple-blue gradients, monochrome minimalism, neon cyber terminals, soft glow atmospheres, or arbitrary bright accents with no semantic behavior.
117
-
118
- These palettes are not banned when the product truly earns them. They are banned as autopilot. If one appears, the design contract must explain why that palette belongs to the product, how each semantic role behaves, and what product-specific color behavior prevents the UI from reading like a first-pass AI template.
119
-
120
- The palette audit must answer:
121
- - What product evidence or anchorReference makes these colors more appropriate than safer defaults?
122
- - Which color roles carry task, status, data, or navigation meaning beyond surface decoration?
123
- - Which color choice would not transfer cleanly to a different product category?
124
-
125
- Accessibility is the floor, not the personality. Do not use contrast compliance as an excuse to flatten the palette into generic cream, slate, monochrome, or gradient safety.
126
-
127
- ## Motion and 3D Courage Rule
128
-
129
- Motion, 3D, canvas, WebGL, scroll choreography, and modern animation libraries are first-class UI options when they improve product understanding, exploration, feedback, hierarchy, memorability, or confidence.
130
-
131
- The agent must not suppress motion or spatial UI because it is afraid of implementation complexity. It must choose the richest responsible interaction model the product can support, then define reduced-motion, keyboard, loading, performance, and non-3D fallbacks.
132
-
133
- When 3D/canvas is not used, document the non-use reason and the replacement interaction quality that will carry the experience. When 3D/canvas is used, document its product role, interaction model, fallback path, and library/runtime decision before coding.
134
-
135
- Do:
136
- - Synthesize a visual direction from the project context and explain why it fits.
137
- - Choose color, typography, spacing, motion, density, and component morphology dynamically from the product and audience.
138
- - Make at least three at-a-glance product-specific signals visible on new screens or broad redesigns: for example a data treatment, physical metaphor, motion behavior, iconography system, spatial structure, or state language that would not transfer cleanly to a different product.
139
- - Use visually exploratory, product-derived palettes while preserving WCAG contrast and status clarity. The design may be quiet, but it must not hide inside safe cream, slate, monochrome, or gradient defaults.
140
- - Use modern, expressive interaction and motion as part of the core design language, especially when it improves hierarchy, feedback, delight, confidence, or memorability.
141
- - Use 3D or spatial/canvas experiences as primary UI only when they improve product understanding or exploration while preserving navigation, content clarity, user actions, performance, accessibility, and non-3D fallbacks.
142
- - Keep frontend code clean, componentized, accessible, and easy to maintain.
143
- - Use tokens and semantic aliases so future changes do not require rewriting components.
144
- - Make design decisions explicit before coding, then implement consistently.
145
-
146
- Do not:
147
- - Ship AI-safe UI: predictable card stacks, rounded template panels, generic abstract marks, decorative grid wallpaper, beige or slate safety palettes, soft glow backgrounds, or first-output composition with only local copy swapped in.
148
- - Default to generic SaaS heroes, balanced card grids, soft startup gradients, or dashboard chrome without product rationale.
149
- - Use background lines, grids, scanlines, noise, glows, blobs, logos, or geometric decoration unless each motif has a named product function such as alignment, measurement, navigation, crop guidance, timeline reading, status, or motion continuity.
150
- - Let desktop, tablet, and mobile be the same design merely scaled down.
151
- - Let heading, body, data, and metadata collapse into one safe typographic treatment without rationale.
152
- - Reuse colors, layout shapes, or motion signatures from unrelated memory.
153
- - Add decorative animation that hurts clarity, accessibility, or runtime performance.
154
- - Let 3D visuals hide navigation, replace readable content, block core actions, or require a powerful device before the product can be understood.
155
- - Choose a dependency because this repo scaffold mentioned it. The LLM must verify fit from current project context and official docs.
156
-
157
- ## Responsive Rule
119
+ ## Responsive Recomposition Plan
158
120
 
159
121
  Responsive design means recomposition, not resizing.
160
122
 
161
- For every UI task, define how major surfaces change across mobile, tablet, and desktop:
162
- - What is reordered, merged, hidden, disclosed, or promoted?
163
- - What interaction changes for touch and narrow screens?
164
- - What content priority changes by viewport?
165
- - What is explicitly forbidden, such as scale-only shrink or preserving desktop order without reason?
123
+ Define viewport mutation rules:
124
+ - Mobile: prioritize the first decisive action and touch flow.
125
+ - Tablet: regroup surfaces without becoming a shrunken desktop.
126
+ - Desktop: expose more context without defaulting to admin chrome.
127
+ - For each viewport, name what is reordered, merged, hidden, disclosed, promoted, and forbidden.
166
128
 
167
129
  ## Required `docs/DESIGN.md` Sections
168
130
 
@@ -181,35 +143,35 @@ For every UI task, define how major surfaces change across mobile, tablet, and d
181
143
 
182
144
  ## Required `docs/design-intent.json` Behavior
183
145
 
184
- The JSON must stay machine-readable and project-specific. It should record:
185
- - the confirmed project context and assumptions to validate
186
- - agent-chosen visual direction, not scaffold-chosen direction
187
- - an `aiSafeUiAudit` or equivalent review signal that states why the screen is not interchangeable with a generic AI-generated template
188
- - `motionPaletteDecision` with motion density source, required interaction states, palette autopilot risk, and whether 3D/canvas is useful or unnecessary
189
- - `conceptualAnchor` and how typography, spacing, morphology, motion, and responsive composition derive from it when no external research was provided
190
- - `derivedTokenLogic` with exact `anchorReference` traceability for color, spacing, typography, and motion tokens
191
- - `libraryResearchStatus` plus `libraryDecisions[]` with verified source metadata or explicit native/project-local fallbacks
192
- - agent-chosen semantic color roles, typography system, spacing rhythm, and motion approach
193
- - token layering with primitive, semantic, and component tokens
194
- - viewport mutation rules for mobile, tablet, and desktop
195
- - interaction-state expectations for key components
196
- - accessibility hard floor and advisory readability checks
197
- - review rubric for distinctiveness, contract fidelity, hierarchy, responsive recomposition, motion discipline, and accessibility
198
- - forbidden patterns that are concrete bad habits for this project
199
- - repo evidence when available, including `repoEvidence.designEvidenceSummary`
146
+ The JSON is the source of truth for machine review. It must stay project-specific and include:
147
+ - confirmed project context and assumptions
148
+ - agent-chosen visual direction
149
+ - `motionPaletteDecision`
150
+ - `conceptualAnchor`
151
+ - `derivedTokenLogic`
152
+ - `aiSafeUiAudit`
153
+ - `tokenSystem`, `colorTruth`, `crossViewportAdaptation`, `motionSystem`, and `componentMorphology`
154
+ - `accessibilityPolicy`
155
+ - `designExecutionPolicy`
156
+ - `designExecutionHandoff`
157
+ - `reviewRubric`
158
+ - `contextHygiene`
159
+ - `libraryResearchStatus` and `libraryDecisions[]`
160
+ - `forbiddenPatterns`
161
+ - `repoEvidence.designEvidenceSummary` when available
200
162
 
201
163
  ## Accessibility and Review
202
164
 
203
- WCAG 2.2 AA is the hard floor. APCA may be used only as advisory perceptual tuning and must never waive a WCAG failure.
165
+ WCAG 2.2 AA is the hard floor. APCA may be used only as advisory perceptual tuning.
166
+
167
+ Define a review rubric that names drift signals and separates taste from failure.
204
168
 
205
- The review must block or flag:
169
+ Block or flag:
206
170
  - inaccessible contrast, focus, target size, keyboard, auth, or dynamic-status behavior
207
171
  - scale-only responsive behavior
208
- - unresearched dependency choices
209
- - AI-safe UI drift: interchangeable card grids, safe cream/slate/monochrome palettes, generic abstract logos, decorative grid wallpaper, or a screen that can be renamed to another product without visual changes
210
- - palette choices that use readability as a reason to stay in safe defaults instead of deriving a richer but accessible palette from the product
211
172
  - default component-kit styling without product rationale
212
- - missing or disconnected `conceptualAnchor` when no external design research was provided
173
+ - nonfunctional background effects, including decorative grid wallpaper
174
+ - palette choices that use readability as an excuse for safe defaults
213
175
  - visual direction copied from unrelated memory or external references
214
176
  - genericity findings that cannot name the exact drift signal
215
177
 
@@ -1,116 +1,100 @@
1
1
  # Frontend Design and Interaction Boundaries
2
2
 
3
- UI work must load the smallest relevant surface, not the entire engineering handbook.
3
+ Load this rule for UI-facing work. Keep the loaded surface small.
4
4
 
5
- ## Auto Activation
6
- When the request is UI-facing, this rule activates automatically.
5
+ ## Activation
7
6
 
8
- UI scope triggers:
9
- - ui, ux, page, screen, component, layout, landing, dashboard, form, onboarding, animation, interaction
7
+ Use this rule for:
8
+ - UI, UX, page, screen, component, layout, landing, dashboard, form, onboarding, animation, interaction
10
9
  - redesign, reskin, visual refresh, responsive fix, hierarchy fix
11
- - frontend deliverables even when the task also touches backend code
12
-
13
- ## What This Rule Is For
14
- Use this file to enforce:
15
- - anti-generic layout and morphology boundaries
16
- - responsive mutation requirements
17
- - accessibility floor for expressive UI
18
- - source hygiene for visual decisions
19
- - lightweight implementation boundaries that keep UI code from collapsing into framework defaults
20
-
21
- Do not use this file to teach generic frontend basics the model already knows.
22
-
23
- ## Source Hygiene and Source Boundaries
24
-
25
- - Valid style context is limited to current repo evidence, the active brief, and current project docs.
26
- - This rule guides the LLM; it must not choose the final style, framework, palette, typography, layout paradigm, or animation library offline.
27
- - Design continuity is opt-in. If the user does not request continuity, synthesize from the current product context instead of remembered layouts.
28
- - Repo evidence outranks memory residue every time.
29
- - External references are tainted by default. If the user supplies one, convert only explicit constraints into the current contract and do not compare against or imitate the source surface.
30
- - If a new UI, animation, styling, or component library is needed, research current official docs and choose the latest stable compatible option for the project.
31
-
32
- ## Zero-Based Redesign Boundary
33
-
34
- - If the user asks for a redesign "from zero" or equivalent reset language, treat existing UI as behavioral/content evidence only, not as visual direction.
35
- - Do not preserve prior palette, typography, hero composition, navigation placement, component morphology, motion signature, or image framing unless the user explicitly requests continuity.
36
- - The new UI must materially recompose at least the primary surface, content hierarchy, interaction model, and responsive information architecture.
37
- - A dark-mode flip, same layout with different colors, or restyled version of the previous hero is not a zero-based redesign.
38
- - Record the visual reset in `docs/DESIGN.md` and `docs/design-intent.json` before coding.
39
-
40
- ## Accessibility Split
41
-
42
- - Treat WCAG 2.2 AA as the hard compliance floor.
43
- - Treat APCA as advisory perceptual tuning only.
44
- - Hard checks must include focus visibility, focus appearance, target size, keyboard access, accessible authentication, use-of-color-only failures, and dynamic status/state access.
45
- - Fix the violation without flattening the interface into generic safe chrome unless that is the only safe option.
46
-
47
- ## Anti-Generic UI Boundaries
48
-
49
- - Do not default to interchangeable dashboard chrome, balanced card grids, centered marketing shells, or generic component-kit surfaces unless the product explicitly needs them.
50
- - Do not ship "AI-safe UI": predictable card stacks, rounded rectangles, generic abstract logos, decorative grids, beige or slate safety palettes, soft glow backgrounds, and first-output template composition are review findings when they are not directly required by the product.
51
- - Do not let repeated surfaces share the same visual treatment by habit. Repetition is allowed only when the contract explains the product reason.
52
- - Do not use default framework button and input treatment as the final UI language.
53
- - Do not let heading, body, and data/meta roles collapse into one safe typographic family without explicit rationale.
54
- - At least three visual, interaction, content, motion, or state behaviors must read as project-specific at a glance for new screens or broad redesigns. For a narrow component edit, at least one touched behavior must preserve or improve project specificity.
55
- - If the UI could be renamed to another product category without changing its composition, palette, iconography, and motion language, treat that as genericity drift and revise before implementation is considered complete.
56
-
57
- ## Dynamic Avant-Garde Anchor Boundary
58
-
59
- - If the user gives no current-task visual research or reference, the scaffold, old UI, and existing design docs do not count as research.
60
- - Before UI code, choose one agent-synthesized conceptual anchor from high-variance non-software domains and record only the final anchor in `docs/design-intent.json`.
61
- - Before broad compliance review, record a creative commitment: one concrete real-world anchor reference, one signature motion behavior, and one typographic decision with meaningful role contrast.
62
- - Reject anchors that can only be described with generic quality words such as "modern", "clean", "premium", "expressive", "minimal", or "bold"; the anchor must name a specific material, instrument, artifact class, architectural system, editorial genre, cinematic behavior, exhibition system, scientific apparatus, or industrial mechanism.
63
- - Internally reject the safest dashboard, portal, card-grid, admin-shell, or minimalist-web-app mental model before writing CSS.
64
- - Typography, spacing, morphology, motion, and responsive recomposition must derive from the chosen anchor, not from framework defaults.
65
- - Token choices must trace to `docs/design-intent.json` `derivedTokenLogic.anchorReference`. A color, spacing, typography, or motion token that cannot be explained from the anchor is invalid.
66
- - Default to an expressive motion plan derived from the anchor. Use spatial transitions, micro-interactions, scroll choreography, and modern animation libraries when they improve the experience; include reduced-motion and performance safeguards without using them as an excuse for a static UI.
67
-
68
- ## Library Research Boundary
69
-
70
- - New UI, animation, scroll, 3D, canvas, charting, icon, styling, or primitive libraries require current official-doc verification before imports are written.
71
- - If live research is unavailable, mark `libraryResearchStatus` as `pending-verification`, record the library as `LIBRARY_TO_VERIFY`, and use native CSS, browser APIs, or already-present project dependencies until verification is possible.
72
- - Each `libraryDecisions[]` entry must have either verification metadata or a concrete `fallbackIfUnavailable`.
73
-
74
- ## Contextual Motion and Palette Intelligence
75
-
76
- - Product categories are heuristics, not style presets. Use them only as a starting signal, then choose motion density from user task, content density, brand intent, device/performance budget, and accessibility needs.
77
- - If the category is unclear, infer from the dominant task: reading, scanning, form completion, data comparison, product inspection, storytelling, learning, play, or spatial exploration.
78
- - For interactive UI, map the required states before coding: default, hover, focus-visible, active/pressed, disabled, loading, empty, error, success, and transition.
79
- - Prefer visually exploratory, product-derived palettes over safe template palettes. High readability is mandatory, but readability must not be used as an excuse for cream/beige/tan, dark slate, purple-blue gradients, monochrome palettes, or uniform card surfaces.
80
- - Do not default to dark slate, cream/beige/tan, purple-blue gradients, monochrome palettes, or uniform card surfaces unless current project evidence supports them. If one of those palettes is used, document why it fits, add enough role contrast that the UI does not read as a template, and include at least one product-specific color behavior that would not make sense in a generic SaaS screen.
81
- - Treat cyber-neon terminal palettes, pale editorial cream surfaces, anonymous dark control rooms, soft glow gradients, and monochrome minimalism as autopilot risks, not reusable defaults. They are valid only when the product anchor explains their task role.
82
- - Palette review must answer why these colors belong to this product, which semantic roles carry task/status/data meaning, and what color behavior would not transfer cleanly to another product category.
83
- - Background lines, grids, scanlines, noise, glows, blobs, abstract logos, and decorative geometry are invalid when used as wallpaper. They must serve a named product function such as alignment, crop guidance, map/route orientation, timeline reading, measurement, status, or motion continuity.
84
- - Use the existing motion stack first. Add animation, 3D, canvas, or scroll dependencies only when they materially improve delivery speed, interaction quality, maintainability, or product understanding.
85
- - Motion should be absent only for a named reason: repeated high-frequency workflow, long-form reading focus, data-density scanning, reduced-motion need, device budget, or performance constraint.
86
- - If rich motion, 3D, canvas, WebGL, scroll choreography, or animation libraries are omitted, the design contract must name the product-fit reason and the replacement interaction quality that will carry hierarchy, feedback, or memorability.
87
-
88
- ## Spatial and 3D Experience Boundary
89
-
90
- - 3D, WebGL, canvas, and immersive spatial interfaces are allowed as the primary experience when they clarify the product, strengthen the chosen anchor, or make exploration meaningfully better than a flat UI.
91
- - 3D must not take over the jobs of navigation, content comprehension, or decisive user actions. Core routes, text, forms, and calls to action must remain discoverable, accessible, and usable without solving the scene.
92
- - Treat 3D as interaction architecture, not decoration. If it is only a modern-looking background or visual stunt, reduce it to a supporting accent or remove it.
93
- - Do not reject 3D/canvas by habit. Reject it only after naming the product, content-density, performance, accessibility, or device constraint that makes a non-3D interaction stronger.
94
- - Define performance and accessibility fallbacks before implementation: reduced motion, keyboard reachable controls, readable non-canvas content, mobile budgets, loading states, and a graceful non-3D path when rendering fails.
95
- - When 3D is central, document its product role, interaction model, fallback path, and library/runtime decision in `docs/DESIGN.md` and `docs/design-intent.json` before coding.
96
-
97
- ## Responsive Mutation Requirements
98
-
99
- - Responsive quality is not allowed to be scale-only. At least one surface must materially change position, grouping, priority, or disclosure strategy between mobile and desktop.
100
- - Mobile must prioritize the first decisive action, not preserve desktop balance out of habit.
101
- - Tablet must simplify simultaneous surfaces without becoming a shrunken desktop.
102
- - Desktop may expose more context, but it must not become an interchangeable admin shell by default.
103
-
104
- ## Surface and Morphology Requirements
105
-
106
- - Define the primary user task or reading path from current evidence before arranging surfaces.
107
- - Supporting surfaces must earn their placement through role, priority, or behavior. They must not feel like cloned modules.
108
- - Component states must preserve identity under hover, focus, loading, success, empty, and error. Do not let everything collapse into anonymous rounded panels.
109
- - Motion should be expressive by default for modern UI work. Make it strengthen hierarchy, feedback, or memorability, then keep it reduced-motion-safe and performant.
10
+ - frontend deliverables inside fullstack or backend work
11
+
12
+ ## Authority
13
+
14
+ - Use current repo evidence, the active brief, and current project docs as valid style context.
15
+ - Treat `.agent-context/` as design governance authority.
16
+ - Treat `README.md` as overview/install/user context only when design or architecture rules conflict.
17
+ - Do not choose final style, framework, palette, typography, layout paradigm, or animation library offline.
18
+ - Research current official docs before adding a new UI, animation, scroll, 3D, canvas, charting, icon, styling, or primitive library.
19
+ - Keep design continuity opt-in. Repo evidence outranks memory residue.
20
+
21
+ ## Required Design Contract
22
+
23
+ Before UI code, create or refine:
24
+ - `docs/DESIGN.md`
25
+ - `docs/design-intent.json`
26
+
27
+ The contract must record:
28
+ - `motionPaletteDecision`
29
+ - `conceptualAnchor`
30
+ - `derivedTokenLogic`
31
+ - `aiSafeUiAudit`
32
+ - `designExecutionPolicy`
33
+ - `designExecutionHandoff`
34
+ - `reviewRubric`
35
+ - `contextHygiene`
36
+ - `libraryResearchStatus` and `libraryDecisions[]`
37
+
38
+ ## Anti-Generic UI Gate
39
+
40
+ Do not ship interchangeable dashboard chrome, balanced card grids, centered marketing shells, generic component-kit surfaces, generic abstract logos, or nonfunctional background decoration unless the product earns them.
41
+
42
+ For new screens or broad redesigns, make at least three at-a-glance product-specific signals visible. Signals may be data treatment, iconography, state language, motion behavior, spatial structure, typography, material logic, or color behavior.
43
+
44
+ Use the rename test: if the UI can be renamed to another product category without changing composition, palette, iconography, and motion language, revise before implementation is considered complete.
45
+
46
+ Background lines, grids, scanlines, noise, glows, blobs, abstract logos, and decorative geometry are invalid as wallpaper. Use them only for a named product function such as alignment, crop guidance, map/route orientation, timeline reading, measurement, status, or motion continuity.
47
+
48
+ ## Dynamic Anchor Gate
49
+
50
+ If the user gives no current-task visual research or reference:
51
+ - Do not count old UI, existing design docs, or scaffold seeds as research.
52
+ - Choose one high-variance non-software conceptual anchor before UI code.
53
+ - Internally reject the safest dashboard, portal, card-grid, admin-shell, or minimalist-web-app mental model.
54
+ - Record one real-world anchor reference, one signature motion behavior, and one typographic decision with role contrast.
55
+ - Derive typography, spacing, morphology, motion, and responsive recomposition from that anchor.
56
+ - Reject anchors described only by generic quality words such as modern, clean, premium, expressive, minimal, or bold.
57
+
58
+ ## Motion, Palette, and 3D
59
+
60
+ - Product categories are heuristics, not style presets.
61
+ - Choose motion density from task, content density, brand intent, device budget, performance, and accessibility.
62
+ - Map states before coding: default, hover, focus-visible, active, disabled, loading, empty, error, success, transition.
63
+ - Prefer visually exploratory, product-derived palettes while preserving WCAG contrast and status clarity.
64
+ - Do not default to dark slate, cream/beige/tan, purple-blue gradients, monochrome palettes, cyber-neon terminals, or uniform card surfaces without product evidence.
65
+ - Treat motion, 3D, WebGL, canvas, scroll choreography, and animation libraries as first-class options.
66
+ - Omit rich motion or spatial UI only after naming the product-fit reason and the replacement interaction quality.
67
+ - Keep reduced-motion, keyboard, loading, performance, mobile, and non-3D fallbacks explicit.
68
+
69
+ ## Zero-Based Redesign
70
+
71
+ If the user asks for a redesign from zero:
72
+ - Treat existing UI as behavioral/content evidence only.
73
+ - Discard prior palette, typography, hero composition, navigation placement, component morphology, motion signature, and image framing unless the user requests continuity.
74
+ - Rewrite or materially update both design docs before coding.
75
+ - Change primary composition, content hierarchy, interaction model, and responsive information architecture.
76
+ - Reject palette swaps, dark-mode flips, and restyled heroes.
77
+
78
+ ## Responsive Mutation
79
+
80
+ Responsive quality is not scale-only.
81
+
82
+ - Mobile must prioritize the first decisive action.
83
+ - Tablet must regroup surfaces instead of shrinking desktop.
84
+ - Desktop may expose more context but must not become interchangeable admin chrome.
85
+ - At least one major surface must change position, grouping, priority, or disclosure strategy between mobile and desktop.
86
+
87
+ ## Accessibility
88
+
89
+ - WCAG 2.2 AA is the hard floor.
90
+ - APCA is advisory perceptual tuning only.
91
+ - Hard checks include focus visibility, focus appearance, target size, keyboard access, accessible authentication, color-only meaning, and dynamic status/state access.
92
+ - Fix accessibility issues without flattening the UI into generic safe chrome unless no expressive safe option remains.
110
93
 
111
94
  ## Implementation Boundaries
112
95
 
113
- - Follow the shipped project stack and current repo patterns before inventing state-management or data-fetching rules.
114
- - Do not hardcode Zustand, React Query, smart/dumb component doctrine, or any framework-specific architecture as universal frontend law in baseline design governance.
115
- - If the repo already uses a runtime pattern, stay consistent with it. If it does not, choose the lightest modern fit for the task and document why.
116
- - Keep structure feature-oriented and avoid giant catch-all UI buckets when the repo does not explicitly require them.
96
+ - Follow the shipped project stack and current repo patterns.
97
+ - Do not hardcode Zustand, React Query, smart/dumb component doctrine, or framework-specific architecture as universal design law.
98
+ - Keep structure feature-oriented when it improves maintainability.
99
+ - Keep component states recognizable across hover, focus, loading, success, empty, and error.
100
+ - Do not let repeated surfaces share one visual treatment by habit; repetition needs a product reason.
@@ -0,0 +1,26 @@
1
+ # State Artifacts
2
+
3
+ Use this directory as a typed governance state surface, not as a dump folder.
4
+
5
+ Tracked seed/config artifacts:
6
+ - `architecture-map.md`
7
+ - `dependency-map.md`
8
+ - `benchmark-comparison-schema.json`
9
+ - `benchmark-reproducibility.json`
10
+ - `benchmark-thresholds.json`
11
+ - `benchmark-watchlist.json`
12
+ - `benchmark-writer-judge-config.json`
13
+ - `memory-adapter-contract.json`
14
+ - `memory-schema-v1.json`
15
+ - `stack-research-snapshot.json`
16
+
17
+ Tracked operational artifact:
18
+ - `onboarding-report.json` stays tracked in this repository because internal audits read it as the current repository onboarding state. In installed projects, `init` and `upgrade` regenerate this file.
19
+
20
+ Local-only/generated artifacts:
21
+ - `active-memory.json`
22
+ - `v3-purge-audit.json`
23
+ - `llm-judge-report.json`
24
+ - benchmark, trend, weekly governance, and quality report outputs
25
+
26
+ Do not treat generated reports as current project truth. Rerun the matching `npm run benchmark:*`, `npm run report:*`, or `npm run audit:*` command when fresh evidence is needed.
@@ -0,0 +1,10 @@
1
+ {
2
+ "mcpServers": {
3
+ "agentic-senior-core": {
4
+ "command": "node",
5
+ "args": ["./scripts/mcp-server.mjs"],
6
+ "cwd": "${workspaceFolder}"
7
+ }
8
+ }
9
+ }
10
+