nightytidy 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/nightytidy.js +1 -1
- package/package.json +1 -1
- package/src/agent/git-integration.js +4 -1
- package/src/claude.js +1 -1
- package/src/prompts/manifest.json +138 -138
- package/src/prompts/steps/02-test-coverage.md +181 -181
- package/src/prompts/steps/03-test-hardening.md +181 -181
- package/src/prompts/steps/04-test-architecture.md +130 -130
- package/src/prompts/steps/05-test-consolidation.md +165 -165
- package/src/prompts/steps/06-test-quality.md +211 -211
- package/src/prompts/steps/07-api-design.md +165 -165
- package/src/prompts/steps/08-security-sweep.md +207 -207
- package/src/prompts/steps/09-dependency-health.md +217 -217
- package/src/prompts/steps/10-codebase-cleanup.md +189 -189
- package/src/prompts/steps/11-crosscutting-concerns.md +196 -196
- package/src/prompts/steps/12-file-decomposition.md +263 -263
- package/src/prompts/steps/13-code-elegance.md +329 -329
- package/src/prompts/steps/14-architectural-complexity.md +297 -297
- package/src/prompts/steps/15-type-safety.md +192 -192
- package/src/prompts/steps/16-logging-error-message.md +173 -173
- package/src/prompts/steps/17-data-integrity.md +139 -139
- package/src/prompts/steps/18-performance.md +183 -183
- package/src/prompts/steps/19-cost-resource-optimization.md +136 -136
- package/src/prompts/steps/20-error-recovery.md +145 -145
- package/src/prompts/steps/21-race-condition-audit.md +178 -178
- package/src/prompts/steps/22-bug-hunt.md +229 -229
- package/src/prompts/steps/23-frontend-quality.md +210 -210
- package/src/prompts/steps/24-uiux-audit.md +284 -284
- package/src/prompts/steps/25-state-management.md +170 -170
- package/src/prompts/steps/26-perceived-performance.md +190 -190
- package/src/prompts/steps/27-devops.md +165 -165
- package/src/prompts/steps/28-scheduled-job-chron-jobs.md +141 -141
- package/src/prompts/steps/29-observability.md +152 -152
- package/src/prompts/steps/30-backup-check.md +155 -155
- package/src/prompts/steps/31-product-polish-ux-friction.md +122 -122
- package/src/prompts/steps/32-feature-discovery-opportunity.md +128 -128
- package/src/prompts/steps/33-strategic-opportunities.md +217 -217
|
@@ -1,210 +1,210 @@
|
|
|
1
|
-
# Frontend Quality Pass
|
|
2
|
-
|
|
3
|
-
## Prompt
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
You are running an overnight frontend quality audit and improvement pass. You have several hours. Your job is to improve accessibility, UX consistency, bundle efficiency, and internationalization readiness across the frontend codebase.
|
|
7
|
-
|
|
8
|
-
Work on a branch called `frontend-quality-[date]`.
|
|
9
|
-
|
|
10
|
-
## Your Mission
|
|
11
|
-
|
|
12
|
-
### Phase 1: Accessibility Audit & Fixes
|
|
13
|
-
|
|
14
|
-
Accessibility isn't optional — it's both a legal requirement and good engineering. Scan every component and page.
|
|
15
|
-
|
|
16
|
-
**Step 1: Automated checks**
|
|
17
|
-
Scan all component/template files for:
|
|
18
|
-
|
|
19
|
-
- **Images**: Missing `alt` attributes, empty `alt` on non-decorative images, decorative images missing `alt=""`
|
|
20
|
-
- **Forms**: Inputs without associated `<label>` elements (or `aria-label`/`aria-labelledby`), missing form validation announcements, submit buttons that don't indicate their purpose
|
|
21
|
-
- **Interactive elements**: Click handlers on non-interactive elements (`div`, `span`) without `role`, `tabIndex`, and keyboard event handlers. Buttons that are actually `<div>`s or `<a>`s without proper roles.
|
|
22
|
-
- **Heading hierarchy**: Skipped heading levels (h1 → h3), multiple h1s per page, headings used for styling rather than structure
|
|
23
|
-
- **Color and contrast**: Hardcoded colors that might fail WCAG AA contrast ratios (especially light gray text on white backgrounds, placeholder text)
|
|
24
|
-
- **Focus management**: Missing focus styles (`:focus` or `:focus-visible`), focus traps in modals that don't exist, modals that don't return focus on close
|
|
25
|
-
- **Dynamic content**: ARIA live regions missing for content that updates dynamically (notifications, loading states, error messages), screen reader announcements for route changes in SPAs
|
|
26
|
-
- **Keyboard navigation**: Interactive elements not reachable via Tab, custom components that don't respond to Enter/Space, dropdown menus that don't support arrow keys, escape key not closing modals/popups
|
|
27
|
-
- **Semantic HTML**: `<div>` and `<span>` used where semantic elements should be (`<nav>`, `<main>`, `<aside>`, `<article>`, `<section>`, `<header>`, `<footer>`, `<button>`, `<time>`)
|
|
28
|
-
- **ARIA usage**: `aria-*` attributes used incorrectly (wrong values, missing required companion attributes, ARIA roles on elements that already have that role natively)
|
|
29
|
-
|
|
30
|
-
**Step 2: Fix what's safe**
|
|
31
|
-
For each issue found:
|
|
32
|
-
- Low-risk fixes (adding alt text, adding labels, adding semantic elements, adding ARIA attributes): implement immediately, run tests, commit
|
|
33
|
-
- Medium-risk fixes (refactoring div-buttons to real buttons, adding keyboard handlers): implement carefully, test thoroughly
|
|
34
|
-
- High-risk fixes (focus management overhauls, major structural changes): document in report only
|
|
35
|
-
- Commit: `a11y: [description] in [component]`
|
|
36
|
-
|
|
37
|
-
### Phase 2: UX Consistency Audit
|
|
38
|
-
|
|
39
|
-
**Step 1: Component inventory**
|
|
40
|
-
Catalog every UI pattern used in the app:
|
|
41
|
-
- Buttons: How many visual styles exist? Are they consistent? Do similar actions use similar button styles?
|
|
42
|
-
- Form inputs: Consistent styling, error states, placeholder text approach, validation feedback
|
|
43
|
-
- Loading states: Spinners, skeletons, progress bars — are they consistent? Do all async operations show loading?
|
|
44
|
-
- Empty states: What happens when a list has no items? Is it always handled? Is the messaging consistent?
|
|
45
|
-
- Error states: How are errors displayed? Consistent format? Red text, toasts, inline, modal?
|
|
46
|
-
- Spacing: Consistent use of spacing scale or are padding/margin values random?
|
|
47
|
-
- Typography: How many font sizes are actually used? Do they follow a consistent scale?
|
|
48
|
-
- Colors: Are colors from a design system / theme, or hardcoded hex values scattered everywhere?
|
|
49
|
-
- Icons: Consistent icon library? Mixed icon sources? Missing icons where they'd help?
|
|
50
|
-
- Responsive behavior: Do components work at mobile sizes? Tablet? Are breakpoints consistent?
|
|
51
|
-
|
|
52
|
-
**Step 2: Document inconsistencies**
|
|
53
|
-
Create a detailed inventory of every inconsistency pattern found:
|
|
54
|
-
- Categorize by severity (confusing to users vs. just messy)
|
|
55
|
-
- Group related issues (all button inconsistencies together, all spacing issues together)
|
|
56
|
-
- Screenshot descriptions or specific file/line references for each
|
|
57
|
-
|
|
58
|
-
**Step 3: Fix what's safe**
|
|
59
|
-
- If there's a clear design system or component library: fix deviations back to the standard
|
|
60
|
-
- Consolidate obviously duplicate component variants (3 different button components that do the same thing)
|
|
61
|
-
- Standardize spacing to the nearest consistent value
|
|
62
|
-
- Ensure all lists have empty states
|
|
63
|
-
- Ensure all async operations have loading states
|
|
64
|
-
- Run tests after each batch of changes
|
|
65
|
-
- Commit: `ui: standardize [pattern] across [scope]`
|
|
66
|
-
|
|
67
|
-
### Phase 3: Bundle Size Analysis & Optimization
|
|
68
|
-
|
|
69
|
-
**Step 1: Analyze the bundle**
|
|
70
|
-
- If build tooling supports it, generate a bundle analysis (webpack-bundle-analyzer, source-map-explorer, or equivalent)
|
|
71
|
-
- Identify:
|
|
72
|
-
- The largest dependencies by size
|
|
73
|
-
- Dependencies that are imported but only partially used (e.g., importing all of lodash for one function)
|
|
74
|
-
- Dependencies with lighter alternatives (moment.js → date-fns, lodash → native methods)
|
|
75
|
-
- Code that's bundled but only used on specific routes (should be lazy-loaded)
|
|
76
|
-
- Duplicate dependencies (same package at multiple versions in the bundle)
|
|
77
|
-
- CSS that's included but never used (dead CSS)
|
|
78
|
-
|
|
79
|
-
**Step 2: Implement safe optimizations**
|
|
80
|
-
- Replace full library imports with specific imports (`import get from 'lodash/get'` instead of `import _ from 'lodash'`)
|
|
81
|
-
- Add dynamic imports / lazy loading for route-specific code that doesn't need to be in the main bundle
|
|
82
|
-
- Remove unused CSS if a reliable method is available
|
|
83
|
-
- Remove unused dependencies from package.json
|
|
84
|
-
- Run the build to verify bundle still works
|
|
85
|
-
- Run tests
|
|
86
|
-
- Commit: `perf: reduce bundle size — [what changed]`
|
|
87
|
-
|
|
88
|
-
**Step 3: Document larger opportunities**
|
|
89
|
-
- Dependencies that should be replaced with lighter alternatives (with migration effort estimate)
|
|
90
|
-
- Code splitting strategies that would require architectural changes
|
|
91
|
-
- Image optimization opportunities (uncompressed images, missing responsive images, images that should be SVGs)
|
|
92
|
-
|
|
93
|
-
### Phase 4: Internationalization (i18n) Readiness
|
|
94
|
-
|
|
95
|
-
**Step 1: Find all hardcoded strings**
|
|
96
|
-
Scan every component, template, and UI-related file for:
|
|
97
|
-
- Hardcoded user-facing text (labels, messages, headings, button text, placeholder text, error messages, tooltips)
|
|
98
|
-
- Hardcoded date formatting (specific date format strings like "MM/DD/YYYY")
|
|
99
|
-
- Hardcoded number formatting (currency symbols, decimal separators, thousand separators)
|
|
100
|
-
- Hardcoded pluralization logic (`count === 1 ? "item" : "items"`)
|
|
101
|
-
- Right-to-left (RTL) incompatible layouts (hardcoded left/right padding/margins instead of logical properties)
|
|
102
|
-
- Concatenated strings that would break in other languages ("Welcome, " + name + "!")
|
|
103
|
-
- Text embedded in images
|
|
104
|
-
|
|
105
|
-
**Step 2: Create string extraction plan**
|
|
106
|
-
- If an i18n framework is already in the project (react-intl, i18next, vue-i18n, etc.), identify strings that should be using it but aren't
|
|
107
|
-
- If no i18n framework exists, recommend one and document the migration effort
|
|
108
|
-
- For either case, create a catalog:
|
|
109
|
-
- Table: | File | Line | Current String | Suggested Key | Notes |
|
|
110
|
-
- Group by module/page for organized extraction
|
|
111
|
-
|
|
112
|
-
**Step 3: Implement extraction if framework exists**
|
|
113
|
-
If the project already has i18n tooling set up:
|
|
114
|
-
- Extract hardcoded strings to the translation file(s)
|
|
115
|
-
- Replace hardcoded strings with translation function calls
|
|
116
|
-
- Use the existing naming/key convention
|
|
117
|
-
- Run tests after each batch
|
|
118
|
-
- Commit: `i18n: extract strings from [module]`
|
|
119
|
-
|
|
120
|
-
If no i18n framework exists:
|
|
121
|
-
- DO NOT add one overnight. Just document the strings and recommendations.
|
|
122
|
-
|
|
123
|
-
## Output Requirements
|
|
124
|
-
|
|
125
|
-
Create the `audit-reports/` directory in the project root if it doesn't already exist. Save the report as `audit-reports/23_FRONTEND_QUALITY_REPORT_[run-number]_[date]_[time in user's local time].md` (e.g., `23_FRONTEND_QUALITY_REPORT_01_2026-02-16_2129.md`). Increment the run number based on any existing reports with the same name prefix in that folder.
|
|
126
|
-
|
|
127
|
-
### Report Structure
|
|
128
|
-
|
|
129
|
-
1. **Executive Summary**
|
|
130
|
-
- Total accessibility issues found and fixed
|
|
131
|
-
- UX consistency score (your subjective assessment: poor/fair/good/excellent)
|
|
132
|
-
- Bundle size before/after (if measurable)
|
|
133
|
-
- i18n readiness assessment (not ready / partially ready / mostly ready)
|
|
134
|
-
|
|
135
|
-
2. **Accessibility**
|
|
136
|
-
- Issues fixed: table with | Component | Issue | Fix |
|
|
137
|
-
- Issues remaining: table with | Component | Issue | Severity | Effort to Fix |
|
|
138
|
-
- Overall WCAG compliance assessment
|
|
139
|
-
|
|
140
|
-
3. **UX Consistency**
|
|
141
|
-
- Component inventory with consistency assessment
|
|
142
|
-
- Inconsistencies found and fixed
|
|
143
|
-
- Inconsistencies documented for team review
|
|
144
|
-
- Recommended design system improvements
|
|
145
|
-
|
|
146
|
-
4. **Bundle Size**
|
|
147
|
-
- Current bundle composition (top 10 largest items)
|
|
148
|
-
- Optimizations implemented
|
|
149
|
-
- Larger optimization opportunities with effort estimates
|
|
150
|
-
|
|
151
|
-
5. **Internationalization**
|
|
152
|
-
- Total hardcoded strings found: X
|
|
153
|
-
- Strings extracted (if framework exists): X
|
|
154
|
-
- Strings remaining: X
|
|
155
|
-
- Full string catalog (appendix)
|
|
156
|
-
- Recommended i18n approach and effort estimate
|
|
157
|
-
|
|
158
|
-
6. **Recommendations**
|
|
159
|
-
- Priority-ordered list of improvements
|
|
160
|
-
- Estimated effort for each
|
|
161
|
-
- Dependencies between improvements
|
|
162
|
-
|
|
163
|
-
## Rules
|
|
164
|
-
- Branch: `frontend-quality-[date]`
|
|
165
|
-
- Run tests after every change
|
|
166
|
-
- For accessibility: implement fixes that don't change visual appearance or behavior. If a fix would change UX flow, document it instead.
|
|
167
|
-
- For consistency: align TO the existing dominant pattern, don't impose a new one
|
|
168
|
-
- For bundle: don't remove dependencies that might be used dynamically or in ways you can't trace statically — document uncertainty
|
|
169
|
-
- For i18n: don't add frameworks or infrastructure. Only extract strings if the framework already exists.
|
|
170
|
-
- Visual changes should be minimal — this is about quality and correctness, not redesign
|
|
171
|
-
- You have all night. Be thorough. Go component by component.
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## Chat Output Requirement
|
|
175
|
-
|
|
176
|
-
In addition to writing the full report file, you MUST print a summary directly in the conversation when you finish. Do not make the user open the report to get the highlights. The chat summary should include:
|
|
177
|
-
|
|
178
|
-
### 1. Status Line
|
|
179
|
-
One sentence: what you did, how long it took, and whether all tests still pass.
|
|
180
|
-
|
|
181
|
-
### 2. Key Findings
|
|
182
|
-
The most important things discovered — bugs, risks, wins, or surprises. Each bullet should be specific and actionable, not vague. Lead with severity or impact.
|
|
183
|
-
|
|
184
|
-
**Good:** "CRITICAL: No backup configuration found for the primary Postgres database — total data loss risk."
|
|
185
|
-
**Bad:** "Found some issues with backups."
|
|
186
|
-
|
|
187
|
-
### 3. Changes Made (if applicable)
|
|
188
|
-
Bullet list of what was actually modified, added, or removed. Skip this section for read-only analysis runs.
|
|
189
|
-
|
|
190
|
-
### 4. Recommendations
|
|
191
|
-
|
|
192
|
-
If there are legitimately beneficial recommendations worth pursuing right now, present them in a table. Do **not** force recommendations — if the audit surfaced no actionable improvements, simply state that no recommendations are warranted at this time and move on.
|
|
193
|
-
|
|
194
|
-
When recommendations exist, use this table format:
|
|
195
|
-
|
|
196
|
-
| # | Recommendation | Impact | Risk if Ignored | Worth Doing? | Details |
|
|
197
|
-
|---|---|---|---|---|---|
|
|
198
|
-
| *Sequential number* | *Short description (≤10 words)* | *What improves if addressed* | *Low / Medium / High / Critical* | *Yes / Probably / Only if time allows* | *1–3 sentences explaining the reasoning, context, or implementation guidance* |
|
|
199
|
-
|
|
200
|
-
Order rows by risk descending (Critical → High → Medium → Low). Be honest in the "Worth Doing?" column — not everything flagged is worth the engineering time. If a recommendation is marginal, say so.
|
|
201
|
-
|
|
202
|
-
### 5. Report Location
|
|
203
|
-
State the full path to the detailed report file for deeper review.
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
**Formatting rules for chat output:**
|
|
208
|
-
- Use markdown headers, bold for severity labels, and bullet points for scannability.
|
|
209
|
-
- Do not duplicate the full report contents — just the highlights and recommendations.
|
|
210
|
-
- If you made zero findings in a phase, say so in one line rather than omitting it silently.
|
|
1
|
+
# Frontend Quality Pass
|
|
2
|
+
|
|
3
|
+
## Prompt
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
You are running an overnight frontend quality audit and improvement pass. You have several hours. Your job is to improve accessibility, UX consistency, bundle efficiency, and internationalization readiness across the frontend codebase.
|
|
7
|
+
|
|
8
|
+
Work on a branch called `frontend-quality-[date]`.
|
|
9
|
+
|
|
10
|
+
## Your Mission
|
|
11
|
+
|
|
12
|
+
### Phase 1: Accessibility Audit & Fixes
|
|
13
|
+
|
|
14
|
+
Accessibility isn't optional — it's both a legal requirement and good engineering. Scan every component and page.
|
|
15
|
+
|
|
16
|
+
**Step 1: Automated checks**
|
|
17
|
+
Scan all component/template files for:
|
|
18
|
+
|
|
19
|
+
- **Images**: Missing `alt` attributes, empty `alt` on non-decorative images, decorative images missing `alt=""`
|
|
20
|
+
- **Forms**: Inputs without associated `<label>` elements (or `aria-label`/`aria-labelledby`), missing form validation announcements, submit buttons that don't indicate their purpose
|
|
21
|
+
- **Interactive elements**: Click handlers on non-interactive elements (`div`, `span`) without `role`, `tabIndex`, and keyboard event handlers. Buttons that are actually `<div>`s or `<a>`s without proper roles.
|
|
22
|
+
- **Heading hierarchy**: Skipped heading levels (h1 → h3), multiple h1s per page, headings used for styling rather than structure
|
|
23
|
+
- **Color and contrast**: Hardcoded colors that might fail WCAG AA contrast ratios (especially light gray text on white backgrounds, placeholder text)
|
|
24
|
+
- **Focus management**: Missing focus styles (`:focus` or `:focus-visible`), focus traps in modals that don't exist, modals that don't return focus on close
|
|
25
|
+
- **Dynamic content**: ARIA live regions missing for content that updates dynamically (notifications, loading states, error messages), screen reader announcements for route changes in SPAs
|
|
26
|
+
- **Keyboard navigation**: Interactive elements not reachable via Tab, custom components that don't respond to Enter/Space, dropdown menus that don't support arrow keys, escape key not closing modals/popups
|
|
27
|
+
- **Semantic HTML**: `<div>` and `<span>` used where semantic elements should be (`<nav>`, `<main>`, `<aside>`, `<article>`, `<section>`, `<header>`, `<footer>`, `<button>`, `<time>`)
|
|
28
|
+
- **ARIA usage**: `aria-*` attributes used incorrectly (wrong values, missing required companion attributes, ARIA roles on elements that already have that role natively)
|
|
29
|
+
|
|
30
|
+
**Step 2: Fix what's safe**
|
|
31
|
+
For each issue found:
|
|
32
|
+
- Low-risk fixes (adding alt text, adding labels, adding semantic elements, adding ARIA attributes): implement immediately, run tests, commit
|
|
33
|
+
- Medium-risk fixes (refactoring div-buttons to real buttons, adding keyboard handlers): implement carefully, test thoroughly
|
|
34
|
+
- High-risk fixes (focus management overhauls, major structural changes): document in report only
|
|
35
|
+
- Commit: `a11y: [description] in [component]`
|
|
36
|
+
|
|
37
|
+
### Phase 2: UX Consistency Audit
|
|
38
|
+
|
|
39
|
+
**Step 1: Component inventory**
|
|
40
|
+
Catalog every UI pattern used in the app:
|
|
41
|
+
- Buttons: How many visual styles exist? Are they consistent? Do similar actions use similar button styles?
|
|
42
|
+
- Form inputs: Consistent styling, error states, placeholder text approach, validation feedback
|
|
43
|
+
- Loading states: Spinners, skeletons, progress bars — are they consistent? Do all async operations show loading?
|
|
44
|
+
- Empty states: What happens when a list has no items? Is it always handled? Is the messaging consistent?
|
|
45
|
+
- Error states: How are errors displayed? Consistent format? Red text, toasts, inline, modal?
|
|
46
|
+
- Spacing: Consistent use of spacing scale or are padding/margin values random?
|
|
47
|
+
- Typography: How many font sizes are actually used? Do they follow a consistent scale?
|
|
48
|
+
- Colors: Are colors from a design system / theme, or hardcoded hex values scattered everywhere?
|
|
49
|
+
- Icons: Consistent icon library? Mixed icon sources? Missing icons where they'd help?
|
|
50
|
+
- Responsive behavior: Do components work at mobile sizes? Tablet? Are breakpoints consistent?
|
|
51
|
+
|
|
52
|
+
**Step 2: Document inconsistencies**
|
|
53
|
+
Create a detailed inventory of every inconsistency pattern found:
|
|
54
|
+
- Categorize by severity (confusing to users vs. just messy)
|
|
55
|
+
- Group related issues (all button inconsistencies together, all spacing issues together)
|
|
56
|
+
- Screenshot descriptions or specific file/line references for each
|
|
57
|
+
|
|
58
|
+
**Step 3: Fix what's safe**
|
|
59
|
+
- If there's a clear design system or component library: fix deviations back to the standard
|
|
60
|
+
- Consolidate obviously duplicate component variants (3 different button components that do the same thing)
|
|
61
|
+
- Standardize spacing to the nearest consistent value
|
|
62
|
+
- Ensure all lists have empty states
|
|
63
|
+
- Ensure all async operations have loading states
|
|
64
|
+
- Run tests after each batch of changes
|
|
65
|
+
- Commit: `ui: standardize [pattern] across [scope]`
|
|
66
|
+
|
|
67
|
+
### Phase 3: Bundle Size Analysis & Optimization
|
|
68
|
+
|
|
69
|
+
**Step 1: Analyze the bundle**
|
|
70
|
+
- If build tooling supports it, generate a bundle analysis (webpack-bundle-analyzer, source-map-explorer, or equivalent)
|
|
71
|
+
- Identify:
|
|
72
|
+
- The largest dependencies by size
|
|
73
|
+
- Dependencies that are imported but only partially used (e.g., importing all of lodash for one function)
|
|
74
|
+
- Dependencies with lighter alternatives (moment.js → date-fns, lodash → native methods)
|
|
75
|
+
- Code that's bundled but only used on specific routes (should be lazy-loaded)
|
|
76
|
+
- Duplicate dependencies (same package at multiple versions in the bundle)
|
|
77
|
+
- CSS that's included but never used (dead CSS)
|
|
78
|
+
|
|
79
|
+
**Step 2: Implement safe optimizations**
|
|
80
|
+
- Replace full library imports with specific imports (`import get from 'lodash/get'` instead of `import _ from 'lodash'`)
|
|
81
|
+
- Add dynamic imports / lazy loading for route-specific code that doesn't need to be in the main bundle
|
|
82
|
+
- Remove unused CSS if a reliable method is available
|
|
83
|
+
- Remove unused dependencies from package.json
|
|
84
|
+
- Run the build to verify bundle still works
|
|
85
|
+
- Run tests
|
|
86
|
+
- Commit: `perf: reduce bundle size — [what changed]`
|
|
87
|
+
|
|
88
|
+
**Step 3: Document larger opportunities**
|
|
89
|
+
- Dependencies that should be replaced with lighter alternatives (with migration effort estimate)
|
|
90
|
+
- Code splitting strategies that would require architectural changes
|
|
91
|
+
- Image optimization opportunities (uncompressed images, missing responsive images, images that should be SVGs)
|
|
92
|
+
|
|
93
|
+
### Phase 4: Internationalization (i18n) Readiness
|
|
94
|
+
|
|
95
|
+
**Step 1: Find all hardcoded strings**
|
|
96
|
+
Scan every component, template, and UI-related file for:
|
|
97
|
+
- Hardcoded user-facing text (labels, messages, headings, button text, placeholder text, error messages, tooltips)
|
|
98
|
+
- Hardcoded date formatting (specific date format strings like "MM/DD/YYYY")
|
|
99
|
+
- Hardcoded number formatting (currency symbols, decimal separators, thousand separators)
|
|
100
|
+
- Hardcoded pluralization logic (`count === 1 ? "item" : "items"`)
|
|
101
|
+
- Right-to-left (RTL) incompatible layouts (hardcoded left/right padding/margins instead of logical properties)
|
|
102
|
+
- Concatenated strings that would break in other languages ("Welcome, " + name + "!")
|
|
103
|
+
- Text embedded in images
|
|
104
|
+
|
|
105
|
+
**Step 2: Create string extraction plan**
|
|
106
|
+
- If an i18n framework is already in the project (react-intl, i18next, vue-i18n, etc.), identify strings that should be using it but aren't
|
|
107
|
+
- If no i18n framework exists, recommend one and document the migration effort
|
|
108
|
+
- For either case, create a catalog:
|
|
109
|
+
- Table: | File | Line | Current String | Suggested Key | Notes |
|
|
110
|
+
- Group by module/page for organized extraction
|
|
111
|
+
|
|
112
|
+
**Step 3: Implement extraction if framework exists**
|
|
113
|
+
If the project already has i18n tooling set up:
|
|
114
|
+
- Extract hardcoded strings to the translation file(s)
|
|
115
|
+
- Replace hardcoded strings with translation function calls
|
|
116
|
+
- Use the existing naming/key convention
|
|
117
|
+
- Run tests after each batch
|
|
118
|
+
- Commit: `i18n: extract strings from [module]`
|
|
119
|
+
|
|
120
|
+
If no i18n framework exists:
|
|
121
|
+
- DO NOT add one overnight. Just document the strings and recommendations.
|
|
122
|
+
|
|
123
|
+
## Output Requirements
|
|
124
|
+
|
|
125
|
+
Create the `audit-reports/` directory in the project root if it doesn't already exist. Save the report as `audit-reports/23_FRONTEND_QUALITY_REPORT_[run-number]_[date]_[time in user's local time].md` (e.g., `23_FRONTEND_QUALITY_REPORT_01_2026-02-16_2129.md`). Increment the run number based on any existing reports with the same name prefix in that folder.
|
|
126
|
+
|
|
127
|
+
### Report Structure
|
|
128
|
+
|
|
129
|
+
1. **Executive Summary**
|
|
130
|
+
- Total accessibility issues found and fixed
|
|
131
|
+
- UX consistency score (your subjective assessment: poor/fair/good/excellent)
|
|
132
|
+
- Bundle size before/after (if measurable)
|
|
133
|
+
- i18n readiness assessment (not ready / partially ready / mostly ready)
|
|
134
|
+
|
|
135
|
+
2. **Accessibility**
|
|
136
|
+
- Issues fixed: table with | Component | Issue | Fix |
|
|
137
|
+
- Issues remaining: table with | Component | Issue | Severity | Effort to Fix |
|
|
138
|
+
- Overall WCAG compliance assessment
|
|
139
|
+
|
|
140
|
+
3. **UX Consistency**
|
|
141
|
+
- Component inventory with consistency assessment
|
|
142
|
+
- Inconsistencies found and fixed
|
|
143
|
+
- Inconsistencies documented for team review
|
|
144
|
+
- Recommended design system improvements
|
|
145
|
+
|
|
146
|
+
4. **Bundle Size**
|
|
147
|
+
- Current bundle composition (top 10 largest items)
|
|
148
|
+
- Optimizations implemented
|
|
149
|
+
- Larger optimization opportunities with effort estimates
|
|
150
|
+
|
|
151
|
+
5. **Internationalization**
|
|
152
|
+
- Total hardcoded strings found: X
|
|
153
|
+
- Strings extracted (if framework exists): X
|
|
154
|
+
- Strings remaining: X
|
|
155
|
+
- Full string catalog (appendix)
|
|
156
|
+
- Recommended i18n approach and effort estimate
|
|
157
|
+
|
|
158
|
+
6. **Recommendations**
|
|
159
|
+
- Priority-ordered list of improvements
|
|
160
|
+
- Estimated effort for each
|
|
161
|
+
- Dependencies between improvements
|
|
162
|
+
|
|
163
|
+
## Rules
|
|
164
|
+
- Branch: `frontend-quality-[date]`
|
|
165
|
+
- Run tests after every change
|
|
166
|
+
- For accessibility: implement fixes that don't change visual appearance or behavior. If a fix would change UX flow, document it instead.
|
|
167
|
+
- For consistency: align TO the existing dominant pattern, don't impose a new one
|
|
168
|
+
- For bundle: don't remove dependencies that might be used dynamically or in ways you can't trace statically — document uncertainty
|
|
169
|
+
- For i18n: don't add frameworks or infrastructure. Only extract strings if the framework already exists.
|
|
170
|
+
- Visual changes should be minimal — this is about quality and correctness, not redesign
|
|
171
|
+
- You have all night. Be thorough. Go component by component.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Chat Output Requirement
|
|
175
|
+
|
|
176
|
+
In addition to writing the full report file, you MUST print a summary directly in the conversation when you finish. Do not make the user open the report to get the highlights. The chat summary should include:
|
|
177
|
+
|
|
178
|
+
### 1. Status Line
|
|
179
|
+
One sentence: what you did, how long it took, and whether all tests still pass.
|
|
180
|
+
|
|
181
|
+
### 2. Key Findings
|
|
182
|
+
The most important things discovered — bugs, risks, wins, or surprises. Each bullet should be specific and actionable, not vague. Lead with severity or impact.
|
|
183
|
+
|
|
184
|
+
**Good:** "CRITICAL: No backup configuration found for the primary Postgres database — total data loss risk."
|
|
185
|
+
**Bad:** "Found some issues with backups."
|
|
186
|
+
|
|
187
|
+
### 3. Changes Made (if applicable)
|
|
188
|
+
Bullet list of what was actually modified, added, or removed. Skip this section for read-only analysis runs.
|
|
189
|
+
|
|
190
|
+
### 4. Recommendations
|
|
191
|
+
|
|
192
|
+
If there are legitimately beneficial recommendations worth pursuing right now, present them in a table. Do **not** force recommendations — if the audit surfaced no actionable improvements, simply state that no recommendations are warranted at this time and move on.
|
|
193
|
+
|
|
194
|
+
When recommendations exist, use this table format:
|
|
195
|
+
|
|
196
|
+
| # | Recommendation | Impact | Risk if Ignored | Worth Doing? | Details |
|
|
197
|
+
|---|---|---|---|---|---|
|
|
198
|
+
| *Sequential number* | *Short description (≤10 words)* | *What improves if addressed* | *Low / Medium / High / Critical* | *Yes / Probably / Only if time allows* | *1–3 sentences explaining the reasoning, context, or implementation guidance* |
|
|
199
|
+
|
|
200
|
+
Order rows by risk descending (Critical → High → Medium → Low). Be honest in the "Worth Doing?" column — not everything flagged is worth the engineering time. If a recommendation is marginal, say so.
|
|
201
|
+
|
|
202
|
+
### 5. Report Location
|
|
203
|
+
State the full path to the detailed report file for deeper review.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
**Formatting rules for chat output:**
|
|
208
|
+
- Use markdown headers, bold for severity labels, and bullet points for scannability.
|
|
209
|
+
- Do not duplicate the full report contents — just the highlights and recommendations.
|
|
210
|
+
- If you made zero findings in a phase, say so in one line rather than omitting it silently.
|