seomd-cli 1.4.0 → 2.0.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 (37) hide show
  1. package/PROVIDER_SPEC.md +125 -0
  2. package/README.md +54 -190
  3. package/SKILL.md +44 -0
  4. package/bin/seomd.js +78 -31
  5. package/package.json +11 -7
  6. package/src/commands/analyze.js +90 -90
  7. package/src/commands/check.js +301 -0
  8. package/src/commands/doctor.js +109 -0
  9. package/src/commands/generate.js +202 -0
  10. package/src/commands/init.js +123 -62
  11. package/src/commands/status.js +92 -76
  12. package/src/commands/sync.js +84 -70
  13. package/src/commands/validate.js +52 -25
  14. package/src/generators/directory.js +43 -110
  15. package/src/generators/reverse.js +46 -56
  16. package/src/generators/seomd.js +197 -44
  17. package/src/providers/http.js +67 -0
  18. package/src/providers/index.js +194 -0
  19. package/src/utils/agent-wiring.js +97 -0
  20. package/src/utils/api-client.js +14 -56
  21. package/src/utils/constants.js +110 -12
  22. package/src/utils/parser.js +114 -25
  23. package/src/utils/repo-scanner.js +207 -0
  24. package/src/utils/writeback.js +171 -82
  25. package/src/validators/seomd.js +255 -93
  26. package/scripts/release-contributors.js +0 -196
  27. package/scripts/release-notes.js +0 -194
  28. package/src/templates/blog/SEO.REVERSE.md +0 -176
  29. package/src/templates/blog/SEO.md +0 -233
  30. package/src/templates/ecommerce/SEO.REVERSE.md +0 -199
  31. package/src/templates/ecommerce/SEO.md +0 -239
  32. package/src/templates/local/SEO.REVERSE.md +0 -222
  33. package/src/templates/local/SEO.md +0 -245
  34. package/src/templates/marketplace/SEO.REVERSE.md +0 -222
  35. package/src/templates/marketplace/SEO.md +0 -245
  36. package/src/templates/saas/SEO.REVERSE.md +0 -268
  37. package/src/templates/saas/SEO.md +0 -257
