@rivi-software/agentic-seo-check 0.1.0 → 0.2.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 (144) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +124 -18
  3. package/dist/brand.d.ts +11 -0
  4. package/dist/brand.js +22 -0
  5. package/dist/brand.js.map +1 -0
  6. package/dist/cli.js +174 -86
  7. package/dist/cli.js.map +1 -1
  8. package/dist/core/aeo/audit.d.ts +44 -0
  9. package/dist/core/aeo/audit.js +310 -0
  10. package/dist/core/aeo/audit.js.map +1 -0
  11. package/dist/core/aeo/bots.d.ts +30 -0
  12. package/dist/core/aeo/bots.js +299 -0
  13. package/dist/core/aeo/bots.js.map +1 -0
  14. package/dist/core/aeo/llms-txt.d.ts +8 -0
  15. package/dist/core/aeo/llms-txt.js +88 -0
  16. package/dist/core/aeo/llms-txt.js.map +1 -0
  17. package/dist/core/aeo/page.d.ts +53 -0
  18. package/dist/core/aeo/page.js +312 -0
  19. package/dist/core/aeo/page.js.map +1 -0
  20. package/dist/core/aeo/probe.d.ts +10 -0
  21. package/dist/core/aeo/probe.js +53 -0
  22. package/dist/core/aeo/probe.js.map +1 -0
  23. package/dist/core/aeo/site-rules.d.ts +13 -0
  24. package/dist/core/aeo/site-rules.js +178 -0
  25. package/dist/core/aeo/site-rules.js.map +1 -0
  26. package/dist/core/audit.d.ts +37 -16
  27. package/dist/core/audit.js +389 -249
  28. package/dist/core/audit.js.map +1 -1
  29. package/dist/core/concurrency.d.ts +4 -4
  30. package/dist/core/concurrency.js +33 -23
  31. package/dist/core/concurrency.js.map +1 -1
  32. package/dist/core/crawl.d.ts +9 -5
  33. package/dist/core/crawl.js +271 -123
  34. package/dist/core/crawl.js.map +1 -1
  35. package/dist/core/fetch.d.ts +5 -5
  36. package/dist/core/fetch.js +151 -100
  37. package/dist/core/fetch.js.map +1 -1
  38. package/dist/core/html/answer.d.ts +4 -0
  39. package/dist/core/html/answer.js +198 -0
  40. package/dist/core/html/answer.js.map +1 -0
  41. package/dist/core/html/dom.d.ts +17 -0
  42. package/dist/core/html/dom.js +83 -0
  43. package/dist/core/html/dom.js.map +1 -0
  44. package/dist/core/html/extract.d.ts +2 -2
  45. package/dist/core/html/extract.js +102 -111
  46. package/dist/core/html/extract.js.map +1 -1
  47. package/dist/core/html/structured-data.d.ts +16 -6
  48. package/dist/core/html/structured-data.js +180 -145
  49. package/dist/core/html/structured-data.js.map +1 -1
  50. package/dist/core/html/text.d.ts +14 -14
  51. package/dist/core/html/text.js +110 -107
  52. package/dist/core/html/text.js.map +1 -1
  53. package/dist/core/lighthouse.d.ts +26 -25
  54. package/dist/core/lighthouse.js +181 -105
  55. package/dist/core/lighthouse.js.map +1 -1
  56. package/dist/core/performance-rules.d.ts +2 -2
  57. package/dist/core/performance-rules.js +105 -33
  58. package/dist/core/performance-rules.js.map +1 -1
  59. package/dist/core/render-rules.d.ts +5 -4
  60. package/dist/core/render-rules.js +129 -62
  61. package/dist/core/render-rules.js.map +1 -1
  62. package/dist/core/render.d.ts +2 -2
  63. package/dist/core/render.js +29 -23
  64. package/dist/core/render.js.map +1 -1
  65. package/dist/core/report/markdown.d.ts +4 -2
  66. package/dist/core/report/markdown.js +210 -129
  67. package/dist/core/report/markdown.js.map +1 -1
  68. package/dist/core/robots.d.ts +12 -5
  69. package/dist/core/robots.js +43 -17
  70. package/dist/core/robots.js.map +1 -1
  71. package/dist/core/rules/aeo.d.ts +11 -0
  72. package/dist/core/rules/aeo.js +423 -0
  73. package/dist/core/rules/aeo.js.map +1 -0
  74. package/dist/core/rules/canonical.d.ts +1 -1
  75. package/dist/core/rules/canonical.js +93 -57
  76. package/dist/core/rules/canonical.js.map +1 -1
  77. package/dist/core/rules/content.js +40 -26
  78. package/dist/core/rules/content.js.map +1 -1
  79. package/dist/core/rules/document.js +64 -41
  80. package/dist/core/rules/document.js.map +1 -1
  81. package/dist/core/rules/headings.js +58 -38
  82. package/dist/core/rules/headings.js.map +1 -1
  83. package/dist/core/rules/hreflang.js +70 -38
  84. package/dist/core/rules/hreflang.js.map +1 -1
  85. package/dist/core/rules/images.js +44 -26
  86. package/dist/core/rules/images.js.map +1 -1
  87. package/dist/core/rules/index.d.ts +10 -6
  88. package/dist/core/rules/index.js +43 -36
  89. package/dist/core/rules/index.js.map +1 -1
  90. package/dist/core/rules/indexing.d.ts +2 -2
  91. package/dist/core/rules/indexing.js +48 -26
  92. package/dist/core/rules/indexing.js.map +1 -1
  93. package/dist/core/rules/keyword.js +84 -47
  94. package/dist/core/rules/keyword.js.map +1 -1
  95. package/dist/core/rules/links.js +72 -37
  96. package/dist/core/rules/links.js.map +1 -1
  97. package/dist/core/rules/meta.js +55 -34
  98. package/dist/core/rules/meta.js.map +1 -1
  99. package/dist/core/rules/response.js +75 -41
  100. package/dist/core/rules/response.js.map +1 -1
  101. package/dist/core/rules/rule.d.ts +6 -6
  102. package/dist/core/rules/rule.js +36 -36
  103. package/dist/core/rules/rule.js.map +1 -1
  104. package/dist/core/rules/social.js +86 -45
  105. package/dist/core/rules/social.js.map +1 -1
  106. package/dist/core/rules/structured-data.d.ts +6 -4
  107. package/dist/core/rules/structured-data.js +314 -102
  108. package/dist/core/rules/structured-data.js.map +1 -1
  109. package/dist/core/rules/title.js +48 -33
  110. package/dist/core/rules/title.js.map +1 -1
  111. package/dist/core/score.d.ts +5 -3
  112. package/dist/core/score.js +11 -9
  113. package/dist/core/score.js.map +1 -1
  114. package/dist/core/site-rules.d.ts +3 -3
  115. package/dist/core/site-rules.js +409 -198
  116. package/dist/core/site-rules.js.map +1 -1
  117. package/dist/core/sitemap.d.ts +5 -5
  118. package/dist/core/sitemap.js +109 -64
  119. package/dist/core/sitemap.js.map +1 -1
  120. package/dist/core/static.d.ts +2 -2
  121. package/dist/core/static.js +210 -112
  122. package/dist/core/static.js.map +1 -1
  123. package/dist/core/summary.d.ts +2 -2
  124. package/dist/core/summary.js +11 -6
  125. package/dist/core/summary.js.map +1 -1
  126. package/dist/core/types.d.ts +189 -14
  127. package/dist/core/types.js +15 -8
  128. package/dist/core/types.js.map +1 -1
  129. package/dist/core/url.d.ts +11 -11
  130. package/dist/core/url.js +122 -70
  131. package/dist/core/url.js.map +1 -1
  132. package/dist/index.d.ts +15 -11
  133. package/dist/index.js +11 -9
  134. package/dist/index.js.map +1 -1
  135. package/dist/mcp-bin.js +7 -4
  136. package/dist/mcp-bin.js.map +1 -1
  137. package/dist/mcp.d.ts +3 -3
  138. package/dist/mcp.js +437 -121
  139. package/dist/mcp.js.map +1 -1
  140. package/dist/version.d.ts +0 -1
  141. package/dist/version.js +4 -2
  142. package/dist/version.js.map +1 -1
  143. package/package.json +32 -10
  144. package/skills/seo-audit/SKILL.md +8 -2
