@rankcli/agent-runtime 0.0.15 → 0.0.17

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 (203) hide show
  1. package/README.md +5 -4
  2. package/dist/index.d.mts +44 -393
  3. package/dist/index.d.ts +44 -393
  4. package/dist/index.js +22098 -26131
  5. package/dist/index.mjs +11834 -15857
  6. package/package.json +10 -4
  7. package/scripts/build-deno.ts +0 -134
  8. package/src/analyzers/core-web-vitals-analyzer.test.ts +0 -236
  9. package/src/analyzers/core-web-vitals-analyzer.ts +0 -557
  10. package/src/analyzers/geo-analyzer.test.ts +0 -310
  11. package/src/analyzers/geo-analyzer.ts +0 -814
  12. package/src/analyzers/image-optimization-analyzer.test.ts +0 -145
  13. package/src/analyzers/image-optimization-analyzer.ts +0 -348
  14. package/src/analyzers/index.ts +0 -233
  15. package/src/analyzers/internal-linking-analyzer.test.ts +0 -141
  16. package/src/analyzers/internal-linking-analyzer.ts +0 -419
  17. package/src/analyzers/mobile-seo-analyzer.test.ts +0 -140
  18. package/src/analyzers/mobile-seo-analyzer.ts +0 -455
  19. package/src/analyzers/security-headers-analyzer.test.ts +0 -115
  20. package/src/analyzers/security-headers-analyzer.ts +0 -318
  21. package/src/analyzers/structured-data-analyzer.test.ts +0 -210
  22. package/src/analyzers/structured-data-analyzer.ts +0 -590
  23. package/src/audit/ai/analyzer.ts +0 -347
  24. package/src/audit/ai/index.ts +0 -29
  25. package/src/audit/ai/prompts/content-analysis.ts +0 -271
  26. package/src/audit/ai/types.ts +0 -179
  27. package/src/audit/checks/additional-checks.ts +0 -439
  28. package/src/audit/checks/agent-experience.ts +0 -108
  29. package/src/audit/checks/ai-citation-worthiness.ts +0 -399
  30. package/src/audit/checks/ai-content-structure.ts +0 -325
  31. package/src/audit/checks/ai-readiness.ts +0 -406
  32. package/src/audit/checks/anchor-text.ts +0 -179
  33. package/src/audit/checks/answer-conciseness.ts +0 -322
  34. package/src/audit/checks/asset-minification.ts +0 -270
  35. package/src/audit/checks/bing-optimization.ts +0 -206
  36. package/src/audit/checks/brand-mention-optimization.ts +0 -349
  37. package/src/audit/checks/caching-headers.ts +0 -305
  38. package/src/audit/checks/canonical-advanced.ts +0 -150
  39. package/src/audit/checks/canonical-domain.ts +0 -196
  40. package/src/audit/checks/citation-quality.ts +0 -358
  41. package/src/audit/checks/client-rendering.ts +0 -542
  42. package/src/audit/checks/color-contrast.ts +0 -342
  43. package/src/audit/checks/content-freshness.ts +0 -170
  44. package/src/audit/checks/content-science.ts +0 -589
  45. package/src/audit/checks/conversion-elements.ts +0 -526
  46. package/src/audit/checks/crawlability.ts +0 -220
  47. package/src/audit/checks/directory-listing.ts +0 -172
  48. package/src/audit/checks/dom-analysis.ts +0 -191
  49. package/src/audit/checks/dom-size.ts +0 -246
  50. package/src/audit/checks/duplicate-content.ts +0 -194
  51. package/src/audit/checks/eeat-signals.ts +0 -990
  52. package/src/audit/checks/entity-seo.ts +0 -396
  53. package/src/audit/checks/featured-snippet.ts +0 -473
  54. package/src/audit/checks/freshness-signals.ts +0 -443
  55. package/src/audit/checks/funnel-intent.ts +0 -463
  56. package/src/audit/checks/hreflang.ts +0 -174
  57. package/src/audit/checks/html-compliance.ts +0 -302
  58. package/src/audit/checks/image-dimensions.ts +0 -167
  59. package/src/audit/checks/images.ts +0 -160
  60. package/src/audit/checks/indexnow.ts +0 -275
  61. package/src/audit/checks/interactive-tools.ts +0 -475
  62. package/src/audit/checks/internal-link-graph.ts +0 -436
  63. package/src/audit/checks/keyword-analysis.ts +0 -239
  64. package/src/audit/checks/keyword-cannibalization.ts +0 -385
  65. package/src/audit/checks/keyword-placement.ts +0 -471
  66. package/src/audit/checks/links.ts +0 -273
  67. package/src/audit/checks/llms-txt.ts +0 -224
  68. package/src/audit/checks/local-seo.ts +0 -296
  69. package/src/audit/checks/mobile.ts +0 -167
  70. package/src/audit/checks/modern-images.ts +0 -226
  71. package/src/audit/checks/navboost-signals.ts +0 -395
  72. package/src/audit/checks/on-page.ts +0 -209
  73. package/src/audit/checks/page-resources.ts +0 -285
  74. package/src/audit/checks/pagination.ts +0 -180
  75. package/src/audit/checks/performance.ts +0 -153
  76. package/src/audit/checks/platform-presence.ts +0 -580
  77. package/src/audit/checks/rag-chunk-readiness.test.ts +0 -159
  78. package/src/audit/checks/rag-chunk-readiness.ts +0 -163
  79. package/src/audit/checks/redirect-analysis.ts +0 -153
  80. package/src/audit/checks/redirect-chain.ts +0 -389
  81. package/src/audit/checks/resource-hints.ts +0 -420
  82. package/src/audit/checks/responsive-css.ts +0 -247
  83. package/src/audit/checks/responsive-images.ts +0 -396
  84. package/src/audit/checks/review-ecosystem.ts +0 -415
  85. package/src/audit/checks/robots-validation.ts +0 -373
  86. package/src/audit/checks/security-headers.ts +0 -188
  87. package/src/audit/checks/security.ts +0 -144
  88. package/src/audit/checks/serp-preview.ts +0 -251
  89. package/src/audit/checks/site-maturity.ts +0 -453
  90. package/src/audit/checks/social-meta.test.ts +0 -275
  91. package/src/audit/checks/social-meta.ts +0 -134
  92. package/src/audit/checks/soft-404.ts +0 -151
  93. package/src/audit/checks/structured-data.ts +0 -238
  94. package/src/audit/checks/tech-detection.ts +0 -496
  95. package/src/audit/checks/topical-clusters.ts +0 -435
  96. package/src/audit/checks/tracker-bloat.ts +0 -462
  97. package/src/audit/checks/tracking-verification.test.ts +0 -371
  98. package/src/audit/checks/tracking-verification.ts +0 -636
  99. package/src/audit/checks/url-safety.ts +0 -682
  100. package/src/audit/deno-entry.ts +0 -66
  101. package/src/audit/discovery/index.ts +0 -15
  102. package/src/audit/discovery/link-crawler.ts +0 -233
  103. package/src/audit/discovery/repo-routes.ts +0 -347
  104. package/src/audit/engine.ts +0 -633
  105. package/src/audit/fixes/index.ts +0 -209
  106. package/src/audit/fixes/social-meta-fixes.test.ts +0 -329
  107. package/src/audit/fixes/social-meta-fixes.ts +0 -463
  108. package/src/audit/index.ts +0 -74
  109. package/src/audit/runner.test.ts +0 -299
  110. package/src/audit/runner.ts +0 -130
  111. package/src/audit/types.ts +0 -1987
  112. package/src/content/featured-snippet.ts +0 -367
  113. package/src/content/generator.test.ts +0 -534
  114. package/src/content/generator.ts +0 -501
  115. package/src/content/headline.ts +0 -317
  116. package/src/content/index.ts +0 -62
  117. package/src/content/intent.ts +0 -258
  118. package/src/content/keyword-density.ts +0 -349
  119. package/src/content/readability.ts +0 -262
  120. package/src/executor.ts +0 -336
  121. package/src/fixer/framework-fixes.test.ts +0 -489
  122. package/src/fixer/framework-fixes.ts +0 -5287
  123. package/src/fixer/index.ts +0 -6
  124. package/src/fixer/schemas.ts +0 -971
  125. package/src/fixer.ts +0 -642
  126. package/src/frameworks/detector.test.ts +0 -248
  127. package/src/frameworks/detector.ts +0 -899
  128. package/src/frameworks/index.ts +0 -68
  129. package/src/frameworks/recipes/angular.yaml +0 -171
  130. package/src/frameworks/recipes/astro.yaml +0 -206
  131. package/src/frameworks/recipes/django.yaml +0 -180
  132. package/src/frameworks/recipes/laravel.yaml +0 -137
  133. package/src/frameworks/recipes/nextjs.yaml +0 -268
  134. package/src/frameworks/recipes/nuxt.yaml +0 -175
  135. package/src/frameworks/recipes/rails.yaml +0 -188
  136. package/src/frameworks/recipes/react.yaml +0 -202
  137. package/src/frameworks/recipes/sveltekit.yaml +0 -154
  138. package/src/frameworks/recipes/vue.yaml +0 -137
  139. package/src/frameworks/recipes/wordpress.yaml +0 -209
  140. package/src/frameworks/suggestion-engine.ts +0 -357
  141. package/src/geo/geo-content.test.ts +0 -305
  142. package/src/geo/geo-content.ts +0 -266
  143. package/src/geo/geo-history.test.ts +0 -473
  144. package/src/geo/geo-history.ts +0 -433
  145. package/src/geo/geo-tracker.test.ts +0 -359
  146. package/src/geo/geo-tracker.ts +0 -411
  147. package/src/geo/index.ts +0 -11
  148. package/src/geo/llm-citation-checker.ts +0 -188
  149. package/src/git/commit-helper.test.ts +0 -261
  150. package/src/git/commit-helper.ts +0 -329
  151. package/src/git/index.ts +0 -12
  152. package/src/git/pr-helper.test.ts +0 -284
  153. package/src/git/pr-helper.ts +0 -307
  154. package/src/index.ts +0 -76
  155. package/src/keywords/ai-keyword-engine.ts +0 -1062
  156. package/src/keywords/ai-summarizer.ts +0 -387
  157. package/src/keywords/ci-mode.ts +0 -555
  158. package/src/keywords/engine.ts +0 -359
  159. package/src/keywords/index.ts +0 -151
  160. package/src/keywords/llm-judge.ts +0 -357
  161. package/src/keywords/nlp-analysis.ts +0 -706
  162. package/src/keywords/prioritizer.ts +0 -295
  163. package/src/keywords/site-crawler.ts +0 -342
  164. package/src/keywords/sources/autocomplete.ts +0 -139
  165. package/src/keywords/sources/competitive-search.ts +0 -450
  166. package/src/keywords/sources/competitor-analysis.ts +0 -374
  167. package/src/keywords/sources/dataforseo.ts +0 -206
  168. package/src/keywords/sources/free-sources.ts +0 -294
  169. package/src/keywords/sources/gsc.ts +0 -123
  170. package/src/keywords/topic-grouping.ts +0 -327
  171. package/src/keywords/types.ts +0 -144
  172. package/src/keywords/wizard.ts +0 -457
  173. package/src/loader.ts +0 -40
  174. package/src/ranking/index.ts +0 -5
  175. package/src/ranking/serp-client.ts +0 -348
  176. package/src/ranking/tracker.ts +0 -380
  177. package/src/ranking/types.ts +0 -123
  178. package/src/reports/index.ts +0 -7
  179. package/src/reports/report-generator.test.ts +0 -293
  180. package/src/reports/report-generator.ts +0 -713
  181. package/src/scheduler/alerts.test.ts +0 -458
  182. package/src/scheduler/alerts.ts +0 -328
  183. package/src/scheduler/index.ts +0 -8
  184. package/src/scheduler/scheduled-audit.test.ts +0 -377
  185. package/src/scheduler/scheduled-audit.ts +0 -149
  186. package/src/test/integration-test.ts +0 -325
  187. package/src/tools/analyzer.ts +0 -373
  188. package/src/tools/crawl.ts +0 -293
  189. package/src/tools/files.ts +0 -301
  190. package/src/tools/h1-fixer.ts +0 -249
  191. package/src/tools/index.ts +0 -67
  192. package/src/tracking/github-action.ts +0 -326
  193. package/src/tracking/google-analytics.ts +0 -265
  194. package/src/tracking/index.ts +0 -45
  195. package/src/tracking/report-generator.ts +0 -386
  196. package/src/tracking/search-console.ts +0 -335
  197. package/src/types.ts +0 -148
  198. package/src/utils/http.ts +0 -302
  199. package/src/wasm-adapter.ts +0 -297
  200. package/src/wasm-entry.ts +0 -14
  201. package/tsconfig.json +0 -17
  202. package/tsup.wasm.config.ts +0 -26
  203. package/vitest.config.ts +0 -15