@@ -0,0 +1,194 @@
1
+ import dotenv from 'dotenv';
2
+ import { getProviderConfig } from '../utils/parser.js';
3
+ import { createHttpClient } from './http.js';
4
+
5
+ export const KNOWN_PROVIDERS = {
6
+ foxcite: {
7
+ name: 'foxcite',
8
+ displayName: 'Foxcite',
9
+ defaultEndpoint: 'https://api.foxcite.com',
10
+ dashboardUrl: 'https://app.foxcite.com',
11
+ nativeProtocol: true,
12
+ capabilities: { analyze: true, sync: true, playbooks: true, x402: true },
13
+ },
14
+ semrush: {
15
+ name: 'semrush',
16
+ displayName: 'SEMrush',
17
+ defaultEndpoint: null,
18
+ dashboardUrl: 'https://www.semrush.com',
19
+ nativeProtocol: false,
20
+ capabilities: { analyze: false, sync: false, playbooks: false, x402: false },
21
+ },
22
+ ahrefs: {
23
+ name: 'ahrefs',
24
+ displayName: 'Ahrefs',
25
+ defaultEndpoint: null,
26
+ dashboardUrl: 'https://ahrefs.com',
27
+ nativeProtocol: false,
28
+ capabilities: { analyze: false, sync: false, playbooks: false, x402: false },
29
+ },
30
+ profound: {
31
+ name: 'profound',
32
+ displayName: 'Profound',
33
+ defaultEndpoint: null,
34
+ dashboardUrl: 'https://www.tryprofound.com',
35
+ nativeProtocol: false,
36
+ capabilities: { analyze: false, sync: false, playbooks: false, x402: false },
37
+ },
38
+ peec: {
39
+ name: 'peec',
40
+ displayName: 'Peec AI',
41
+ defaultEndpoint: null,
42
+ dashboardUrl: 'https://peec.ai',
43
+ nativeProtocol: false,
44
+ capabilities: { analyze: false, sync: false, playbooks: false, x402: false },
45
+ },
46
+ custom: {
47
+ name: 'custom',
48
+ displayName: 'Custom Provider',
49
+ defaultEndpoint: null,
50
+ dashboardUrl: null,
51
+ nativeProtocol: true,
52
+ capabilities: { analyze: true, sync: true, playbooks: true, x402: false },
53
+ },
54
+ };
55
+
56
+ const MAX_SYNC_QUERY_BYTES = 4000;
57
+
58
+ /**
59
+ * Resolves the active SEO.md intelligence provider from env vars + SEO.md config.
60
+ * Never freezes credentials at import time and never silently hardcodes a vendor
61
+ * when no provider or credentials are configured.
62
+ *
63
+ * @param {any} [seoData] - Parsed SEO.md data
64
+ * @returns {object|null} Provider adapter or null if unconfigured
65
+ */
66
+ export function resolveProvider(seoData = null) {
67
+ dotenv.config();
68
+
69
+ const cfg = getProviderConfig(seoData);
70
+ const envProvider = process.env.SEOMD_PROVIDER?.trim().toLowerCase() || null;
71
+ const envUrl = process.env.SEOMD_API_URL?.trim() || null;
72
+ const apiKey = process.env.SEOMD_API_KEY?.trim() || null;
73
+ const paymentToken = process.env.SEOMD_PAYMENT_TOKEN?.trim() || null;
74
+ const domainHeader = process.env.SEOMD_DOMAIN?.trim() || null;
75
+
76
+ const declaredName = (envProvider || cfg.name || '').trim().toLowerCase() || null;
77
+ const explicitEndpoint = envUrl || cfg.endpoint || null;
78
+
79
+ let providerName = declaredName;
80
+ if (!providerName && explicitEndpoint) {
81
+ providerName = explicitEndpoint.includes('foxcite.com') ? 'foxcite' : 'custom';
82
+ } else if (!providerName && (apiKey || paymentToken)) {
83
+ // Backward compatibility for users who only configured SEOMD_API_KEY
84
+ providerName = 'foxcite';
85
+ }
86
+
87
+ if (!providerName) {
88
+ return null;
89
+ }
90
+
91
+ const meta = KNOWN_PROVIDERS[providerName] || {
92
+ name: providerName,
93
+ displayName: providerName,
94
+ defaultEndpoint: null,
95
+ dashboardUrl: null,
96
+ nativeProtocol: Boolean(explicitEndpoint),
97
+ capabilities: {
98
+ analyze: Boolean(explicitEndpoint),
99
+ sync: Boolean(explicitEndpoint),
100
+ playbooks: Boolean(explicitEndpoint),
101
+ x402: false,
102
+ },
103
+ };
104
+
105
+ const endpoint = explicitEndpoint || meta.defaultEndpoint || null;
106
+ const hasEndpoint = Boolean(endpoint);
107
+ const hasAuth = Boolean(apiKey || paymentToken);
108
+
109
+ const capabilities = hasEndpoint
110
+ ? { ...meta.capabilities, analyze: true, sync: true }
111
+ : { ...meta.capabilities };
112
+
113
+ const assertSupported = (capability) => {
114
+ if (!endpoint) {
115
+ throw new Error(
116
+ `Provider '${meta.displayName}' does not have a native SEO.md '${capability}' endpoint configured yet.\n\n` +
117
+ `Options:\n` +
118
+ ` 1. Point SEOMD_API_URL (or provider.endpoint in SEO.md) to a compatible bridge/adapter implementing PROVIDER_SPEC.md.\n` +
119
+ ` 2. Ask ${meta.displayName} to add native SEO.md Provider Protocol support (https://seomd.dev/providers).\n` +
120
+ ` 3. Use a natively supported provider (e.g. set provider.name: foxcite or SEOMD_PROVIDER=foxcite).`
121
+ );
122
+ }
123
+ if (!hasAuth) {
124
+ throw new Error(
125
+ `No credentials found for provider '${meta.displayName}'.\n` +
126
+ `Set SEOMD_API_KEY (or SEOMD_PAYMENT_TOKEN for x402) in your environment or .env file.`
127
+ );
128
+ }
129
+ };
130
+
131
+ const getClient = () =>
132
+ createHttpClient({
133
+ baseURL: endpoint,
134
+ apiKey,
135
+ paymentToken,
136
+ domain: domainHeader,
137
+ dashboardUrl: meta.dashboardUrl,
138
+ });
139
+
140
+ return {
141
+ name: meta.name,
142
+ displayName: meta.displayName,
143
+ endpoint,
144
+ hasAuth,
145
+ capabilities,
146
+
147
+ async analyze(payload) {
148
+ assertSupported('analyze');
149
+ const http = getClient();
150
+ const response = await http.post('/cli/analyze', payload);
151
+ return response.data;
152
+ },
153
+
154
+ async sync({ domain, pages = [] }) {
155
+ assertSupported('sync');
156
+ const http = getClient();
157
+
158
+ const compactPages = pages.map((p) => ({
159
+ id: p.id,
160
+ url: p.url,
161
+ primary_keyword: p.primary_keyword || p.keyword || null,
162
+ }));
163
+
164
+ // Trim pages payload if serialized JSON exceeds safe GET query length
165
+ let pagesForQuery = compactPages;
166
+ let pagesParam = JSON.stringify(pagesForQuery);
167
+ while (pagesParam.length > MAX_SYNC_QUERY_BYTES && pagesForQuery.length > 1) {
168
+ pagesForQuery = pagesForQuery.slice(0, Math.floor(pagesForQuery.length / 2));
169
+ pagesParam = JSON.stringify(pagesForQuery);
170
+ }
171
+
172
+ if (meta.name === 'foxcite') {
173
+ const response = await http.get('/cli/sync', {
174
+ params: { domain, pages: pagesParam },
175
+ });
176
+ return response.data;
177
+ }
178
+
179
+ // Standard v2 providers prefer POST /cli/sync (no URL length limits), falling back to GET on 405
180
+ try {
181
+ const response = await http.post('/cli/sync', { domain, pages: compactPages });
182
+ return response.data;
183
+ } catch (err) {
184
+ if (String(err.message).includes('(405)')) {
185
+ const response = await http.get('/cli/sync', {
186
+ params: { domain, pages: pagesParam },
187
+ });
188
+ return response.data;
189
+ }
190
+ throw err;
191
+ }
192
+ },
193
+ };
194
+ }
@@ -0,0 +1,97 @@
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
3
+
4
+ export const MARKER_START = '<!-- seomd:start -->';
5
+ export const MARKER_END = '<!-- seomd:end -->';
6
+
7
+ export const AGENT_INSTRUCTION_BLOCK = `${MARKER_START}
8
+ ## SEO & AI Citation Rules (\`SEO.md\`)
9
+
10
+ Before creating or editing public-facing pages, landing pages, metadata, JSON-LD schema, or marketing copy:
11
+ 1. Read \`SEO.md\` at the repository root for canonical product facts, target buyer prompts, page rules, and forbidden claims.
12
+ 2. Check \`.seo/pages/<page-id>.md\` and \`.seo/REVERSE.md\` (if present) for page-specific citation gaps and playbooks.
13
+ 3. Run \`npx seomd-cli validate\` (and \`npx seomd-cli check\` against built output or localhost) to verify SEO/AEO compliance.
14
+ ${MARKER_END}`;
15
+
16
+ const AGENT_FILES = ['AGENTS.md', 'CLAUDE.md'];
17
+
18
+ /**
19
+ * Wires SEO.md instructions into existing AGENTS.md / CLAUDE.md files.
20
+ * If neither exists, creates a minimal AGENTS.md with the SEO.md pointer.
21
+ * Idempotent: updates existing marker block in place if already wired.
22
+ *
23
+ * @param {string} cwd - Project root directory
24
+ * @returns {Promise<{ updated: string[], created: string[] }>}
25
+ */
26
+ export async function wireAgentFiles(cwd) {
27
+ const updated = [];
28
+ const created = [];
29
+
30
+ const existing = [];
31
+ for (const fileName of AGENT_FILES) {
32
+ const filePath = path.join(cwd, fileName);
33
+ if (await fs.pathExists(filePath)) {
34
+ existing.push({ fileName, filePath });
35
+ }
36
+ }
37
+
38
+ if (existing.length === 0) {
39
+ const agentsPath = path.join(cwd, 'AGENTS.md');
40
+ const content = `# AGENTS.md\n\n${AGENT_INSTRUCTION_BLOCK}\n`;
41
+ await fs.writeFile(agentsPath, content, 'utf8');
42
+ created.push('AGENTS.md');
43
+ return { updated, created };
44
+ }
45
+
46
+ const blockRegex = new RegExp(
47
+ `${escapeRegex(MARKER_START)}[\\s\\S]*?${escapeRegex(MARKER_END)}`,
48
+ 'm'
49
+ );
50
+
51
+ for (const { fileName, filePath } of existing) {
52
+ const current = await fs.readFile(filePath, 'utf8');
53
+ let next;
54
+
55
+ if (blockRegex.test(current)) {
56
+ next = current.replace(blockRegex, AGENT_INSTRUCTION_BLOCK);
57
+ } else {
58
+ const sep = current.endsWith('\n\n') ? '' : current.endsWith('\n') ? '\n' : '\n\n';
59
+ next = `${current}${sep}${AGENT_INSTRUCTION_BLOCK}\n`;
60
+ }
61
+
62
+ if (next !== current) {
63
+ await fs.writeFile(filePath, next, 'utf8');
64
+ }
65
+ updated.push(fileName);
66
+ }
67
+
68
+ return { updated, created };
69
+ }
70
+
71
+ /**
72
+ * Checks whether AGENTS.md or CLAUDE.md exists and references SEO.md.
73
+ *
74
+ * @param {string} cwd
75
+ * @returns {Promise<{ filesFound: string[], wiredFiles: string[] }>}
76
+ */
77
+ export async function inspectAgentWiring(cwd) {
78
+ const filesFound = [];
79
+ const wiredFiles = [];
80
+
81
+ for (const fileName of AGENT_FILES) {
82
+ const filePath = path.join(cwd, fileName);
83
+ if (await fs.pathExists(filePath)) {
84
+ filesFound.push(fileName);
85
+ const content = await fs.readFile(filePath, 'utf8');
86
+ if (content.includes(MARKER_START) || content.includes('SEO.md')) {
87
+ wiredFiles.push(fileName);
88
+ }
89
+ }
90
+ }
91
+
92
+ return { filesFound, wiredFiles };
93
+ }
94
+
95
+ function escapeRegex(str) {
96
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
97
+ }
@@ -1,58 +1,16 @@
1
- import axios from 'axios';
2
1
  import dotenv from 'dotenv';
