@cobola/dsh-geo 0.8.0 → 0.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0 - 2026-11-29
4
+
5
+ ### Features
6
+
7
+ - Add the SEO / AEO / GEO pillar view. Every rule now declares one pillar, and
8
+ the pillar scores appear in the CLI, audit report, tool result and in-chat card.
9
+ Pillars are a second view over the same findings: they never change the Core
10
+ total.
11
+ - Add eight checks: viewport declaration, image dimensions, lazy loading, URL
12
+ structure, hreflang (SEO); answer-first opening, question-heading density and
13
+ extractable term blocks (AEO).
14
+ - Rubric is now 53 checks: SEO 26, AEO 16, GEO 11.
15
+
16
+ ### Notes
17
+
18
+ - `seo.hreflang` reports `skip` on single-language sites instead of penalising
19
+ them.
20
+
21
+
22
+ ## 0.9.0 - 2026-11-29
23
+
24
+ ### Features
25
+
26
+ - Add `generate-llms` and `generate-faq` (CLI) plus `geo_generate_llms` and
27
+ `geo_generate_faq` (MCP): build an llms.txt and FAQPage JSON-LD from the pages
28
+ that were actually crawled.
29
+ - Section extraction now groups each heading with the prose and lists that
30
+ follow it, which both generators read.
31
+
32
+ ### Fixes
33
+
34
+ - The content container is now the largest `<article>`/`<main>` rather than the
35
+ first one. A decorative card placed before the real content used to make a
36
+ content-rich page look like a JavaScript shell (journal123.com scored 79.3
37
+ instead of 71.9 after this fix, because the false "content depends on
38
+ JavaScript" finding disappeared).
39
+
40
+ ### Boundaries
41
+
42
+ - Both generators only extract: llms.txt sections come from real headings and
43
+ anchors, FAQ answers are each section's own prose, and a missing meta
44
+ description is stated rather than invented.
45
+ - A site with no question-shaped heading that has a real answer yields no FAQ
46
+ document (exit code 4) instead of a fabricated one.
47
+ - Both outputs state that Google Search does not use llms.txt, and that Google
48
+ restricted FAQ rich results to authoritative government and health sites in
49
+ August 2023.
50
+
51
+
3
52
  ## 0.8.0 - 2026-11-29
4
53
 
5
54
  ### Features
package/README.md CHANGED
@@ -23,7 +23,7 @@
23
23
  | 会话内结果卡 | 模型调用 `geo_scan` / `geo_fix_plan` 后,对话中直接显示分数、五维、平台参考分与优先修复,不用另开页面 |
24
24
  | `geo_fix_plan`(DSH 工具) | 把最近一次(或指定的)报告变成按影响力排序的修复清单 |
25
25
  | **设置 → GEO 体检**(面板) | 修改抓取页数、robots 策略、限速、超时、体积上限、报告目录、私有目标开关 |
26
- | CLI(`dsh-geo`) | `scan` / `ci` / `mcp` / `fix-plan` / `history` / `diff`,支持 `--json` 与 `--fail-under` |
26
+ | CLI(`dsh-geo`) | `scan` / `ci` / `mcp` / `generate-llms` / `generate-faq` / `fix-plan` / `history` / `diff` |
27
27
  | MCP server | `npx -y @cobola/dsh-geo mcp`,给 Cursor / Claude Code 等客户端直接调用 |
28
28
 
29
29
  报告固定在会话工作区的 `.dsh-geo/` 下;报告可能包含页面正文摘录,上传 CI artifact 前请先审阅内容:
@@ -167,7 +167,7 @@ dsh-geo ci https://journal123.com \
167
167
 
168
168
  ```yaml
169
169
  - uses: actions/checkout@v4
170
- - uses: cobola/dsh-geo@v0.8.0
170
+ - uses: cobola/dsh-geo@v0.10.0
171
171
  with:
172
172
  url: https://journal123.com
173
173
  baseline: geo-baseline.json
@@ -201,6 +201,22 @@ CLI 也随 npm 包提供:`npx @cobola/dsh-geo --help`;完整参数见 `dsh-g
201
201
 
202
202
  45 条可审计检查,维度内按权重归一化;`pass` 计 1、`warn` 计 0.5、`fail` 计 0、`skip` 移出分母。总分是五维加权平均。完整规则、阈值与修复建议见 **[docs/RULES.md](docs/RULES.md)**(由 `lib/rules.js` 生成)。
203
203
 
204
+ ### 内容生成器(可选)
205
+
206
+ ```sh
207
+ dsh-geo generate-llms https://journal123.com --out llms.txt
208
+ dsh-geo generate-faq https://journal123.com --out faq.json
209
+ ```
210
+
211
+ 两者都**只从真实抓取的页面里提取**:llms.txt 的分节来自页面真实标题与锚点,FAQ 的答案是那个小节自己的正文。站点没有可用的问句时,不生成 FAQ,退出码 `4`。
212
+
213
+ 需要说清楚的两条平台事实,生成的文件里也会写明:
214
+
215
+ - **Google Search 不使用 llms.txt**,它服务于其他 agent 与工具;
216
+ - **Google 在 2023-08 把 FAQ 富媒体结果限制到权威政府/健康站点**,绝大多数站点已拿不到,这段标记仍合法但不再是富媒体机会。
217
+
218
+ 细节见 [docs/GENERATORS.md](docs/GENERATORS.md)。
219
+
204
220
  ### 平台适配:单独计分,不进 Core 总分
205
221
 
206
222
  | Profile | 状态 | 覆盖内容 |
@@ -263,6 +279,8 @@ lib/ci.js CI 审计、基线与质量门禁
263
279
  lib/mcp.js stdio MCP server(零依赖手写 JSON-RPC)
264
280
  bin/dsh-geo-mcp.js MCP 二进制入口
265
281
  docs/MCP.md MCP 用法与协议行为
282
+ docs/GENERATORS.md 生成器:只提取,不编造
283
+ lib/generate.js llms.txt 与 FAQ JSON-LD 生成器
266
284
  action.yml GitHub composite action
267
285
  lib/score.js 评分聚合(纯函数)
268
286
  lib/report.js 报告/修复清单/diff 生成
package/bin/dsh-geo.js CHANGED
@@ -27,6 +27,8 @@ Usage:
27
27
  dsh-geo scan <url> [options]
28
28
  dsh-geo ci <url> [options]
29
29
  dsh-geo mcp Serve the Model Context Protocol over stdio.
30
+ dsh-geo generate-llms <url> [--out <path>]
31
+ dsh-geo generate-faq <url> [--out <path>]
30
32
  dsh-geo fix-plan [options]
31
33
  dsh-geo history [options]
32
34
  dsh-geo diff <before.json> <after.json> [--json]
@@ -37,6 +39,15 @@ mcp:
37
39
  Register it in an MCP client as: npx -y @cobola/dsh-geo mcp
38
40
  Reports are written to <cwd>/.dsh-geo/ for the directory you start it in.
39
41
 
42
+ generate-llms / generate-faq:
43
+ Build content from the pages that were actually crawled. Nothing is invented:
44
+ llms.txt sections come from real headings, and FAQ answers are each
45
+ section's own prose. Google Search does not use llms.txt, and FAQ rich
46
+ results have been limited to authoritative government and health sites since
47
+ August 2023; both outputs say so in their own text.
48
+ Exit code 4 when a FAQ document cannot be built because the site has no
49
+ question-shaped heading with a real answer.
50
+
40
51
  ci options (for CI jobs):
41
52
  --baseline <path> Compare against a committed baseline report.
42
53
  --fail-under <score> Exit 3 when the total is below this score.
@@ -100,6 +111,7 @@ function defaults() {
100
111
  jsonFile: null,
101
112
  reportFile: null,
102
113
  baselineOut: null,
114
+ out: null,
103
115
  };
104
116
  }
