sugikit 0.0.1 → 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 (72) hide show
  1. package/LICENSE +29 -21
  2. package/README.md +45 -0
  3. package/dist/api/browser.d.ts +5 -0
  4. package/dist/api/browser.js +5 -0
  5. package/dist/api/rules.d.ts +12 -0
  6. package/dist/api/rules.js +14 -0
  7. package/dist/auth.d.ts +156 -0
  8. package/dist/auth.js +547 -0
  9. package/dist/browser.d.ts +25 -0
  10. package/dist/browser.js +120 -0
  11. package/dist/check.d.ts +21 -0
  12. package/dist/check.js +89 -0
  13. package/dist/convert-probe.d.ts +21 -0
  14. package/dist/convert-probe.js +647 -0
  15. package/dist/fetch.d.ts +6 -0
  16. package/dist/fetch.js +22 -0
  17. package/dist/framework.d.ts +2 -0
  18. package/dist/framework.js +17 -0
  19. package/dist/gather.d.ts +48 -0
  20. package/dist/gather.js +211 -0
  21. package/dist/html.d.ts +17 -0
  22. package/dist/html.js +43 -0
  23. package/dist/http.d.ts +36 -0
  24. package/dist/http.js +57 -0
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +331 -0
  27. package/dist/links.d.ts +8 -0
  28. package/dist/links.js +69 -0
  29. package/dist/polish-run.d.ts +115 -0
  30. package/dist/polish-run.js +357 -0
  31. package/dist/probe.d.ts +14 -0
  32. package/dist/probe.js +457 -0
  33. package/dist/psi-scores.d.ts +4 -0
  34. package/dist/psi-scores.js +7 -0
  35. package/dist/psi.d.ts +56 -0
  36. package/dist/psi.js +192 -0
  37. package/dist/release.d.ts +1 -0
  38. package/dist/release.js +5 -0
  39. package/dist/render.d.ts +28 -0
  40. package/dist/render.js +270 -0
  41. package/dist/report.d.ts +227 -0
  42. package/dist/report.js +69 -0
  43. package/dist/rules/convert-render.d.ts +100 -0
  44. package/dist/rules/convert-render.js +279 -0
  45. package/dist/rules/convert.d.ts +15 -0
  46. package/dist/rules/convert.js +322 -0
  47. package/dist/rules/fixes.d.ts +16 -0
  48. package/dist/rules/fixes.js +536 -0
  49. package/dist/rules/geo.d.ts +15 -0
  50. package/dist/rules/geo.js +112 -0
  51. package/dist/rules/polish.d.ts +59 -0
  52. package/dist/rules/polish.js +223 -0
  53. package/dist/rules/robots.d.ts +14 -0
  54. package/dist/rules/robots.js +69 -0
  55. package/dist/rules/seo.d.ts +31 -0
  56. package/dist/rules/seo.js +208 -0
  57. package/dist/rules/types.d.ts +55 -0
  58. package/dist/rules/types.js +78 -0
  59. package/dist/score.d.ts +6 -0
  60. package/dist/score.js +23 -0
  61. package/dist/skills.d.ts +9 -0
  62. package/dist/skills.js +22 -0
  63. package/package.json +64 -4
  64. package/skills/INSTALL_PROMPT.md +9 -0
  65. package/skills/sugikit/SKILL.md +147 -0
  66. package/skills/sugikit/references/convert.md +127 -0
  67. package/skills/sugikit/references/geo.md +97 -0
  68. package/skills/sugikit/references/next.md +254 -0
  69. package/skills/sugikit/references/pagespeed.md +94 -0
  70. package/skills/sugikit/references/polish.md +123 -0
  71. package/skills/sugikit/references/seo.md +150 -0
  72. package/skills/sugikit/references/tanstack-start.md +246 -0