2
+ import { createHttpClient } from '../providers/http.js';
3
3
 
4
- // Load .env configuration
5
- dotenv.config();
6
-
7
- const API_URL = process.env.SEOMD_API_URL || 'https://api.foxcite.com';
8
- const API_KEY = process.env.SEOMD_API_KEY;
9
- const PAYMENT_TOKEN = process.env.SEOMD_PAYMENT_TOKEN;
10
- const SEOMD_DOMAIN = process.env.SEOMD_DOMAIN;
11
-
12
- const getDashboardUrlFromApi = (apiUrl) => {
13
- if (apiUrl.includes('127.0.0.1') || apiUrl.includes('localhost')) {
14
- return 'http://localhost:3000';
15
- }
16
- if (apiUrl.includes('api.foxcite.com')) {
17
- return 'https://app.foxcite.com';
18
- }
19
- return 'https://seomd.dev';
20
- };
21
-
22
- export const client = axios.create({
23
- baseURL: API_URL,
24
- timeout: 300000, // 5 minutes timeout for LLM audits
25
- headers: {
26
- 'Content-Type': 'application/json',
27
- ...(API_KEY ? { 'Authorization': `Bearer ${API_KEY}` } : {}),
28
- ...(PAYMENT_TOKEN ? { 'x-payment-token': PAYMENT_TOKEN } : {}),
29
- ...(SEOMD_DOMAIN ? { 'x-seomd-domain': SEOMD_DOMAIN } : {})
30
- }
31
- });
32
-
33
- // Interceptor for cleaner error feedback
34
- client.interceptors.response.use(
35
- (response) => response,
36
- (error) => {
37
- if (error.response) {
38
- const status = error.response.status;
39
- const detail = error.response.data?.detail || error.response.data?.message || error.message;
40
-
41
- if (status === 401) {
42
- return Promise.reject(new Error('Authentication failed: Invalid or missing API key (SEOMD_API_KEY).'));
43
- }
44
- if (status === 402) {
45
- const dashUrl = getDashboardUrlFromApi(API_URL);
46
- return Promise.reject(new Error(
47
- `Insufficient scan credits.\n\n` +
48
- `👉 For Humans: Recharge credits or upgrade your plan in the dashboard:\n` +
49
- ` ${dashUrl}/billing\n\n` +
50
- `🤖 For Programmatic Agents:\n` +
51
- ` Set SEOMD_PAYMENT_TOKEN in your environment or headers to pay-per-scan inline using USDC via the agent-native x402 protocol.`
52
- ));
53
- }
54
- return Promise.reject(new Error(`API Error (${status}): ${detail}`));
55
- }
56
- return Promise.reject(new Error(`Network Error: ${error.message}`));
57
- }
58
- );
4
+ /**
5
+ * Dynamically creates an HTTP client from current environment variables.
6
+ * Kept for backwards compatibility; prefer `resolveProvider()` from `src/providers/index.js`.
7
+ */
8
+ export function getApiClient() {
9
+ dotenv.config();
10
+ return createHttpClient({
11
+ baseURL: process.env.SEOMD_API_URL || 'https://api.foxcite.com',
12
+ apiKey: process.env.SEOMD_API_KEY || null,
13
+ paymentToken: process.env.SEOMD_PAYMENT_TOKEN || null,
14
+ domain: process.env.SEOMD_DOMAIN || null,
15
+ });
16
+ }
@@ -1,3 +1,5 @@
1
+ export const SPEC_VERSION = '2.0.0';
2
+
1
3
  export const SITE_TYPES = [
2
4
  { name: 'SaaS / Software', value: 'saas' },
3
5
  { name: 'Ecommerce', value: 'ecommerce' },
@@ -6,6 +8,8 @@ export const SITE_TYPES = [
6
8
  { name: 'Marketplace', value: 'marketplace' },
7
9
  ];
8
10
 
11
+ export const VALID_SITE_TYPES = SITE_TYPES.map((t) => t.value);
12
+
9
13
  export const INTENT_CATEGORIES = [
10
14
  'informational',
11
15
  'comparison',
@@ -14,6 +18,10 @@ export const INTENT_CATEGORIES = [
14
18
  'category',
15
19
  ];
16
20
 
21
+ export const VALID_PRIORITIES = ['low', 'medium', 'high', 'critical'];
22
+
23
+ export const VALID_PAGE_STATUSES = ['live', 'draft', 'planned'];
24
+
17
25
  export const INTENT_PRIORITIES = {
18
26
  saas: {
19
27
  informational: 'medium',
@@ -61,9 +69,8 @@ export const REQUIRED_PAGES = {
61
69
  { id: 'alternatives', url: '/alternatives/[competitor]', priority: 5 },
62
70
  { id: 'use-cases', url: '/for/[segment]', priority: 6 },
63
71
  { id: 'integrations', url: '/integrations', priority: 7 },
64
- { id: 'changelog', url: '/changelog', priority: 8 },
65
- { id: 'docs', url: '/docs', priority: 9 },
66
- { id: 'blog', url: '/blog', priority: 10 },
72
+ { id: 'docs', url: '/docs', priority: 8 },
73
+ { id: 'blog', url: '/blog', priority: 9 },
67
74
  ],
68
75
  ecommerce: [
69
76
  { id: 'homepage', url: '/', priority: 1 },
@@ -71,8 +78,8 @@ export const REQUIRED_PAGES = {
71
78
  { id: 'product', url: '/products/[slug]', priority: 3 },
72
79
  { id: 'collection', url: '/collections/[slug]', priority: 4 },
73
80
  { id: 'reviews', url: '/reviews', priority: 5 },
74
- { id: 'cart', url: '/cart', priority: 6 },
75
- { id: 'checkout', url: '/checkout', priority: 7 },
81
+ { id: 'shipping-returns', url: '/shipping-and-returns', priority: 6 },
82
+ { id: 'faq', url: '/faq', priority: 7 },
76
83
  ],
77
84
  local: [
78
85
  { id: 'homepage', url: '/', priority: 1 },
@@ -97,10 +104,9 @@ export const REQUIRED_PAGES = {
97
104
  { id: 'listing', url: '/listings/[slug]', priority: 2 },
98
105
  { id: 'category', url: '/[category]', priority: 3 },
99
106
  { id: 'seller-profile', url: '/sellers/[slug]', priority: 4 },
100
- { id: 'search-results', url: '/search', priority: 5 },
101
- { id: 'how-it-works', url: '/how-it-works', priority: 6 },
102
- { id: 'pricing', url: '/pricing', priority: 7 },
103
- { id: 'trust-safety', url: '/trust', priority: 8 },
107
+ { id: 'how-it-works', url: '/how-it-works', priority: 5 },
108
+ { id: 'pricing', url: '/pricing', priority: 6 },
109
+ { id: 'trust-safety', url: '/trust', priority: 7 },
104
110
  ],
105
111
  };
106
112
 
@@ -112,12 +118,104 @@ export const SCHEMA_TYPES = {
112
118
  marketplace: ['WebSite', 'Organization', 'FAQPage', 'Product'],
113
119
  };
114
120
 
121
+ export const SITE_TYPE_PROFILES = {
122
+ saas: {
123
+ defaultKeyword: 'workflow automation software',
124
+ negativeKeywords: ['free download', 'cracked', 'open source clone'],
125
+ disallow: ['/admin', '/api/*', '/app/*', '/dashboard/*'],
126
+ categoryQuery: (kw, year) => [`best ${kw}`, `top ${kw} tools ${year}`],
127
+ comparisonSuffix: (kw) => `best ${kw} for startups`,
128
+ transactionalQueries: (brandLower) => [
129
+ `is ${brandLower} worth it`,
130
+ `${brandLower} pricing`,
131
+ `${brandLower} demo`,
132
+ ],
133
+ agentRules: [
134
+ 'Open every key page with a 40-60 word direct answer to the page\'s primary query.',
135
+ 'Include a structured FAQ section (minimum 4 questions) with `FAQPage` JSON-LD.',
136
+ 'Emit `Organization` and `SoftwareApplication` JSON-LD on core product pages.',
137
+ 'Comparison pages (`/vs/*`, `/alternatives/*`) must include a factual feature table — never fabricate competitor pricing.',
138
+ ],
139
+ },
140
+ ecommerce: {
141
+ defaultKeyword: 'specialty coffee beans',
142
+ negativeKeywords: ['wholesale bulk', 'cheap knockoff', 'free sample'],
143
+ disallow: ['/admin', '/api/*', '/cart', '/checkout', '/account/*'],
144
+ categoryQuery: (kw, year) => [`best ${kw}`, `top ${kw} brands ${year}`],
145
+ comparisonSuffix: (kw) => `best ${kw} to buy online`,
146
+ transactionalQueries: (brandLower) => [
147
+ `buy ${brandLower}`,
148
+ `${brandLower} shipping and returns`,
149
+ `${brandLower} discount`,
150
+ ],
151
+ agentRules: [
152
+ 'Include clear pricing, availability, materials/specs, and shipping details in plain text on every product page.',
153
+ 'Emit `Product` (with `Offer` and `AggregateRating` where real reviews exist) and `BreadcrumbList` JSON-LD.',
154
+ 'Never index `/cart`, `/checkout`, or account pages; keep them disallowed in `robots.txt`.',
155
+ 'Add concise buying-guide FAQs on category and product pages answering sizing, care, and compatibility questions.',
156
+ ],
157
+ },
158
+ local: {
159
+ defaultKeyword: 'emergency plumbing service',
160
+ negativeKeywords: ['diy', 'jobs', 'careers', 'salary'],
161
+ disallow: ['/admin', '/api/*', '/portal/*'],
162
+ categoryQuery: (kw, year) => [`best ${kw} near me`, `top rated ${kw} ${year}`],
163
+ comparisonSuffix: (kw) => `most reliable ${kw} in my area`,
164
+ transactionalQueries: (brandLower) => [
165
+ `${brandLower} phone number`,
166
+ `${brandLower} hours and pricing`,
167
+ `book ${brandLower}`,
168
+ ],
169
+ agentRules: [
170
+ 'Keep Name, Address, Phone (NAP), service areas, and business hours consistent across all pages.',
171
+ 'Emit `LocalBusiness` (with `GeoCoordinates` and opening hours) and `FAQPage` JSON-LD.',
172
+ 'Give each service and city/location page unique local proof points (never duplicate city-swap boilerplate).',
173
+ 'Surface verified customer reviews, licenses, and guarantees near the top of service pages.',
174
+ ],
175
+ },
176
+ blog: {
177
+ defaultKeyword: 'developer productivity',
178
+ negativeKeywords: ['paid ad', 'sponsored spam'],
179
+ disallow: ['/admin', '/api/*', '/drafts/*'],
180
+ categoryQuery: (kw, year) => [`best ${kw} guides`, `top ${kw} resources ${year}`],
181
+ comparisonSuffix: (kw) => `best ${kw} newsletters and blogs`,
182
+ transactionalQueries: (brandLower) => [
183
+ `${brandLower} newsletter`,
184
+ `subscribe to ${brandLower}`,
185
+ ],
186
+ agentRules: [
187
+ 'Lead every article with a 2-3 sentence direct takeaway (answer-first format) before deep context.',
188
+ 'Include explicit author bio, publish/updated dates, and primary-source citations.',
189
+ 'Emit `Article`, `Person` (author), and `BreadcrumbList` JSON-LD on every post.',
190
+ 'Use clear H1 -> H2 -> H3 hierarchy and concise summaries/tables that AI engines can quote accurately.',
191
+ ],
192
+ },
193
+ marketplace: {
194
+ defaultKeyword: 'freelance design marketplace',
195
+ negativeKeywords: ['scam', 'free cracked'],
196
+ disallow: ['/admin', '/api/*', '/checkout', '/messages/*', '/account/*'],
197
+ categoryQuery: (kw, year) => [`best ${kw}`, `top ${kw} platforms ${year}`],
198
+ comparisonSuffix: (kw) => `best ${kw} for buyers and sellers`,
199
+ transactionalQueries: (brandLower) => [
200
+ `how does ${brandLower} work`,
201
+ `${brandLower} fees`,
202
+ `is ${brandLower} safe`,
203
+ ],
204
+ agentRules: [
205
+ 'Clearly explain both sides of the marketplace (buyer protection, seller fees, verification) on core pages.',
206
+ 'Emit `WebSite` (with `SearchAction`), `Organization`, and `Product`/`Offer` JSON-LD on listing pages.',
207
+ 'Keep dynamic search/filter parameter URLs canonicalized to clean category pages to avoid crawl bloat.',
208
+ 'Include trust, safety, and fee-structure FAQs with `FAQPage` JSON-LD.',
209
+ ],
210
+ },
211
+ };
212
+
115
213
  export const PERFORMANCE_THRESHOLDS = {
116
214
  lcp: '2.5s',
117
215
  cls: '0.1',
118
- fid: '100ms',
216
+ inp: '200ms',
119
217
  page_size: '500kb',
120
- time_to_first_byte: '800ms',
218
+ ttfb: '800ms',
121
219
  };
122
220
 
123
221
  export const AI_BOTS = [
@@ -144,4 +242,4 @@ export const AI_BOTS = [
144
242
  { userAgent: 'CCBot', allow: '/' },
145
243
  { userAgent: 'diffbot', allow: '/' },
146
244
  { userAgent: 'webzio-extended', allow: '/' },
147
- ];
245
+ ];