105
117
 
@@ -107,6 +119,7 @@ const VALUE_OPTIONS = new Set([
107
119
  'dir', 'fail-under', 'max-pages', 'now', 'timeout', 'rate-limit',
108
120
  'user-agent', 'report', 'limit',
109
121
  'baseline', 'max-regression', 'summary-file', 'json-file', 'report-file', 'write-baseline',
122
+ 'out',
110
123
  ]);
111
124
 
112
125
  function parseArgs(argv) {
@@ -154,6 +167,7 @@ function parseArgs(argv) {
154
167
  case 'json-file': options.jsonFile = value; break;
155
168
  case 'report-file': options.reportFile = value; break;
156
169
  case 'write-baseline': options.baselineOut = value; break;
170
+ case 'out': options.out = value; break;
157
171
  default: throw new Error(`Unknown option: --${key}`);
158
172
  }
159
173
  }
@@ -169,7 +183,7 @@ function validate(options, commandName) {
169
183
  }
170
184
  if (options.now !== null && !Number.isFinite(Date.parse(options.now))) throw new Error(`--now is not a valid ISO time: ${options.now}`);
171
185
  if (!Number.isInteger(options.limit) || options.limit < 1) throw new Error('--limit must be a positive integer');
172
- if (!['scan', 'ci'].includes(commandName) && (options.maxPages !== 6 || options.now !== null || !options.respectRobots
186
+ if (!['scan', 'ci', 'generate-llms', 'generate-faq'].includes(commandName) && (options.maxPages !== 6 || options.now !== null || !options.respectRobots
173
187
  || options.allowPrivate || options.insecureTls || options.timeoutMs !== 10_000 || options.rateLimitMs !== 250)) {
174
188
  throw new Error(`Scan-only options are not accepted by "${commandName}"`);
175
189
  }
@@ -193,6 +207,10 @@ function renderScan(report, scan, extras = {}) {
193
207
  for (const dimension of report.dimensions) {
194
208
  lines.push(`${dimension.title.padEnd(6, ' ')} ${String(dimension.score).padStart(5, ' ')} ${bar(dimension.score)} 权重 ${dimension.weight}`);
195
209
  }
210
+ if (Array.isArray(report.pillars) && report.pillars.length > 0) {
211
+ lines.push('');
212
+ lines.push(report.pillars.map((pillar) => `${pillar.title} ${pillar.score}`).join(' · ') + ' (支柱视图)');
213
+ }
196
214
  for (const platform of report.platforms ?? []) {
197
215
  lines.push(`${platform.title.padEnd(14, ' ')} ${String(platform.total).padStart(5, ' ')} ${bar(platform.total)} 平台参考分(不计入总分)`);
198
216
  }
@@ -408,10 +426,60 @@ async function commandMcp(positionals, options) {
408
426
  return 0;
409
427
  }
410
428
 
429
+ async function commandGenerate(positionals, options) {
430
+ const kind = options.generateKind;
431
+ if (kind !== 'llms' && kind !== 'faq') throw new Error(`Unknown generator: ${kind}`);
432
+ const url = positionals[0];
433
+ if (!url) throw new Error('Missing <url>');
434
+
435
+ const { auditSite } = await import('../lib/audit.js');
436
+ const { generateLlmsTxt, generateFaqJsonLd, FAQ_NOTE } = await import('../lib/generate.js');
437
+ const { scan } = await auditSite(url, {
438
+ maxPages: options.maxPages,
439
+ respectRobots: options.respectRobots,
440
+ allowPrivate: options.allowPrivate,
441
+ insecureTls: options.insecureTls,
442
+ timeoutMs: options.timeoutMs,
443
+ rateLimitMs: options.rateLimitMs,
444
+ userAgent: options.userAgent,
445
+ now: options.now ?? undefined,
446
+ });
447
+
448
+ if (kind === 'llms') {
449
+ const result = generateLlmsTxt(scan);
450
+ if (options.out) {
451
+ await fs.mkdir(path.dirname(path.resolve(options.out)), { recursive: true });
452
+ await fs.writeFile(path.resolve(options.out), result.content, 'utf8');
453
+ process.stderr.write(`dsh-geo: wrote ${options.out} (${result.links} links from ${result.sourcePages} page(s))\n`);
454
+ } else {
455
+ process.stdout.write(result.content);
456
+ }
457
+ return 0;
458
+ }
459
+
460
+ const result = generateFaqJsonLd(scan);
461
+ if (!result.json) {
462
+ process.stderr.write(`dsh-geo: ${result.skipped}\n`);
463
+ return 4;
464
+ }
465
+ const output = `${JSON.stringify(result.json, null, 2)}\n`;
466
+ process.stderr.write(`dsh-geo: ${FAQ_NOTE}\n`);
467
+ if (options.out) {
468
+ await fs.mkdir(path.dirname(path.resolve(options.out)), { recursive: true });
469
+ await fs.writeFile(path.resolve(options.out), output, 'utf8');
470
+ process.stderr.write(`dsh-geo: wrote ${options.out} (${result.items.length} item(s))\n`);
471
+ } else {
472
+ process.stdout.write(output);
473
+ }
474
+ return 0;
475
+ }
476
+
411
477
  const COMMANDS = {
412
478
  scan: commandScan,
413
479
  ci: commandCi,
414
480
  mcp: commandMcp,
481
+ 'generate-llms': (pos, opts) => commandGenerate(pos, { ...opts, generateKind: 'llms' }),
482
+ 'generate-faq': (pos, opts) => commandGenerate(pos, { ...opts, generateKind: 'faq' }),
415
483
  'fix-plan': commandFixPlan,
416
484
  history: commandHistory,
417
485
  diff: commandDiff,
@@ -447,7 +515,7 @@ async function main(argv) {
447
515
  validate(parsed.options, name);
448
516
  return await handler(positionals, parsed.options);
449
517
  } catch (error) {
450
- const usageError = /Missing <url>|Unexpected argument|Scan-only options|diff needs exactly/.test(error.message);
518
+ const usageError = /Missing <url>|Unexpected argument|Scan-only options|diff needs exactly|Unknown generator/.test(error.message);
451
519
  process.stderr.write(`dsh-geo: ${error.message}\n`);
452
520
  return usageError ? 2 : 1;
453
521
  }
package/client.js CHANGED
@@ -59,6 +59,7 @@ window.__ModuleLoader__.load({
59
59
  cardFailed: '体检没有完成',
60
60
  cardDelta: '较上次',
61
61
  cardPlatforms: '平台参考分(不计入总分)',
62
+ cardPillars: '支柱(SEO / AEO / GEO)',
62
63
  cardActions: '优先修复',
63
64
  },
64
65
  en: {
@@ -103,6 +104,7 @@ window.__ModuleLoader__.load({
103
104
  cardFailed: 'The audit did not complete',
104
105
  cardDelta: 'vs previous',
105
106
  cardPlatforms: 'Platform scores (not in Core total)',
107
+ cardPillars: 'Pillars (SEO / AEO / GEO)',
106
108
  cardActions: 'Top fixes',
107
109
  },
108
110
  };
@@ -445,6 +447,17 @@ window.__ModuleLoader__.load({
445
447
  }, `${t('cardDelta')} ${delta.before} → ${delta.after}(${delta.totalDelta >= 0 ? '+' : ''}${delta.totalDelta})`));
446
448
  }
447
449
 
450
+ const pillarRows = (meta.pillars ?? []).map((pillar) => h('div', { key: pillar.title, style: styles.cardRow },
451
+ h('span', { style: styles.label }, pillar.title),
452
+ h('div', { style: styles.barTrack },
453
+ h('div', { style: { ...styles.barFill, width: `${Math.max(0, Math.min(100, pillar.score))}%` } })),
454
+ h('span', { style: { ...styles.hint, textAlign: 'right' } }, `${pillar.score}`)));
455
+
456
+ if (pillarRows.length > 0) {
457
+ children.push(h('div', { key: 'pillars', style: { marginTop: 6 } },
458
+ h('div', { style: styles.sectionLabel }, t('cardPillars')),
459
+ pillarRows));
460
+ }
448
461
  if (dimensionRows.length > 0) children.push(h('div', { key: 'dimensions' }, dimensionRows));
449
462
  if (platformRows.length > 0) {
450
463
  children.push(h('div', { key: 'platforms', style: { marginTop: 6 } },
package/docs/CI.md CHANGED
@@ -123,7 +123,7 @@ on:
123
123
 
124
124
  ```yaml
125
125
  - uses: actions/checkout@v4
126
- - uses: cobola/dsh-geo@v0.8.0
126
+ - uses: cobola/dsh-geo@v0.10.0
127
127
  with:
128
128
  url: https://journal123.com
129
129
  baseline: geo-baseline.json
@@ -0,0 +1,75 @@
1
+ # 内容生成器
2
+
3
+ 两个生成器:`generate-llms` 与 `generate-faq`。它们从**实际抓取到的页面**里提取内容,不编造。
4
+
5
+ ```sh
6
+ dsh-geo generate-llms https://journal123.com --out llms.txt
7
+ dsh-geo generate-faq https://journal123.com --out faq.json
8
+ ```
9
+
10
+ 也可以在 MCP 里调用:`geo_generate_llms`、`geo_generate_faq`。
11
+
12
+ ## 为什么不编造
13
+
14
+ 生成器的诱惑是“看起来内容更完整”:补一段摘要、凑几条 FAQ。但这个工具的整个前提是**证据可追溯**。如果生成器输出了站点上不存在的文字,那就是在向模型misrepresent 一个站点——这正好是我们在审计里批评的行为。
15
+
16
+ 所以两个生成器都只做提取:
17
+
18
+ - **llms.txt 的分节**来自页面真实存在的 `<h2>`/`<h3>`,带真实 `id` 锚点;
19
+ - **FAQ 的答案**是那个小节自己的正文,不是重写的;
20
+ - 页面没有 meta description 时,输出会**明确说明缺失**,而不是编一句;
21
+ - 站点没有“问句式标题 + 真实答案”时,**不生成 FAQ 文档**,退出码 `4`。
22
+
23
+ ## llms.txt
24
+
25
+ 结构:
26
+
27
+ ```text
28
+ # <站点名>
29
+
30
+ > <入口页的 meta description;没有就说明缺失>
31
+
32
+ Note: Google Search does not use this file. ...
33
+
34
+ ## Pages
35
+ - [页面标题](URL)
36
+
37
+ ## Sections
38
+ - [真实标题](URL#anchor) — 该小节正文摘录
39
+
40
+ ## Machine-readable resources
41
+ - [sitemap](URL)
42
+ - [robots.txt](URL)
43
+ ```
44
+
45
+ **重要**:Google Search 明确不使用 `llms.txt`。它服务于其他选择读取它的 agent 与工具。这句话写在生成的文件里,不只是文档里。
46
+
47
+ ## FAQ JSON-LD
48
+
49
+ ```json
50
+ {
51
+ "@context": "https://schema.org",
52
+ "@type": "FAQPage",
53
+ "mainEntity": [
54
+ { "@type": "Question", "name": "...", "acceptedAnswer": { "@type": "Answer", "text": "..." } }
55
+ ]
56
+ }
57
+ ```
58
+
59
+ **重要**:Google 在 2023-08 把 FAQ 富媒体搜索结果限制到权威政府与健康站点,绝大多数站点已不再获得该富媒体结果。这段标记仍然合法、是机器可读结构,但**不是富媒体机会**。这句话同样写在输出里。
60
+
61
+ 参考:[Google: HowTo 和常见问题解答富媒体搜索结果方面的变化](https://developers.google.com/search/blog/2023/08/howto-faq-changes)
62
+
63
+ ## 边界
64
+
65
+ - 生成器**不修改站点**,只输出文本或 JSON;
66
+ - 不发布、不写入站点仓库,你自己决定放哪里;
67
+ - 不生成内容、不扩充内容、不做“改写优化”;
68
+ - 产物需要人工审阅后再上线。
69
+
70
+ ## 退出码
71
+
72
+ | 码 | 含义 |
73
+ |---|---|
74
+ | 0 | 生成成功 |
75
+ | 4 | 无法生成 FAQ(站点没有可用的问句标题与答案) |
package/docs/RULES.md CHANGED
@@ -1,4 +1,4 @@
1
- # GEO 评分规则(geo-rubric@1)
1
+ # GEO 评分规则(geo-rubric@2)
2
2
 
3
3
  本文件由 `scripts/gen-docs.mjs` 从 `lib/rules.js` 生成,请勿手工编辑。改规则后运行 `npm run docs`。
4
4
 
@@ -14,77 +14,85 @@
14
14
 
15
15
  ## 2. 规则表
16
16
 
17
- 共 45 条规则。每条规则的通过条件、证据格式与失败阈值都在 `lib/rules.js` 的 `evaluate()` 中,运行时会把证据写进报告(`findings[].evidence`),因此报告本身就能说明为什么得分。
17
+ 共 53 条规则,分归三个支柱:SEO 26 条、AEO 16 条、GEO 11 条。支柱是同一批规则的第二个视图,不改变 Core 总分。每条规则的通过条件、证据格式与失败阈值都在 `lib/rules.js` 的 `evaluate()` 中,运行时会把证据写进报告(`findings[].evidence`),因此报告本身就能说明为什么得分。
18
18
 
19
19
  ### 可发现性(25 分)
20
20
 
21
- | 规则 ID | 权重 | 检查项 | 修复建议 |
22
- |---|---|---|---|
23
- | `disc.robots-present` | 3 | robots.txt 可访问 | 在站点根目录发布 robots.txt,声明 Sitemap 与 AI 爬虫策略;返回 200 且为纯文本。 |
24
- | `disc.robots-not-blocking-site` | 4 | robots.txt 未封禁站点 | 删掉对 Disallow: / 的全局封禁;只对确实需要保密的路径单独设置规则。 |
25
- | `disc.ai-crawler-policy` | 3 | AI 爬虫策略明确 | 若希望被 AI 检索,在 robots.txt 显式 Allow GPTBot、ClaudeBot、PerplexityBot、Google-Extended 等;若刻意封闭,保留 Disallow 但需接受 AI 搜索不可见。 |
26
- | `disc.googlebot-accessible` | 3 | Googlebot 可抓取 | 在 robots.txt 中允许 Googlebot 与 Googlebot-Image 抓取公开页面;这是 Google Search(包括生成式 AI 功能)的前提。 |
27
- | `disc.sitemap-present` | 3 | XML sitemap 可用 | 发布 /sitemap.xml(或 sitemap index),每个 <url> 使用最终的可索引 URL,并在 robots.txt 里声明。 |
28
- | `disc.sitemap-declared` | 2 | sitemap 已声明 | 在 robots.txt 增加 Sitemap: <绝对 URL>,或在首页 <link rel="sitemap"> / Link 响应头中声明。 |
29
- | `disc.sitemap-covers-pages` | 2 | sitemap 覆盖已抓取页面 | 把被内链或导航暴露的可索引页面全部写进 sitemap,移除已 404/重定向的旧 URL。 |
30
- | `disc.indexable` | 3 | 入口页可索引 | 入口页返回 200;移除 meta robots 与 X-Robots-Tag 中的 noindex/nofollow。 |
31
- | `disc.canonical` | 2 | canonical 自指且为绝对地址 | 每个页面输出 <link rel="canonical" href="https://正式域名/该页路径">,与当前 URL 完全一致(含尾斜杠策略)。 |
32
- | `disc.internal-links` | 3 | 入口页内链充分 | 在入口页用真实 <a href> 链接导航到核心页面(≥5 个),避免只在 JavaScript 里跳转。 |
21
+ | 规则 ID | 支柱 | 权重 | 检查项 | 修复建议 |
22
+ |---|---|---|---|---|
23
+ | `disc.robots-present` | SEO | 3 | robots.txt 可访问 | 在站点根目录发布 robots.txt,声明 Sitemap 与 AI 爬虫策略;返回 200 且为纯文本。 |
24
+ | `disc.robots-not-blocking-site` | SEO | 4 | robots.txt 未封禁站点 | 删掉对 Disallow: / 的全局封禁;只对确实需要保密的路径单独设置规则。 |
25
+ | `disc.ai-crawler-policy` | GEO | 3 | AI 爬虫策略明确 | 若希望被 AI 检索,在 robots.txt 显式 Allow GPTBot、ClaudeBot、PerplexityBot、Google-Extended 等;若刻意封闭,保留 Disallow 但需接受 AI 搜索不可见。 |
26
+ | `disc.googlebot-accessible` | SEO | 3 | Googlebot 可抓取 | 在 robots.txt 中允许 Googlebot 与 Googlebot-Image 抓取公开页面;这是 Google Search(包括生成式 AI 功能)的前提。 |
27
+ | `disc.sitemap-present` | SEO | 3 | XML sitemap 可用 | 发布 /sitemap.xml(或 sitemap index),每个 <url> 使用最终的可索引 URL,并在 robots.txt 里声明。 |
28
+ | `disc.sitemap-declared` | SEO | 2 | sitemap 已声明 | 在 robots.txt 增加 Sitemap: <绝对 URL>,或在首页 <link rel="sitemap"> / Link 响应头中声明。 |
29
+ | `disc.sitemap-covers-pages` | SEO | 2 | sitemap 覆盖已抓取页面 | 把被内链或导航暴露的可索引页面全部写进 sitemap,移除已 404/重定向的旧 URL。 |
30
+ | `disc.indexable` | SEO | 3 | 入口页可索引 | 入口页返回 200;移除 meta robots 与 X-Robots-Tag 中的 noindex/nofollow。 |
31
+ | `disc.canonical` | SEO | 2 | canonical 自指且为绝对地址 | 每个页面输出 <link rel="canonical" href="https://正式域名/该页路径">,与当前 URL 完全一致(含尾斜杠策略)。 |
32
+ | `disc.internal-links` | SEO | 3 | 入口页内链充分 | 在入口页用真实 <a href> 链接导航到核心页面(≥5 个),避免只在 JavaScript 里跳转。 |
33
+ | `seo.url-structure` | SEO | 2 | URL 结构可读 | 用短、含语义词的路径;避免大写、下划线、过长 query 串与深层嵌套(超过 4 层)。 |
34
+ | `seo.hreflang` | SEO | 1 | 多语言 hreflang | 若站点有多个语言版本,用 <link rel="alternate" hreflang="..."> 标注互指;单语言站点可忽略。 |
33
35
 
34
36
  ### 可解析性(20 分)
35
37
 
36
- | 规则 ID | 权重 | 检查项 | 修复建议 |
37
- |---|---|---|---|
38
- | `parse.title` | 3 | <title> 长度合适 | 为每个页面写唯一的 <title>,10–65 个字符,包含主题词与品牌名。 |
39
- | `parse.meta-description` | 2 | meta description 存在且合适 | 为每个页面输出 50–170 字的 <meta name="description">,概括该页回答的问题。 |
40
- | `parse.lang` | 1 | <html lang> 已声明 | 在 <html> 上声明 lang(如 lang="zh-CN"),便于检索与语言匹配。 |
41
- | `parse.h1` | 2 | 唯一且非空的主标题 | 每页保留一个 <h1> 作为主标题,用 <h2>/<h3> 组织小节。 |
42
- | `parse.heading-order` | 2 | 标题层级连续 | 按 h1 → h2 → h3 顺序组织标题,不要从 h1 直接跳到 h4;每个小节都要有 h2。 |
43
- | `parse.semantics` | 2 | 语义化正文容器 | 用 <main> 包裹正文、<article> 包裹独立内容,替代无语义的 <div> 堆叠。 |
44
- | `parse.raw-content` | 3 | 无 JS 也能读到正文 | 服务端渲染或预渲染正文,保证不执行 JavaScript 的检索/引用管线也能读到 ≥600 字;Googlebot 能渲染 JS,但许多 AI 抓取器不能。 |
45
- | `parse.pages-with-content` | 2 | 被抓取页面普遍含正文 | 确保列表页、详情页都在原始 HTML 中输出正文,而不是只输出加载骨架。 |
46
- | `parse.duplicate-metadata` | 2 | 页面标题/描述不重复 | 为每个页面写唯一的 <title> 与 meta description;重复元数据会让检索系统难以区分页面,也浪费抓取预算。 |
47
- | `parse.image-alt` | 2 | 图片 alt 覆盖 | 为所有内容图片补写描述性 alt;纯装饰图片使用 alt="" 并标记 role="presentation"。 |
48
- | `parse.jsonld-syntax` | 2 | JSON-LD 语法有效 | 用 schema.org 词汇输出 application/ld+json,并在发布前用校验器检查括号与逗号。 |
49
- | `parse.link-text` | 1 | 内链锚文本有描述性 | 把“点击这里/了解更多”改成能说明目标内容的锚文本,例如“GEO 评分方法”。 |
38
+ | 规则 ID | 支柱 | 权重 | 检查项 | 修复建议 |
39
+ |---|---|---|---|---|
40
+ | `parse.title` | SEO | 3 | <title> 长度合适 | 为每个页面写唯一的 <title>,10–65 个字符,包含主题词与品牌名。 |
41
+ | `parse.meta-description` | SEO | 2 | meta description 存在且合适 | 为每个页面输出 50–170 字的 <meta name="description">,概括该页回答的问题。 |
42
+ | `parse.lang` | SEO | 1 | <html lang> 已声明 | 在 <html> 上声明 lang(如 lang="zh-CN"),便于检索与语言匹配。 |
43
+ | `parse.h1` | SEO | 2 | 唯一且非空的主标题 | 每页保留一个 <h1> 作为主标题,用 <h2>/<h3> 组织小节。 |
44
+ | `parse.heading-order` | SEO | 2 | 标题层级连续 | 按 h1 → h2 → h3 顺序组织标题,不要从 h1 直接跳到 h4;每个小节都要有 h2。 |
45
+ | `parse.semantics` | AEO | 2 | 语义化正文容器 | 用 <main> 包裹正文、<article> 包裹独立内容,替代无语义的 <div> 堆叠。 |
46
+ | `parse.raw-content` | AEO | 3 | 无 JS 也能读到正文 | 服务端渲染或预渲染正文,保证不执行 JavaScript 的检索/引用管线也能读到 ≥600 字;Googlebot 能渲染 JS,但许多 AI 抓取器不能。 |
47
+ | `parse.pages-with-content` | AEO | 2 | 被抓取页面普遍含正文 | 确保列表页、详情页都在原始 HTML 中输出正文,而不是只输出加载骨架。 |
48
+ | `parse.duplicate-metadata` | SEO | 2 | 页面标题/描述不重复 | 为每个页面写唯一的 <title> 与 meta description;重复元数据会让检索系统难以区分页面,也浪费抓取预算。 |
49
+ | `parse.image-alt` | SEO | 2 | 图片 alt 覆盖 | 为所有内容图片补写描述性 alt;纯装饰图片使用 alt="" 并标记 role="presentation"。 |
50
+ | `parse.jsonld-syntax` | AEO | 2 | JSON-LD 语法有效 | 用 schema.org 词汇输出 application/ld+json,并在发布前用校验器检查括号与逗号。 |
51
+ | `parse.link-text` | SEO | 1 | 内链锚文本有描述性 | 把“点击这里/了解更多”改成能说明目标内容的锚文本,例如“GEO 评分方法”。 |
52
+ | `seo.viewport` | SEO | 2 | 移动端视口声明 | 在 <head> 输出 <meta name="viewport" content="width=device-width, initial-scale=1">;缺少它会让移动端按桌面宽度渲染。 |
53
+ | `seo.image-dimensions` | SEO | 2 | 图片声明宽高 | 为 <img> 写上 width/height 或使用 aspect-ratio,避免加载时布局跳动(CLS)。 |
54
+ | `seo.image-lazy` | SEO | 1 | 首屏外图片懒加载 | 给首屏以下的图片加 loading="lazy",首屏图不要加,避免延迟最大内容渲染。 |
50
55
 
51
56
  ### 可引用性(25 分)
52
57
 
53
- | 规则 ID | 权重 | 检查项 | 修复建议 |
54
- |---|---|---|---|
55
- | `cite.qa-structure` | 3 | 问答结构 | 把用户真实提问写成 h2/h3,并用 FAQPage/HowTo 结构化数据标注问答对。 |
56
- | `cite.summary` | 2 | 摘要 / TL;DR 区块 | 在正文开头加一段 2–4 句的摘要(class="summary" 或 TL;DR),让引用者能直接取用。 |
57
- | `cite.numeric-evidence` | 3 | 可验证的数字证据 | 补充带单位的具体数字(百分比、耗时、样本量、版本号、日期),避免只有形容词。 |
58
- | `cite.authority-sources` | 2 | 引用权威来源 | 在关键论断处链接一手来源(标准文档、官方文档、论文、政府/教育站点),并保持链接可访问。 |
59
- | `cite.freshness` | 3 | 内容时效可判定 | 输出 datePublished/dateModified(JSON-LD 或 <time datetime>),并在正文中显示“最后更新日期”。 |
60
- | `cite.author` | 2 | 作者署名可识别 | 在页面与 Article schema 中给出作者姓名、简介与主页;匿名内容很难被引用。 |
61
- | `cite.anchors` | 2 | 章节可锚点引用 | 给每个 h2/h3 加语义化 id(如 id="geo-score"),方便引用到具体小节。 |
62
- | `cite.structure` | 3 | 结构化排版与短段落 | 用表格、有序列表承载对比与步骤,段落控制在 120 词以内,便于模型截取。 |
63
- | `cite.snippet-ready` | 3 | 小节答案可直接摘录 | 每个 h2 下紧跟 30–140 词的直接回答,再展开细节;避免先铺垫后给结论。 |
58
+ | 规则 ID | 支柱 | 权重 | 检查项 | 修复建议 |
59
+ |---|---|---|---|---|
60
+ | `cite.qa-structure` | AEO | 3 | 问答结构 | 把用户真实提问写成 h2/h3,并用 FAQPage/HowTo 结构化数据标注问答对。 |
61
+ | `cite.summary` | AEO | 2 | 摘要 / TL;DR 区块 | 在正文开头加一段 2–4 句的摘要(class="summary" 或 TL;DR),让引用者能直接取用。 |
62
+ | `cite.numeric-evidence` | GEO | 3 | 可验证的数字证据 | 补充带单位的具体数字(百分比、耗时、样本量、版本号、日期),避免只有形容词。 |
63
+ | `cite.authority-sources` | GEO | 2 | 引用权威来源 | 在关键论断处链接一手来源(标准文档、官方文档、论文、政府/教育站点),并保持链接可访问。 |
64
+ | `cite.freshness` | GEO | 3 | 内容时效可判定 | 输出 datePublished/dateModified(JSON-LD 或 <time datetime>),并在正文中显示“最后更新日期”。 |
65
+ | `cite.author` | GEO | 2 | 作者署名可识别 | 在页面与 Article schema 中给出作者姓名、简介与主页;匿名内容很难被引用。 |
66
+ | `cite.anchors` | AEO | 2 | 章节可锚点引用 | 给每个 h2/h3 加语义化 id(如 id="geo-score"),方便引用到具体小节。 |
67
+ | `cite.structure` | AEO | 3 | 结构化排版与短段落 | 用表格、有序列表承载对比与步骤,段落控制在 120 词以内,便于模型截取。 |
68
+ | `cite.snippet-ready` | AEO | 3 | 小节答案可直接摘录 | 每个 h2 下紧跟 30–140 词的直接回答,再展开细节;避免先铺垫后给结论。 |
69
+ | `aeo.answer-first` | AEO | 3 | 正文开头给出直接答案 | 在第一个 h1 之后紧跟一段 2–4 句的直接回答,再展开解释;语音助手与摘要更依赖开头的自足段落。 |
70
+ | `aeo.question-density` | AEO | 2 | 问句式标题覆盖 | 用用户真实的提问作为 h2/h3(“怎么…”“为什么…”“是否…”),一段回答一个问题。 |
71
+ | `aeo.definition-list` | AEO | 1 | 术语与要点可抽取 | 用 <dl>/<table>/<ul> 承载定义、对比与步骤;纯段落堆叠不易被答案引擎抽成条目。 |
64
72
 
65
73
  ### 实体与信任(15 分)
66
74
 
67
- | 规则 ID | 权重 | 检查项 | 修复建议 |
68
- |---|---|---|---|
69
- | `trust.https` | 3 | 全站 HTTPS | 启用 HTTPS,把 HTTP 301 到 HTTPS,并提交 HSTS。 |
70
- | `trust.org-schema` | 3 | 组织实体 schema | 用 Organization/LocalBusiness JSON-LD 声明 name、url、logo、sameAs,帮助实体消歧与富结果;Google 表示生成式 AI 不要求特殊 schema。 |
71
- | `trust.contact` | 2 | 联系方式可找到 | 提供 /contact 页面、mailto: 或 schema contactPoint,并保持信息与实体注册一致。 |
72
- | `trust.about` | 2 | About 页面可核实身份 | 提供 /about 页面,写明团队、公司主体、所在地与联系方式。 |
73
- | `trust.security-headers` | 2 | 基础安全响应头 | 至少配置 HSTS(HTTPS)、Content-Security-Policy、X-Content-Type-Options: nosniff、Referrer-Policy。 |
74
- | `trust.privacy` | 1 | 隐私政策可达 | 添加隐私政策页面并从页脚链接,说明数据用途与联系方式。 |
75
- | `trust.sameas` | 2 | 外部身份背书 | 在 Organization sameAs 或 <link rel="me"> 中列出官方 GitHub、LinkedIn、X、维基数据等主页。 |
75
+ | 规则 ID | 支柱 | 权重 | 检查项 | 修复建议 |
76
+ |---|---|---|---|---|
77
+ | `trust.https` | SEO | 3 | 全站 HTTPS | 启用 HTTPS,把 HTTP 301 到 HTTPS,并提交 HSTS。 |
78
+ | `trust.org-schema` | AEO | 3 | 组织实体 schema | 用 Organization/LocalBusiness JSON-LD 声明 name、url、logo、sameAs,帮助实体消歧与富结果;Google 表示生成式 AI 不要求特殊 schema。 |
79
+ | `trust.contact` | AEO | 2 | 联系方式可找到 | 提供 /contact 页面、mailto: 或 schema contactPoint,并保持信息与实体注册一致。 |
80
+ | `trust.about` | AEO | 2 | About 页面可核实身份 | 提供 /about 页面,写明团队、公司主体、所在地与联系方式。 |
81
+ | `trust.security-headers` | SEO | 2 | 基础安全响应头 | 至少配置 HSTS(HTTPS)、Content-Security-Policy、X-Content-Type-Options: nosniff、Referrer-Policy。 |
82
+ | `trust.privacy` | AEO | 1 | 隐私政策可达 | 添加隐私政策页面并从页脚链接,说明数据用途与联系方式。 |
83
+ | `trust.sameas` | GEO | 2 | 外部身份背书 | 在 Organization sameAs 或 <link rel="me"> 中列出官方 GitHub、LinkedIn、X、维基数据等主页。 |
76
84
 
77
85
  ### 机器说明书(15 分)
78
86
 
79
- | 规则 ID | 权重 | 检查项 | 修复建议 |
80
- |---|---|---|---|
81
- | `manifest.llms-txt` | 2 | llms.txt(可选,非 Google 必需) | 可选:若需要服务非 Google 的 agent/工具,可发布 llms.txt(# 标题 + ## 分节 + Markdown 链接)。Google Search 明确不使用 llms.txt,不要把它当作 Google 排名手段。 |
82
- | `manifest.llms-structure` | 1 | llms.txt 结构完整(可选) | 若提供 llms.txt,至少包含 2 个 ## 分节和 3 个指向正文的 Markdown 链接。注意:Google Search 不使用该文件。 |
83
- | `manifest.structured-breadth` | 2 | schema.org 类型覆盖面(富结果) | 按页面类型输出 schema(Organization/WebSite、Article、FAQPage、BreadcrumbList),用于富结果与实体消歧。Google 明确表示生成式 AI 不需要特殊 schema。 |
84
- | `manifest.og-cards` | 1 | OpenGraph / 分享卡片 | 为每个页面输出 og:title、og:description、og:image(1200×630)与 og:url。 |
85
- | `manifest.feed` | 1 | 内容 feed(可选) | 发布 RSS/Atom feed,并用 <link rel="alternate" type="application/rss+xml"> 暴露;它服务于订阅与分发,不是 Google AI 的要求。 |
86
- | `manifest.link-hints` | 1 | HTTP Link / Markdown 入口提示(可选) | 可选:在响应头加 Link: </llms.txt>; rel="llms",或提供 text/markdown alternate。Google Search 不使用这些提示。 |
87
- | `manifest.entity-id` | 1 | 实体 @id 稳定 | 给 Organization/WebSite 分配稳定的 @id(如 https://example.com/#organization),所有页面复用同一 @id。 |
87
+ | 规则 ID | 支柱 | 权重 | 检查项 | 修复建议 |
88
+ |---|---|---|---|---|
89
+ | `manifest.llms-txt` | GEO | 2 | llms.txt(可选,非 Google 必需) | 可选:若需要服务非 Google 的 agent/工具,可发布 llms.txt(# 标题 + ## 分节 + Markdown 链接)。Google Search 明确不使用 llms.txt,不要把它当作 Google 排名手段。 |
90
+ | `manifest.llms-structure` | GEO | 1 | llms.txt 结构完整(可选) | 若提供 llms.txt,至少包含 2 个 ## 分节和 3 个指向正文的 Markdown 链接。注意:Google Search 不使用该文件。 |
91
+ | `manifest.structured-breadth` | GEO | 2 | schema.org 类型覆盖面(富结果) | 按页面类型输出 schema(Organization/WebSite、Article、FAQPage、BreadcrumbList),用于富结果与实体消歧。Google 明确表示生成式 AI 不需要特殊 schema。 |
92
+ | `manifest.og-cards` | SEO | 1 | OpenGraph / 分享卡片 | 为每个页面输出 og:title、og:description、og:image(1200×630)与 og:url。 |
93
+ | `manifest.feed` | SEO | 1 | 内容 feed(可选) | 发布 RSS/Atom feed,并用 <link rel="alternate" type="application/rss+xml"> 暴露;它服务于订阅与分发,不是 Google AI 的要求。 |
94
+ | `manifest.link-hints` | GEO | 1 | HTTP Link / Markdown 入口提示(可选) | 可选:在响应头加 Link: </llms.txt>; rel="llms",或提供 text/markdown alternate。Google Search 不使用这些提示。 |
95
+ | `manifest.entity-id` | GEO | 1 | 实体 @id 稳定 | 给 Organization/WebSite 分配稳定的 @id(如 https://example.com/#organization),所有页面复用同一 @id。 |
88
96
 
89
97
  ## 3. fixture 与基线分数
90
98
 
@@ -93,8 +101,8 @@
93
101
  | fixture | 总分 | 等级 | 页数 | 说明 |
94
102
  |---|---|---|---|---|
95
103
  | `good-static` | 100.0 | A+ | 5 | 五维全部通过,用来证明满分可达 |
96
- | `bad-spa` | 30.5 | F | 1 | 正文只在 JavaScript 里,抓取器看到空壳 |
97
- | `bad-robots` | 77.4 | B | 5 | 内容可读;第三方 AI 爬虫封禁提示 warn,但 Googlebot 可抓取 |
104
+ | `bad-spa` | 32.4 | F | 1 | 正文只在 JavaScript 里,抓取器看到空壳 |
105
+ | `bad-robots` | 76.0 | B | 5 | 内容可读;第三方 AI 爬虫封禁提示 warn,但 Googlebot 可抓取 |
98
106
 
99
107
  任何规则或 fixture 的改动都会让这些数字变化,测试会立即失败。要更新基线,必须先确认改动是**有意的**,再同时修改 fixture 与测试中的期望值。
100
108
 
package/docs/index.json CHANGED
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "versions": [
29
29
  {
30
- "version": "0.8.0",
30
+ "version": "0.10.0",
31
31
  "source": {
32
32
  "type": "npm"
33
33
  },
@@ -23,7 +23,7 @@ jobs:
23
23
  - uses: actions/checkout@v4
24
24
 
25
25
  - name: Audit and compare against the committed baseline
26
- uses: cobola/dsh-geo@v0.8.0
26
+ uses: cobola/dsh-geo@v0.10.0
27
27
  with:
28
28
  url: https://journal123.com
29
29
  baseline: geo-baseline.json
@@ -15,7 +15,7 @@ jobs:
15
15
  - uses: actions/checkout@v4
16
16
 
17
17
  - name: Audit and write a baseline
18
- uses: cobola/dsh-geo@v0.8.0
18
+ uses: cobola/dsh-geo@v0.10.0
19
19
  with:
20
20
  url: https://journal123.com
21
21
  now: 2026-11-29T00:00:00Z
package/index.js CHANGED
@@ -167,7 +167,7 @@ const scanOutputSchema = {
167
167
  additionalProperties: false,
168
168
  required: [
169
169
  'url', 'scannedAt', 'pages', 'total', 'grade', 'gradeLabel', 'counts',
170
- 'dimensions', 'topActions', 'platforms', 'blockedByRobots', 'paths',
170
+ 'dimensions', 'topActions', 'pillars', 'platforms', 'blockedByRobots', 'paths',
171
171
  ],
172
172
  properties: {
173
173
  url: { type: 'string' },
@@ -179,6 +179,7 @@ const scanOutputSchema = {
179
179
  counts: countsSchema,
180
180
  dimensions: { type: 'array', items: { type: 'object', additionalProperties: true } },
181
181
  topActions: { type: 'array', items: { type: 'object', additionalProperties: true } },
182
+ pillars: { type: 'array', items: { type: 'object', additionalProperties: true } },
182
183
  platforms: { type: 'array', items: { type: 'object', additionalProperties: true } },
183
184
  blockedByRobots: { type: 'boolean' },
184
185
  comparison: { type: 'object', additionalProperties: true },
@@ -210,6 +211,9 @@ function scanRender(args, value) {
210
211
  for (const dimension of value.dimensions) {
211
212
  lines.push(`- ${dimension.title}: ${dimension.score} (weight ${dimension.weight})`);
212
213
  }
214
+ if (Array.isArray(value.pillars) && value.pillars.length > 0) {
215
+ lines.push(`- pillars: ${value.pillars.map((pillar) => `${pillar.title} ${pillar.score}`).join(' · ')}`);
216
+ }
213
217
  for (const platform of value.platforms ?? []) {
214
218
  lines.push(`- ${platform.title} (platform, not in Core score): ${platform.total}`);
215
219
  }
@@ -274,6 +278,10 @@ export function scanPresentation(value) {
274
278
  score: dimension.score,
275
279
  weight: dimension.weight,
276
280
  })),
281
+ pillars: (value.pillars ?? []).map((pillar) => ({
282
+ title: pillar.title,
283
+ score: pillar.score,
284
+ })),
277
285
  platforms: (value.platforms ?? []).map((platform) => ({
278
286
  title: platform.title,
279
287
  total: platform.total,
@@ -373,6 +381,7 @@ export function apply(ctx, config) {
373
381
  counts: summary.counts,
374
382
  dimensions: summary.dimensions,
375
383
  topActions: summary.topActions,
384
+ pillars: summary.pillars,
376
385
  platforms: summary.platforms,
377
386
  blockedByRobots: Boolean(scan.blockedByRobots),
378
387
  paths,