@@ -1,59 +1,74 @@
1
- import { isGenericTitle } from '../html/text.js';
2
- import { defineRule, GOOGLE_DOCS } from './rule.js';
1
+ import { isGenericTitle } from "../html/text.js";
2
+ import { defineRule, GOOGLE_DOCS } from "./rule.js";
3
3
  export const titleRules = [
4
4
  defineRule({
5
- id: 'title.missing',
6
- category: 'title',
7
- severity: 'error',
8
- description: 'The page has no <title> element or it is empty.',
9
- recommendation: 'Add a unique, descriptive <title> in <head> (about 30-60 characters) that states what the page is about.',
5
+ id: "title.missing",
6
+ category: "title",
7
+ severity: "error",
8
+ description: "The page has no <title> element or it is empty.",
9
+ recommendation: "Add a unique, descriptive <title> in <head> (about 30-60 characters) that states what the page is about.",
10
10
  docs: GOOGLE_DOCS.titles,
11
- }, ({ page }, make) => (page.title ? null : make('Page has no <title> or the title is empty.', { selector: 'head > title' }))),
11
+ }, ({ page }, make) => page.title
12
+ ? null
13
+ : make("Page has no <title> or the title is empty.", {
14
+ selector: "head > title",
15
+ })),
12
16
  defineRule({
13
- id: 'title.multiple',
14
- category: 'title',
15
- severity: 'warning',
16
- description: 'More than one <title> element is present.',
17
- recommendation: 'Keep exactly one <title>. Browsers and crawlers may pick different ones when several exist.',
17
+ id: "title.multiple",
18
+ category: "title",
19
+ severity: "warning",
20
+ description: "More than one <title> element is present.",
21
+ recommendation: "Keep exactly one <title>. Browsers and crawlers may pick different ones when several exist.",
18
22
  docs: GOOGLE_DOCS.titles,
19
23
  }, ({ page }, make) => page.titles.length > 1
20
- ? make(`Page has ${page.titles.length} <title> elements.`, { selector: 'title', evidence: { titles: page.titles } })
24
+ ? make(`Page has ${page.titles.length} <title> elements.`, {
25
+ selector: "title",
26
+ evidence: { titles: page.titles },
27
+ })
21
28
  : null),
