@ryuenn3123/agentic-senior-core 3.0.50 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/.agent-context/prompts/bootstrap-design.md +3 -1
  2. package/.agent-context/prompts/research-design.md +165 -0
  3. package/.agent-context/review-checklists/pr-checklist.md +1 -0
  4. package/.agent-context/rules/api-docs.md +63 -47
  5. package/.agent-context/rules/architecture.md +133 -120
  6. package/.agent-context/rules/database-design.md +36 -18
  7. package/.agent-context/rules/docker-runtime.md +66 -43
  8. package/.agent-context/rules/efficiency-vs-hype.md +38 -17
  9. package/.agent-context/rules/error-handling.md +35 -16
  10. package/.agent-context/rules/event-driven.md +35 -18
  11. package/.agent-context/rules/frontend-architecture.md +103 -76
  12. package/.agent-context/rules/git-workflow.md +81 -197
  13. package/.agent-context/rules/microservices.md +42 -41
  14. package/.agent-context/rules/naming-conv.md +27 -8
  15. package/.agent-context/rules/performance.md +32 -12
  16. package/.agent-context/rules/realtime.md +26 -9
  17. package/.agent-context/rules/security.md +39 -20
  18. package/.agent-context/rules/testing.md +36 -16
  19. package/AGENTS.md +21 -20
  20. package/README.md +10 -1
  21. package/lib/cli/commands/init.mjs +12 -0
  22. package/lib/cli/commands/upgrade.mjs +11 -0
  23. package/lib/cli/compiler.mjs +1 -0
  24. package/lib/cli/detector/constants.mjs +135 -0
  25. package/lib/cli/detector/design-evidence/collector.mjs +256 -0
  26. package/lib/cli/detector/design-evidence/constants.mjs +39 -0
  27. package/lib/cli/detector/design-evidence/file-traversal.mjs +83 -0
  28. package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +117 -0
  29. package/lib/cli/detector/design-evidence/summary.mjs +109 -0
  30. package/lib/cli/detector/design-evidence/utility-helpers.mjs +122 -0
  31. package/lib/cli/detector/design-evidence.mjs +25 -610
  32. package/lib/cli/detector/stack-detection.mjs +243 -0
  33. package/lib/cli/detector/ui-signals.mjs +150 -0
  34. package/lib/cli/detector/workspace-scan.mjs +177 -0
  35. package/lib/cli/detector.mjs +20 -688
  36. package/lib/cli/memory-continuity.mjs +1 -0
  37. package/lib/cli/project-scaffolder/design-contract/research-dossier-migration.mjs +165 -0
  38. package/lib/cli/project-scaffolder/design-contract/sections/audits.mjs +96 -0
  39. package/lib/cli/project-scaffolder/design-contract/sections/conceptual-anchor.mjs +233 -0
  40. package/lib/cli/project-scaffolder/design-contract/sections/execution-handoff.mjs +211 -0
  41. package/lib/cli/project-scaffolder/design-contract/seed-signals.mjs +79 -0
  42. package/lib/cli/project-scaffolder/design-contract/signal-vocab.mjs +64 -0
  43. package/lib/cli/project-scaffolder/design-contract/validation/anchor-validators.mjs +456 -0
  44. package/lib/cli/project-scaffolder/design-contract/validation/audit-validators.mjs +117 -0
  45. package/lib/cli/project-scaffolder/design-contract/validation/completeness.mjs +83 -0
  46. package/lib/cli/project-scaffolder/design-contract/validation/execution-validators.mjs +328 -0
  47. package/lib/cli/project-scaffolder/design-contract/validation/helpers.mjs +8 -0
  48. package/lib/cli/project-scaffolder/design-contract/validation/research-dossier-validators.mjs +104 -0
  49. package/lib/cli/project-scaffolder/design-contract/validation/structural-validators.mjs +79 -0
  50. package/lib/cli/project-scaffolder/design-contract/validation/system-validators.mjs +256 -0
  51. package/lib/cli/project-scaffolder/design-contract/validation.mjs +61 -896
  52. package/lib/cli/project-scaffolder/design-contract.mjs +151 -556
  53. package/lib/cli/project-scaffolder/prompt-builders.mjs +9 -0
  54. package/mcp.json +30 -9
  55. package/package.json +17 -2
  56. package/scripts/audit-cache-layer-contract.mjs +258 -0
  57. package/scripts/audit-caching-scope-hygiene.mjs +263 -0
  58. package/scripts/audit-file-size.mjs +219 -0
  59. package/scripts/audit-reflection-citations.mjs +163 -0
  60. package/scripts/audit-release-bundle.mjs +170 -0
  61. package/scripts/audit-rule-id-uniqueness.mjs +313 -0
  62. package/scripts/benchmark-evidence-bundle.mjs +1 -0
  63. package/scripts/build-release-benchmark-bundle.mjs +204 -0
  64. package/scripts/context-triggered-audit.mjs +1 -0
  65. package/scripts/documentation-boundary-audit.mjs +1 -0
  66. package/scripts/explain-on-demand-audit.mjs +2 -1
  67. package/scripts/frontend-usability-audit.mjs +10 -10
  68. package/scripts/llm-judge/checklist-loader.mjs +45 -0
  69. package/scripts/llm-judge/constants.mjs +66 -0
  70. package/scripts/llm-judge/diff-collection.mjs +74 -0
  71. package/scripts/llm-judge/prompting.mjs +78 -0
  72. package/scripts/llm-judge/providers.mjs +111 -0
  73. package/scripts/llm-judge/verdict.mjs +134 -0
  74. package/scripts/llm-judge.mjs +21 -482
  75. package/scripts/mcp-server/tool-registry.mjs +55 -0
  76. package/scripts/mcp-server/tools.mjs +137 -1
  77. package/scripts/migrate-rule-format/id-prefix-table.mjs +37 -0
  78. package/scripts/migrate-rule-format/parse-legacy.mjs +180 -0
  79. package/scripts/migrate-rule-format/render-new.mjs +169 -0
  80. package/scripts/migrate-rule-format/roundtrip-validate.mjs +89 -0
  81. package/scripts/migrate-rule-format.mjs +192 -0
  82. package/scripts/release-gate/constants.mjs +1 -1
  83. package/scripts/release-gate/static-checks.mjs +1 -1
  84. package/scripts/rules-guardian-audit.mjs +5 -2
  85. package/scripts/single-source-lazy-loading-audit.mjs +2 -1
  86. package/scripts/ui-design-judge/git-input.mjs +3 -0
  87. package/scripts/validate/config.mjs +27 -2
  88. package/scripts/validate/coverage-checks.mjs +1 -1
  89. package/scripts/validate.mjs +94 -1
