SilentPolish: Next.js Full-App Polish
Fix spacing and design bugs, use next/image, remove ALL fake data, and centralize everything in site.ts.
Trigger prompt: "Follow this skill on the entire app. Do every step in order. Do not skip any file."
0. Context
- Next.js app (App Router assumed; adapt for Pages Router).
- UI was probably generated by an AI tool (e.g. Google Stitch via MCP). Expect inconsistent padding, fixed pixel sizes, plain
<img>tags, and made-up numbers, stats, prices, dates and table rows. - The owner will update real data by hand, often (daily). All changeable data must live in ONE file:
site.ts.
1. Hard rules (never break)
- No fake data in components. No invented numbers, stats, percentages, prices, ratings, counts, dates, names, emails, phones, testimonials, or table rows.
- All data comes from
site.ts. Components only read from it. Components never contain literal data. - Never invent replacement numbers. Use
null(rendered as—) or an empty array. Placeholders must be obviously empty, not realistic-looking. - All content images use
next/image. No<img>tags. - One spacing system. No random one-off paddings.
- Do not change the design direction (colors, fonts, brand feel). Fix spacing and bugs only.
- Do not break working features. Run the build at the end.
- Work through the WHOLE app: every page, layout, component, and loading/error/not-found file.
2. Workflow
Do the steps in order. Report the audit before changing anything.
Step 1: Audit
Run scripts/audit.sh <project-root> (or the manual greps in references/audit-patterns.md). Output a short list grouped:
- A. Fake / hardcoded data: numbers in JSX text, data-like arrays inside components, fake contact info, fake dates.
- B. Images:
<img>tags, CSS background images used as content. - C. Layout / padding problems: fixed pixel sizes,
h-screen/100vh, mixed section padding, double padding, mobile edge-touching, horizontal scroll, absolute positioning for layout, negative-margin hacks, missingmax-width, overflowing text, inconsistent card sizes/radii.
Step 2: Create site.ts
Copy assets/templates/site.ts to src/config/site.ts (or config/ / lib/ to match the project; use the project's existing import alias, e.g. @/config/site).
- Fully typed. Every changeable value lives here.
- Unknown values are
nullor[], never fake. - Comments above each section tell the owner what to edit.
- Keep it flat and simple. Only keep sections that match the real app; add sections for anything the audit found (pricing, schedule, rates, team...).
- Keep the Owner's Quick Update Guide (section 5 below) as a comment at the top.
Step 3: Replace fake data in every component
For each finding in Audit A:
- Remove the hardcoded value or array from the component.
- Add a matching entry to
site.tswith an empty placeholder (null,"",[]). - Import it in the component and render from it.
- Handle the empty state gracefully (no crash, no broken layout).
Reference patterns: assets/templates/StatsExample.tsx, assets/templates/TableExample.tsx.
Rules:
- Numbers, dates, prices, table data, and contact info must be in
site.ts. Static brand words (headings, button labels, nav labels) may stay in components or move tosite.tsif likely to change. - Use stable
ids as React keys, not array indexes. - Numbers used only for layout (
grid-cols-3) are fine. - No
Math.random()and no fake animated counters. A counter may only animate to a value read fromsite.tsand shows—ifnull. - Hide contact/social items when empty:
{contact.email && <a ...>}.
Step 4: Images with next/image
Replace every <img> and content background-image. Full rules in references/image-rules.md. Summary:
- Always meaningful
alt(empty only for purely decorative images). width+height, orfillwith arelativeparent. Never both.- With
fill: addsizesandobject-cover/object-contain. priorityonly on above-the-fold / LCP images.- Local files in
/public/images/; remote hosts added tonext.configremotePatterns. - Paths, alt text and dimensions live in
site.ts(images). - If no real file exists, do NOT use an external stock URL. Render a neutral empty block (
bg-muted aspect-[16/9]) and leave thesite.tsentry for the owner. - Put
roundedandoverflow-hiddenon the wrapper.
Step 5: Padding and spacing system
- Copy
assets/templates/Container.tsxandSection.tsxtocomponents/ui/. - Use ONLY the scale in
references/spacing-system.md. - Wrap every page section in
<Section>; remove duplicate ad-hocpx-*/py-*. - Remove double padding, pixel-based sizes, and
h-screen/100vhon sections. - Standardize header, footer, cards (one radius), buttons (44px min tap target), forms, long text (
max-w-prose), and wrap tables inoverflow-x-auto. - Add
overflow-x-hiddentobodyonly as a last resort after fixing the real cause.
If the project does not use Tailwind, create CSS variables with the same scale.
Step 6: Design bug checklist
Work through references/design-checklist.md and fix everything.
Step 7: Verify
Run scripts/verify.sh <project-root> (typecheck, lint, build, then re-run the audit). Fix everything that fails. Do not say "done" before the build passes.
Step 8: Final report (required output)
- Files changed
- What was moved into
site.ts(sections and what each controls) - Fake data removed (what and where)
- Images converted (count, plus any needing real files from the owner)
- Spacing fixes (global changes, new
Container/Sectionusage) - Everything the owner must fill in (list of
null/[]entries) - Build result (pass/fail)
5. Owner's quick update guide (also goes at the top of site.ts)
- Update a number:
site.ts→stats→ changevalue. - Update a table (daily):
tables.main.rows→ edit/add rows → setupdatedAtto today's date ("YYYY-MM-DD"). - Change contact info:
contact. - Swap an image: drop the file in
/public/images/→ updatesrc,alt,width,heightinimages. - Hide something: set the value to
nullor the list to[]. - Save. The site updates on next reload/deploy. No component edits needed.
6. Do not
- Do not invent numbers, names, prices, reviews, or dates to "fill space".
- Do not leave data arrays inside components.
- Do not use
<img>or CSS background images for content. - Do not add new random padding values.
- Do not redesign colors, fonts, or brand.
- Do not add dependencies unless truly required.
- Do not skip files or stop at "the main page".
- Do not say "done" before the build passes.