22
29
  defineRule({
23
- id: 'title.too-long',
24
- category: 'title',
25
- severity: 'warning',
26
- description: 'Title is longer than the configured maximum (default 60 characters) and will be truncated in search results.',
27
- recommendation: 'Shorten the title to roughly 60 characters or fewer, keeping the most important words first.',
30
+ id: "title.too-long",
31
+ category: "title",
32
+ severity: "warning",
33
+ description: "Title is longer than the configured maximum (default 60 characters) and will be truncated in search results.",
34
+ recommendation: "Shorten the title to roughly 60 characters or fewer, keeping the most important words first.",
28
35
  docs: GOOGLE_DOCS.titles,
29
36
  }, ({ page, thresholds }, make) => page.title && page.title.length > thresholds.titleMaxChars
30
37
  ? make(`Title is ${page.title.length} characters (max ${thresholds.titleMaxChars}).`, {
31
- selector: 'head > title',
32
- evidence: { title: page.title, length: page.title.length, max: thresholds.titleMaxChars },
38
+ selector: "head > title",
39
+ evidence: {
40
+ title: page.title,
41
+ length: page.title.length,
42
+ max: thresholds.titleMaxChars,
43
+ },
33
44
  })
34
45
  : null),
35
46
  defineRule({
36
- id: 'title.too-short',
37
- category: 'title',
38
- severity: 'info',
39
- description: 'Title is shorter than the configured minimum (default 30 characters).',
40
- recommendation: 'Consider a more descriptive title that includes the page topic and, where sensible, the brand.',
47
+ id: "title.too-short",
48
+ category: "title",
49
+ severity: "info",
50
+ description: "Title is shorter than the configured minimum (default 30 characters).",
51
+ recommendation: "Consider a more descriptive title that includes the page topic and, where sensible, the brand.",
41
52
  docs: GOOGLE_DOCS.titles,
42
53
  }, ({ page, thresholds }, make) => page.title && page.title.length < thresholds.titleMinChars
43
54
  ? make(`Title is only ${page.title.length} characters (recommended at least ${thresholds.titleMinChars}).`, {
44
- selector: 'head > title',
45
- evidence: { title: page.title, length: page.title.length, min: thresholds.titleMinChars },
55
+ selector: "head > title",
56
+ evidence: {
57
+ title: page.title,
58
+ length: page.title.length,
59
+ min: thresholds.titleMinChars,
60
+ },
46
61
  })
47
62
  : null),
48
63
  defineRule({
49
- id: 'title.generic',
50
- category: 'title',
51
- severity: 'warning',
64
+ id: "title.generic",
65
+ category: "title",
66
+ severity: "warning",
52
67
  description: 'Title is a framework default or placeholder such as "React App", "Create Next App", "Home" or "Untitled".',
53
- recommendation: 'Replace the placeholder with a title that describes this page. In frameworks, set it per route (metadata export, <Head>, useHead, <svelte:head>, etc.).',
68
+ recommendation: "Replace the placeholder with a title that describes this page. In frameworks, set it per route (metadata export, <Head>, useHead, <svelte:head>, etc.).",
54
69
  docs: GOOGLE_DOCS.titles,
55
70
  }, ({ page }, make) => page.title && isGenericTitle(page.title)
56
- ? make(`Title "${page.title}" looks like a placeholder or framework default.`, { selector: 'head > title', evidence: { title: page.title } })
71
+ ? make(`Title "${page.title}" looks like a placeholder or framework default.`, { selector: "head > title", evidence: { title: page.title } })
57
72
  : null),
58
73
  ];