@@ -1,25 +1,42 @@
1
+ ---
2
+ id_prefix: EVT
3
+ domain: event-driven
4
+ priority: medium
5
+ scope: backend
6
+ applies_to:
7
+ - backend
8
+ - fullstack
9
+ keywords:
10
+ - event-driven
11
+ - evt
12
+ - events
13
+ - consumers
14
+ - outbox
15
+ - consistency
16
+ ---
17
+
1
18
  # Event Boundary
2
19
 
3
20
  Do not add event-driven architecture because it sounds modern. Use it only when the product or repo shows a real async boundary.
4
21
 
5
- Use events when:
6
- - multiple independent consumers must react to the same fact
7
- - synchronous coupling would harm reliability, latency, or ownership
8
- - audit history, fan-out, or eventual consistency is a real requirement
9
- - the team can operate retries, monitoring, and failure recovery
22
+ ## EVT-001: Event Boundary and Hard Delivery Rules
10
23
 
11
- Reject events when a direct call, database transaction, or simple module boundary is enough.
24
+ 1. Use events when multiple independent consumers must react to the same fact.
25
+ 2. Use events when synchronous coupling would harm reliability, latency, or ownership.
26
+ 3. Use events when audit history, fan-out, or eventual consistency is a real requirement.
27
+ 4. Use events only when the team can operate retries, monitoring, and failure recovery.
28
+ 5. Reject events when a direct call, database transaction, or simple module boundary is enough.
29
+ 6. Events describe facts that already happened.
30
+ 7. Payloads are versioned, typed, and documented.
31
+ 8. Producers do not know consumer internals.
32
+ 9. Consumers are idempotent.
33
+ 10. Retries are bounded and dead-letter or recovery behavior is defined.
34
+ 11. Transactional publishing uses an outbox or equivalent safety pattern when data consistency matters.
35
+ 12. Dual-write flows that update local state and publish a message must use a transactional outbox or document an equivalent atomicity and replay strategy.
12
36
 
13
- Hard rules:
14
- - events describe facts that already happened
15
- - payloads are versioned, typed, and documented
16
- - producers do not know consumer internals
17
- - consumers are idempotent
18
- - retries are bounded and dead-letter or recovery behavior is defined
19
- - transactional publishing uses an outbox or equivalent safety pattern when data consistency matters
20
- - dual-write flows that update local state and publish a message must use a transactional outbox or document an equivalent atomicity and replay strategy
21
- - distributed transactions and two-phase commit are not the default recovery model; prefer local transactions plus saga, choreography, orchestration, or explicit compensating actions when consistency crosses service boundaries
22
- - message handlers must record processed message identifiers or use another duplicate-detection strategy when the delivery model can retry or redeliver
23
- - event catalogs or docs identify producer, consumers, ownership, and schema evolution rules
37
+ ## EVT-002: Event Recovery and Catalogs
24
38
 
