@caddis/cli 0.0.0 → 0.1.0

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 (153) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -1
  3. package/bundles/antigravity-plugin/agents/code-reviewer.md +47 -0
  4. package/bundles/antigravity-plugin/agents/preflight.md +53 -0
  5. package/bundles/antigravity-plugin/guard_agy.py +338 -0
  6. package/bundles/antigravity-plugin/hooks.json +36 -0
  7. package/bundles/antigravity-plugin/mcp_config.json +8 -0
  8. package/bundles/antigravity-plugin/mcp_ping_server.py +55 -0
  9. package/bundles/antigravity-plugin/plugin.json +5 -0
  10. package/bundles/antigravity-plugin/session_end_agy.py +57 -0
  11. package/bundles/antigravity-plugin/skills/_registry.md +115 -0
  12. package/bundles/antigravity-plugin/skills/add-rules/SKILL.md +45 -0
  13. package/bundles/antigravity-plugin/skills/api-design/SKILL.md +249 -0
  14. package/bundles/antigravity-plugin/skills/backend-development/SKILL.md +305 -0
  15. package/bundles/antigravity-plugin/skills/best-practices/SKILL.md +500 -0
  16. package/bundles/antigravity-plugin/skills/best-practices/agents/best-practices-referencer.md +263 -0
  17. package/bundles/antigravity-plugin/skills/best-practices/agents/codebase-context-builder.md +326 -0
  18. package/bundles/antigravity-plugin/skills/best-practices/agents/task-intent-analyzer.md +245 -0
  19. package/bundles/antigravity-plugin/skills/best-practices/references/anti-patterns.md +571 -0
  20. package/bundles/antigravity-plugin/skills/best-practices/references/before-after-examples.md +1114 -0
  21. package/bundles/antigravity-plugin/skills/best-practices/references/best-practices-guide.md +513 -0
  22. package/bundles/antigravity-plugin/skills/best-practices/references/common-workflows.md +692 -0
  23. package/bundles/antigravity-plugin/skills/best-practices/references/prompt-patterns.md +547 -0
  24. package/bundles/antigravity-plugin/skills/brainstorming/SKILL.md +57 -0
  25. package/bundles/antigravity-plugin/skills/ci-cd-pipeline/SKILL.md +315 -0
  26. package/bundles/antigravity-plugin/skills/code-documentation/SKILL.md +271 -0
  27. package/bundles/antigravity-plugin/skills/code-review/SKILL.md +122 -0
  28. package/bundles/antigravity-plugin/skills/codebase-audit/SKILL.md +204 -0
  29. package/bundles/antigravity-plugin/skills/context-curator/SKILL.md +157 -0
  30. package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +40 -0
  31. package/bundles/antigravity-plugin/skills/css-architecture/SKILL.md +305 -0
  32. package/bundles/antigravity-plugin/skills/css-architecture/references/RESPONSIVE-DESIGN.md +604 -0
  33. package/bundles/antigravity-plugin/skills/database-design/SKILL.md +177 -0
  34. package/bundles/antigravity-plugin/skills/db-diagram/SKILL.md +148 -0
  35. package/bundles/antigravity-plugin/skills/db-diagram/scripts/sql_to_graph.py +1212 -0
  36. package/bundles/antigravity-plugin/skills/digress/SKILL.md +61 -0
  37. package/bundles/antigravity-plugin/skills/draw-io/SKILL.md +162 -0
  38. package/bundles/antigravity-plugin/skills/draw-io/references/aws-icons.md +677 -0
  39. package/bundles/antigravity-plugin/skills/draw-io/references/layout-guidelines.md +142 -0
  40. package/bundles/antigravity-plugin/skills/draw-io/references/troubleshooting.md +118 -0
  41. package/bundles/antigravity-plugin/skills/draw-io/references/workflows.md +103 -0
  42. package/bundles/antigravity-plugin/skills/draw-io/scripts/convert-drawio-to-png.sh +25 -0
  43. package/bundles/antigravity-plugin/skills/draw-io/scripts/find_aws_icon.py +79 -0
  44. package/bundles/antigravity-plugin/skills/error-handling/SKILL.md +260 -0
  45. package/bundles/antigravity-plugin/skills/excalidraw-db/SKILL.md +38 -0
  46. package/bundles/antigravity-plugin/skills/fastapi-dev/SKILL.md +300 -0
  47. package/bundles/antigravity-plugin/skills/feature-plan/SKILL.md +198 -0
  48. package/bundles/antigravity-plugin/skills/frontend-design/SKILL.md +193 -0
  49. package/bundles/antigravity-plugin/skills/frontend-design/references/my-tech-stack.md +127 -0
  50. package/bundles/antigravity-plugin/skills/gh-cli/SKILL.md +195 -0
  51. package/bundles/antigravity-plugin/skills/git-commit/SKILL.md +285 -0
  52. package/bundles/antigravity-plugin/skills/golden-plan/SKILL.md +577 -0
  53. package/bundles/antigravity-plugin/skills/handoff/SKILL.md +100 -0
  54. package/bundles/antigravity-plugin/skills/implement/SKILL.md +114 -0
  55. package/bundles/antigravity-plugin/skills/javascript-typescript/SKILL.md +142 -0
  56. package/bundles/antigravity-plugin/skills/kb/SKILL.md +60 -0
  57. package/bundles/antigravity-plugin/skills/mermaid-db/SKILL.md +33 -0
  58. package/bundles/antigravity-plugin/skills/mermaid-diagrams/SKILL.md +236 -0
  59. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/ENHANCEMENTS.md +264 -0
  60. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/MERMAID-SUMMARY.md +137 -0
  61. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/advanced-features.md +556 -0
  62. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/architecture-diagrams.md +192 -0
  63. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/c4-diagrams.md +410 -0
  64. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/class-diagrams.md +361 -0
  65. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/erd-diagrams.md +510 -0
  66. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/flowcharts.md +450 -0
  67. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/sequence-diagrams.md +394 -0
  68. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/troubleshooting.md +335 -0
  69. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/workflows.md +418 -0
  70. package/bundles/antigravity-plugin/skills/migrate-dir/SKILL.md +68 -0
  71. package/bundles/antigravity-plugin/skills/mockup/SKILL.md +242 -0
  72. package/bundles/antigravity-plugin/skills/particle-art/SKILL.md +243 -0
  73. package/bundles/antigravity-plugin/skills/particle-art/references/canvas-utils.ts +171 -0
  74. package/bundles/antigravity-plugin/skills/particle-art/references/dot-field.template.tsx +203 -0
  75. package/bundles/antigravity-plugin/skills/particle-art/references/flow-field.template.tsx +263 -0
  76. package/bundles/antigravity-plugin/skills/particle-art/references/node-shape.template.tsx +261 -0
  77. package/bundles/antigravity-plugin/skills/particle-art/references/shape-sampler.ts +281 -0
  78. package/bundles/antigravity-plugin/skills/particle-art/references/stipple-morph.template.tsx +167 -0
  79. package/bundles/antigravity-plugin/skills/particle-art/references/stipple.template.tsx +175 -0
  80. package/bundles/antigravity-plugin/skills/particle-art/references/trail-ghost.template.tsx +266 -0
  81. package/bundles/antigravity-plugin/skills/particle-art/references/usage-examples.md +320 -0
  82. package/bundles/antigravity-plugin/skills/playwright/API_REFERENCE.md +653 -0
  83. package/bundles/antigravity-plugin/skills/playwright/SKILL.md +454 -0
  84. package/bundles/antigravity-plugin/skills/playwright/lib/helpers.js +441 -0
  85. package/bundles/antigravity-plugin/skills/playwright/package.json +26 -0
  86. package/bundles/antigravity-plugin/skills/playwright/run.js +228 -0
  87. package/bundles/antigravity-plugin/skills/prd/SKILL.md +107 -0
  88. package/bundles/antigravity-plugin/skills/preflight/SKILL.md +435 -0
  89. package/bundles/antigravity-plugin/skills/python/SKILL.md +388 -0
  90. package/bundles/antigravity-plugin/skills/react-best-practices/SKILL.md +269 -0
  91. package/bundles/antigravity-plugin/skills/react-dev/README.md +404 -0
  92. package/bundles/antigravity-plugin/skills/react-dev/SKILL.md +459 -0
  93. package/bundles/antigravity-plugin/skills/react-dev/examples/generic-components.md +579 -0
  94. package/bundles/antigravity-plugin/skills/react-dev/examples/server-components.md +579 -0
  95. package/bundles/antigravity-plugin/skills/react-dev/references/event-handlers.md +574 -0
  96. package/bundles/antigravity-plugin/skills/react-dev/references/hooks.md +456 -0
  97. package/bundles/antigravity-plugin/skills/react-dev/references/react-19-patterns.md +638 -0
  98. package/bundles/antigravity-plugin/skills/react-dev/references/react-router.md +1002 -0
  99. package/bundles/antigravity-plugin/skills/react-dev/references/tanstack-router.md +587 -0
  100. package/bundles/antigravity-plugin/skills/refactoring/SKILL.md +486 -0
  101. package/bundles/antigravity-plugin/skills/resume/SKILL.md +36 -0
  102. package/bundles/antigravity-plugin/skills/security-review/SKILL.md +196 -0
  103. package/bundles/antigravity-plugin/skills/setup-project-ai/SKILL.md +61 -0
  104. package/bundles/antigravity-plugin/skills/ship/SKILL.md +107 -0
  105. package/bundles/antigravity-plugin/skills/ship-merge/SKILL.md +103 -0
  106. package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +102 -0
  107. package/bundles/antigravity-plugin/skills/skill-creator/LICENSE.txt +202 -0
  108. package/bundles/antigravity-plugin/skills/skill-creator/SKILL.md +491 -0
  109. package/bundles/antigravity-plugin/skills/skill-creator/agents/analyzer.md +274 -0
  110. package/bundles/antigravity-plugin/skills/skill-creator/agents/comparator.md +202 -0
  111. package/bundles/antigravity-plugin/skills/skill-creator/agents/grader.md +223 -0
  112. package/bundles/antigravity-plugin/skills/skill-creator/assets/eval_review.html +146 -0
  113. package/bundles/antigravity-plugin/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  114. package/bundles/antigravity-plugin/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  115. package/bundles/antigravity-plugin/skills/skill-creator/references/schemas.md +430 -0
  116. package/bundles/antigravity-plugin/skills/skill-creator/scripts/__init__.py +0 -0
  117. package/bundles/antigravity-plugin/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  118. package/bundles/antigravity-plugin/skills/skill-creator/scripts/generate_report.py +326 -0
  119. package/bundles/antigravity-plugin/skills/skill-creator/scripts/improve_description.py +247 -0
  120. package/bundles/antigravity-plugin/skills/skill-creator/scripts/package_skill.py +136 -0
  121. package/bundles/antigravity-plugin/skills/skill-creator/scripts/quick_validate.py +103 -0
  122. package/bundles/antigravity-plugin/skills/skill-creator/scripts/run_eval.py +310 -0
  123. package/bundles/antigravity-plugin/skills/skill-creator/scripts/run_loop.py +328 -0
  124. package/bundles/antigravity-plugin/skills/skill-creator/scripts/utils.py +47 -0
  125. package/bundles/antigravity-plugin/skills/sql/SKILL.md +321 -0
  126. package/bundles/antigravity-plugin/skills/tdd/SKILL.md +37 -0
  127. package/bundles/antigravity-plugin/skills/tdd-workflow/SKILL.md +188 -0
  128. package/bundles/antigravity-plugin/skills/technical-writing/SKILL.md +286 -0
  129. package/bundles/antigravity-plugin/skills/test-strategy/SKILL.md +155 -0
  130. package/bundles/antigravity-plugin/skills/ui-brief/SKILL.md +84 -0
  131. package/bundles/antigravity-plugin/skills/ui-review/SKILL.md +176 -0
  132. package/bundles/antigravity-plugin/skills/ui-review/references/framework-fixes.md +471 -0
  133. package/bundles/antigravity-plugin/skills/ui-review/references/visual-checklist.md +236 -0
  134. package/bundles/antigravity-plugin/skills/usage-review/SKILL.md +77 -0
  135. package/bundles/antigravity-plugin/skills/use-model/SKILL.md +64 -0
  136. package/bundles/antigravity-plugin/skills/using-git-worktrees/SKILL.md +217 -0
  137. package/bundles/antigravity-plugin/skills/version/SKILL.md +18 -0
  138. package/bundles/antigravity-plugin/skills/warm-editorial-ui/DESIGN_TOKENS.md +487 -0
  139. package/bundles/antigravity-plugin/skills/warm-editorial-ui/IMPLEMENTATION_GUIDE.md +177 -0
  140. package/bundles/antigravity-plugin/skills/warm-editorial-ui/SKILL.md +732 -0
  141. package/bundles/antigravity-plugin/skills/webapp-testing/LICENSE.txt +202 -0
  142. package/bundles/antigravity-plugin/skills/webapp-testing/SKILL.md +97 -0
  143. package/bundles/antigravity-plugin/skills/webapp-testing/examples/console_logging.py +35 -0
  144. package/bundles/antigravity-plugin/skills/webapp-testing/examples/element_discovery.py +40 -0
  145. package/bundles/antigravity-plugin/skills/webapp-testing/examples/static_html_automation.py +33 -0
  146. package/bundles/antigravity-plugin/skills/webapp-testing/scripts/with_server.py +106 -0
  147. package/bundles/antigravity-plugin/skills/windows-deployment/SKILL.md +880 -0
  148. package/bundles/antigravity-plugin/skills/writing-plans/SKILL.md +384 -0
  149. package/bundles/antigravity-plugin/statusline-command-agy.sh +91 -0
  150. package/bundles/antigravity-plugin/warm_start_agy.py +149 -0
  151. package/bundles/manifest.json +6 -0
  152. package/dist/cli.js +5363 -0
  153. package/package.json +61 -4
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: ui-brief
3
+ description: Design-first UI brief — lock the aesthetic before writing any code
4
+ ---
5
+
6
+ # /ui-brief — design first, code second
7
+
8
+ You are about to build a React frontend. **Do not write any code yet.**
9
+
10
+ Your job right now is to propose the visual direction and get approval before touching a file.
11
+
12
+ ## What you're building
13
+
14
+ **$ARGUMENTS**
15
+
16
+ ## Step 1 — Load the right skill
17
+
18
+ **Your organization's internal app family** (an existing internal tool/dashboard suite that shares a
19
+ house design system): load `warm-editorial-ui`.
20
+
21
+ **Matching a known brand** (Stripe, Linear, Vercel, Supabase, Notion, Apple, Cursor, PostHog, or any company the user names): load `popular-web-designs` and read the matching template. Use that brand's exact tokens as the basis for your brief proposal.
22
+
23
+ **Data dashboard** (not part of an existing internal design system): load `enterprise-dashboard-aesthetic-system`.
24
+
25
+ **Standalone or public-facing product** (no brand specified): load `frontend-design`.
26
+
27
+ ## Step 2 — Propose the brief (3 things only)
28
+
29
+ Present exactly this, in plain language, no code:
30
+
31
+ ```
32
+ FONT PAIRING
33
+ Heading: <specific font name and weight — not Inter, not Roboto>
34
+ Body: <specific font name>
35
+ Why: <one sentence on the mood it creates>
36
+
37
+ COLOUR STORY
38
+ Background: <hex> Surface: <hex> Primary: <hex> Accent: <hex>
39
+ Why: <one sentence — warm/cold/bold/editorial?>
40
+
41
+ ONE ANIMATION MOMENT
42
+ What moves: <the one element that gets the hero animation>
43
+ How: <spring entrance / stagger reveal / scroll trigger / etc.>
44
+ Why: <what it communicates — speed, weight, personality>
45
+
46
+ LAYOUT APPROACH
47
+ <2 sentences: grid structure, whitespace philosophy, any asymmetry or grid-breaking>
48
+ ```
49
+
50
+ If you loaded `popular-web-designs` for a specific brand, use that brand's actual colors and fonts in the brief — not approximations.
51
+
52
+ ## Step 3 — Wait
53
+
54
+ Do not proceed until the user responds with one of:
55
+ - **"go"** — build exactly as proposed
56
+ - feedback / changes — revise the brief and re-present, then wait again
57
+ - **"skip"** — proceed with your best judgement immediately
58
+
59
+ ## Step 4 — Build
60
+
61
+ Once approved: implement using the loaded skill as your design system.
62
+ Use Framer Motion for the approved animation moment.
63
+ Every component must reflect the agreed colour story and font pairing — no fallback to defaults.
64
+
65
+ ### Quality Standards (enforce these during build)
66
+
67
+ **Avoid AI design slop:**
68
+ - No aggressive gradients unless specifically in the brief
69
+ - No glassmorphism by default — only if it fits the brand
70
+ - No generic SaaS card grids as the default layout
71
+ - No fake dashboards with placeholder charts and made-up metrics
72
+ - No filler text ("Lorem ipsum", "User Name", "Description here")
73
+ - No decorative emojis in headings or UI chrome
74
+
75
+ **Motion discipline:**
76
+ - Use animation as communication, not decoration
77
+ - Always respect `prefers-reduced-motion` media query
78
+ - One hero animation moment — not every element animating on load
79
+ - 44px minimum touch targets on mobile
80
+
81
+ **Verification:**
82
+ - Confirm the file exists before reporting done
83
+ - Check browser console for errors if possible
84
+ - Never claim to have verified something you did not verify
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: ui-review
3
+ description: Review UI implementations against design requirements, accessibility standards (WCAG 2.2 AA), and brand guidelines. Use when reviewing designs or validating UI before release.
4
+ ---
5
+
6
+ # UI Review Skill
7
+
8
+ ## When to Use
9
+ - Reviewing a UI implementation
10
+ - Checking accessibility compliance
11
+ - Validating brand consistency
12
+ - Before releasing new UI features
13
+ - Finding and fixing design issues in running websites
14
+
15
+ ## Scope of Application
16
+ - Static sites (HTML/CSS/JS)
17
+ - SPA frameworks (React, Vue, Angular, Svelte)
18
+ - Full-stack frameworks (Next.js, Nuxt, SvelteKit)
19
+ - Any web application (local dev, staging, or production)
20
+
21
+ ---
22
+
23
+ ## Steps
24
+
25
+ ### Step 0: Information Gathering
26
+
27
+ Before reviewing, understand the project context:
28
+
29
+ | Item | What to Determine |
30
+ |------|-------------------|
31
+ | Framework | React, Vue, Next.js, etc. |
32
+ | Styling Method | CSS, SCSS, Tailwind, CSS-in-JS, CSS Modules |
33
+ | Source Location | Where style files and components live |
34
+ | Review Scope | Specific pages or entire site |
35
+
36
+ Detect automatically from workspace files when possible (`package.json`, `tailwind.config.*`, `next.config.*`, etc.).
37
+
38
+ **References:** For framework-specific fix patterns see `references/framework-fixes.md`. For a detailed visual checklist see `references/visual-checklist.md`.
39
+
40
+ ### Step 1: Capture Current State
41
+ Document: Screenshot/URL, purpose, target users, requirements.
42
+
43
+ ### Step 2: Visual Design Review
44
+
45
+ #### Brand Compliance
46
+ - [ ] Primary color (`<BRAND_PRIMARY>`) used for CTAs and accents
47
+ - [ ] Dark color (`<BRAND_DARK>`) used for text and headers
48
+ - [ ] Light color (`<BRAND_LIGHT>`) used for backgrounds
49
+ - [ ] 60-30-10 color rule followed
50
+ - [ ] No off-brand colors used
51
+
52
+ #### Typography
53
+ - [ ] Consistent font family
54
+ - [ ] Proper heading hierarchy (h1 -> h2 -> h3)
55
+ - [ ] Min 14px body text
56
+ - [ ] Text contrast meets WCAG AA (4.5:1)
57
+
58
+ #### Layout Issues to Detect
59
+
60
+ | Issue | Description | Severity |
61
+ |-------|-------------|----------|
62
+ | Element Overflow | Content overflows parent or viewport | High |
63
+ | Element Overlap | Unintended overlapping | High |
64
+ | Alignment Issues | Grid or flex alignment problems | Medium |
65
+ | Inconsistent Spacing | Padding/margin inconsistencies | Medium |
66
+ | Text Clipping | Long text not handled properly | Medium |
67
+ | Font Inconsistency | Mixed font families | Medium |
68
+ | Color Inconsistency | Non-unified brand colors | Medium |
69
+
70
+ #### Layout
71
+ - [ ] Consistent spacing
72
+ - [ ] Visual hierarchy is clear
73
+ - [ ] Sufficient whitespace
74
+
75
+ ### Step 3: Accessibility Review (WCAG 2.2 AA)
76
+
77
+ #### Perceivable
78
+ - [ ] Color contrast: text 4.5:1, large text 3:1, UI 3:1
79
+ - [ ] Color not sole means of communication
80
+ - [ ] Images have alt text
81
+
82
+ #### Operable
83
+ - [ ] All elements keyboard accessible
84
+ - [ ] Focus indicators visible
85
+ - [ ] Touch targets minimum 44px
86
+
87
+ #### Understandable
88
+ - [ ] Form labels descriptive
89
+ - [ ] Error messages clear
90
+ - [ ] Consistent navigation
91
+
92
+ ### Step 4: Functionality Review
93
+ - [ ] Buttons trigger expected actions
94
+ - [ ] Forms validate correctly
95
+ - [ ] Error and success states display
96
+ - [ ] Loading states present
97
+ - [ ] Empty states handled
98
+ - [ ] Pagination works
99
+
100
+ ### Step 5: Responsive Design Review
101
+ Test at these viewports:
102
+
103
+ | Name | Width | Representative Device |
104
+ |------|-------|----------------------|
105
+ | Mobile | 375px | iPhone SE/12 mini |
106
+ | Tablet | 768px | iPad |
107
+ | Laptop | 1024px | Standard laptop |
108
+ | Desktop | 1280px+ | Standard PC |
109
+ | Wide | 1920px | Large display |
110
+
111
+ Responsive issues to check:
112
+
113
+ | Issue | Description | Severity |
114
+ |-------|-------------|----------|
115
+ | Non-mobile Friendly | Layout breaks on small screens | High |
116
+ | Breakpoint Issues | Unnatural transitions at size changes | Medium |
117
+ | Touch Targets | Buttons/links too small on mobile (<44px) | Medium |
118
+
119
+ ### Step 6: Generate Report
120
+
121
+ ```markdown
122
+ ## UI Review Report
123
+
124
+ | Aspect | Status | Score |
125
+ |--------|--------|-------|
126
+ | Visual Design | Pass/Issues/Fail | X/10 |
127
+ | Accessibility | Pass/Issues/Fail | X/10 |
128
+ | Functionality | Pass/Issues/Fail | X/10 |
129
+ | Responsive | Pass/Issues/Fail | X/10 |
130
+
131
+ ### Issues Found
132
+ #### Critical (Must Fix)
133
+ #### Major (Should Fix)
134
+ #### Minor (Nice to Fix)
135
+
136
+ ### Recommendations
137
+ ```
138
+
139
+ ## Issue Fix Workflow
140
+
141
+ When fixing issues found during review:
142
+
143
+ ### Prioritization
144
+ - **P1 (Fix Immediately)**: Layout issues affecting functionality
145
+ - **P2 (Fix Next)**: Visual issues degrading UX
146
+ - **P3 (Fix If Possible)**: Minor visual inconsistencies
147
+
148
+ ### Fix Principles
149
+ 1. **Minimal Changes**: Only the minimum necessary to resolve the issue
150
+ 2. **Respect Existing Patterns**: Follow the project's existing code style
151
+ 3. **Avoid Breaking Changes**: Don't affect other areas
152
+ 4. **One at a Time**: Fix one issue, verify, then move to the next
153
+
154
+ ### Re-verification After Fixes
155
+ 1. Reload the page (or wait for HMR)
156
+ 2. Capture screenshots of fixed areas
157
+ 3. Compare before and after
158
+ 4. Verify fixes haven't caused regressions
159
+ 5. If 3+ fix attempts fail for one issue, consult the user
160
+
161
+ ## Troubleshooting
162
+
163
+ | Problem | Solutions |
164
+ |---------|----------|
165
+ | Style files not found | Check `package.json` deps; consider CSS-in-JS or build-time CSS |
166
+ | Fixes not reflected | Check HMR; clear cache; rebuild; check CSS specificity |
167
+ | Fixes affect other areas | Rollback; use more specific selectors; use scoped styles |
168
+
169
+ ## Checklist
170
+ - [ ] Visual design reviewed against brand guidelines
171
+ - [ ] Accessibility audit completed (WCAG 2.2 AA)
172
+ - [ ] Functionality tested (happy path + errors)
173
+ - [ ] Responsive design verified at all viewports
174
+ - [ ] Report generated with scores and action items
175
+ - [ ] Fixes applied one at a time with verification
176
+ - [ ] No regressions introduced by fixes
@@ -0,0 +1,471 @@
1
+ # Framework-specific Fix Guide
2
+
3
+ This document explains specific fix techniques for each framework and styling method.
4
+
5
+ ---
6
+
7
+ ## Pure CSS / SCSS
8
+
9
+ ### Fixing Layout Overflow
10
+
11
+ ```css
12
+ /* Before: Overflow occurs */
13
+ .container {
14
+ width: 100%;
15
+ }
16
+
17
+ /* After: Control overflow */
18
+ .container {
19
+ width: 100%;
20
+ max-width: 100%;
21
+ overflow-x: hidden;
22
+ }
23
+ ```
24
+
25
+ ### Text Clipping Prevention
26
+
27
+ ```css
28
+ /* Single line truncation */
29
+ .text-truncate {
30
+ overflow: hidden;
31
+ text-overflow: ellipsis;
32
+ white-space: nowrap;
33
+ }
34
+
35
+ /* Multi-line truncation */
36
+ .text-clamp {
37
+ display: -webkit-box;
38
+ -webkit-line-clamp: 3;
39
+ -webkit-box-orient: vertical;
40
+ overflow: hidden;
41
+ }
42
+
43
+ /* Word wrapping */
44
+ .text-wrap {
45
+ word-wrap: break-word;
46
+ overflow-wrap: break-word;
47
+ hyphens: auto;
48
+ }
49
+ ```
50
+
51
+ ### Spacing Unification
52
+
53
+ ```css
54
+ /* Unify spacing with CSS custom properties */
55
+ :root {
56
+ --spacing-xs: 0.25rem;
57
+ --spacing-sm: 0.5rem;
58
+ --spacing-md: 1rem;
59
+ --spacing-lg: 1.5rem;
60
+ --spacing-xl: 2rem;
61
+ }
62
+
63
+ .card {
64
+ padding: var(--spacing-md);
65
+ margin-bottom: var(--spacing-lg);
66
+ }
67
+ ```
68
+
69
+ ### Improving Contrast
70
+
71
+ ```css
72
+ /* Before: Insufficient contrast */
73
+ .text {
74
+ color: #999999;
75
+ background-color: #ffffff;
76
+ }
77
+
78
+ /* After: Meets WCAG AA standards */
79
+ .text {
80
+ color: #595959; /* Contrast ratio 7:1 */
81
+ background-color: #ffffff;
82
+ }
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Tailwind CSS
88
+
89
+ ### Layout Fixes
90
+
91
+ ```jsx
92
+ {/* Before: Overflow */}
93
+ <div className="w-full">
94
+ <img src="..." />
95
+ </div>
96
+
97
+ {/* After: Overflow control */}
98
+ <div className="w-full max-w-full overflow-hidden">
99
+ <img src="..." className="w-full h-auto object-contain" />
100
+ </div>
101
+ ```
102
+
103
+ ### Text Clipping Prevention
104
+
105
+ ```jsx
106
+ {/* Single line truncation */}
107
+ <p className="truncate">Long text...</p>
108
+
109
+ {/* Multi-line truncation */}
110
+ <p className="line-clamp-3">Long text...</p>
111
+
112
+ {/* Allow wrapping */}
113
+ <p className="break-words">Long text...</p>
114
+ ```
115
+
116
+ ### Responsive Support
117
+
118
+ ```jsx
119
+ {/* Mobile-first responsive */}
120
+ <div className="
121
+ flex flex-col gap-4
122
+ md:flex-row md:gap-6
123
+ lg:gap-8
124
+ ">
125
+ <div className="w-full md:w-1/2 lg:w-1/3">
126
+ Content
127
+ </div>
128
+ </div>
129
+ ```
130
+
131
+ ### Spacing Unification (Tailwind Config)
132
+
133
+ ```javascript
134
+ // tailwind.config.js
135
+ module.exports = {
136
+ theme: {
137
+ extend: {
138
+ spacing: {
139
+ '18': '4.5rem',
140
+ '22': '5.5rem',
141
+ },
142
+ },
143
+ },
144
+ }
145
+ ```
146
+
147
+ ### Accessibility Improvements
148
+
149
+ ```jsx
150
+ {/* Add focus state */}
151
+ <button className="
152
+ bg-blue-500 text-white
153
+ hover:bg-blue-600
154
+ focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
155
+ ">
156
+ Button
157
+ </button>
158
+
159
+ {/* Improve contrast */}
160
+ <p className="text-gray-700 bg-white"> {/* Changed from text-gray-500 */}
161
+ Readable text
162
+ </p>
163
+ ```
164
+
165
+ ---
166
+
167
+ ## React + CSS Modules
168
+
169
+ ### Fixes in Module Scope
170
+
171
+ ```css
172
+ /* Component.module.css */
173
+
174
+ /* Before */
175
+ .container {
176
+ display: flex;
177
+ }
178
+
179
+ /* After: Add overflow control */
180
+ .container {
181
+ display: flex;
182
+ flex-wrap: wrap;
183
+ overflow: hidden;
184
+ max-width: 100%;
185
+ }
186
+ ```
187
+
188
+ ### Component-side Fixes
189
+
190
+ ```jsx
191
+ // Component.jsx
192
+ import styles from './Component.module.css';
193
+
194
+ // Before
195
+ <div className={styles.container}>
196
+
197
+ // After: Add conditional class
198
+ <div className={`${styles.container} ${isOverflow ? styles.overflow : ''}`}>
199
+ ```
200
+
201
+ ---
202
+
203
+ ## styled-components / Emotion
204
+
205
+ ### Style Fixes
206
+
207
+ ```jsx
208
+ // Before
209
+ const Container = styled.div`
210
+ width: 100%;
211
+ `;
212
+
213
+ // After
214
+ const Container = styled.div`
215
+ width: 100%;
216
+ max-width: 100%;
217
+ overflow-x: hidden;
218
+
219
+ @media (max-width: 768px) {
220
+ padding: 1rem;
221
+ }
222
+ `;
223
+ ```
224
+
225
+ ### Responsive Support
226
+
227
+ ```jsx
228
+ const Card = styled.div`
229
+ display: grid;
230
+ grid-template-columns: repeat(3, 1fr);
231
+ gap: 1.5rem;
232
+
233
+ @media (max-width: 1024px) {
234
+ grid-template-columns: repeat(2, 1fr);
235
+ }
236
+
237
+ @media (max-width: 640px) {
238
+ grid-template-columns: 1fr;
239
+ gap: 1rem;
240
+ }
241
+ `;
242
+ ```
243
+
244
+ ### Consistency with Theme
245
+
246
+ ```jsx
247
+ // theme.js
248
+ export const theme = {
249
+ colors: {
250
+ primary: '#2563eb',
251
+ text: '#1f2937',
252
+ textLight: '#4b5563', // Improved contrast
253
+ },
254
+ spacing: {
255
+ sm: '0.5rem',
256
+ md: '1rem',
257
+ lg: '1.5rem',
258
+ },
259
+ };
260
+
261
+ // Usage
262
+ const Text = styled.p`
263
+ color: ${({ theme }) => theme.colors.text};
264
+ margin-bottom: ${({ theme }) => theme.spacing.md};
265
+ `;
266
+ ```
267
+
268
+ ---
269
+
270
+ ## Vue (Scoped Styles)
271
+
272
+ ### Fixing Scoped Styles
273
+
274
+ ```vue
275
+ <template>
276
+ <div class="container">
277
+ <p class="text">Content</p>
278
+ </div>
279
+ </template>
280
+
281
+ <style scoped>
282
+ /* Applied only to this component */
283
+ .container {
284
+ max-width: 100%;
285
+ overflow: hidden;
286
+ }
287
+
288
+ .text {
289
+ /* Fix: Improve contrast */
290
+ color: #374151; /* Was: #9ca3af */
291
+ }
292
+
293
+ /* Responsive */
294
+ @media (max-width: 768px) {
295
+ .container {
296
+ padding: 1rem;
297
+ }
298
+ }
299
+ </style>
300
+ ```
301
+
302
+ ### Deep Selectors (Affecting Child Components)
303
+
304
+ ```vue
305
+ <style scoped>
306
+ /* Override child component styles (use cautiously) */
307
+ :deep(.child-class) {
308
+ margin-bottom: 1rem;
309
+ }
310
+ </style>
311
+ ```
312
+
313
+ ---
314
+
315
+ ## Next.js / App Router
316
+
317
+ ### Global Style Fixes
318
+
319
+ ```css
320
+ /* app/globals.css */
321
+ :root {
322
+ --foreground: #171717;
323
+ --background: #ffffff;
324
+ }
325
+
326
+ /* Prevent layout overflow */
327
+ html, body {
328
+ max-width: 100vw;
329
+ overflow-x: hidden;
330
+ }
331
+
332
+ /* Prevent image overflow */
333
+ img {
334
+ max-width: 100%;
335
+ height: auto;
336
+ }
337
+ ```
338
+
339
+ ### Fixes in Layout Components
340
+
341
+ ```tsx
342
+ // app/layout.tsx
343
+ export default function RootLayout({ children }) {
344
+ return (
345
+ <html lang="en">
346
+ <body className="min-h-screen flex flex-col">
347
+ <header className="sticky top-0 z-50">
348
+ {/* Header */}
349
+ </header>
350
+ <main className="flex-1 container mx-auto px-4 py-8">
351
+ {children}
352
+ </main>
353
+ <footer>
354
+ {/* Footer */}
355
+ </footer>
356
+ </body>
357
+ </html>
358
+ );
359
+ }
360
+ ```
361
+
362
+ ---
363
+
364
+ ## Common Patterns
365
+
366
+ ### Fixing Flexbox Layout Issues
367
+
368
+ ```css
369
+ /* Before: Items overflow */
370
+ .flex-container {
371
+ display: flex;
372
+ gap: 1rem;
373
+ }
374
+
375
+ /* After: Wrap and size control */
376
+ .flex-container {
377
+ display: flex;
378
+ flex-wrap: wrap;
379
+ gap: 1rem;
380
+ }
381
+
382
+ .flex-item {
383
+ flex: 1 1 300px; /* grow, shrink, basis */
384
+ min-width: 0; /* Prevent flexbox overflow issues */
385
+ }
386
+ ```
387
+
388
+ ### Fixing Grid Layout Issues
389
+
390
+ ```css
391
+ /* Before: Fixed column count */
392
+ .grid-container {
393
+ display: grid;
394
+ grid-template-columns: repeat(4, 1fr);
395
+ }
396
+
397
+ /* After: Auto-adjust */
398
+ .grid-container {
399
+ display: grid;
400
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
401
+ gap: 1.5rem;
402
+ }
403
+ ```
404
+
405
+ ### Organizing z-index
406
+
407
+ ```css
408
+ /* Systematize z-index */
409
+ :root {
410
+ --z-dropdown: 100;
411
+ --z-sticky: 200;
412
+ --z-modal-backdrop: 300;
413
+ --z-modal: 400;
414
+ --z-tooltip: 500;
415
+ }
416
+
417
+ .modal {
418
+ z-index: var(--z-modal);
419
+ }
420
+ ```
421
+
422
+ ### Adding Focus States
423
+
424
+ ```css
425
+ /* Add focus state to all interactive elements */
426
+ button:focus-visible,
427
+ a:focus-visible,
428
+ input:focus-visible,
429
+ select:focus-visible,
430
+ textarea:focus-visible {
431
+ outline: 2px solid #2563eb;
432
+ outline-offset: 2px;
433
+ }
434
+
435
+ /* Customize focus ring */
436
+ .custom-focus:focus-visible {
437
+ outline: none;
438
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.5);
439
+ }
440
+ ```
441
+
442
+ ---
443
+
444
+ ## Debugging Techniques
445
+
446
+ ### Visualizing Element Boundaries
447
+
448
+ ```css
449
+ /* Use only during development */
450
+ * {
451
+ outline: 1px solid red !important;
452
+ }
453
+ ```
454
+
455
+ ### Detecting Overflow
456
+
457
+ ```javascript
458
+ // Run in console to detect overflow elements
459
+ document.querySelectorAll('*').forEach(el => {
460
+ if (el.scrollWidth > el.clientWidth) {
461
+ console.log('Horizontal overflow:', el);
462
+ }
463
+ if (el.scrollHeight > el.clientHeight) {
464
+ console.log('Vertical overflow:', el);
465
+ }
466
+ });
467
+ ```
468
+
469
+ ### Checking Contrast Ratio
470
+
471
+ Use browser DevTools Lighthouse or axe DevTools, or an online contrast checker (e.g. webaim.org/resources/contrastchecker/).