@adgine/geo-cli 1.2.8

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 (115) hide show
  1. package/README.md +93 -0
  2. package/bin/adgine-geo.js +224 -0
  3. package/package.json +38 -0
  4. package/skills/.env.example +11 -0
  5. package/skills/README.md +247 -0
  6. package/skills/SKILL.md +117 -0
  7. package/skills/VERSION +1 -0
  8. package/skills/adgine-geo-aiagent/SKILL.md +200 -0
  9. package/skills/adgine-geo-aiagent/scripts/_client.py +341 -0
  10. package/skills/adgine-geo-aiagent/scripts/bot_traffic.py +278 -0
  11. package/skills/adgine-geo-aiagent/scripts/human_traffic.py +357 -0
  12. package/skills/adgine-geo-aiagent/scripts/page_analytics.py +317 -0
  13. package/skills/adgine-geo-aiagent/scripts/page_detail.py +273 -0
  14. package/skills/adgine-geo-analytics/API.md +89 -0
  15. package/skills/adgine-geo-analytics/SKILL.md +191 -0
  16. package/skills/adgine-geo-analytics/scripts/_client.py +341 -0
  17. package/skills/adgine-geo-analytics/scripts/get_overview.py +129 -0
  18. package/skills/adgine-geo-billing/SKILL.md +118 -0
  19. package/skills/adgine-geo-billing/scripts/_client.py +341 -0
  20. package/skills/adgine-geo-billing/scripts/get_credits.py +51 -0
  21. package/skills/adgine-geo-billing/scripts/get_credits_pricing.py +52 -0
  22. package/skills/adgine-geo-billing/scripts/get_subscription.py +48 -0
  23. package/skills/adgine-geo-billing/scripts/list_plans.py +66 -0
  24. package/skills/adgine-geo-brand/SKILL.md +193 -0
  25. package/skills/adgine-geo-brand/WORKFLOW.md +66 -0
  26. package/skills/adgine-geo-brand/scripts/_client.py +341 -0
  27. package/skills/adgine-geo-brand/scripts/generate_brand.py +95 -0
  28. package/skills/adgine-geo-brand/scripts/get_brand.py +67 -0
  29. package/skills/adgine-geo-brand/scripts/list_jobs.py +153 -0
  30. package/skills/adgine-geo-brand/scripts/update_brand.py +61 -0
  31. package/skills/adgine-geo-citation/SKILL.md +220 -0
  32. package/skills/adgine-geo-citation/scripts/_client.py +341 -0
  33. package/skills/adgine-geo-citation/scripts/create_tests.py +62 -0
  34. package/skills/adgine-geo-citation/scripts/get_aggregate.py +108 -0
  35. package/skills/adgine-geo-citation/scripts/get_results.py +179 -0
  36. package/skills/adgine-geo-content/SKILL.md +224 -0
  37. package/skills/adgine-geo-content/WORKFLOW.md +100 -0
  38. package/skills/adgine-geo-content/scripts/_client.py +341 -0
  39. package/skills/adgine-geo-content/scripts/generate_article.py +108 -0
  40. package/skills/adgine-geo-content/scripts/generate_outline.py +113 -0
  41. package/skills/adgine-geo-content/scripts/generate_titles.py +51 -0
  42. package/skills/adgine-geo-content/scripts/list_content.py +65 -0
  43. package/skills/adgine-geo-content/scripts/manage_content.py +90 -0
  44. package/skills/adgine-geo-content/scripts/manage_jobs.py +184 -0
  45. package/skills/adgine-geo-dashboard/SKILL.md +181 -0
  46. package/skills/adgine-geo-dashboard/scripts/_client.py +341 -0
  47. package/skills/adgine-geo-dashboard/scripts/check_integrations.py +139 -0
  48. package/skills/adgine-geo-dashboard/scripts/get_overview.py +155 -0
  49. package/skills/adgine-geo-dashboard/scripts/get_visibility_overview.py +93 -0
  50. package/skills/adgine-geo-docs/SKILL.md +60 -0
  51. package/skills/adgine-geo-domains/SKILL.md +223 -0
  52. package/skills/adgine-geo-domains/scripts/_client.py +341 -0
  53. package/skills/adgine-geo-domains/scripts/get_domain.py +75 -0
  54. package/skills/adgine-geo-domains/scripts/list_domains.py +66 -0
  55. package/skills/adgine-geo-domains/scripts/search_domains.py +85 -0
  56. package/skills/adgine-geo-integrations/SKILL.md +188 -0
  57. package/skills/adgine-geo-integrations/scripts/_client.py +341 -0
  58. package/skills/adgine-geo-integrations/scripts/cloudflare_connect.py +155 -0
  59. package/skills/adgine-geo-integrations/scripts/cloudflare_worker.py +212 -0
  60. package/skills/adgine-geo-integrations/scripts/ga4_data.py +192 -0
  61. package/skills/adgine-geo-integrations/scripts/ga4_setup.py +120 -0
  62. package/skills/adgine-geo-opportunities/SKILL.md +162 -0
  63. package/skills/adgine-geo-opportunities/scripts/_client.py +341 -0
  64. package/skills/adgine-geo-opportunities/scripts/get_opportunity.py +90 -0
  65. package/skills/adgine-geo-opportunities/scripts/list_opportunities.py +92 -0
  66. package/skills/adgine-geo-performance/SKILL.md +177 -0
  67. package/skills/adgine-geo-performance/scripts/_client.py +341 -0
  68. package/skills/adgine-geo-performance/scripts/analyze_page.py +100 -0
  69. package/skills/adgine-geo-projects/SKILL.md +279 -0
  70. package/skills/adgine-geo-projects/scripts/_client.py +341 -0
  71. package/skills/adgine-geo-projects/scripts/check_auth.py +45 -0
  72. package/skills/adgine-geo-projects/scripts/list_projects.py +47 -0
  73. package/skills/adgine-geo-projects/scripts/manage_competitors.py +122 -0
  74. package/skills/adgine-geo-projects/scripts/manage_project.py +88 -0
  75. package/skills/adgine-geo-saas/SKILL.md +144 -0
  76. package/skills/adgine-geo-saas/scripts/_client.py +341 -0
  77. package/skills/adgine-geo-saas/scripts/check_domain.py +43 -0
  78. package/skills/adgine-geo-saas/scripts/create_website.py +56 -0
  79. package/skills/adgine-geo-saas/scripts/get_task.py +94 -0
  80. package/skills/adgine-geo-site-audit/README.md +281 -0
  81. package/skills/adgine-geo-site-audit/SKILL.md +449 -0
  82. package/skills/adgine-geo-site-audit/requirements.txt +5 -0
  83. package/skills/adgine-geo-site-audit/scripts/_client.py +341 -0
  84. package/skills/adgine-geo-site-audit/scripts/_geo_notice.py +55 -0
  85. package/skills/adgine-geo-site-audit/scripts/export_skill_package.py +197 -0
  86. package/skills/adgine-geo-site-audit/scripts/geo_collect.py +2443 -0
  87. package/skills/adgine-geo-site-audit/scripts/geo_score.py +490 -0
  88. package/skills/adgine-geo-site-audit/scripts/geo_timing.py +399 -0
  89. package/skills/adgine-geo-site-audit/scripts/geo_visibility.py +718 -0
  90. package/skills/adgine-geo-site-audit/scripts/render_report_pdf.py +1502 -0
  91. package/skills/adgine-geo-topics/SKILL.md +232 -0
  92. package/skills/adgine-geo-topics/scripts/_client.py +341 -0
  93. package/skills/adgine-geo-topics/scripts/generate_prompts.py +140 -0
  94. package/skills/adgine-geo-topics/scripts/manage_prompts.py +153 -0
  95. package/skills/adgine-geo-topics/scripts/manage_topics.py +145 -0
  96. package/skills/adgine-geo-visibility/SKILL.md +168 -0
  97. package/skills/adgine-geo-visibility/scripts/_client.py +341 -0
  98. package/skills/adgine-geo-visibility/scripts/get_execution.py +151 -0
  99. package/skills/adgine-geo-visibility/scripts/get_matrix.py +111 -0
  100. package/skills/adgine-geo-visibility/scripts/get_prompt_metrics.py +104 -0
  101. package/skills/adgine-geo-visibility/scripts/get_topic_metrics.py +201 -0
  102. package/skills/adgine-geo-visibility/scripts/get_visibility.py +166 -0
  103. package/skills/adgine-geo-wordpress/SKILL.md +151 -0
  104. package/skills/adgine-geo-wordpress/scripts/_client.py +341 -0
  105. package/skills/adgine-geo-wordpress/scripts/list_publishable.py +62 -0
  106. package/skills/adgine-geo-wordpress/scripts/manage_credentials.py +139 -0
  107. package/skills/adgine-geo-wordpress/scripts/manage_publishes.py +108 -0
  108. package/skills/adgine-geo-wordpress/scripts/publish.py +79 -0
  109. package/skills/scripts/check_version.py +290 -0
  110. package/skills/setup.py +248 -0
  111. package/src/config.js +126 -0
  112. package/src/doctor.js +137 -0
  113. package/src/install.js +90 -0
  114. package/src/manifest.js +99 -0
  115. package/src/runner.js +159 -0