25
- If event tooling is unresolved, the LLM must recommend a current project-fit broker or managed service from official docs before implementation.
39
+ 1. Distributed transactions and two-phase commit are not the default recovery model; prefer local transactions plus saga, choreography, orchestration, or explicit compensating actions when consistency crosses service boundaries.
40
+ 2. Message handlers must record processed message identifiers or use another duplicate-detection strategy when the delivery model can retry or redeliver.
41
+ 3. Event catalogs or docs identify producer, consumers, ownership, and schema evolution rules.
42
+ 4. If event tooling is unresolved, recommend a current project-fit broker or managed service from official docs before implementation.
@@ -1,107 +1,134 @@
1
+ ---
2
+ id_prefix: FE
3
+ domain: frontend-architecture
4
+ priority: high
5
+ scope: ui
6
+ applies_to:
7
+ - frontend
8
+ - fullstack
9
+ keywords:
10
+ - frontend-architecture
11
+ - fe
12
+ - ui
13
+ - design
14
+ - interaction
15
+ - boundaries
16
+ ---
17
+
1
18
  # Frontend Design and Interaction Boundaries
2
19
 
3
20
  Load this rule for UI-facing work. Keep the loaded surface small.
4
21
 
5
- ## Activation
22
+ ## FE-001: Activation
23
+
24
+ 1. 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.
25
+
26
+ ## FE-002: Authority
6
27
 
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.
28
+ 1. Use current repo evidence, the active brief, and current project docs as valid style context.
29
+ 2. Treat `.agent-context/` as design governance authority.
30
+ 3. Treat `README.md` as public and developer overview, setup, usage, and user-facing context only when design or architecture rules conflict.
31
+ 4. Do not choose final style, framework, palette, typography, layout paradigm, or animation library offline.
32
+ 5. Research current official docs before adding a new UI, animation, scroll, 3D, canvas, charting, icon, styling, or primitive library.
33
+ 6. Dynamic UI Foundation: do not hardcode shadcn/ui, Tailwind-only, native-only, or any component library as the universal answer, and do not avoid them out of guardrail fear when they fit. Tailwind-first is valid when the stack, token model, and team workflow support it; pure Tailwind, vanilla CSS, shadcn/ui, or any kit is not neutral by itself. Modern primitives, motion/canvas/WebGL helpers, charting libraries, and styling tools are valid when product evidence, accessibility, runtime constraints, and official docs support them.
34
+ 7. For fresh projects, prefer official framework scaffolders or setup commands when official docs show they produce the current supported shape. Build files manually only when approved architecture, repo constraints, or learning/prototype scope makes that better.
35
+ 8. Keep design continuity opt-in. Repo evidence outranks memory residue.
8
36
 
9
- ## Authority
37
+ ## FE-003: Required Design Contract
10
38
 
11
- - Use current repo evidence, the active brief, and current project docs as valid style context.
12
- - Treat `.agent-context/` as design governance authority.
13
- - Treat `README.md` as public and developer overview, setup, usage, and user-facing context only when design or architecture rules conflict.
14
- - Do not choose final style, framework, palette, typography, layout paradigm, or animation library offline.
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, and do not avoid them out of guardrail fear when they fit. Tailwind-first is valid when the stack, token model, and team workflow support it; pure Tailwind, vanilla CSS, shadcn/ui, or any kit is not neutral by itself. Modern primitives, motion/canvas/WebGL helpers, charting libraries, and styling tools are valid when product evidence, accessibility, runtime constraints, and official docs support them.
17
- - For fresh projects, prefer official framework scaffolders or setup commands when official docs show they produce the current supported shape. Build files manually only when approved architecture, repo constraints, or learning/prototype scope makes that better.
18
- - Keep design continuity opt-in. Repo evidence outranks memory residue.
39
+ 1. Before UI code, create or refine `docs/DESIGN.md` and `docs/design-intent.json`.
40
+ 2. The contract must record `motionPaletteDecision`, `designFlexibilityPolicy`, `conceptualAnchor`, `derivedTokenLogic`, `aiSafeUiAudit`, `designExecutionPolicy`, `designExecutionHandoff`, `reviewRubric`, `contextHygiene`, `libraryResearchStatus`, and `libraryDecisions[]`.
19
41
 
20
- ## Required Design Contract
42
+ ## FE-004: Anti-Generic UI Gate
21
43
 
22
- Before UI code, create or refine `docs/DESIGN.md` and `docs/design-intent.json`. The contract must record `motionPaletteDecision`, `designFlexibilityPolicy`, `conceptualAnchor`, `derivedTokenLogic`, `aiSafeUiAudit`, `designExecutionPolicy`, `designExecutionHandoff`, `reviewRubric`, `contextHygiene`, `libraryResearchStatus`, and `libraryDecisions[]`.
44
+ 1. 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.
45
+ 2. 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.
46
+ 3. 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.
47
+ 4. 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.
23
48
 
24
- ## Anti-Generic UI Gate
49
+ ## FE-005: Dynamic Anchor Gate
25
50
 
