@rankcli/agent-runtime 0.0.1
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/README.md +242 -0
- package/dist/analyzer-2CSWIQGD.mjs +6 -0
- package/dist/chunk-YNZYHEYM.mjs +774 -0
- package/dist/index.d.mts +4012 -0
- package/dist/index.d.ts +4012 -0
- package/dist/index.js +29672 -0
- package/dist/index.mjs +28602 -0
- package/package.json +53 -0
- package/scripts/build-deno.ts +134 -0
- package/src/audit/ai/analyzer.ts +347 -0
- package/src/audit/ai/index.ts +29 -0
- package/src/audit/ai/prompts/content-analysis.ts +271 -0
- package/src/audit/ai/types.ts +179 -0
- package/src/audit/checks/additional-checks.ts +439 -0
- package/src/audit/checks/ai-citation-worthiness.ts +399 -0
- package/src/audit/checks/ai-content-structure.ts +325 -0
- package/src/audit/checks/ai-readiness.ts +339 -0
- package/src/audit/checks/anchor-text.ts +179 -0
- package/src/audit/checks/answer-conciseness.ts +322 -0
- package/src/audit/checks/asset-minification.ts +270 -0
- package/src/audit/checks/bing-optimization.ts +206 -0
- package/src/audit/checks/brand-mention-optimization.ts +349 -0
- package/src/audit/checks/caching-headers.ts +305 -0
- package/src/audit/checks/canonical-advanced.ts +150 -0
- package/src/audit/checks/canonical-domain.ts +196 -0
- package/src/audit/checks/citation-quality.ts +358 -0
- package/src/audit/checks/client-rendering.ts +542 -0
- package/src/audit/checks/color-contrast.ts +342 -0
- package/src/audit/checks/content-freshness.ts +170 -0
- package/src/audit/checks/content-science.ts +589 -0
- package/src/audit/checks/conversion-elements.ts +526 -0
- package/src/audit/checks/crawlability.ts +220 -0
- package/src/audit/checks/directory-listing.ts +172 -0
- package/src/audit/checks/dom-analysis.ts +191 -0
- package/src/audit/checks/dom-size.ts +246 -0
- package/src/audit/checks/duplicate-content.ts +194 -0
- package/src/audit/checks/eeat-signals.ts +990 -0
- package/src/audit/checks/entity-seo.ts +396 -0
- package/src/audit/checks/featured-snippet.ts +473 -0
- package/src/audit/checks/freshness-signals.ts +443 -0
- package/src/audit/checks/funnel-intent.ts +463 -0
- package/src/audit/checks/hreflang.ts +174 -0
- package/src/audit/checks/html-compliance.ts +302 -0
- package/src/audit/checks/image-dimensions.ts +167 -0
- package/src/audit/checks/images.ts +160 -0
- package/src/audit/checks/indexnow.ts +275 -0
- package/src/audit/checks/interactive-tools.ts +475 -0
- package/src/audit/checks/internal-link-graph.ts +436 -0
- package/src/audit/checks/keyword-analysis.ts +239 -0
- package/src/audit/checks/keyword-cannibalization.ts +385 -0
- package/src/audit/checks/keyword-placement.ts +471 -0
- package/src/audit/checks/links.ts +203 -0
- package/src/audit/checks/llms-txt.ts +224 -0
- package/src/audit/checks/local-seo.ts +296 -0
- package/src/audit/checks/mobile.ts +167 -0
- package/src/audit/checks/modern-images.ts +226 -0
- package/src/audit/checks/navboost-signals.ts +395 -0
- package/src/audit/checks/on-page.ts +209 -0
- package/src/audit/checks/page-resources.ts +285 -0
- package/src/audit/checks/pagination.ts +180 -0
- package/src/audit/checks/performance.ts +153 -0
- package/src/audit/checks/platform-presence.ts +580 -0
- package/src/audit/checks/redirect-analysis.ts +153 -0
- package/src/audit/checks/redirect-chain.ts +389 -0
- package/src/audit/checks/resource-hints.ts +420 -0
- package/src/audit/checks/responsive-css.ts +247 -0
- package/src/audit/checks/responsive-images.ts +396 -0
- package/src/audit/checks/review-ecosystem.ts +415 -0
- package/src/audit/checks/robots-validation.ts +373 -0
- package/src/audit/checks/security-headers.ts +172 -0
- package/src/audit/checks/security.ts +144 -0
- package/src/audit/checks/serp-preview.ts +251 -0
- package/src/audit/checks/site-maturity.ts +444 -0
- package/src/audit/checks/social-meta.test.ts +275 -0
- package/src/audit/checks/social-meta.ts +134 -0
- package/src/audit/checks/soft-404.ts +151 -0
- package/src/audit/checks/structured-data.ts +238 -0
- package/src/audit/checks/tech-detection.ts +496 -0
- package/src/audit/checks/topical-clusters.ts +435 -0
- package/src/audit/checks/tracker-bloat.ts +462 -0
- package/src/audit/checks/tracking-verification.test.ts +371 -0
- package/src/audit/checks/tracking-verification.ts +636 -0
- package/src/audit/checks/url-safety.ts +682 -0
- package/src/audit/deno-entry.ts +66 -0
- package/src/audit/discovery/index.ts +15 -0
- package/src/audit/discovery/link-crawler.ts +232 -0
- package/src/audit/discovery/repo-routes.ts +347 -0
- package/src/audit/engine.ts +620 -0
- package/src/audit/fixes/index.ts +209 -0
- package/src/audit/fixes/social-meta-fixes.test.ts +329 -0
- package/src/audit/fixes/social-meta-fixes.ts +463 -0
- package/src/audit/index.ts +74 -0
- package/src/audit/runner.test.ts +299 -0
- package/src/audit/runner.ts +130 -0
- package/src/audit/types.ts +1953 -0
- package/src/content/featured-snippet.ts +367 -0
- package/src/content/generator.test.ts +534 -0
- package/src/content/generator.ts +501 -0
- package/src/content/headline.ts +317 -0
- package/src/content/index.ts +62 -0
- package/src/content/intent.ts +258 -0
- package/src/content/keyword-density.ts +349 -0
- package/src/content/readability.ts +262 -0
- package/src/executor.ts +336 -0
- package/src/fixer.ts +416 -0
- package/src/frameworks/detector.test.ts +248 -0
- package/src/frameworks/detector.ts +371 -0
- package/src/frameworks/index.ts +68 -0
- package/src/frameworks/recipes/angular.yaml +171 -0
- package/src/frameworks/recipes/astro.yaml +206 -0
- package/src/frameworks/recipes/django.yaml +180 -0
- package/src/frameworks/recipes/laravel.yaml +137 -0
- package/src/frameworks/recipes/nextjs.yaml +268 -0
- package/src/frameworks/recipes/nuxt.yaml +175 -0
- package/src/frameworks/recipes/rails.yaml +188 -0
- package/src/frameworks/recipes/react.yaml +202 -0
- package/src/frameworks/recipes/sveltekit.yaml +154 -0
- package/src/frameworks/recipes/vue.yaml +137 -0
- package/src/frameworks/recipes/wordpress.yaml +209 -0
- package/src/frameworks/suggestion-engine.ts +320 -0
- package/src/geo/geo-content.test.ts +305 -0
- package/src/geo/geo-content.ts +266 -0
- package/src/geo/geo-history.test.ts +473 -0
- package/src/geo/geo-history.ts +433 -0
- package/src/geo/geo-tracker.test.ts +359 -0
- package/src/geo/geo-tracker.ts +411 -0
- package/src/geo/index.ts +10 -0
- package/src/git/commit-helper.test.ts +261 -0
- package/src/git/commit-helper.ts +329 -0
- package/src/git/index.ts +12 -0
- package/src/git/pr-helper.test.ts +284 -0
- package/src/git/pr-helper.ts +307 -0
- package/src/index.ts +66 -0
- package/src/keywords/ai-keyword-engine.ts +1062 -0
- package/src/keywords/ai-summarizer.ts +387 -0
- package/src/keywords/ci-mode.ts +555 -0
- package/src/keywords/engine.ts +359 -0
- package/src/keywords/index.ts +151 -0
- package/src/keywords/llm-judge.ts +357 -0
- package/src/keywords/nlp-analysis.ts +706 -0
- package/src/keywords/prioritizer.ts +295 -0
- package/src/keywords/site-crawler.ts +342 -0
- package/src/keywords/sources/autocomplete.ts +139 -0
- package/src/keywords/sources/competitive-search.ts +450 -0
- package/src/keywords/sources/competitor-analysis.ts +374 -0
- package/src/keywords/sources/dataforseo.ts +206 -0
- package/src/keywords/sources/free-sources.ts +294 -0
- package/src/keywords/sources/gsc.ts +123 -0
- package/src/keywords/topic-grouping.ts +327 -0
- package/src/keywords/types.ts +144 -0
- package/src/keywords/wizard.ts +457 -0
- package/src/loader.ts +40 -0
- package/src/reports/index.ts +7 -0
- package/src/reports/report-generator.test.ts +293 -0
- package/src/reports/report-generator.ts +713 -0
- package/src/scheduler/alerts.test.ts +458 -0
- package/src/scheduler/alerts.ts +328 -0
- package/src/scheduler/index.ts +8 -0
- package/src/scheduler/scheduled-audit.test.ts +377 -0
- package/src/scheduler/scheduled-audit.ts +149 -0
- package/src/test/integration-test.ts +325 -0
- package/src/tools/analyzer.ts +373 -0
- package/src/tools/crawl.ts +293 -0
- package/src/tools/files.ts +301 -0
- package/src/tools/h1-fixer.ts +249 -0
- package/src/tools/index.ts +67 -0
- package/src/tracking/github-action.ts +326 -0
- package/src/tracking/google-analytics.ts +265 -0
- package/src/tracking/index.ts +45 -0
- package/src/tracking/report-generator.ts +386 -0
- package/src/tracking/search-console.ts +335 -0
- package/src/types.ts +134 -0
- package/src/utils/http.ts +302 -0
- package/src/wasm-adapter.ts +297 -0
- package/src/wasm-entry.ts +14 -0
- package/tsconfig.json +17 -0
- package/tsup.wasm.config.ts +26 -0
- package/vitest.config.ts +15 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
// AI Content Analysis Prompts
|
|
2
|
+
|
|
3
|
+
export const CONTENT_ANALYSIS_SYSTEM = `You are an expert SEO analyst with deep knowledge of search engine algorithms, content quality signals, and Google's E-E-A-T (Experience, Expertise, Authoritativeness, Trustworthiness) guidelines.
|
|
4
|
+
|
|
5
|
+
Your task is to analyze webpage content and provide actionable SEO insights. Be specific, practical, and data-driven in your analysis.
|
|
6
|
+
|
|
7
|
+
Always respond with valid JSON matching the specified schema.`;
|
|
8
|
+
|
|
9
|
+
export const CONTENT_ANALYSIS_USER = (context: {
|
|
10
|
+
url: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
h1?: string;
|
|
13
|
+
metaDescription?: string;
|
|
14
|
+
textContent: string;
|
|
15
|
+
wordCount: number;
|
|
16
|
+
headings?: { level: number; text: string }[];
|
|
17
|
+
}) => `Analyze this webpage content for SEO quality:
|
|
18
|
+
|
|
19
|
+
<webpage>
|
|
20
|
+
URL: ${context.url}
|
|
21
|
+
Title: ${context.title || 'Not found'}
|
|
22
|
+
H1: ${context.h1 || 'Not found'}
|
|
23
|
+
Meta Description: ${context.metaDescription || 'Not found'}
|
|
24
|
+
Word Count: ${context.wordCount}
|
|
25
|
+
Headings: ${JSON.stringify(context.headings || [])}
|
|
26
|
+
|
|
27
|
+
Content (first 5000 chars):
|
|
28
|
+
${context.textContent.substring(0, 5000)}
|
|
29
|
+
</webpage>
|
|
30
|
+
|
|
31
|
+
Analyze this content and return JSON with this exact structure:
|
|
32
|
+
{
|
|
33
|
+
"overallScore": <0-100 integer>,
|
|
34
|
+
"searchIntentMatch": <0-100 integer - how well content satisfies likely search intent>,
|
|
35
|
+
"contentDepth": "<shallow|moderate|comprehensive>",
|
|
36
|
+
"keywordNaturalness": <0-100 integer - 100 = perfectly natural, 0 = keyword stuffed>,
|
|
37
|
+
"eeatSignals": {
|
|
38
|
+
"experience": [<strings describing first-hand experience indicators found>],
|
|
39
|
+
"expertise": [<strings describing expertise signals like credentials, depth of knowledge>],
|
|
40
|
+
"authority": [<strings describing authority signals like citations, references>],
|
|
41
|
+
"trust": [<strings describing trust signals like contact info, transparency>]
|
|
42
|
+
},
|
|
43
|
+
"improvements": [
|
|
44
|
+
{
|
|
45
|
+
"priority": <1-5 integer, 1 = highest>,
|
|
46
|
+
"suggestion": "<specific actionable improvement>",
|
|
47
|
+
"impact": "<expected SEO impact of this change>"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"uniqueValue": "<one sentence describing what unique value this page provides>",
|
|
51
|
+
"missingTopics": [<topics that comprehensive coverage should include>],
|
|
52
|
+
"targetKeyword": "<the primary keyword this page appears to target>",
|
|
53
|
+
"keywordDensity": <percentage as decimal, e.g., 2.5>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Be critical but constructive. Focus on high-impact improvements.`;
|
|
57
|
+
|
|
58
|
+
export const META_ANALYSIS_SYSTEM = `You are an expert SEO copywriter specializing in meta tags that drive clicks from search results.
|
|
59
|
+
|
|
60
|
+
You understand:
|
|
61
|
+
- Google's SERP display rules (title ~60 chars, description ~155 chars)
|
|
62
|
+
- Click psychology and emotional triggers
|
|
63
|
+
- Keyword optimization without stuffing
|
|
64
|
+
- Brand positioning in titles
|
|
65
|
+
|
|
66
|
+
Always respond with valid JSON matching the specified schema.`;
|
|
67
|
+
|
|
68
|
+
export const META_ANALYSIS_USER = (context: {
|
|
69
|
+
url: string;
|
|
70
|
+
title?: string;
|
|
71
|
+
metaDescription?: string;
|
|
72
|
+
h1?: string;
|
|
73
|
+
pageType?: string;
|
|
74
|
+
industry?: string;
|
|
75
|
+
}) => `Analyze these meta tags and suggest improvements:
|
|
76
|
+
|
|
77
|
+
<page>
|
|
78
|
+
URL: ${context.url}
|
|
79
|
+
Current Title: ${context.title || 'Missing'}
|
|
80
|
+
Current Description: ${context.metaDescription || 'Missing'}
|
|
81
|
+
H1: ${context.h1 || 'Not found'}
|
|
82
|
+
Page Type: ${context.pageType || 'Unknown'}
|
|
83
|
+
Industry: ${context.industry || 'General'}
|
|
84
|
+
</page>
|
|
85
|
+
|
|
86
|
+
Return JSON with this exact structure:
|
|
87
|
+
{
|
|
88
|
+
"titleAnalysis": {
|
|
89
|
+
"effectiveness": <0-100 integer>,
|
|
90
|
+
"clickPotential": <0-100 integer>,
|
|
91
|
+
"keywordPlacement": "<optimal|suboptimal|missing>",
|
|
92
|
+
"emotionalTriggers": [<power words or emotional triggers found>],
|
|
93
|
+
"suggestions": [<3-5 alternative title suggestions that would perform better>]
|
|
94
|
+
},
|
|
95
|
+
"descriptionAnalysis": {
|
|
96
|
+
"effectiveness": <0-100 integer>,
|
|
97
|
+
"hasCallToAction": <boolean>,
|
|
98
|
+
"hasUniqueSellingProposition": <boolean>,
|
|
99
|
+
"keywordNaturalness": <0-100 integer>,
|
|
100
|
+
"suggestions": [<3-5 alternative description suggestions>]
|
|
101
|
+
},
|
|
102
|
+
"serpPrediction": {
|
|
103
|
+
"predictedCTR": <predicted click-through rate as percentage, e.g., 3.5>,
|
|
104
|
+
"competitiveStrength": "<weak|average|strong>",
|
|
105
|
+
"improvements": [<specific changes that would improve CTR>]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
Make suggestions compelling, keyword-optimized, and within character limits.`;
|
|
110
|
+
|
|
111
|
+
export const SCHEMA_ANALYSIS_SYSTEM = `You are an expert in structured data and Schema.org markup for SEO.
|
|
112
|
+
|
|
113
|
+
You understand:
|
|
114
|
+
- All Schema.org types and their properties
|
|
115
|
+
- Google's rich result requirements
|
|
116
|
+
- JSON-LD best practices
|
|
117
|
+
- How to maximize rich snippet eligibility
|
|
118
|
+
|
|
119
|
+
Always respond with valid JSON matching the specified schema.`;
|
|
120
|
+
|
|
121
|
+
export const SCHEMA_ANALYSIS_USER = (context: {
|
|
122
|
+
url: string;
|
|
123
|
+
title?: string;
|
|
124
|
+
textContent: string;
|
|
125
|
+
existingSchema?: object[];
|
|
126
|
+
pageType?: string;
|
|
127
|
+
}) => `Analyze this page and recommend structured data:
|
|
128
|
+
|
|
129
|
+
<page>
|
|
130
|
+
URL: ${context.url}
|
|
131
|
+
Title: ${context.title || 'Unknown'}
|
|
132
|
+
Detected Page Type: ${context.pageType || 'Unknown'}
|
|
133
|
+
Existing Schema: ${JSON.stringify(context.existingSchema || [], null, 2)}
|
|
134
|
+
|
|
135
|
+
Content Summary (first 2000 chars):
|
|
136
|
+
${context.textContent.substring(0, 2000)}
|
|
137
|
+
</page>
|
|
138
|
+
|
|
139
|
+
Return JSON with this exact structure:
|
|
140
|
+
{
|
|
141
|
+
"detectedPageType": "<article|product|service|faq|how-to|local-business|organization|person|event|recipe|other>",
|
|
142
|
+
"recommendedSchemas": [
|
|
143
|
+
{
|
|
144
|
+
"type": "<Schema.org type name>",
|
|
145
|
+
"priority": "<critical|high|medium|low>",
|
|
146
|
+
"reason": "<why this schema is recommended>"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"generatedSchemas": [
|
|
150
|
+
{
|
|
151
|
+
"type": "<Schema.org type>",
|
|
152
|
+
"jsonLd": <complete valid JSON-LD object>,
|
|
153
|
+
"explanation": "<what this schema does and why>"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"richSnippetPotential": [
|
|
157
|
+
{
|
|
158
|
+
"type": "<rich result type: FAQ, How-to, Review, Product, etc.>",
|
|
159
|
+
"eligible": <boolean>,
|
|
160
|
+
"requirements": [<what's needed to qualify>]
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
Generate complete, valid JSON-LD that can be directly used.`;
|
|
166
|
+
|
|
167
|
+
export const AI_VISIBILITY_SYSTEM = `You are an expert in how AI systems (LLMs like ChatGPT, Claude, Perplexity) crawl, understand, and cite web content.
|
|
168
|
+
|
|
169
|
+
You understand:
|
|
170
|
+
- How LLMs parse and understand content structure
|
|
171
|
+
- The llms.txt standard for AI guidance
|
|
172
|
+
- When to allow/block AI crawlers
|
|
173
|
+
- How to optimize for AI citation
|
|
174
|
+
|
|
175
|
+
Always respond with valid JSON matching the specified schema.`;
|
|
176
|
+
|
|
177
|
+
export const AI_VISIBILITY_USER = (context: {
|
|
178
|
+
url: string;
|
|
179
|
+
title?: string;
|
|
180
|
+
textContent: string;
|
|
181
|
+
headings?: { level: number; text: string }[];
|
|
182
|
+
hasLlmsTxt: boolean;
|
|
183
|
+
llmsTxtContent?: string;
|
|
184
|
+
blockedBots: string[];
|
|
185
|
+
}) => `Analyze this page's AI/LLM visibility:
|
|
186
|
+
|
|
187
|
+
<page>
|
|
188
|
+
URL: ${context.url}
|
|
189
|
+
Title: ${context.title || 'Unknown'}
|
|
190
|
+
Has llms.txt: ${context.hasLlmsTxt}
|
|
191
|
+
llms.txt content: ${context.llmsTxtContent || 'N/A'}
|
|
192
|
+
Blocked AI Bots: ${context.blockedBots.join(', ') || 'None'}
|
|
193
|
+
|
|
194
|
+
Heading Structure:
|
|
195
|
+
${(context.headings || []).map(h => ' '.repeat(h.level - 1) + h.text).join('\n')}
|
|
196
|
+
|
|
197
|
+
Content (first 3000 chars):
|
|
198
|
+
${context.textContent.substring(0, 3000)}
|
|
199
|
+
</page>
|
|
200
|
+
|
|
201
|
+
Return JSON with this exact structure:
|
|
202
|
+
{
|
|
203
|
+
"llmReadability": {
|
|
204
|
+
"score": <0-100 integer>,
|
|
205
|
+
"structureClarity": <0-100 integer - how clear is the content structure>,
|
|
206
|
+
"contextClarity": <0-100 integer - how clear is the page's purpose/topic>,
|
|
207
|
+
"citationPotential": <0-100 integer - likelihood of being cited by AI>,
|
|
208
|
+
"improvements": [<specific improvements for AI readability>]
|
|
209
|
+
},
|
|
210
|
+
"botAccessRecommendation": {
|
|
211
|
+
"shouldAllowGPTBot": <boolean>,
|
|
212
|
+
"shouldAllowClaudeBot": <boolean>,
|
|
213
|
+
"shouldAllowPerplexityBot": <boolean>,
|
|
214
|
+
"shouldAllowGoogleExtended": <boolean>,
|
|
215
|
+
"rationale": "<explanation of bot access recommendation>"
|
|
216
|
+
},
|
|
217
|
+
"llmsTxtSuggestion": {
|
|
218
|
+
"content": "<suggested llms.txt content>",
|
|
219
|
+
"explanation": "<why this llms.txt is recommended>"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
Consider the site's likely goals when recommending bot access.`;
|
|
224
|
+
|
|
225
|
+
export const FIX_PRIORITIZATION_SYSTEM = `You are an SEO strategist who excels at prioritizing fixes for maximum impact with minimum effort.
|
|
226
|
+
|
|
227
|
+
You understand:
|
|
228
|
+
- Which SEO issues have the biggest ranking impact
|
|
229
|
+
- Implementation effort for different types of fixes
|
|
230
|
+
- How to batch related fixes together
|
|
231
|
+
- Quick wins vs long-term improvements
|
|
232
|
+
|
|
233
|
+
Always respond with valid JSON matching the specified schema.`;
|
|
234
|
+
|
|
235
|
+
export const FIX_PRIORITIZATION_USER = (context: {
|
|
236
|
+
issues: { code: string; severity: string; title: string; category: string }[];
|
|
237
|
+
url: string;
|
|
238
|
+
framework?: string;
|
|
239
|
+
}) => `Prioritize these SEO issues by impact and effort:
|
|
240
|
+
|
|
241
|
+
<context>
|
|
242
|
+
URL: ${context.url}
|
|
243
|
+
Framework: ${context.framework || 'Unknown'}
|
|
244
|
+
</context>
|
|
245
|
+
|
|
246
|
+
<issues>
|
|
247
|
+
${context.issues.map(i => `- [${i.severity.toUpperCase()}] ${i.code}: ${i.title} (${i.category})`).join('\n')}
|
|
248
|
+
</issues>
|
|
249
|
+
|
|
250
|
+
Return JSON with this exact structure:
|
|
251
|
+
{
|
|
252
|
+
"prioritizedIssues": [
|
|
253
|
+
{
|
|
254
|
+
"issueCode": "<issue code>",
|
|
255
|
+
"impactScore": <0-100 integer - SEO impact if fixed>,
|
|
256
|
+
"effortScore": <0-100 integer - effort to fix, 100 = very hard>,
|
|
257
|
+
"roiScore": <calculated as impact / effort, higher is better>,
|
|
258
|
+
"rationale": "<why this priority>"
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"fixBatches": [
|
|
262
|
+
{
|
|
263
|
+
"batch": <1, 2, 3, etc.>,
|
|
264
|
+
"theme": "<batch theme like 'Meta Tags' or 'Technical SEO'>",
|
|
265
|
+
"estimatedImpact": "<description of combined impact>",
|
|
266
|
+
"issueCodes": [<issue codes in this batch>]
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
Sort prioritizedIssues by roiScore descending. Group related fixes into batches.`;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// AI-Powered SEO Analysis Types
|
|
2
|
+
|
|
3
|
+
export interface AIConfig {
|
|
4
|
+
openaiApiKey: string;
|
|
5
|
+
model?: 'gpt-4o' | 'gpt-4o-mini' | 'gpt-4-turbo';
|
|
6
|
+
maxTokens?: number;
|
|
7
|
+
temperature?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Content Analysis Types
|
|
11
|
+
export interface AIContentAnalysis {
|
|
12
|
+
overallScore: number;
|
|
13
|
+
searchIntentMatch: number;
|
|
14
|
+
contentDepth: 'shallow' | 'moderate' | 'comprehensive';
|
|
15
|
+
keywordNaturalness: number;
|
|
16
|
+
|
|
17
|
+
eeatSignals: {
|
|
18
|
+
experience: string[];
|
|
19
|
+
expertise: string[];
|
|
20
|
+
authority: string[];
|
|
21
|
+
trust: string[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
improvements: {
|
|
25
|
+
priority: number;
|
|
26
|
+
suggestion: string;
|
|
27
|
+
impact: string;
|
|
28
|
+
}[];
|
|
29
|
+
|
|
30
|
+
uniqueValue: string;
|
|
31
|
+
missingTopics: string[];
|
|
32
|
+
targetKeyword?: string;
|
|
33
|
+
keywordDensity?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Meta Tag Analysis Types
|
|
37
|
+
export interface AIMetaAnalysis {
|
|
38
|
+
titleAnalysis: {
|
|
39
|
+
effectiveness: number;
|
|
40
|
+
clickPotential: number;
|
|
41
|
+
keywordPlacement: 'optimal' | 'suboptimal' | 'missing';
|
|
42
|
+
emotionalTriggers: string[];
|
|
43
|
+
suggestions: string[];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
descriptionAnalysis: {
|
|
47
|
+
effectiveness: number;
|
|
48
|
+
hasCallToAction: boolean;
|
|
49
|
+
hasUniqueSellingProposition: boolean;
|
|
50
|
+
keywordNaturalness: number;
|
|
51
|
+
suggestions: string[];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
serpPrediction: {
|
|
55
|
+
predictedCTR: number;
|
|
56
|
+
competitiveStrength: 'weak' | 'average' | 'strong';
|
|
57
|
+
improvements: string[];
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Schema/Structured Data Analysis Types
|
|
62
|
+
export interface AISchemaAnalysis {
|
|
63
|
+
detectedPageType: string;
|
|
64
|
+
recommendedSchemas: {
|
|
65
|
+
type: string;
|
|
66
|
+
priority: 'critical' | 'high' | 'medium' | 'low';
|
|
67
|
+
reason: string;
|
|
68
|
+
}[];
|
|
69
|
+
|
|
70
|
+
generatedSchemas: {
|
|
71
|
+
type: string;
|
|
72
|
+
jsonLd: object;
|
|
73
|
+
explanation: string;
|
|
74
|
+
}[];
|
|
75
|
+
|
|
76
|
+
richSnippetPotential: {
|
|
77
|
+
type: string;
|
|
78
|
+
eligible: boolean;
|
|
79
|
+
requirements: string[];
|
|
80
|
+
}[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Link Quality Analysis Types
|
|
84
|
+
export interface AILinkAnalysis {
|
|
85
|
+
internalLinkQuality: {
|
|
86
|
+
topicalRelevance: number;
|
|
87
|
+
anchorTextQuality: 'descriptive' | 'generic' | 'over-optimized';
|
|
88
|
+
distribution: 'balanced' | 'top-heavy' | 'sparse';
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
suggestedInternalLinks: {
|
|
92
|
+
targetUrl: string;
|
|
93
|
+
suggestedAnchor: string;
|
|
94
|
+
contextReason: string;
|
|
95
|
+
}[];
|
|
96
|
+
|
|
97
|
+
externalLinkQuality: {
|
|
98
|
+
authorityScore: number;
|
|
99
|
+
relevanceScore: number;
|
|
100
|
+
concerningLinks: {
|
|
101
|
+
url: string;
|
|
102
|
+
concern: string;
|
|
103
|
+
}[];
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// AI Visibility Analysis Types
|
|
108
|
+
export interface AIVisibilityAnalysis {
|
|
109
|
+
llmReadability: {
|
|
110
|
+
score: number;
|
|
111
|
+
structureClarity: number;
|
|
112
|
+
contextClarity: number;
|
|
113
|
+
citationPotential: number;
|
|
114
|
+
improvements: string[];
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
botAccessRecommendation: {
|
|
118
|
+
shouldAllowGPTBot: boolean;
|
|
119
|
+
shouldAllowClaudeBot: boolean;
|
|
120
|
+
shouldAllowPerplexityBot: boolean;
|
|
121
|
+
shouldAllowGoogleExtended: boolean;
|
|
122
|
+
rationale: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
llmsTxtSuggestion?: {
|
|
126
|
+
content: string;
|
|
127
|
+
explanation: string;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Fix Prioritization Types
|
|
132
|
+
export interface AIFixPrioritization {
|
|
133
|
+
prioritizedIssues: {
|
|
134
|
+
issueCode: string;
|
|
135
|
+
impactScore: number;
|
|
136
|
+
effortScore: number;
|
|
137
|
+
roiScore: number;
|
|
138
|
+
rationale: string;
|
|
139
|
+
}[];
|
|
140
|
+
|
|
141
|
+
fixBatches: {
|
|
142
|
+
batch: number;
|
|
143
|
+
theme: string;
|
|
144
|
+
estimatedImpact: string;
|
|
145
|
+
issueCodes: string[];
|
|
146
|
+
}[];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Combined AI Analysis Result
|
|
150
|
+
export interface AIAnalysisResult {
|
|
151
|
+
content?: AIContentAnalysis;
|
|
152
|
+
meta?: AIMetaAnalysis;
|
|
153
|
+
schema?: AISchemaAnalysis;
|
|
154
|
+
links?: AILinkAnalysis;
|
|
155
|
+
aiVisibility?: AIVisibilityAnalysis;
|
|
156
|
+
fixPrioritization?: AIFixPrioritization;
|
|
157
|
+
|
|
158
|
+
// Metadata
|
|
159
|
+
analysisTime: number;
|
|
160
|
+
tokensUsed: number;
|
|
161
|
+
modelUsed: string;
|
|
162
|
+
cached: boolean;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Page Context for AI Analysis
|
|
166
|
+
export interface PageContext {
|
|
167
|
+
url: string;
|
|
168
|
+
title?: string;
|
|
169
|
+
metaDescription?: string;
|
|
170
|
+
h1?: string;
|
|
171
|
+
headings?: { level: number; text: string }[];
|
|
172
|
+
textContent: string;
|
|
173
|
+
wordCount: number;
|
|
174
|
+
links?: { href: string; text: string; isInternal: boolean }[];
|
|
175
|
+
images?: { src: string; alt?: string }[];
|
|
176
|
+
schema?: object[];
|
|
177
|
+
framework?: string;
|
|
178
|
+
industry?: string;
|
|
179
|
+
}
|