@@ -0,0 +1,281 @@
1
+ # adgine-geo-site-audit
2
+
3
+ Agent-driven GEO (Generative Engine Optimization) audit skill: 5 dimensions,
4
+ 30 compressed strict v3 checks, optional AI visibility/citation sampling, and PDF
5
+ export.
6
+
7
+ This skill is intended to be integrated into
8
+ [`adgine-ai/adgine-geo-skills`](https://github.com/adgine-ai/adgine-geo-skills)
9
+ as `adgine-geo-site-audit/`. The narrower name keeps it distinct from platform
10
+ API skills such as `adgine-geo-performance`, `adgine-geo-visibility`,
11
+ `adgine-geo-analytics`, and `adgine-geo-citation`.
12
+
13
+ ## Architecture
14
+
15
+ ```
16
+ Python collector Agent judgment Deterministic scorer
17
+ ┌─────────────────┐ JSON ┌────────────────────┐ ┌─────────────────┐
18
+ │ geo_collect.py │ ───────→ │ 30 item statuses │ ───→ │ geo_score.py │
19
+ │ public signals │ │ evidence + notes │ │ score + caps │
20
+ │ 20-page sample │ │ │ │ │
21
+ └─────────────────┘ └────────────────────┘ └─────────────────┘
22
+ ```
23
+
24
+ `scripts/geo_score.py` is the single source of truth for the evaluation table:
25
+ dimension weights, item points, status coefficients, and cap rules.
26
+
27
+ ## Dimensions
28
+
29
+ | Dimension | Weight | Items | Focus |
30
+ |---|---:|---:|---|
31
+ | 维度一:AI 可发现 | 25% | 7 | crawler discovery, access, indexability, rendering |
32
+ | 维度二:AI 可理解 | 20% | 7 | metadata, headings, information architecture, schema |
33
+ | 维度三:AI 可引用 | 20% | 5 | quotable answers, content formats, evidence, density |
34
+ | 维度四:AI 可信任 | 20% | 5 | entity clarity, trust pages, third-party validation |
35
+ | 维度五:AI 可推荐 | 15% | 6 | topical authority, decision assets, conversion paths |
36
+
37
+ ## Quick Start
38
+
39
+ ```bash
40
+ pip install -r requirements.txt
41
+ python scripts/geo_collect.py https://example.com --max-subpages 20 --concurrency 6 --output ./signals.json
42
+ python scripts/geo_score.py validate
43
+ ```
44
+
45
+ The agent reads `SKILL.md`, evaluates all 30 items from the collected evidence,
46
+ then scores the structured assessment:
47
+
48
+ ```bash
49
+ python scripts/geo_score.py score ./assessment.json \
50
+ --output ./score-results.json \
51
+ --report ./score-report.md
52
+ ```
53
+
54
+ Windows PowerShell:
55
+
56
+ ```powershell
57
+ py -m pip install -r requirements.txt
58
+ py scripts\geo_collect.py https://example.com --max-subpages 20 --concurrency 6 --output .\signals.json
59
+ py scripts\geo_score.py validate
60
+ py scripts\geo_score.py score .\assessment.json `
61
+ --output .\score-results.json `
62
+ --report .\score-report.md
63
+ ```
64
+
65
+ Assessment JSON shape:
66
+
67
+ ```json
68
+ {
69
+ "items": {
70
+ "1.1": {"status": "PASS", "note": "HTTPS 可用,入口统一。"},
71
+ "1.2": {"status": "WARN", "note": "robots 可访问,但缺少 llms.txt。"}
72
+ }
73
+ }
74
+ ```
75
+
76
+ ## Scoring
77
+
78
+ | Status | Badge | Coefficient | Meaning |
79
+ |---|---|---:|---|
80
+ | PASS | ✅ PASS | 1.0 | Meets standard |
81
+ | WARN | ⚠️ WARN | item-specific | Needs improvement |
82
+ | FAIL | ❌ FAIL | 0.0 | Does not meet standard |
83
+ | ERROR | 🔴 ERROR | excluded | Detection failed |
84
+ | N/A | ➖ N/A | excluded | Not applicable to the business model |
85
+
86
+ Formula:
87
+
88
+ `dimension_score = floor(Σ(item_points × coefficient) / Σ(effective_item_points) × 100)`
89
+
90
+ `GEO score = floor(Σ(dimension_score × dimension_weight))`
91
+
92
+ `WARN` uses each item's own strict-v3 coefficient, commonly 20%, 30%, 40%,
93
+ 50%, or 60%. `ERROR` and `N/A` are excluded from the effective denominator and
94
+ the dimension is normalized back to 100.
95
+
96
+ Caps apply to severe blockers:
97
+
98
+ - AI 可发现: failures in AI crawler accessibility, indexability, or error-page
99
+ fallback cap the dimension at 55 or 35.
100
+ - AI 可引用: failures in quotable answer capability and evidence support cap the
101
+ dimension at 65, 45, or 35.
102
+ - AI 可信任: failures in verifiable brand entity/contact or compliance/security
103
+ transparency cap the dimension at 55 or 35.
104
+ - AI 可推荐: failures in platform/search-intent coverage, topical authority, or
105
+ conversion landing pages cap the dimension at 60 or 45.
106
+ - Cross-dimension caps apply when crawler accessibility or error-page fallback
107
+ fails. P0 technical blockers also cap the final score at 70 or 62.
108
+
109
+ ## Optional AI Visibility / Citation Sampling
110
+
111
+ The normal audit flow does not run or mention isolated sub-agent visibility
112
+ sampling. Run it only when the user explicitly asks for AI visibility,
113
+ AI citation, or brand-in-answer sampling. This output is an optional reference
114
+ section only and does not participate in the GEO score.
115
+
116
+ Prepare prompts:
117
+
118
+ ```bash
119
+ python scripts/geo_visibility.py prepare ./signals.json --output ./visibility-plan.json
120
+ ```
121
+
122
+ The generated plan includes `subagent_concurrency_limit: 5` and
123
+ `subagent_batches`. The agent sends each `subagent_tasks` entry to one isolated
124
+ sub-agent, with no more than 5 sub-agents running at once. Sub-agents receive
125
+ only the raw prompt and output schema, not the brand profile, audit JSON, or
126
+ parent-agent conclusions.
127
+
128
+ After collecting sub-agent answers:
129
+
130
+ ```bash
131
+ python scripts/geo_visibility.py score ./visibility-plan.json ./visibility-answers.json \
132
+ --output ./visibility-results.json \
133
+ --report ./visibility-report.md
134
+ ```
135
+
136
+ Product and use-case terms are extracted from the audited site's own public
137
+ content and URL slugs. The visibility module does not use a fixed product
138
+ keyword list, so prompts are less biased toward finance, payments, or SaaS
139
+ examples.
140
+
141
+ ## Collection Performance
142
+
143
+ The collector samples up to 20 sub-pages by default. Raising the sample size
144
+ improves coverage but can increase runtime on slow sites; use
145
+ `--max-subpages` to tune it per run.
146
+
147
+ Sub-page sampling combines sitemap order with GEO-specific priority. The
148
+ homepage is fetched separately first. If sitemap page URLs exist, they are used
149
+ as the candidate pool; if sitemap is missing or empty, same-origin homepage
150
+ links are used as the fallback pool. Candidates are selected in this order: core
151
+ conversion pages, core trust pages, citation-ready pages, one page per
152
+ important residual template, technical entry URLs, and finally high-risk
153
+ validation URLs such as component/search/fallback/404-like paths.
154
+
155
+ Time-saving defaults:
156
+
157
+ - Sitemap discovery first uses robots-declared sitemap URLs, then falls back to
158
+ common sitemap locations only when the declared paths fail. Child sitemap
159
+ indexes are followed in bounded parallel batches. If no sitemap page URLs are
160
+ available, homepage same-origin links are used for sub-page sampling without
161
+ marking the sitemap itself as healthy.
162
+ - AI/search crawler UA probes run in parallel.
163
+ - Sitemap sub-page fetches run in parallel with a default concurrency of 6.
164
+ - Wikipedia and Wikidata probes run concurrently.
165
+ - The 404 probe remains mandatory because it feeds soft-404 and 404-index
166
+ conflict scoring; it runs in the resource-discovery batch and is timed as
167
+ `meta.timings.notfound_probe_seconds`.
168
+
169
+ Reports do not display generation duration for now. Detailed debug timings are stored in `meta.timings` inside the collector JSON.
170
+ `geo_score.py` and `geo_visibility.py` also write `timings` to their output JSON.
171
+ For PDF export, pass `--timings-output ./pdf-timings.json` when you need a
172
+ debug trace of Markdown rendering and PDF engine time.
173
+
174
+ To summarize timing without slowing down the audit, run `scripts/geo_timing.py`
175
+ once at the end. It reads existing artifact timings instead of adding start/stop
176
+ commands around every phase:
177
+
178
+ ```bash
179
+ python scripts/geo_collect.py https://example.com --max-subpages 20 --concurrency 6 --output ./signals.json
180
+ # agent generates assessment.json
181
+ python scripts/geo_score.py score ./assessment.json --output ./score-results.json --report ./score-report.md
182
+
183
+ python scripts/geo_timing.py artifacts \
184
+ --label example.com \
185
+ --collect-json ./signals.json \
186
+ --score-json ./score-results.json \
187
+ --output ./timing-summary.json \
188
+ --report ./timing-summary.md
189
+ ```
190
+
191
+ If the optional AI visibility/citation sampling ran, add
192
+ `--visibility-plan-json ./visibility-plan.json` and
193
+ `--visibility-results-json ./visibility-results.json`.
194
+
195
+ If the UI exposes elapsed time, pass it as `--ui-elapsed-seconds <seconds>` and
196
+ the summary reports the remaining untracked agent/UI overhead. The legacy
197
+ `start`/`mark` ledger mode still exists for deep debugging, but it should not be
198
+ used in the default audit flow because marker commands themselves add overhead.
199
+
200
+ ## PDF Export
201
+
202
+ After the agent generates a Markdown report, save it to a `.md` file and render
203
+ it to PDF:
204
+
205
+ ```bash
206
+ TEMP_DIR="${TMPDIR:-/tmp}"
207
+ python scripts/render_report_pdf.py "$TEMP_DIR/geo_audit_reports/example.md" \
208
+ --output "$TEMP_DIR/geo_audit_reports/example.pdf"
209
+ ```
210
+
211
+ Windows PowerShell:
212
+
213
+ ```powershell
214
+ py scripts\render_report_pdf.py $env:TEMP\geo_audit_reports\example.md `
215
+ --output $env:TEMP\geo_audit_reports\example.pdf
216
+ ```
217
+
218
+ The renderer defaults to the pure-Python ReportLab path, so normal PDF export
219
+ does not launch Chrome/Chromium in background agent environments. Use
220
+ `--keep-html` to preserve intermediate HTML for debugging. Use
221
+ `--engine playwright` or `--engine chrome` only when browser rendering is
222
+ explicitly required; `--engine auto` tries ReportLab first, then browser
223
+ engines.
224
+
225
+ To install Playwright into the Python environment that runs this script, pass
226
+ `--install-playwright` once:
227
+
228
+ ```bash
229
+ python scripts/render_report_pdf.py "$TEMP_DIR/geo_audit_reports/example.md" \
230
+ --output "$TEMP_DIR/geo_audit_reports/example.pdf" \
231
+ --engine playwright \
232
+ --install-playwright
233
+ ```
234
+
235
+ Set `GEO_AUDIT_PLAYWRIGHT_EXECUTABLE_PATH=/path/to/chrome` if Playwright's
236
+ default bundled browser is blocked. Set `GEO_AUDIT_CHROME_PATH=/path/to/chrome`
237
+ to force a Chrome/Chromium/Edge binary.
238
+
239
+ ## Skill Package Export
240
+
241
+ Create a portable zip package for installing or moving this skill:
242
+
243
+ ```bash
244
+ python scripts/export_skill_package.py
245
+ ```
246
+
247
+ By default the script writes `dist/adgine-geo-site-audit-<timestamp>.zip` and
248
+ stores files under the top-level `adgine-geo-site-audit/` directory inside the
249
+ zip. It includes `SKILL.md`, `README.md`, `requirements.txt`, `scripts/*.py`,
250
+ and `tests/*.py`, while excluding `.git`, `dist`, Python caches, pyc files, and
251
+ local run artifacts.
252
+
253
+ Runtime-only package:
254
+
255
+ ```bash
256
+ python scripts/export_skill_package.py --no-tests --output dist/adgine-geo-site-audit-runtime.zip
257
+ ```
258
+
259
+ ## Usage with Agent
260
+
261
+ Tell your agent:
262
+
263
+ > 审计 longbridge.com
264
+
265
+ The agent will:
266
+
267
+ 1. Run `geo_collect.py` to collect public signals.
268
+ 2. Judge all 30 score-table items with evidence-backed notes.
269
+ 3. Run `geo_score.py score` to calculate dimension scores, caps, and GEO score.
270
+ 4. Generate a Markdown report and ask whether to export PDF.
271
+
272
+ If the user explicitly asks to add AI visibility/citation sampling, the agent
273
+ runs `geo_visibility.py` and inserts the optional reference section before
274
+ prioritized recommendations.
275
+
276
+ ## Dependencies
277
+
278
+ - Python 3.9+ on macOS/Linux/Windows
279
+ - requests, beautifulsoup4, lxml, markdown, reportlab
280
+ - Chrome/Chromium/Edge or Playwright Chromium, optional for SPA rendering and
281
+ high-fidelity PDF export