26
- 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.
51
+ 1. If the user gives no current-task visual research or reference, do not count old UI, existing design docs, or scaffold seeds as research.
52
+ 2. Choose one high-variance non-software conceptual anchor before UI code.
53
+ 3. Internally reject the safest dashboard, portal, card-grid, admin-shell, or minimalist-web-app mental model.
54
+ 4. Do not let the fallback anchor become a generic place metaphor. Avoid room, darkroom, counting room, control room, war room, studio, lab, cockpit, and command center unless the product actually depends on that place model; prefer product-specific artifacts, workflows, custody chains, instruments, data behaviors, material systems, editorial systems, service rituals, or interaction mechanisms over "where the UI lives".
55
+ 5. Record one real-world anchor reference, one signature motion behavior, and one typographic decision with role contrast.
56
+ 6. Derive typography, spacing, morphology, motion, and responsive recomposition from that anchor.
57
+ 7. 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
+ 8. Reject anchors described only by generic quality words such as modern, clean, premium, expressive, minimal, or bold.
27
59
 
28
- 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.
60
+ ## FE-006: Motion, Palette, and 3D
29
61
 
30
- 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.
62
+ 1. Product categories are heuristics, not style presets.
63
+ 2. Choose motion density from task, content density, brand intent, device budget, performance, and accessibility.
64
+ 3. Map states before coding: default, hover, focus-visible, active, disabled, loading, empty, error, success, transition.
65
+ 4. Distinguish motion (visual continuity between states) from interaction design (state machines, focus transfer on route/modal/error transitions, optimistic updates where safe, skeleton shapes that match real content, `aria-live` for status, keyboard paths, scroll-driven progressive disclosure). Record at least one interaction-design decision per major flow alongside motion choices.
66
+ 5. Prefer visually exploratory, product-derived palettes while preserving WCAG contrast and status clarity.
67
+ 6. Do not default to dark slate, cream/beige/tan, purple-blue gradients, monochrome palettes, cyber-neon terminals, or uniform card surfaces without product evidence.
68
+ 7. Treat motion, 3D, WebGL, canvas, scroll choreography, and animation libraries as first-class options.
31
69
 
32
- 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.
70
+ ## FE-007: Zero-Based Redesign
33
71
 
34
- 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.
72
+ 1. If the user asks for a redesign from zero, treat existing UI as behavioral/content evidence only.
73
+ 2. Discard prior palette, typography, hero composition, navigation placement, component morphology, motion signature, and image framing unless the user requests continuity.
74
+ 3. Rewrite or materially update both design docs before coding.
75
+ 4. Change primary composition, content hierarchy, interaction model, and responsive information architecture.
76
+ 5. Reject palette swaps, dark-mode flips, and restyled heroes.
77
+ 6. Reject implementations that remove animation, media, depth, or interaction density merely to reduce complexity when the request calls for a more distinctive experience.
35
78
 
36
- 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.
79
+ ## FE-008: Responsive Mutation
37
80
 
38
- 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.
81
+ 1. Responsive quality is not scale-only.
82
+ 2. Mobile must prioritize the first decisive action.
83
+ 3. Tablet must regroup surfaces instead of shrinking desktop.
84
+ 4. Desktop may expose more context but must not become interchangeable admin chrome (see [REF:FE-004]).
85
+ 5. At least one major surface must change position, grouping, priority, or disclosure strategy between mobile and desktop.
86
+ 6. Prefer container queries, dynamic viewport units, support-checked selectors, subgrid, popover, or disclosure primitives when they simplify recomposition and fallbacks are clear.
39
87
 
40
- ## Dynamic Anchor Gate
88
+ ## FE-009: Accessibility
41
89
 
42
- If the user gives no current-task visual research or reference:
43
- - Do not count old UI, existing design docs, or scaffold seeds as research.
44
- - Choose one high-variance non-software conceptual anchor before UI code.
45
- - Internally reject the safest dashboard, portal, card-grid, admin-shell, or minimalist-web-app mental model.
46
- - Do not let the fallback anchor become a generic place metaphor. Avoid room, darkroom, counting room, control room, war room, studio, lab, cockpit, and command center unless the product actually depends on that place model; prefer product-specific artifacts, workflows, custody chains, instruments, data behaviors, material systems, editorial systems, service rituals, or interaction mechanisms over "where the UI lives".
47
- - Record one real-world anchor reference, one signature motion behavior, and one typographic decision with role contrast.
48
- - Derive typography, spacing, morphology, motion, and responsive recomposition from that anchor.
49
- - 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.
50
- - Reject anchors described only by generic quality words such as modern, clean, premium, expressive, minimal, or bold.
90
+ 1. WCAG 2.2 AA is the hard floor.
91
+ 2. APCA is advisory perceptual tuning only.
92
+ 3. Hard checks include focus visibility, focus appearance, target size, keyboard access, accessible authentication, color-only meaning, and dynamic status/state access.
93
+ 4. Fix accessibility issues without flattening the UI into generic safe chrome unless no expressive safe option remains (see [REF:FE-004]).
51
94
 
52
- ## Motion, Palette, and 3D
95
+ ## FE-010: CSS Production Hardening
53
96
 