@@ -1,358 +0,0 @@
1
- /**
2
- * Citation Quality Checks
3
- *
4
- * AI prioritizes content that cites reputable sources. Well-cited content
5
- * demonstrates expertise and trustworthiness (E-E-A-T signals).
6
- * These checks verify proper citation practices.
7
- */
8
-
9
- import * as cheerio from 'cheerio';
10
- import type { AuditIssue } from '../types.js';
11
-
12
- // Reputable source domains by category
13
- const REPUTABLE_SOURCES = {
14
- academic: [
15
- 'scholar.google.com', 'pubmed.ncbi.nlm.nih.gov', 'ncbi.nlm.nih.gov',
16
- 'arxiv.org', 'jstor.org', 'researchgate.net', 'sciencedirect.com',
17
- 'nature.com', 'science.org', 'springer.com', 'wiley.com',
18
- ],
19
- government: [
20
- 'gov', 'gov.uk', 'europa.eu', 'un.org', 'who.int', 'cdc.gov',
21
- 'nih.gov', 'fda.gov', 'epa.gov', 'sec.gov', 'ftc.gov',
22
- ],
23
- educational: [
24
- '.edu', 'mit.edu', 'stanford.edu', 'harvard.edu', 'oxford.ac.uk',
25
- 'cambridge.org', 'coursera.org', 'khanacademy.org',
26
- ],
27
- authoritative: [
28
- 'wikipedia.org', 'britannica.com', 'statista.com', 'pewresearch.org',
29
- 'gallup.com', 'mckinsey.com', 'hbr.org', 'forbes.com', 'reuters.com',
30
- 'apnews.com', 'bbc.com', 'nytimes.com', 'wsj.com', 'economist.com',
31
- ],
32
- technical: [
33
- 'github.com', 'stackoverflow.com', 'developer.mozilla.org', 'w3.org',
34
- 'ietf.org', 'rfc-editor.org', 'docs.google.com', 'developers.google.com',
35
- ],
36
- };
37
-
38
- export interface CitationQualityData {
39
- totalLinks: number;
40
- externalLinks: number;
41
- citationLinks: number;
42
- reputableSources: {
43
- academic: string[];
44
- government: string[];
45
- educational: string[];
46
- authoritative: string[];
47
- technical: string[];
48
- };
49
- citationPatterns: {
50
- hasInlineCitations: boolean;
51
- hasReferencesSection: boolean;
52
- hasStatistics: boolean;
53
- statisticsWithSources: number;
54
- statisticsWithoutSources: number;
55
- };
56
- citationScore: number;
57
- }
58
-
59
- export function analyzeCitationQuality(
60
- html: string,
61
- url: string
62
- ): { issues: AuditIssue[]; data: CitationQualityData } {
63
- const issues: AuditIssue[] = [];
64
- const $ = cheerio.load(html);
65
- const parsedUrl = new URL(url);
66
- const currentDomain = parsedUrl.hostname;
67
-
68
- // Remove nav, footer, aside for content analysis
69
- const $content = $('body').clone();
70
- $content.find('nav, footer, aside, script, style, noscript').remove();
71
-
72
- // Collect all links
73
- const links = $content.find('a[href]');
74
- let totalLinks = 0;
75
- let externalLinks = 0;
76
- let citationLinks = 0;
77
-
78
- const reputableSources: CitationQualityData['reputableSources'] = {
79
- academic: [],
80
- government: [],
81
- educational: [],
82
- authoritative: [],
83
- technical: [],
84
- };
85
-
86
- links.each((_, link) => {
87
- const href = $(link).attr('href');
88
- if (!href) return;
89
-
90
- totalLinks++;
91
-
92
- try {
93
- const linkUrl = new URL(href, url);
94
-
95
- // Skip internal links
96
- if (linkUrl.hostname === currentDomain || linkUrl.hostname.endsWith(`.${currentDomain}`)) {
97
- return;
98
- }
99
-
100
- // Skip common non-citation links
101
- if (linkUrl.hostname.includes('facebook.com') ||
102
- linkUrl.hostname.includes('twitter.com') ||
103
- linkUrl.hostname.includes('instagram.com') ||
104
- linkUrl.hostname.includes('linkedin.com/share') ||
105
- linkUrl.hostname.includes('pinterest.com')) {
106
- return;
107
- }
108
-
109
- externalLinks++;
110
-
111
- // Check if it's a reputable source
112
- const hostname = linkUrl.hostname.toLowerCase();
113
-
114
- for (const source of REPUTABLE_SOURCES.academic) {
115
- if (hostname.includes(source)) {
116
- reputableSources.academic.push(hostname);
117
- citationLinks++;
118
- return;
119
- }
120
- }
121
-
122
- for (const source of REPUTABLE_SOURCES.government) {
123
- if (hostname.endsWith(source) || hostname.includes(`.${source}`)) {
124
- reputableSources.government.push(hostname);
125
- citationLinks++;
126
- return;
127
- }
128
- }
129
-
130
- for (const source of REPUTABLE_SOURCES.educational) {
131
- if (hostname.endsWith(source) || hostname.includes(source)) {
132
- reputableSources.educational.push(hostname);
133
- citationLinks++;
134
- return;
135
- }
136
- }
137
-
138
- for (const source of REPUTABLE_SOURCES.authoritative) {
139
- if (hostname.includes(source)) {
140
- reputableSources.authoritative.push(hostname);
141
- citationLinks++;
142
- return;
143
- }
144
- }
145
-
146
- for (const source of REPUTABLE_SOURCES.technical) {
147
- if (hostname.includes(source)) {
148
- reputableSources.technical.push(hostname);
149
- citationLinks++;
150
- return;
151
- }
152
- }
153
-
154
- } catch {
155
- // Invalid URL
156
- }
157
- });
158
-
159
- // Check for citation patterns
160
- const bodyText = $content.text();
161
- const bodyHtml = $content.html() || '';
162
-
163
- // Inline citations like [1], (Source: X), (2023), etc.
164
- const hasInlineCitations =
165
- /\[\d+\]/.test(bodyText) ||
166
- /\(Source:/i.test(bodyText) ||
167
- /\(Citation:/i.test(bodyText) ||
168
- /according to/i.test(bodyText) ||
169
- /study (by|from|shows|found)/i.test(bodyText);
170
-
171
- // References section
172
- const hasReferencesSection =
173
- /(references|sources|citations|bibliography|works cited)/i.test(
174
- $('h2, h3, h4, h5, h6').text()
175
- ) ||
176
- $('#references, .references, #sources, .sources, #citations').length > 0;
177
-
178
- // Statistics detection
179
- const statisticPatterns = [
180
- /(\d+(?:\.\d+)?)\s*%/g, // Percentages
181
- /(\d+(?:,\d{3})*(?:\.\d+)?)\s*(million|billion|trillion)/gi, // Large numbers
182
- /\$(\d+(?:,\d{3})*(?:\.\d+)?)/g, // Dollar amounts
183
- /(\d+)\s*out of\s*(\d+)/gi, // Ratios
184
- /(\d+)x\s/gi, // Multipliers
185
- ];
186
-
187
- let statisticsWithSources = 0;
188
- let statisticsWithoutSources = 0;
189
-
190
- // Find paragraphs with statistics
191
- $content.find('p').each((_, p) => {
192
- const pText = $(p).text();
193
- const pHtml = $(p).html() || '';
194
-
195
- let hasStatistic = false;
196
- for (const pattern of statisticPatterns) {
197
- if (pattern.test(pText)) {
198
- hasStatistic = true;
199
- pattern.lastIndex = 0; // Reset regex
200
- break;
201
- }
202
- }
203
-
204
- if (hasStatistic) {
205
- // Check if paragraph has a citation link
206
- const hasLink = $(p).find('a[href]').length > 0;
207
- const hasCitationText = /\(.*\d{4}\)|according to|source:|study/i.test(pText);
208
-
209
- if (hasLink || hasCitationText) {
210
- statisticsWithSources++;
211
- } else {
212
- statisticsWithoutSources++;
213
- }
214
- }
215
- });
216
-
217
- const hasStatistics = statisticsWithSources + statisticsWithoutSources > 0;
218
-
219
- // Calculate citation score (0-100)
220
- let citationScore = 30; // Base score
221
-
222
- // Reputable source bonuses
223
- if (reputableSources.academic.length > 0) citationScore += 15;
224
- if (reputableSources.government.length > 0) citationScore += 15;
225
- if (reputableSources.educational.length > 0) citationScore += 10;
226
- if (reputableSources.authoritative.length > 0) citationScore += 10;
227
- if (reputableSources.technical.length > 0) citationScore += 5;
228
-
229
- // Citation pattern bonuses
230
- if (hasInlineCitations) citationScore += 10;
231
- if (hasReferencesSection) citationScore += 10;
232
-
233
- // Statistics citation bonus/penalty
234
- if (hasStatistics) {
235
- const citedRatio = statisticsWithSources / (statisticsWithSources + statisticsWithoutSources);
236
- if (citedRatio >= 0.8) citationScore += 10;
237
- else if (citedRatio >= 0.5) citationScore += 5;
238
- else if (citedRatio < 0.3) citationScore -= 10;
239
- }
240
-
241
- // Penalty for no external links at all
242
- if (externalLinks === 0) citationScore -= 20;
243
-
244
- citationScore = Math.max(0, Math.min(100, citationScore));
245
-
246
- // Generate issues
247
-
248
- // No reputable sources cited
249
- const totalReputable = Object.values(reputableSources).flat().length;
250
- if (totalReputable === 0 && externalLinks > 0) {
251
- issues.push({
252
- code: 'AI_NO_REPUTABLE_CITATIONS',
253
- severity: 'warning',
254
- category: 'ai-readiness',
255
- title: 'No reputable sources cited',
256
- description: 'Content has external links but none to recognized authoritative sources. AI prioritizes content that cites reputable sources.',
257
- impact: 'Lower E-E-A-T signals and reduced likelihood of AI citing your content.',
258
- howToFix: 'Add citations to reputable sources: academic papers, government sites (.gov), educational institutions (.edu), or established publications.',
259
- affectedUrls: [url],
260
- details: {
261
- externalLinks,
262
- reputableLinks: 0,
263
- suggestedSources: [
264
- 'Academic: scholar.google.com, pubmed.ncbi.nlm.nih.gov',
265
- 'Government: .gov, who.int, cdc.gov',
266
- 'Technical: developer.mozilla.org, w3.org',
267
- ],
268
- },
269
- });
270
- }
271
-
272
- // No external links at all
273
- if (externalLinks === 0 && totalLinks > 0) {
274
- issues.push({
275
- code: 'AI_NO_EXTERNAL_CITATIONS',
276
- severity: 'warning',
277
- category: 'ai-readiness',
278
- title: 'No external sources linked',
279
- description: 'Content has no external links. AI values content that references and links to authoritative sources.',
280
- impact: 'Appears self-contained without external validation, reducing trust signals for AI.',
281
- howToFix: 'Add relevant external links to support your claims. Link to studies, official documentation, or authoritative sources.',
282
- affectedUrls: [url],
283
- });
284
- }
285
-
286
- // Statistics without sources
287
- if (statisticsWithoutSources > 0) {
288
- issues.push({
289
- code: 'AI_UNCITED_STATISTICS',
290
- severity: 'warning',
291
- category: 'ai-readiness',
292
- title: 'Statistics without source citations',
293
- description: `Found ${statisticsWithoutSources} statistic(s) without linked sources. AI is trained to prefer claims backed by citations.`,
294
- impact: 'Uncited statistics reduce content credibility and E-E-A-T signals.',
295
- howToFix: 'Add source links or citations for all statistics. Include the source name and year when possible (e.g., "according to [Source, 2024]").',
296
- affectedUrls: [url],
297
- details: {
298
- statisticsWithSources,
299
- statisticsWithoutSources,
300
- citedRatio: statisticsWithSources / (statisticsWithSources + statisticsWithoutSources),
301
- },
302
- });
303
- }
304
-
305
- // No references section for content-heavy pages
306
- const wordCount = bodyText.split(/\s+/).length;
307
- if (wordCount > 1000 && !hasReferencesSection && citationLinks > 0) {
308
- issues.push({
309
- code: 'AI_NO_REFERENCES_SECTION',
310
- severity: 'notice',
311
- category: 'ai-readiness',
312
- title: 'No dedicated references section',
313
- description: 'Long-form content with citations but no dedicated references section. A references section signals academic rigor.',
314
- impact: 'Missing opportunity to demonstrate comprehensive research and boost E-E-A-T.',
315
- howToFix: 'Add a "References" or "Sources" section at the end listing all cited sources with full attribution.',
316
- affectedUrls: [url],
317
- });
318
- }
319
-
320
- // Low citation score
321
- if (citationScore < 40) {
322
- issues.push({
323
- code: 'AI_LOW_CITATION_QUALITY',
324
- severity: 'warning',
325
- category: 'ai-readiness',
326
- title: 'Content citation quality needs improvement',
327
- description: `Citation quality score: ${citationScore}/100. Well-cited content ranks higher in AI search results.`,
328
- impact: 'Low citation quality signals reduce E-E-A-T and AI citation likelihood.',
329
- howToFix: 'Improve citations: 1) Link to reputable sources, 2) Cite statistics with sources, 3) Add a references section, 4) Use inline citations for claims.',
330
- affectedUrls: [url],
331
- details: {
332
- citationScore,
333
- externalLinks,
334
- reputableSources: totalReputable,
335
- statisticsWithSources,
336
- statisticsWithoutSources,
337
- },
338
- });
339
- }
340
-
341
- return {
342
- issues,
343
- data: {
344
- totalLinks,
345
- externalLinks,
346
- citationLinks,
347
- reputableSources,
348
- citationPatterns: {
349
- hasInlineCitations,
350
- hasReferencesSection,
351
- hasStatistics,
352
- statisticsWithSources,
353
- statisticsWithoutSources,
354
- },
355
- citationScore,
356
- },
357
- };
358
- }