59
74
  //# sourceMappingURL=title.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"title.js","sourceRoot":"","sources":["../../../src/core/rules/title.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,UAAU,CACR;QACE,EAAE,EAAE,eAAe;QACnB,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE,iDAAiD;QAC9D,cAAc,EAAE,0GAA0G;QAC1H,IAAI,EAAE,WAAW,CAAC,MAAM;KACzB,EACD,CAAC,EAAE,IAAI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,eAAe;QACnB,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,SAAS;QACnB,WAAW,EACT,2GAA2G;QAC7G,cAAc,EACZ,yJAAyJ;QAC3J,IAAI,EAAE,WAAW,CAAC,MAAM;KACzB,EACD,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,CACjB,IAAI,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QACtC,CAAC,CAAC,IAAI,CACF,UAAU,IAAI,CAAC,KAAK,kDAAkD,EACtE,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAC9D;QACH,CAAC,CAAC,IAAI,CACX;CACF,CAAC"}
@@ -1,3 +1,5 @@
1
- import type { Finding, PageAudit, SeverityCounts } from './types.js';
2
- export declare function pageScore(counts: SeverityCounts): number;
3
- export declare function siteScore(pages: PageAudit[], siteFindings: Finding[]): number;
1
+ import type { Finding, SeverityCounts } from "./types.js";
2
+ export declare const pageScore: (counts: SeverityCounts) => number;
3
+ export declare const siteScore: (pages: {
4
+ score: number;
5
+ }[], siteFindings: Finding[]) => number;
@@ -1,15 +1,17 @@
1
1
  const PAGE_WEIGHTS = { error: 15, warning: 5, info: 1 };
2
2
  const SITE_WEIGHTS = { error: 10, warning: 3, info: 0.5 };
3
- export function pageScore(counts) {
4
- const deduction = counts.error * PAGE_WEIGHTS.error + counts.warning * PAGE_WEIGHTS.warning + counts.info * PAGE_WEIGHTS.info;
3
+ const clamp = (n) => Math.max(0, Math.min(100, n));
4
+ export const pageScore = (counts) => {
5
+ const deduction = counts.error * PAGE_WEIGHTS.error +
6
+ counts.warning * PAGE_WEIGHTS.warning +
7
+ counts.info * PAGE_WEIGHTS.info;
5
8
  return clamp(Math.round(100 - deduction));
6
- }
7
- export function siteScore(pages, siteFindings) {
8
- const avg = pages.length ? pages.reduce((sum, p) => sum + p.score, 0) / pages.length : 100;
9
+ };
10
+ export const siteScore = (pages, siteFindings) => {
11
+ const avg = pages.length
12
+ ? pages.reduce((sum, p) => sum + p.score, 0) / pages.length
13
+ : 100;
9
14
  const deduction = siteFindings.reduce((sum, f) => sum + SITE_WEIGHTS[f.severity], 0);
10
15
  return clamp(Math.round(avg - deduction));
11
- }
12
- function clamp(n) {
13
- return Math.max(0, Math.min(100, n));
14
- }
16
+ };
15
17
  //# sourceMappingURL=score.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"score.js","sourceRoot":"","sources":["../../src/core/score.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAW,CAAC;AACjE,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAW,CAAC;AAEnE,MAAM,UAAU,SAAS,CAAC,MAAsB;IAC9C,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;IAC9H,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAkB,EAAE,YAAuB;IACnE,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;IAC3F,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAA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CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM;QAC3D,CAAC,CAAC,GAAG,CAAC;IAER,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CACnC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,EAC1C,CAAC,CACF,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ExtractedPage, Finding, ResponseInfo, RobotsTxtInfo, RuleMeta, SitemapInfo, Thresholds, CrawlStats } from './types.js';
1
+ import type { ExtractedPage, Finding, ResponseInfo, RobotsTxtInfo, RuleMeta, SitemapInfo, Thresholds, CrawlStats } from "./types.js";
2
2
  export declare const SITE_RULES: RuleMeta[];
3
3
  export interface PageRecord {
4
4
  /** Normalized final URL (or synthetic URL for files). */
@@ -40,7 +40,7 @@ export interface ProbeResults {
40
40
  }
41
41
  export interface SiteContext {
42
42
  startUrl: string;
43
- source: 'crawl' | 'directory';
43
+ source: "crawl" | "directory";
44
44
  pages: PageRecord[];
45
45
  /** Status of every internal URL that was fetched or probed, keyed by normalized URL. */
46
46
  linkChecks: Map<string, LinkCheck>;
@@ -61,4 +61,4 @@ export interface SiteContext {
61
61
  /** Directory audits: HTML files nobody links to. */
62
62
  unlinkedPages?: string[];
63
63
  }
64
- export declare function runSiteRules(ctx: SiteContext): Finding[];
64
+ export declare const runSiteRules: (ctx: SiteContext) => Finding[];