54
- - Product categories are heuristics, not style presets.
55
- - Choose motion density from task, content density, brand intent, device budget, performance, and accessibility.
56
- - Map states before coding: default, hover, focus-visible, active, disabled, loading, empty, error, success, transition.
57
- - Distinguish motion (visual continuity between states) from interaction design (state machines, focus transfer on route/modal/error transitions, optimistic updates where safe, skeleton shapes that match real content, `aria-live` for status, keyboard paths, scroll-driven progressive disclosure). Record at least one interaction-design decision per major flow alongside motion choices.
58
- - Prefer visually exploratory, product-derived palettes while preserving WCAG contrast and status clarity.
59
- - Do not default to dark slate, cream/beige/tan, purple-blue gradients, monochrome palettes, cyber-neon terminals, or uniform card surfaces without product evidence.
60
- - Treat motion, 3D, WebGL, canvas, scroll choreography, and animation libraries as first-class options.
61
- - Omit rich motion or spatial UI only after naming the product-fit reason and the replacement interaction quality.
62
- - 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.
63
- - Prefer micro-interactions in 150-300ms, layout transitions in 300-500ms, transform/opacity for high-frequency motion, explicit easing, bounded stagger, and reduced-motion alternatives unless evidence changes the budget.
64
- - Keep reduced-motion, keyboard, loading, performance, mobile, and non-3D fallbacks explicit.
65
- - 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.
66
- - 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, candidate signature moves, and external website inspiration flexible until evidence or approval locks them. Convert references into product-fit rules; do not copy layout, palette, component skin, brand posture, or visual metaphor.
67
- ## Zero-Based Redesign
97
+ 1. Plan overflow, wrapping, truncation, empty, loading, error, and extreme-content behavior before declaring a layout complete.
98
+ 2. Prefer `min()`, `max()`, `clamp()`, stable aspect ratios, container-relative sizing, OKLCH, and tinted neutrals for new tokens when supported; preserve existing design-system tokens.
99
+ 3. Prefer composition primitives that match content meaning: named `grid-template-areas` for editorial regions, subgrid for nested alignment across siblings, container queries for component-level responsiveness independent of viewport, and explicit stacking context (`isolation: isolate`) when overlap or z-depth carries meaning. Do not default to flex column when content has structure that grid expresses better.
100
+ 4. Treat recursive card nesting, uniform radius everywhere, shadow on every surface, arbitrary spacing, gray text on saturated color, and library-default skins as drift signals requiring product rationale.
68
101
 
69
- If the user asks for a redesign from zero:
70
- - Treat existing UI as behavioral/content evidence only.
71
- - Discard prior palette, typography, hero composition, navigation placement, component morphology, motion signature, and image framing unless the user requests continuity.
72
- - Rewrite or materially update both design docs before coding.
73
- - Change primary composition, content hierarchy, interaction model, and responsive information architecture.
74
- - Reject palette swaps, dark-mode flips, and restyled heroes.
75
- - Reject implementations that remove animation, media, depth, or interaction density merely to reduce complexity when the request calls for a more distinctive experience.
102
+ ## FE-011: Implementation Boundaries
76
103
 
77
- ## Responsive Mutation
104
+ 1. Follow the shipped project stack and current repo patterns.
105
+ 2. Do not hardcode Zustand, React Query, smart/dumb component doctrine, or framework-specific architecture as universal design law.
106
+ 3. Keep structure feature-oriented when it improves maintainability.
107
+ 4. Keep component states recognizable across hover, focus, loading, success, empty, and error.
108
+ 5. Do not let repeated surfaces share one visual treatment by habit; repetition needs a product reason.
78
109
 
79
- Responsive quality is not scale-only.
110
+ ## FE-013: Background and Wallpaper Discipline
80
111
 
81
- - Mobile must prioritize the first decisive action.
82
- - Tablet must regroup surfaces instead of shrinking desktop.
83
- - Desktop may expose more context but must not become interchangeable admin chrome.
84
- - At least one major surface must change position, grouping, priority, or disclosure strategy between mobile and desktop.
85
- - Prefer container queries, dynamic viewport units, support-checked selectors, subgrid, popover, or disclosure primitives when they simplify recomposition and fallbacks are clear.
112
+ 1. Background lines, grids, scanlines, noise, glows, blobs, abstract logos, calibration marks, and decorative geometry are invalid as wallpaper.
113
+ 2. Do not use grid or line backgrounds as first-output filler.
114
+ 3. Use them only for a named product function such as alignment, crop guidance, map/route orientation, timeline reading, measurement, status, or motion continuity.
115
+ 4. Measurement, calibration, crop, map, route, and inspection marks are task-bound overlays or control affordances.
116
+ 5. They must not become the page background, hero backdrop, or default visual texture.
117
+ 6. When a conceptual anchor (see [REF:FE-005]) 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.
86
118
 
87
- ## Accessibility
119
+ ## FE-014: Production Content Policy
88
120
 
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.
121
+ 1. 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.
122
+ 2. User-facing workflows need an operable UI path; terminal-only core flows are valid only for CLI, developer-tool, or runbook products.
93
123
 
94
- ## CSS Production Hardening
124
+ ## FE-015: Motion Implementation Budget
95
125
 