@@ -0,0 +1,536 @@
1
+ const NEXT_METADATA = ["app/layout.tsx", "app/page.tsx"];
2
+ const TSS_HEAD = ["src/routes/__root.tsx", "src/routes/index.tsx"];
3
+ const NEXT_STYLES = ["app/globals.css", "app/page.tsx"];
4
+ const TSS_STYLES = ["src/styles.css", "src/routes/index.tsx"];
5
+ // Content-level convert fixes: the page and the components it renders.
6
+ const CONTENT_NEXT = ["app/page.tsx", "components/"];
7
+ const CONTENT_TSS = ["src/routes/index.tsx", "src/components/"];
8
+ export const FIXES = {
9
+ "seo/title": {
10
+ summary: "Add a <title> that names the product and what it does.",
11
+ next: {
12
+ summary: "Set `title` in `export const metadata: Metadata` (or return it from `generateMetadata`). Use `title: { default, template }` in app/layout.tsx for a site-wide pattern.",
13
+ files: NEXT_METADATA,
14
+ },
15
+ "tanstack-start": {
16
+ summary: "Return `meta: [{ title: '...' }]` from the route `head: () => ({ ... })` option.",
17
+ files: TSS_HEAD,
18
+ },
19
+ },
20
+ "seo/title-length": {
21
+ summary: "Rewrite the title to 30 to 60 characters: product name plus the main benefit.",
22
+ next: { summary: "Edit `metadata.title` (string or `{ default, template }`).", files: NEXT_METADATA },
23
+ "tanstack-start": { summary: "Edit the `{ title }` entry in the route `head().meta` array.", files: TSS_HEAD },
24
+ },
25
+ "seo/meta-description": {
26
+ summary: 'Add <meta name="description"> with one or two sentences that say what the product does.',
27
+ next: { summary: "Set `description` in `export const metadata` or `generateMetadata`.", files: NEXT_METADATA },
28
+ "tanstack-start": {
29
+ summary: "Add `{ name: 'description', content: '...' }` to the route `head().meta` array.",
30
+ files: TSS_HEAD,
31
+ },
32
+ },
33
+ "seo/meta-description-length": {
34
+ summary: "Rewrite the meta description to 70 to 160 characters.",
35
+ next: { summary: "Edit `metadata.description`.", files: NEXT_METADATA },
36
+ "tanstack-start": {
37
+ summary: "Edit the `{ name: 'description', content }` entry in `head().meta`.",
38
+ files: TSS_HEAD,
39
+ },
40
+ },
41
+ "seo/html-lang": {
42
+ summary: 'Set the language on the root element, for example <html lang="en">.',
43
+ next: { summary: 'Render `<html lang="en">` in the root layout.', files: ["app/layout.tsx"] },
44
+ "tanstack-start": {
45
+ summary: 'Render `<html lang="en">` in the root route `shellComponent` (or `RootDocument`).',
46
+ files: ["src/routes/__root.tsx"],
47
+ },
48
+ },
49
+ "seo/viewport": {
50
+ summary: 'Add <meta name="viewport" content="width=device-width, initial-scale=1">.',
51
+ next: {
52
+ summary: "Next.js adds the viewport tag by default; if it is missing, check for a custom <head> and use `export const viewport: Viewport` instead.",
53
+ files: ["app/layout.tsx"],
54
+ },
55
+ "tanstack-start": {
56
+ summary: "Add `{ name: 'viewport', content: 'width=device-width, initial-scale=1' }` to the root route `head().meta`.",
57
+ files: ["src/routes/__root.tsx"],
58
+ },
59
+ },
60
+ "seo/canonical": {
61
+ summary: 'Add <link rel="canonical"> with the absolute https URL of this page.',
62
+ next: {
63
+ summary: "Set `metadataBase: new URL('https://example.com')` in app/layout.tsx and `alternates: { canonical: '/' }` in the page metadata.",
64
+ files: NEXT_METADATA,
65
+ },
66
+ "tanstack-start": {
67
+ summary: "Add `links: [{ rel: 'canonical', href: 'https://example.com/' }]` to the route `head()` with an absolute URL.",
68
+ files: TSS_HEAD,
69
+ },
70
+ },
71
+ "seo/open-graph": {
72
+ summary: "Add og:title, og:description, og:url and og:image (absolute URL, 1200x630).",
73
+ next: {
74
+ summary: "Set `openGraph: { title, description, url, images }` in metadata and `metadataBase` so image URLs become absolute, or add app/opengraph-image.tsx.",
75
+ files: [...NEXT_METADATA, "app/opengraph-image.tsx"],
76
+ },
77
+ "tanstack-start": {
78
+ summary: "Add `{ property: 'og:title', content }`, og:description, og:url and og:image (absolute URL) to the route `head().meta`.",
79
+ files: TSS_HEAD,
80
+ },
81
+ },
82
+ "seo/twitter-card": {
83
+ summary: 'Add <meta name="twitter:card" content="summary_large_image">.',
84
+ next: { summary: "Set `twitter: { card: 'summary_large_image', title, description, images }` in metadata.", files: NEXT_METADATA },
85
+ "tanstack-start": {
86
+ summary: "Add `{ name: 'twitter:card', content: 'summary_large_image' }` to the route `head().meta`.",
87
+ files: TSS_HEAD,
88
+ },
89
+ },
90
+ "seo/json-ld": {
91
+ summary: 'Add a valid <script type="application/ld+json"> block that describes the product.',
92
+ next: {
93
+ summary: "Render `<script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd).replace(/</g, '\\\\u003c') }} />` in the page component.",
94
+ files: ["app/page.tsx"],
95
+ },
96
+ "tanstack-start": {
97
+ summary: "Add `scripts: [{ type: 'application/ld+json', children: JSON.stringify(jsonLd) }]` to the route `head()`.",
98
+ files: TSS_HEAD,
99
+ },
100
+ },
101
+ "seo/json-ld-type": {
102
+ summary: "Give the JSON-LD an @type of Organization, WebSite, SoftwareApplication, MobileApplication or Product (use @graph for several).",
103
+ next: { summary: "Edit the JSON-LD object rendered in the page component.", files: ["app/page.tsx"] },
104
+ "tanstack-start": { summary: "Edit the JSON-LD object in the route `head().scripts`.", files: TSS_HEAD },
105
+ },
106
+ "seo/h1": {
107
+ summary: "Use exactly one <h1> on the page, the main headline.",
108
+ next: { summary: "Keep one <h1> in the hero; change other h1 elements to h2.", files: ["app/page.tsx"] },
109
+ "tanstack-start": {
110
+ summary: "Keep one <h1> in the hero; change other h1 elements to h2.",
111
+ files: ["src/routes/index.tsx"],
112
+ },
113
+ },
114
+ "seo/heading-order": {
115
+ summary: "Do not skip heading levels (h2 after h1, h3 after h2). Style with CSS, not with the heading level.",
116
+ next: { summary: "Fix heading tags in the page and its section components.", files: ["app/page.tsx"] },
117
+ "tanstack-start": { summary: "Fix heading tags in the route and its section components.", files: ["src/routes/index.tsx"] },
118
+ },
119
+ "seo/img-alt": {
120
+ summary: 'Give every <img> an alt attribute; use alt="" for decorative images.',
121
+ next: { summary: "Add `alt` to each `next/image` <Image> and <img>.", files: ["app/page.tsx"] },
122
+ "tanstack-start": { summary: "Add `alt` to each <img>.", files: ["src/routes/index.tsx"] },
123
+ },
124
+ "seo/favicon": {
125
+ summary: 'Add a favicon and link it with <link rel="icon">.',
126
+ next: {
127
+ summary: "Add app/icon.png (or app/icon.svg) and app/favicon.ico; Next.js adds the link tags.",
128
+ files: ["app/icon.png", "app/favicon.ico"],
129
+ },
130
+ "tanstack-start": {
131
+ summary: "Put the icon in public/ and add `links: [{ rel: 'icon', href: '/favicon.ico' }]` to the root route `head()`.",
132
+ files: ["src/routes/__root.tsx", "public/favicon.ico"],
133
+ },
134
+ },
135
+ "seo/noindex": {
136
+ summary: "Remove noindex from the robots meta tag and the X-Robots-Tag header on the production page.",
137
+ next: {
138
+ summary: "Remove `robots: { index: false }` from metadata and any X-Robots-Tag header in next.config.ts or middleware.",
139
+ files: [...NEXT_METADATA, "next.config.ts"],
140
+ },
141
+ "tanstack-start": {
142
+ summary: "Remove `{ name: 'robots', content: 'noindex' }` from `head().meta` and any X-Robots-Tag header in server middleware.",
143
+ files: TSS_HEAD,
144
+ },
145
+ },
146
+ "seo/robots-txt": {
147
+ summary: "Serve /robots.txt with status 200.",
148
+ next: {
149
+ summary: "Add app/robots.ts that exports a default function returning `MetadataRoute.Robots` with `rules: { userAgent: '*', allow: '/' }` and `sitemap`.",
150
+ files: ["app/robots.ts"],
151
+ },
152
+ "tanstack-start": {
153
+ summary: "Add a server route: `export const Route = createFileRoute('/robots.txt')({ server: { handlers: { GET: () => new Response(body, { headers: { 'Content-Type': 'text/plain' } }) } } })`, or a static public/robots.txt.",
154
+ files: ["src/routes/robots[.]txt.ts"],
155
+ },
156
+ },
157
+ "seo/robots-sitemap": {
158
+ summary: "Add a `Sitemap: https://example.com/sitemap.xml` line to robots.txt with the absolute sitemap URL.",
159
+ next: { summary: "Return `sitemap: 'https://example.com/sitemap.xml'` from app/robots.ts.", files: ["app/robots.ts"] },
160
+ "tanstack-start": {
161
+ summary: "Add the `Sitemap:` line to the body returned by the robots.txt server route.",
162
+ files: ["src/routes/robots[.]txt.ts"],
163
+ },
164
+ },
165
+ "seo/sitemap": {
166
+ summary: "Serve a sitemap.xml (a <urlset> or <sitemapindex>) with status 200.",
167
+ next: {
168
+ summary: "Add app/sitemap.ts that exports a default function returning `MetadataRoute.Sitemap` with `url` and `lastModified` per page.",
169
+ files: ["app/sitemap.ts"],
170
+ },
171
+ "tanstack-start": {
172
+ summary: "Add a server route `createFileRoute('/sitemap.xml')({ server: { handlers: { GET: () => new Response(xml, { headers: { 'Content-Type': 'application/xml' } }) } } })`, or enable `sitemap` in the tanstackStart() plugin options.",
173
+ files: ["src/routes/sitemap[.]xml.ts", "vite.config.ts"],
174
+ },
175
+ },
176
+ "seo/sitemap-lastmod": {
177
+ summary: "Give every sitemap entry a <lastmod> date (W3C datetime).",
178
+ next: { summary: "Set `lastModified` on every entry returned from app/sitemap.ts.", files: ["app/sitemap.ts"] },
179
+ "tanstack-start": {
180
+ summary: "Write a <lastmod> element for every <url> in the sitemap server route.",
181
+ files: ["src/routes/sitemap[.]xml.ts"],
182
+ },
183
+ },
184
+ "seo/sitemap-host": {
185
+ summary: "Nothing to change on a preview or dev server. On the live site, make the robots.txt Sitemap: line use the same host as the site.",
186
+ next: {
187
+ summary: "Build the `sitemap` URL in app/robots.ts from the same base URL as `metadataBase`.",
188
+ files: ["app/robots.ts"],
189
+ },
190
+ "tanstack-start": {
191
+ summary: "Build the `Sitemap:` URL in the robots.txt server route from the same base URL as the site.",
192
+ files: ["src/routes/robots[.]txt.ts"],
193
+ },
194
+ },
195
+ "seo/sitemap-local": {
196
+ summary: "Make the robots.txt Sitemap: line use the production URL, not a local host.",
197
+ next: {
198
+ summary: "Set `metadataBase` and build the `sitemap` URL in app/robots.ts from the production domain.",
199
+ files: ["app/robots.ts", "app/layout.tsx"],
200
+ },
201
+ "tanstack-start": {
202
+ summary: "Build the `Sitemap:` line in the robots.txt server route from the production site URL.",
203
+ files: ["src/routes/robots[.]txt.ts"],
204
+ },
205
+ },
206
+ "geo/llms-txt": {
207
+ summary: "Serve /llms.txt (markdown) with status 200 that describes the product and links the key pages.",
208
+ next: {
209
+ summary: "Add app/llms.txt/route.ts with `export function GET() { return new Response(markdown, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) }`.",
210
+ files: ["app/llms.txt/route.ts"],
211
+ },
212
+ "tanstack-start": {
213
+ summary: "Add a server route `createFileRoute('/llms.txt')({ server: { handlers: { GET: () => new Response(markdown, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) } } })`.",
214
+ files: ["src/routes/llms[.]txt.ts"],
215
+ },
216
+ },
217
+ "geo/llms-txt-format": {
218
+ summary: 'Start /llms.txt with a "# Product name" heading, a "> summary" line, then markdown links like "- [Docs](https://...)".',
219
+ next: { summary: "Edit the markdown returned by the route handler.", files: ["app/llms.txt/route.ts"] },
220
+ "tanstack-start": { summary: "Edit the markdown returned by the server route.", files: ["src/routes/llms[.]txt.ts"] },
221
+ },
222
+ "geo/llms-full-txt": {
223
+ summary: "Serve /llms-full.txt with the full page content as markdown.",
224
+ next: { summary: "Add app/llms-full.txt/route.ts with a `GET` route handler.", files: ["app/llms-full.txt/route.ts"] },
225
+ "tanstack-start": {
226
+ summary: "Add a server route `createFileRoute('/llms-full.txt')` with a `server.handlers.GET`.",
227
+ files: ["src/routes/llms-full[.]txt.ts"],
228
+ },
229
+ },
230
+ "geo/ai-crawlers": {
231
+ summary: "Allow AI crawlers (GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, Claude-User, PerplexityBot, Google-Extended, Applebot-Extended) to crawl /.",
232
+ next: {
233
+ summary: "Remove `disallow: '/'` for these user agents (and for '*') from the rules in app/robots.ts.",
234
+ files: ["app/robots.ts"],
235
+ },
236
+ "tanstack-start": {
237
+ summary: "Remove `Disallow: /` for these user agents (and for '*') in the robots.txt server route.",
238
+ files: ["src/routes/robots[.]txt.ts"],
239
+ },
240
+ },
241
+ "geo/faq-schema": {
242
+ summary: "Add an FAQ section and matching FAQPage JSON-LD (mainEntity of Question with acceptedAnswer).",
243
+ next: { summary: "Render FAQPage JSON-LD in a <script type=\"application/ld+json\"> in the page.", files: ["app/page.tsx"] },
244
+ "tanstack-start": {
245
+ summary: "Add the FAQPage object to the route `head().scripts` as `{ type: 'application/ld+json', children: JSON.stringify(faq) }`.",
246
+ files: ["src/routes/index.tsx"],
247
+ },
248
+ },
249
+ "geo/ssr-content": {
250
+ summary: "Render the page content on the server so the raw HTML holds the text; crawlers without JavaScript see nothing otherwise.",
251
+ next: {
252
+ summary: "Keep the page a Server Component; move `'use client'` down to small interactive parts and do not load main content in useEffect or with `ssr: false`.",
253
+ files: ["app/page.tsx"],
254
+ },
255
+ "tanstack-start": {
256
+ summary: "Keep SSR on for the route (no `ssr: false`, no SPA mode) and load data in the route `loader`, not in useEffect.",
257
+ files: ["src/routes/index.tsx", "vite.config.ts"],
258
+ },
259
+ },
260
+ "geo/hero-statement": {
261
+ summary: "Put a <p> right after the h1 that says what the product is and who it is for.",
262
+ next: { summary: "Add the paragraph under the h1 in the hero.", files: ["app/page.tsx"] },
263
+ "tanstack-start": { summary: "Add the paragraph under the h1 in the hero.", files: ["src/routes/index.tsx"] },
264
+ },
265
+ "geo/hero-length": {
266
+ summary: "Shorten the first sentence after the h1 to 30 words or fewer so AI answers can quote it.",
267
+ next: { summary: "Edit the hero paragraph.", files: ["app/page.tsx"] },
268
+ "tanstack-start": { summary: "Edit the hero paragraph.", files: ["src/routes/index.tsx"] },
269
+ },
270
+ "polish/horizontal-scroll": {
271
+ summary: "Find the element wider than the phone viewport (fixed width, wide table, long unbroken text, large media) and let it shrink: max-width: 100%, min-width: 0 on flex or grid children, or overflow-wrap: anywhere. Do not hide the overflow on body.",
272
+ next: { summary: "Change the width rule on the listed element in its component or in app/globals.css.", files: NEXT_STYLES },
273
+ "tanstack-start": { summary: "Change the width rule on the listed element in its component or in the global stylesheet.", files: TSS_STYLES },
274
+ },
275
+ "polish/tap-targets": {
276
+ summary: "Give each listed control a hit area of at least 24x24 CSS px (44x44 is better on touch) with padding or min-width and min-height, or move it so a 24 px circle around it does not touch the next control, without changing how it looks.",
277
+ next: { summary: "Add the padding or min size in the component that renders the control.", files: NEXT_STYLES },
278
+ "tanstack-start": { summary: "Add the padding or min size in the component that renders the control.", files: TSS_STYLES },
279
+ },
280
+ "polish/contrast": {
281
+ summary: "Raise text contrast to 4.5:1 (3:1 for large text) in the listed states by moving the text or background color to a darker or lighter step of the existing palette.",
282
+ next: {
283
+ summary: "Change the color token in app/globals.css (or the Tailwind color class) and check the dark theme values too.",
284
+ files: NEXT_STYLES,
285
+ },
286
+ "tanstack-start": {
287
+ summary: "Change the color token in the global stylesheet (or the Tailwind color class) and check the dark theme values too.",
288
+ files: TSS_STYLES,
289
+ },
290
+ },
291
+ "polish/axe": {
292
+ summary: "Fix each listed axe rule (https://dequeuniversity.com/rules/axe/ explains every id): accessible names on buttons and links, labels on inputs, valid ARIA.",
293
+ next: { summary: "Fix the markup in the component that renders the listed element.", files: ["app/page.tsx", "app/layout.tsx"] },
294
+ "tanstack-start": {
295
+ summary: "Fix the markup in the component that renders the listed element.",
296
+ files: ["src/routes/index.tsx", "src/routes/__root.tsx"],
297
+ },
298
+ },
299
+ "polish/type-scale": {
300
+ summary: "Map the font sizes of the page text onto a scale of 12 or fewer steps. Keep the site's fonts and hierarchy.",
301
+ next: { summary: "Set the size steps once (CSS variables or the Tailwind theme) and use only those.", files: NEXT_STYLES },
302
+ "tanstack-start": { summary: "Set the size steps once (CSS variables or the Tailwind theme) and use only those.", files: TSS_STYLES },
303
+ },
304
+ "polish/body-text-size": {
305
+ summary: "Raise the main paragraph text to 16 px on phones with a step of the existing type scale (for example the base step instead of the small one). Keep the font, and keep small text for captions and notes.",
306
+ next: { summary: "Change the body text class or size token (Tailwind: text-sm to text-base on paragraphs) in the components or app/globals.css.", files: NEXT_STYLES },
307
+ "tanstack-start": { summary: "Change the body text class or size token (Tailwind: text-sm to text-base on paragraphs) in the components or the global stylesheet.", files: TSS_STYLES },
308
+ },
309
+ "polish/line-length": {
310
+ summary: "Cap paragraph width at about 65 to 75 characters with max-width: 65ch (Tailwind: max-w-prose) on the text, not the whole section.",
311
+ next: { summary: "Add the max width to the listed paragraphs or their text wrapper.", files: NEXT_STYLES },
312
+ "tanstack-start": { summary: "Add the max width to the listed paragraphs or their text wrapper.", files: TSS_STYLES },
313
+ },
314
+ "polish/spacing-scale": {
315
+ summary: "Round the listed padding, margin and gap values to the nearest multiple of 4 px so spacing follows one grid.",
316
+ next: { summary: "Replace arbitrary values (for example p-[13px]) with scale steps.", files: NEXT_STYLES },
317
+ "tanstack-start": { summary: "Replace arbitrary values (for example p-[13px]) with scale steps.", files: TSS_STYLES },
318
+ },
319
+ "polish/img-dimensions": {
320
+ summary: "Give every image a width and height (or a CSS aspect-ratio) so the browser reserves its space, and serve files no larger than 2x their display size.",
321
+ next: {
322
+ summary: "Use next/image with width and height, or fill inside a sized parent with a `sizes` prop, so Next serves a resized file.",
323
+ files: ["app/page.tsx", "next.config.ts"],
324
+ },
325
+ "tanstack-start": {
326
+ summary: "Add width and height attributes to each <img> and a srcset with sizes that point at resized files.",
327
+ files: ["src/routes/index.tsx", "public/"],
328
+ },
329
+ },
330
+ "polish/dark-mode": {
331
+ summary: "Optional: add a dark theme under prefers-color-scheme: dark that swaps the background and the text color together, built from the existing palette.",
332
+ next: {
333
+ summary: "Add dark values for the color tokens in app/globals.css (or Tailwind dark: variants) and `color-scheme: light dark` on :root.",
334
+ files: ["app/globals.css", "app/layout.tsx"],
335
+ },
336
+ "tanstack-start": {
337
+ summary: "Add dark values for the color tokens in the global stylesheet (or Tailwind dark: variants) and `color-scheme: light dark` on :root.",
338
+ files: ["src/styles.css", "src/routes/__root.tsx"],
339
+ },
340
+ },
341
+ "polish/reduced-motion": {
342
+ summary: "Stop endless and long motion when the visitor asks for reduced motion: put the animations in @media (prefers-reduced-motion: no-preference), or set them to none under prefers-reduced-motion: reduce.",
343
+ next: {
344
+ summary: "Add the media query in app/globals.css; with Motion, wrap the app in `<MotionConfig reducedMotion=\"user\">`.",
345
+ files: ["app/globals.css", "app/layout.tsx"],
346
+ },
347
+ "tanstack-start": {
348
+ summary: "Add the media query in the global stylesheet; with Motion, wrap the app in `<MotionConfig reducedMotion=\"user\">`.",
349
+ files: ["src/styles.css", "src/routes/__root.tsx"],
350
+ },
351
+ },
352
+ "polish/slow-page": {
353
+ summary: "The page took longer than the check's time budget. Run sugikit check again with a longer --timeout <seconds>, and make the page lighter: smaller hero media, lazy-loaded images and video, fewer third-party scripts.",
354
+ },
355
+ "polish/browser": {
356
+ summary: "Install the headless Chromium build that Sugikit needs with `npx sugikit browsers install`. If the page failed with a TLS certificate error on a local URL, trust the dev server's CA in the system trust store. Use `sugikit check` with --no-browser only to skip the polish checks.",
357
+ },
358
+ "seo/http-status": {
359
+ summary: "Check the URL or start the dev server.",
360
+ },
361
+ "seo/fetch-blocked": {
362
+ summary: "Check the bot protection and WAF rules of your host or CDN (for example Cloudflare Bot Fight Mode, Vercel Firewall): they must allow Googlebot, Bingbot, GPTBot, ClaudeBot and PerplexityBot to fetch the page without a challenge.",
363
+ next: {
364
+ summary: "Also make sure middleware (proxy.ts in Next.js 16) does not block or challenge these user agents.",
365
+ files: ["middleware.ts", "proxy.ts"],
366
+ },
367
+ "tanstack-start": {
368
+ summary: "Also make sure global request middleware does not block or challenge these user agents.",
369
+ files: ["src/start.ts"],
370
+ },
371
+ },
372
+ "convert/link-text": {
373
+ summary: 'Rewrite each "click here", "learn more", "read more" or "here" link to say where it goes ("See pricing", "Read the setup guide"). If the visible text must stay, add an aria-label that names the target.',
374
+ next: { summary: "Edit the link text in the page or component that renders it.", files: CONTENT_NEXT },
375
+ "tanstack-start": { summary: "Edit the link text in the route or component that renders it.", files: CONTENT_TSS },
376
+ },
377
+ "convert/placeholder-text": {
378
+ summary: 'Remove leftovers: Lorem ipsum, TODO, "Your Name", "Company Inc", links to example.com, href="#" links and links that return 4xx. Point links at real pages, or remove them. Never invent names, companies or contact details: ask the owner for the real values.',
379
+ next: { summary: "Fix the text in the page components; a broken internal link needs the route under app/ or a corrected href.", files: CONTENT_NEXT },
380
+ "tanstack-start": {
381
+ summary: "Fix the text in the route components; a broken internal link needs the route under src/routes/ or a corrected href.",
382
+ files: CONTENT_TSS,
383
+ },
384
+ },
385
+ "convert/contact-visible": {
386
+ summary: "Add a contact link to the footer or header: a mailto: link, a contact page or a support link. Ask the owner for the address; never make one up.",
387
+ next: { summary: "Add the link to the shared footer or header component.", files: ["app/layout.tsx", "app/page.tsx"] },
388
+ "tanstack-start": { summary: "Add the link to the footer or header in the root route or its layout component.", files: ["src/routes/__root.tsx", "src/routes/index.tsx"] },
389
+ },
390
+ "convert/form-fields": {
391
+ summary: "Cut the sign-up form to the email field (plus a name only if it is really needed). Drop the phone field. Ask for the rest during onboarding, after sign-up.",
392
+ next: { summary: "Edit the form component and the server action or API route that reads its fields.", files: CONTENT_NEXT },
393
+ "tanstack-start": { summary: "Edit the form component and the server function that reads its fields.", files: CONTENT_TSS },
394
+ },
395
+ "convert/price-visible": {
396
+ summary: "Show the price on the page, or link a pricing page or section from the header or hero. Take prices only from the repo (pricing config, checkout setup) or from the owner; never invent a price or a plan.",
397
+ next: { summary: "Add a pricing section to the page or a Pricing link to the nav.", files: CONTENT_NEXT },
398
+ "tanstack-start": { summary: "Add a pricing section to the route or a Pricing link to the nav.", files: CONTENT_TSS },
399
+ },
400
+ "convert/hero-in-first-screen": {
401
+ summary: "Fit the h1 and the primary CTA into the first screen at 1440x900 and 390x844: cut hero top padding and decorative space, and on phones put the CTA above the hero visual. Keep the fonts, colors and layout style; only change spacing and order.",
402
+ next: { summary: "Adjust the hero section's padding and order (Tailwind md: and lg: classes or the hero CSS).", files: [...CONTENT_NEXT, "app/globals.css"] },
403
+ "tanstack-start": { summary: "Adjust the hero section's padding and order in the route or hero component and its CSS.", files: [...CONTENT_TSS, "src/styles.css"] },
404
+ },
405
+ "convert/mobile-fold": {
406
+ summary: "On a phone, show the h1 and the primary CTA in the first screen, and let the next section or more content peek in at the bottom so the page does not look finished. Reduce the hero's height (no min-height: 100vh hero with nothing below the fold); never add an arrow that does nothing.",
407
+ next: { summary: "Change the hero's mobile height and spacing (base classes before md:) in the page or hero component.", files: [...CONTENT_NEXT, "app/globals.css"] },
408
+ "tanstack-start": { summary: "Change the hero's mobile height and spacing in the route or hero component and its CSS.", files: [...CONTENT_TSS, "src/styles.css"] },
409
+ },
410
+ "convert/primary-cta-one": {
411
+ summary: "Give the first screen exactly one filled primary button for the main action. With none: fill the main CTA with the site's darkest or accent color from its existing palette. With two or more: keep one filled and turn the others into outline or text links. No new colors.",
412
+ next: { summary: "Change the button variants in the hero (and header) components.", files: CONTENT_NEXT },
413
+ "tanstack-start": { summary: "Change the button variants in the hero (and header) components.", files: CONTENT_TSS },
414
+ },
415
+ "convert/cta-salient": {
416
+ summary: "Make the primary CTA the thing that stands out, within the existing palette: label contrast at least 4.5:1, fill at least 3:1 against the background around it, and more visual weight than any other control in the hero (size, fill, space around it). Use the darkest or strongest color the site already has; never add a new hue.",
417
+ next: { summary: "Edit the primary button's classes or the theme color tokens it uses.", files: [...CONTENT_NEXT, "app/globals.css"] },
418
+ "tanstack-start": { summary: "Edit the primary button's classes or the theme color tokens it uses.", files: [...CONTENT_TSS, "src/styles.css"] },
419
+ },
420
+ "convert/cta-tap-size": {
421
+ summary: "Make the primary CTA at least 44x44 CSS px on phones: more vertical and horizontal padding (or min-height: 44px). Keep its look.",
422
+ next: { summary: "Raise the button's padding or min-height in the button or hero component.", files: CONTENT_NEXT },
423
+ "tanstack-start": { summary: "Raise the button's padding or min-height in the button or hero component.", files: CONTENT_TSS },
424
+ },
425
+ "convert/arrival-popup": {
426
+ summary: "Remove the popup, modal or cookie wall that covers the screen on arrival. Show newsletter asks inline after the value (end of a section or the page), and a cookie notice as a small bar that leaves the content usable. Do not show it on a timer within the first seconds.",
427
+ next: { summary: "Find the modal or consent component mounted in the layout or page and change when and how it shows.", files: ["app/layout.tsx", "app/page.tsx", "components/"] },
428
+ "tanstack-start": { summary: "Find the modal or consent component mounted in the root route or page and change when and how it shows.", files: ["src/routes/__root.tsx", "src/routes/index.tsx", "src/components/"] },
429
+ },
430
+ "convert/cta-works": {
431
+ summary: 'Make every primary and pricing CTA do its job in one step: point links at a real page that answers 2xx (not "#", empty or javascript:), give buttons a working click handler, and fix the error a click throws. If the right target (checkout link, download URL) is not in the repo, ask the owner.',
432
+ next: { summary: "Fix the href or onClick in the hero and pricing components; a missing page needs its route under app/.", files: CONTENT_NEXT },
433
+ "tanstack-start": { summary: "Fix the href or onClick in the hero and pricing components; a missing page needs its route under src/routes/.", files: CONTENT_TSS },
434
+ },
435
+ "convert/hero-lcp": {
436
+ summary: 'Make the hero the first thing that arrives on a phone: the largest element in the first screen should paint within 2.5 s. Preload the hero image and give it fetchpriority="high" (never loading="lazy"), serve it at the right size, and render the hero on the server, not only on the client.',
437
+ next: {
438
+ summary: "Render the hero image with next/image and `preload` (`priority` before Next.js 16) and `sizes`; keep the hero a Server Component.",
439
+ files: ["app/page.tsx", "app/layout.tsx"],
440
+ },
441
+ "tanstack-start": {
442
+ summary: 'Give the hero <img> width, height and fetchpriority="high", preload it in the route `head().links`, and keep the hero in the SSR output.',
443
+ files: ["src/routes/index.tsx", "src/routes/__root.tsx"],
444
+ },
445
+ },
446
+ "pagespeed/local-url": {
447
+ summary: "Deploy a preview to a public URL and run `sugikit psi <url>` on it.",
448
+ },
449
+ "pagespeed/no-key": {
450
+ summary: "Get a free API key (https://developers.google.com/speed/docs/insights/v5/get-started) and set it as the PSI_API_KEY environment variable.",
451
+ },
452
+ "pagespeed/api-error": {
453
+ summary: "Run `sugikit psi <url>` again later; check that the URL is public and that PSI_API_KEY is valid.",
454
+ },
455
+ };
456
+ const NEXT_IMAGES = {
457
+ summary: "Use next/image with width, height and `sizes`; it serves resized WebP or AVIF files and lazy loads images below the fold.",
458
+ files: ["app/page.tsx", "next.config.ts"],
459
+ };
460
+ const TSS_IMAGES = {
461
+ summary: 'Give each <img> width and height, a srcset with sizes that points at resized WebP or AVIF files, and loading="lazy" below the fold.',
462
+ files: ["src/routes/index.tsx", "public/"],
463
+ };
464
+ export const AUDIT_HINTS = {
465
+ "render-blocking-resources": {
466
+ next: {
467
+ summary: "Load fonts with next/font and third-party scripts with next/script (`strategy=\"lazyOnload\"` or `\"afterInteractive\"`).",
468
+ files: ["app/layout.tsx"],
469
+ },
470
+ "tanstack-start": {
471
+ summary: "Preload the main font, use font-display: swap, and load third-party scripts with async or defer in the root route `head()`.",
472
+ files: ["src/routes/__root.tsx", "src/styles.css"],
473
+ },
474
+ },
475
+ "uses-responsive-images": { next: NEXT_IMAGES, "tanstack-start": TSS_IMAGES },
476
+ "modern-image-formats": { next: NEXT_IMAGES, "tanstack-start": TSS_IMAGES },
477
+ "offscreen-images": { next: NEXT_IMAGES, "tanstack-start": TSS_IMAGES },
478
+ "unused-javascript": {
479
+ next: {
480
+ summary: "Load heavy client components with next/dynamic (dynamic import) and keep `'use client'` on small leaf components.",
481
+ files: ["app/page.tsx"],
482
+ },
483
+ "tanstack-start": {
484
+ summary: "Split heavy components with React.lazy and dynamic `import()` so Vite puts them in their own chunks.",
485
+ files: ["src/routes/index.tsx", "vite.config.ts"],
486
+ },
487
+ },
488
+ "largest-contentful-paint-element": {
489
+ next: {
490
+ summary: "If the LCP element is an image, render it with next/image and `preload` (`priority` before Next.js 16); if it is text, load its font with next/font.",
491
+ files: ["app/page.tsx", "app/layout.tsx"],
492
+ },
493
+ "tanstack-start": {
494
+ summary: 'If the LCP element is an image, give it width, height and fetchpriority="high" without loading="lazy"; if it is text, preload its font in the root route `head().links`.',
495
+ files: ["src/routes/index.tsx", "src/routes/__root.tsx"],
496
+ },
497
+ },
498
+ "font-display": {
499
+ next: { summary: "Load fonts with next/font, which sets font-display: swap.", files: ["app/layout.tsx"] },
500
+ "tanstack-start": {
501
+ summary: "Add font-display: swap to every @font-face and preload the main font with `links: [{ rel: 'preload', as: 'font', type: 'font/woff2', href, crossOrigin: 'anonymous' }]`.",
502
+ files: ["src/styles.css", "src/routes/__root.tsx"],
503
+ },
504
+ },
505
+ "unsized-images": {
506
+ next: { summary: "Use next/image with width and height, or `fill` inside a sized parent.", files: ["app/page.tsx"] },
507
+ "tanstack-start": { summary: "Add width and height attributes to each <img>.", files: ["src/routes/index.tsx"] },
508
+ },
509
+ };
510
+ export function plainDescription(description) {
511
+ const urls = [];
512
+ const text = description
513
+ .replace(/\[([^\]]*)\]\(([^)\s]+)\)/g, (_, label, url) => {
514
+ urls.push(url);
515
+ return label;
516
+ })
517
+ .replace(/\s+/g, " ")
518
+ .trim();
519
+ return urls.length ? `${text} ${urls.join(" ")}` : text;
520
+ }
521
+ export function auditFix(auditId, description, framework) {
522
+ const summary = plainDescription(description);
523
+ const specific = framework === "unknown" ? undefined : AUDIT_HINTS[auditId]?.[framework];
524
+ if (!specific)
525
+ return { summary };
526
+ return { summary: `${summary} ${specific.summary}`, framework, files: specific.files };
527
+ }
528
+ export function fixFor(id, framework) {
529
+ const entry = FIXES[id];
530
+ if (!entry)
531
+ return { summary: "See the message for what to change." };
532
+ const specific = framework === "unknown" ? undefined : entry[framework];
533
+ if (!specific)
534
+ return { summary: entry.summary };
535
+ return { summary: `${entry.summary} ${specific.summary}`, framework, files: specific.files };
536
+ }
@@ -0,0 +1,15 @@
1
+ import { type PageContext, type Rule } from "./types.js";
2
+ export declare const AI_CRAWLERS: string[];
3
+ export declare const MIN_SSR_TEXT = 400;
4
+ export declare const MAX_HERO_WORDS = 30;
5
+ export declare const geoLlmsTxt: Rule;
6
+ export declare const geoLlmsTxtFormat: Rule;
7
+ export declare const geoLlmsFullTxt: Rule;
8
+ export declare const geoAiCrawlers: Rule;
9
+ export declare const geoFaqSchema: Rule;
10
+ export declare function visibleText({ $ }: Pick<PageContext, "$">): string;
11
+ export declare const geoSsrContent: Rule;
12
+ export declare function firstSentence(text: string): string;
13
+ export declare const geoHeroStatement: Rule;
14
+ export declare const geoHeroLength: Rule;
15
+ export declare const geoRules: Rule[];