96
- - Plan overflow, wrapping, truncation, empty, loading, error, and extreme-content behavior before declaring a layout complete.
97
- - Prefer `min()`, `max()`, `clamp()`, stable aspect ratios, container-relative sizing, OKLCH, and tinted neutrals for new tokens when supported; preserve existing design-system tokens.
98
- - Prefer composition primitives that match content meaning: named `grid-template-areas` for editorial regions, subgrid for nested alignment across siblings, container queries for component-level responsiveness independent of viewport, and explicit stacking context (`isolation: isolate`) when overlap or z-depth carries meaning. Do not default to flex column when content has structure that grid expresses better.
99
- - Treat recursive card nesting, uniform radius everywhere, shadow on every surface, arbitrary spacing, gray text on saturated color, and library-default skins as drift signals requiring product rationale.
126
+ 1. Omit rich motion or spatial UI only after naming the product-fit reason and the replacement interaction quality.
127
+ 2. 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.
128
+ 3. Prefer micro-interactions in 150-300ms, layout transitions in 300-500ms, transform/opacity for high-frequency motion, explicit easing, bounded stagger, and reduced-motion alternatives unless evidence changes the budget.
129
+ 4. Keep reduced-motion, keyboard, loading, performance, mobile, and non-3D fallbacks explicit.
100
130
 
101
- ## Implementation Boundaries
131
+ ## FE-016: Library and Design-Intent Discipline
102
132
 
103
- - Follow the shipped project stack and current repo patterns.
104
- - Do not hardcode Zustand, React Query, smart/dumb component doctrine, or framework-specific architecture as universal design law.
105
- - Keep structure feature-oriented when it improves maintainability.
106
- - Keep component states recognizable across hover, focus, loading, success, empty, and error.
107
- - Do not let repeated surfaces share one visual treatment by habit; repetition needs a product reason.
133
+ 1. 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.
134
+ 2. 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, candidate signature moves, and external website inspiration flexible until evidence or approval locks them. Convert references into product-fit rules; do not copy layout, palette, component skin, brand posture, or visual metaphor.
@@ -1,200 +1,84 @@
1
- # Git Workflow — Clean History, Atomic Commits
2
-
3
- > Your git log is a changelog. If it reads like gibberish, your team is lost.
4
-
5
- ## Commit Message Format: Conventional Commits (Enforced)
6
-
7
- ```
8
- <type>(<scope>): <description>
9
-
10
- [optional body — explain WHY, not WHAT]
11
- [optional footer — Breaking changes, issue references]
12
- ```
13
-
14
- ### Types (Strict Set)
15
- | Type | When | Example |
16
- |------|------|---------|
17
- | `feat` | New feature | `feat(auth): add JWT refresh token rotation` |
18
- | `fix` | Bug fix | `fix(payment): handle race condition in checkout` |
19
- | `refactor` | Code restructuring (no behavior change) | `refactor(user): extract validation to separate service` |
20
- | `docs` | Documentation only | `docs(api): add OpenAPI schema for /orders endpoint` |
21
- | `test` | Adding/fixing tests | `test(cart): add edge case for empty cart discount` |
22
- | `chore` | Build, CI, config, dependencies | `chore(deps): upgrade prisma to 5.x` |
23
- | `perf` | Performance improvement | `perf(search): add index on users.email column` |
24
- | `style` | Formatting, semicolons (no logic change) | `style: apply prettier formatting` |
25
- | `ci` | CI/CD changes | `ci: add Node 20 to test matrix` |
26
-
27
- ### Rules
28
- 1. **Type is mandatory.** No commits without a type prefix.
29
- 2. **Scope is required for module or feature changes.** Use the module/feature name.
30
- 3. **Description is imperative mood.** "add", not "added" or "adds".
31
- 4. **Max 72 characters** for the subject line.
32
- 5. **Body explains WHY,** not what. The diff shows what.
33
-
34
- ### ❌ BANNED Commit Messages
35
- ```
36
- fix bug
37
- updates
38
- WIP
39
- asdf
40
- misc changes
41
- working now
42
- final fix
43
- fix fix fix
44
- ```
45
-
46
1
  ---
47
-
48
- ## Branching Model
49
-
50
- ### Main Branches
51
- | Branch | Purpose | Merge Strategy |
52
- |--------|---------|---------------|
53
- | `main` | Production-ready code | Merge commit or squash |
54
- | `develop` | Integration branch (if using GitFlow) | Merge commit |
55
-
56
- ### Feature Branches
57
- ```
58
- Pattern: <type>/<ticket-id>-<short-description>
59
-
60
- Examples:
61
- feat/AUTH-123-jwt-refresh
62
- fix/PAY-456-checkout-race-condition
63
- refactor/USER-789-extract-validation
64
- chore/INFRA-101-upgrade-node-20
65
- ```
66
-
67
- ### Rules
68
- 1. Branch from `main` (or `develop` if using GitFlow)
69
- 2. Keep branches short-lived (max 2-3 days)
70
- 3. Rebase on `main` before creating PR — don't merge main into your branch
71
- 4. Delete branch after merge
72
-
2
+ id_prefix: GIT
3
+ domain: git-workflow
4
+ priority: medium
5
+ scope: governance
6
+ applies_to:
7
+ - backend
8
+ - frontend
9
+ - fullstack
10
+ keywords:
11
+ - git-workflow
12
+ - git
13
+ - commit
14
+ - branch
15
+ - pull-request
16
+ - gitignore
73
17
  ---
74
18
 
75
- ## Pull Request Standards
76
-
77
- ### PR Size
78
- | Size | Lines Changed | Verdict |
79
- |------|--------------|---------|
80
- | Small | 1-100 | ✅ Ideal — easy to review |
81
- | Medium | 100-300 | ⚠️ Acceptable split if possible |
82
- | Large | 300-500 | 🔶 Needs justification |
83
- | Massive | 500+ | MUST be split into smaller PRs |
84
-
85
- **Rule:** If a PR touches more than 5 files across different modules, it's doing too much. Split it.
86
-
87
- ### PR Description Template
88
- ```markdown
89
- ## What
90
- Brief description of what this PR does.
91
-
92
- ## Why
93
- Why this change is needed. Link to issue/ticket.
94
-
95
- ## How
96
- High-level approach. Mention any non-obvious design decisions.
97
-
98
- ## Testing
99
- - [ ] Unit tests added/updated
100
- - [ ] Integration tests (if applicable)
101
- - [ ] Manual testing steps
102
-
103
- ## Screenshots (if UI change)
104
- Before | After
105
- ```
106
-
107
- ### PR Review Rules
108
- 1. Every PR needs at least 1 approval
109
- 2. Author resolves all comments before merge
110
- 3. CI must pass (lint, test, build)
111
- 4. No `// TODO` without a linked issue
112
- 5. No `console.log` debugging statements in production code
113
-
114
- ---
115
-
116
- ## Commit Atomicity
117
-
118
- ### Rule: Each Commit Must Be a Complete, Working Unit
119
-
120
- ```
121
- BANNED sequence:
122
- 1. feat(user): add user model ← compiles? maybe
123
- 2. fix: fix import ← fixing previous commit
124
- 3. feat(user): add user service ← compiles? probably
125
- 4. fix: fix typo ← fixing previous commit
126
- 5. feat(user): add user controller ← finally works together
127
-
128
- REQUIRED:
129
- 1. feat(user): add user registration module
130
- Model, Service, Controller, Tests all in one complete, working commit
131
- Or split into logical chunks that each compile and pass tests independently
132
- ```
133
-
134
- **Rule:** Every commit on `main` should compile, pass lint, and pass tests. Use interactive rebase (`git rebase -i`) to squash fix-up commits before merging.
135
-
136
- ---
137
-
138
- ## .gitignore Standards
139
-
140
- ### MUST Ignore
141
- ```
142
- # Dependencies
143
- node_modules/
144
- vendor/
145
- venv/
146
- __pycache__/
147
- .gradle/
148
- target/
149
-
150
- # Environment
151
- .env
152
- .env.local
153
- .env.*.local
154
-
155
- # IDE
156
- .idea/
157
- .vscode/settings.json
158
- *.swp
159
- *.swo
160
- .DS_Store
161
- Thumbs.db
162
-
163
- # Build output
164
- dist/
165
- build/
166
- out/
167
- *.min.js
168
- *.min.css
169
-
170
- # Logs
171
- *.log
172
- npm-debug.log*
173
-
174
- # OS
175
- .DS_Store
176
- Thumbs.db
177
- ```
178
-
179
- ### MUST Commit
180
- ```
181
- .env.example # Template with placeholder values
182
- .editorconfig # Consistent formatting across IDEs
183
- .prettierrc # Formatter config
184
- .eslintrc.* # Linter config
185
- tsconfig.json # TypeScript config
186
- docker-compose.yml # Dev environment
187
- Makefile / Taskfile # Standard commands
188
- ```
189
-
190
- ---
191
-
192
- ## The Git Health Check
193
-
194
- Before pushing:
195
- - [ ] All commits follow Conventional Commits format
196
- - [ ] No fixup commits (squash them)
197
- - [ ] Branch is rebased on latest main
198
- - [ ] CI passes locally (lint, test, build)
199
- - [ ] No secrets in any commit (check with `git log -p | grep -i "password\|secret\|key"`)
200
- - [ ] No merge commits in feature branch (rebase instead)
19
+ # Git Workflow - Clean History, Atomic Commits
20
+
21
+ Your git log is a changelog. If it reads like gibberish, your team is lost.
22
+
23
+ ## GIT-001: Commit Message Format (Conventional Commits Enforced)
24
+
25
+ 1. Use Conventional Commits for every commit: `<type>(<scope>): <description>`.
26
+ 2. Use the optional body to explain WHY, not WHAT.
27
+ 3. Use the optional footer for breaking changes and issue references.
28
+ 4. Use only the strict types set: `feat` for new feature, `fix` for bug fix, `refactor` for code restructuring with no behavior change, `docs` for documentation only, `test` for adding or fixing tests, `chore` for build, CI, config, or dependencies, `perf` for performance improvement, `style` for formatting and semicolons with no logic change, and `ci` for CI/CD changes.
29
+ 5. Type is mandatory. No commits without a type prefix.
30
+ 6. Scope is required for module or feature changes. Use the module or feature name.
31
+ 7. Description must use imperative mood: "add", not "added" or "adds".
32
+ 8. Keep the subject line at max 72 characters.
33
+ 9. Body explains WHY; the diff shows what.
34
+ 10. Reject banned commit messages: `fix bug`, `updates`, `WIP`, `asdf`, `misc changes`, `working now`, `final fix`, and `fix fix fix`.
35
+
36
+ ## GIT-002: Branching Model and Merge Strategy
37
+
38
+ 1. Keep `main` production-ready; its purpose is production-ready code, and its merge strategy is merge commit or squash according to project policy.
39
+ 2. Use `develop` as an integration branch only when the project uses GitFlow; its purpose is integration.
40
+ 3. Name feature branches with the pattern `<type>/<ticket-id>-<short-description>`.
41
+ 4. Example branch names include `feat/AUTH-123-jwt-refresh`, `fix/PAY-456-checkout-race-condition`, `refactor/USER-789-extract-validation`, and `chore/INFRA-101-upgrade-node-20`.
42
+ 5. Branch from `main`, or from `develop` when using GitFlow.
43
+ 6. Keep branches short-lived, max 2-3 days.
44
+ 7. Rebase on `main` before creating a PR; do not merge main into your branch.
45
+ 8. Delete the branch after merge.
46
+
47
+ ## GIT-003: Pull Request Standards
48
+
49
+ 1. Keep PR size reviewable: small is 1-100 lines changed and ideal because it is easy to review; medium is 100-300 and acceptable, split if possible; large is 300-500 and needs justification; massive is 500+ and must be split into smaller PRs. Treat these thresholds as the PR size verdict.
50
+ 2. Split a PR when it touches more than 5 files across different modules; it is doing too much.
51
+ 3. PR descriptions must follow the PR Description Template: What, Why, How, Testing, and Screenshots when the change affects UI.
52
+ 4. What gives a brief description of what the PR does.
53
+ 5. Why explains why the change is needed and links to the issue or ticket.
54
+ 6. How gives the high-level approach and mentions non-obvious design decisions.
55
+ 7. Testing lists unit tests, integration tests when applicable, and manual testing steps.
56
+ 8. Every PR needs at least 1 approval, author resolves all comments before merge, CI must pass lint, test, and build, no `// TODO` appears without a linked issue, and production code contains no `console.log` debugging statements.
57
+
58
+ ## GIT-004: Commit Atomicity
59
+
60
+ 1. Each commit must be a complete, working unit.
61
+ 2. Reject banned sequences where a feature commit is followed by fix imports, fix typos, or other fix-up commits needed to make the previous commit work.
62
+ 3. Prefer one complete working commit for a cohesive module, such as model, service, controller, and tests for user registration.
63
+ 4. Split into logical chunks only when each chunk compiles and passes tests independently.
64
+ 5. Every commit on `main` should compile, pass lint, and pass tests.
65
+ 6. Use interactive rebase (`git rebase -i`) to squash fix-up commits before merging.
66
+
67
+ ## GIT-005: .gitignore Standards
68
+
69
+ 1. Ignore dependency and cache directories: `node_modules/`, `vendor/`, `venv/`, `__pycache__/`, `.gradle/`, and `target/`.
70
+ 2. Ignore environment files: `.env`, `.env.local`, and `.env.*.local`.
71
+ 3. Ignore IDE and OS artifacts: `.idea/`, `.vscode/settings.json`, `*.swp`, `*.swo`, `.DS_Store`, and `Thumbs.db`.
72
+ 4. Ignore build output: `dist/`, `build/`, `out/`, `*.min.js`, and `*.min.css`.
73
+ 5. Ignore logs: `*.log` and `npm-debug.log*`.
74
+ 6. Commit configuration templates and formatter or linter config: `.env.example`, `.editorconfig`, `.prettierrc`, `.eslintrc.*`, and `tsconfig.json`.
75
+ 7. Commit standard development commands and environments when they are part of the project contract: `docker-compose.yml`, `Makefile`, or `Taskfile`.
76
+
77
+ ## GIT-006: Git Health Check
78
+
79
+ 1. Before pushing, verify all commits follow Conventional Commits format.
80
+ 2. Before pushing, verify there are no fixup commits; squash them.
81
+ 3. Before pushing, verify the branch is rebased on latest main.
82
+ 4. Before pushing, verify CI passes locally: lint, test, and build.
83
+ 5. Before pushing, verify there are no secrets in any commit; check with `git log -p | grep -i "password\|secret\|key"`.
84
+ 6. Before pushing, verify there are no merge commits in the feature branch; rebase instead.