optbrew 0.0.0-stage → 0.1.2

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 (179) hide show
  1. package/.claude-plugin/marketplace.json +6 -0
  2. package/.claude-plugin/plugin.json +6 -0
  3. package/.codex-plugin/plugin.json +13 -0
  4. package/CHANGELOG.md +50 -0
  5. package/LICENSE +21 -0
  6. package/README.ko.md +149 -0
  7. package/README.md +148 -2
  8. package/THIRD_PARTY_NOTICES.md +10 -0
  9. package/bin/optbrew.mjs +4 -0
  10. package/docs/platforms.md +107 -0
  11. package/docs/release.md +14 -0
  12. package/lib/cli.mjs +116 -0
  13. package/lib/doctor.mjs +45 -0
  14. package/lib/install.mjs +158 -0
  15. package/lib/paths.mjs +30 -0
  16. package/lib/records.mjs +44 -0
  17. package/lib/reinstall.mjs +92 -0
  18. package/lib/transaction.mjs +205 -0
  19. package/lib/update.mjs +189 -0
  20. package/package.json +39 -4
  21. package/plugin.json +13 -0
  22. package/skills/optbrew/LICENSE +21 -0
  23. package/skills/optbrew/SKILL.md +17 -0
  24. package/skills/optbrew/THIRD_PARTY_NOTICES.md +10 -0
  25. package/skills/optbrew/agents/openai.yaml +4 -0
  26. package/skills/optbrew/bundle-manifest.json +687 -0
  27. package/skills/optbrew/licenses/firecrawl-seo-audit.txt +15 -0
  28. package/skills/optbrew/licenses/magnus-seo.txt +21 -0
  29. package/skills/optbrew/licenses/marketing-search.txt +21 -0
  30. package/skills/optbrew/licenses/mblode-seo.txt +21 -0
  31. package/skills/optbrew/licenses/naver-searchadvisor.txt +29 -0
  32. package/skills/optbrew/licenses/seranking-seo.txt +21 -0
  33. package/skills/optbrew/modules/firecrawl-seo-audit/GUIDE.md +64 -0
  34. package/skills/optbrew/modules/magnus-seo/GUIDE.md +79 -0
  35. package/skills/optbrew/modules/magnus-seo/README.md +45 -0
  36. package/skills/optbrew/modules/magnus-seo/assets/audit-report-template.md +76 -0
  37. package/skills/optbrew/modules/magnus-seo/references/aeo-methodology.md +105 -0
  38. package/skills/optbrew/modules/magnus-seo/references/agent-readable-content.md +28 -0
  39. package/skills/optbrew/modules/magnus-seo/references/content-and-entity-architecture.md +100 -0
  40. package/skills/optbrew/modules/magnus-seo/references/content-strategy-seo.md +142 -0
  41. package/skills/optbrew/modules/magnus-seo/references/discovery-and-freshness.md +47 -0
  42. package/skills/optbrew/modules/magnus-seo/references/evidence-boundaries.md +75 -0
  43. package/skills/optbrew/modules/magnus-seo/references/ghost-metadata.md +204 -0
  44. package/skills/optbrew/modules/magnus-seo/references/implementation-playbook.md +114 -0
  45. package/skills/optbrew/modules/magnus-seo/references/measurement-and-experimentation.md +47 -0
  46. package/skills/optbrew/modules/magnus-seo/references/onpage-seo.md +154 -0
  47. package/skills/optbrew/modules/magnus-seo/references/platform-guidance.md +30 -0
  48. package/skills/optbrew/modules/magnus-seo/references/schema-markup.md +244 -0
  49. package/skills/optbrew/modules/magnus-seo/references/source-index.md +36 -0
  50. package/skills/optbrew/modules/magnus-seo/references/structured-data.md +56 -0
  51. package/skills/optbrew/modules/magnus-seo/references/technical-seo.md +99 -0
  52. package/skills/optbrew/modules/magnus-seo/scripts/aeo_audit.py +158 -0
  53. package/skills/optbrew/modules/magnus-seo/scripts/build_prompt_matrix.py +52 -0
  54. package/skills/optbrew/modules/magnus-seo/templates/aeo-implementation-plan.md +53 -0
  55. package/skills/optbrew/modules/magnus-seo/templates/citation-observation-log.md +16 -0
  56. package/skills/optbrew/modules/magnus-seo/templates/llms.txt.template +15 -0
  57. package/skills/optbrew/modules/magnus-seo/templates/question-cluster.md +27 -0
  58. package/skills/optbrew/modules/magnus-seo/templates/robots-ai-crawlers.txt +23 -0
  59. package/skills/optbrew/modules/marketing-search/skills/ai-seo/GUIDE.md +483 -0
  60. package/skills/optbrew/modules/marketing-search/skills/ai-seo/references/agent-readiness.md +57 -0
  61. package/skills/optbrew/modules/marketing-search/skills/ai-seo/references/citations-vs-recommendations.md +85 -0
  62. package/skills/optbrew/modules/marketing-search/skills/ai-seo/references/content-patterns.md +287 -0
  63. package/skills/optbrew/modules/marketing-search/skills/ai-seo/references/content-types.md +71 -0
  64. package/skills/optbrew/modules/marketing-search/skills/ai-seo/references/format-volatility.md +98 -0
  65. package/skills/optbrew/modules/marketing-search/skills/ai-seo/references/okf.md +104 -0
  66. package/skills/optbrew/modules/marketing-search/skills/ai-seo/references/platform-ranking-factors.md +154 -0
  67. package/skills/optbrew/modules/marketing-search/skills/ai-seo/references/youtube-ai-citations.md +60 -0
  68. package/skills/optbrew/modules/marketing-search/skills/analytics/GUIDE.md +303 -0
  69. package/skills/optbrew/modules/marketing-search/skills/analytics/references/event-library.md +260 -0
  70. package/skills/optbrew/modules/marketing-search/skills/analytics/references/ga4-implementation.md +300 -0
  71. package/skills/optbrew/modules/marketing-search/skills/analytics/references/gtm-implementation.md +390 -0
  72. package/skills/optbrew/modules/marketing-search/skills/content-strategy/GUIDE.md +432 -0
  73. package/skills/optbrew/modules/marketing-search/skills/content-strategy/references/content-distribution.md +83 -0
  74. package/skills/optbrew/modules/marketing-search/skills/content-strategy/references/headless-cms.md +194 -0
  75. package/skills/optbrew/modules/marketing-search/skills/programmatic-seo/GUIDE.md +231 -0
  76. package/skills/optbrew/modules/marketing-search/skills/programmatic-seo/references/playbooks.md +308 -0
  77. package/skills/optbrew/modules/marketing-search/skills/schema/GUIDE.md +172 -0
  78. package/skills/optbrew/modules/marketing-search/skills/schema/references/schema-examples.md +398 -0
  79. package/skills/optbrew/modules/marketing-search/skills/seo-audit/GUIDE.md +492 -0
  80. package/skills/optbrew/modules/marketing-search/skills/seo-audit/references/ai-writing-detection.md +200 -0
  81. package/skills/optbrew/modules/marketing-search/skills/seo-audit/references/international-seo.md +230 -0
  82. package/skills/optbrew/modules/marketing-search/skills/site-architecture/GUIDE.md +350 -0
  83. package/skills/optbrew/modules/marketing-search/skills/site-architecture/references/mermaid-templates.md +216 -0
  84. package/skills/optbrew/modules/marketing-search/skills/site-architecture/references/navigation-patterns.md +305 -0
  85. package/skills/optbrew/modules/marketing-search/skills/site-architecture/references/site-type-templates.md +293 -0
  86. package/skills/optbrew/modules/mblode-seo/GUIDE.md +74 -0
  87. package/skills/optbrew/modules/mblode-seo/references/answer-engines.md +58 -0
  88. package/skills/optbrew/modules/mblode-seo/references/audit.md +78 -0
  89. package/skills/optbrew/modules/mblode-seo/references/brief-template.md +47 -0
  90. package/skills/optbrew/modules/mblode-seo/references/monitoring.md +56 -0
  91. package/skills/optbrew/modules/mblode-seo/references/nextjs-implementation.md +65 -0
  92. package/skills/optbrew/modules/mblode-seo/references/research-protocol.md +37 -0
  93. package/skills/optbrew/modules/mblode-seo/references/sources.md +47 -0
  94. package/skills/optbrew/modules/mblode-seo/references/validation-evidence.md +21 -0
  95. package/skills/optbrew/modules/naver-searchadvisor/GUIDE.md +75 -0
  96. package/skills/optbrew/modules/naver-searchadvisor/NOTICE.md +59 -0
  97. package/skills/optbrew/modules/naver-searchadvisor/references/INDEX.md +97 -0
  98. package/skills/optbrew/modules/naver-searchadvisor/scripts/audit.mjs +742 -0
  99. package/skills/optbrew/modules/naver-searchadvisor/scripts/robots.mjs +77 -0
  100. package/skills/optbrew/modules/seranking-seo/skills/seo-ai-search-share-of-voice/GUIDE.md +94 -0
  101. package/skills/optbrew/modules/seranking-seo/skills/seo-api/GUIDE.md +186 -0
  102. package/skills/optbrew/modules/seranking-seo/skills/seo-api/references/api-surface-map.md +207 -0
  103. package/skills/optbrew/modules/seranking-seo/skills/seo-api/references/auth-and-keys.md +182 -0
  104. package/skills/optbrew/modules/seranking-seo/skills/seo-api/references/integration-patterns.md +283 -0
  105. package/skills/optbrew/modules/seranking-seo/skills/seo-api/references/rate-limits-and-credits.md +235 -0
  106. package/skills/optbrew/modules/seranking-seo/skills/seo-competitor-gap-analysis/GUIDE.md +117 -0
  107. package/skills/optbrew/modules/seranking-seo/skills/seo-content-audit/GUIDE.md +155 -0
  108. package/skills/optbrew/modules/seranking-seo/skills/seo-content-audit/references/cite.md +84 -0
  109. package/skills/optbrew/modules/seranking-seo/skills/seo-content-audit/references/core-eeat.md +147 -0
  110. package/skills/optbrew/modules/seranking-seo/skills/seo-content-audit/templates/verdict.md +63 -0
  111. package/skills/optbrew/modules/seranking-seo/skills/seo-firecrawl/GUIDE.md +141 -0
  112. package/skills/optbrew/modules/seranking-seo/skills/seo-firecrawl/references/preflight.md +73 -0
  113. package/skills/optbrew/modules/seranking-seo/skills/seo-geo/GUIDE.md +159 -0
  114. package/skills/optbrew/modules/seranking-seo/skills/seo-google/GUIDE.md +393 -0
  115. package/skills/optbrew/modules/seranking-seo/skills/seo-google/assets/templates/cwv-audit-report.md +48 -0
  116. package/skills/optbrew/modules/seranking-seo/skills/seo-google/assets/templates/gsc-performance-report.md +44 -0
  117. package/skills/optbrew/modules/seranking-seo/skills/seo-google/assets/templates/indexation-status-report.md +43 -0
  118. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/auth-setup.md +160 -0
  119. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/cross-skill-integration.md +187 -0
  120. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/ga4-data-api.md +184 -0
  121. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/indexing-api.md +109 -0
  122. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/keyword-planner-api.md +66 -0
  123. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/nlp-api.md +55 -0
  124. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/pagespeed-crux-api.md +204 -0
  125. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/rate-limits-quotas.md +75 -0
  126. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/search-console-api.md +156 -0
  127. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/supplementary-apis.md +99 -0
  128. package/skills/optbrew/modules/seranking-seo/skills/seo-google/references/youtube-api.md +49 -0
  129. package/skills/optbrew/modules/seranking-seo/skills/seo-keyword-niche/GUIDE.md +174 -0
  130. package/skills/optbrew/modules/seranking-seo/skills/seo-page/GUIDE.md +174 -0
  131. package/skills/optbrew/modules/seranking-seo/skills/seo-plan/GUIDE.md +220 -0
  132. package/skills/optbrew/modules/seranking-seo/skills/seo-schema/GUIDE.md +135 -0
  133. package/skills/optbrew/modules/seranking-seo/skills/seo-schema/references/google-rich-results.md +89 -0
  134. package/skills/optbrew/modules/seranking-seo/skills/seo-schema/templates/article.json +23 -0
  135. package/skills/optbrew/modules/seranking-seo/skills/seo-schema/templates/breadcrumb-list.json +18 -0
  136. package/skills/optbrew/modules/seranking-seo/skills/seo-schema/templates/faq-page.json +22 -0
  137. package/skills/optbrew/modules/seranking-seo/skills/seo-schema/templates/local-business.json +32 -0
  138. package/skills/optbrew/modules/seranking-seo/skills/seo-schema/templates/product.json +25 -0
  139. package/skills/optbrew/modules/seranking-seo/skills/seo-sitemap/GUIDE.md +128 -0
  140. package/skills/optbrew/modules/seranking-seo/skills/seo-technical-audit/GUIDE.md +235 -0
  141. package/skills/optbrew/modules/seranking-seo/skills/seo-technical-audit/references/severity-mapping.md +133 -0
  142. package/skills/optbrew/references/ai-crawlers.json +21 -0
  143. package/skills/optbrew/references/ai-crawlers.md +24 -0
  144. package/skills/optbrew/references/api.md +45 -0
  145. package/skills/optbrew/references/check-registry.json +28 -0
  146. package/skills/optbrew/references/evidence.md +9 -0
  147. package/skills/optbrew/references/intake.md +9 -0
  148. package/skills/optbrew/references/measurement.md +29 -0
  149. package/skills/optbrew/references/policies.md +7 -0
  150. package/skills/optbrew/references/profiles.json +13 -0
  151. package/skills/optbrew/references/remediations.json +12 -0
  152. package/skills/optbrew/references/report.md +29 -0
  153. package/skills/optbrew/references/routing.md +15 -0
  154. package/skills/optbrew/references/schemas/contract.schema.json +51 -0
  155. package/skills/optbrew/references/scoring.md +62 -0
  156. package/skills/optbrew/scripts/adapters/anthropic.mjs +116 -0
  157. package/skills/optbrew/scripts/adapters/imports.mjs +81 -0
  158. package/skills/optbrew/scripts/audit.mjs +124 -0
  159. package/skills/optbrew/scripts/cli.mjs +41 -0
  160. package/skills/optbrew/scripts/core/bootstrap.mjs +31 -0
  161. package/skills/optbrew/scripts/core/bundle.mjs +73 -0
  162. package/skills/optbrew/scripts/core/capabilities.mjs +19 -0
  163. package/skills/optbrew/scripts/core/collector.mjs +250 -0
  164. package/skills/optbrew/scripts/core/compare.mjs +47 -0
  165. package/skills/optbrew/scripts/core/contracts.mjs +144 -0
  166. package/skills/optbrew/scripts/core/cost-ledger.mjs +95 -0
  167. package/skills/optbrew/scripts/core/crawlers.mjs +11 -0
  168. package/skills/optbrew/scripts/core/derive.mjs +168 -0
  169. package/skills/optbrew/scripts/core/facts.mjs +189 -0
  170. package/skills/optbrew/scripts/core/findings.mjs +54 -0
  171. package/skills/optbrew/scripts/core/html.mjs +53 -0
  172. package/skills/optbrew/scripts/core/metrics.mjs +97 -0
  173. package/skills/optbrew/scripts/core/protocol.mjs +125 -0
  174. package/skills/optbrew/scripts/core/report.mjs +742 -0
  175. package/skills/optbrew/scripts/core/scope.mjs +52 -0
  176. package/skills/optbrew/scripts/core/score.mjs +71 -0
  177. package/skills/optbrew/scripts/core/weights.mjs +139 -0
  178. package/skills/optbrew/source-lock.json +2686 -0
  179. package/source-lock.json +2686 -0
@@ -0,0 +1,49 @@
1
+ # YouTube Data API v3 Reference
2
+
3
+ YouTube mentions have the strongest correlation with AI visibility (0.737 per GEO research). This API provides authoritative YouTube data directly from Google.
4
+
5
+ ## Endpoints Used
6
+
7
+ | Method | Quota Cost | Description |
8
+ |--------|-----------|-------------|
9
+ | `search.list` | 100 units | Search for videos matching a query |
10
+ | `videos.list` | 1 unit | Get video details, statistics, content |
11
+ | `channels.list` | 1 unit | Get channel info, subscriber count |
12
+ | `commentThreads.list` | 1 unit | Get top comments on a video |
13
+
14
+ ## Daily Quota
15
+
16
+ Default: **10,000 units/day** (free). This allows:
17
+ - ~100 searches per day, OR
18
+ - ~10,000 video/channel lookups per day
19
+
20
+ ## Data Available
21
+
22
+ ### Video Search
23
+ - Title, channel, channel ID, published date
24
+ - Description (first 300 chars), thumbnail URL
25
+ - Views, likes, comments count, duration
26
+
27
+ ### Video Details
28
+ - Full description, tags, category ID
29
+ - Duration, definition (HD/SD), has captions
30
+ - Topic categories (Wikipedia URLs)
31
+ - Views, likes, comments, favorites
32
+ - Top 10 relevant comments with likes
33
+
34
+ ### Channel Info
35
+ - Title, description, custom URL
36
+ - Subscriber count, video count, total views
37
+ - Country, published date, thumbnail
38
+
39
+ ## Authentication
40
+
41
+ **API key only** (read-only public data). No OAuth needed.
42
+
43
+ ## Enable the API
44
+
45
+ 1. Go to [console.cloud.google.com/apis/library](https://console.cloud.google.com/apis/library)
46
+ 2. Search for "YouTube Data API v3"
47
+ 3. Click Enable
48
+
49
+ No billing required. The API key you already have for PSI/CrUX works.
@@ -0,0 +1,174 @@
1
+ > Example output: examples/seo-keyword-niche-espresso-machine-reviews-20260514/KEYWORD-NICHE-PLAN.md (upstream-only reference; route through optbrew)
2
+
3
+ # Keyword Niche
4
+
5
+ Mine the long tail for content opportunities. Pulls longtail variants, question-intent keywords, related keywords, and SERP samples to find under-served niche keywords; clusters them by intent; proposes a content tier (template + URL pattern + sample pages + thin-content quality gates) that can be published programmatically or as a steady editorial cadence.
6
+
7
+ ## Prerequisites
8
+
9
+ - SE Ranking MCP server connected.
10
+ - User provides: a seed topic (e.g. "running shoes", "tax preparation"), or 2–5 seed keywords. Target country (default `us`). Optional: minimum volume threshold (default: 50/mo for niche skill — lower than `seo-keyword-cluster`'s 100), maximum KD (default: 40 for accessibility).
11
+
12
+ ## Process
13
+
14
+ 1. **Validate & preflight**
15
+ - Confirm seeds make sense (not too broad, not branded, not single-letter).
16
+ - `DATA_getCreditBalance` — surface remaining credits. This skill is heavier than most: pulling longtail at depth costs more than pulling head terms.
17
+
18
+ 2. **Longtail expansion** `DATA_getLongTailKeywords`
19
+ - For each seed: pull longtail variants (typically 3+ words, lower individual volume, lower KD).
20
+ - Target: 200–500 longtail candidates per seed.
21
+
22
+ 3. **Question expansion** `DATA_getKeywordQuestions`
23
+ - For each seed: pull question-phrased keywords.
24
+ - These are gold for content mining — explicit user intent in the keyword.
25
+
26
+ 4. **Related expansion** `DATA_getRelatedKeywords` and `DATA_getSimilarKeywords`
27
+ - For each seed: pull related + similar keywords.
28
+ - Catches semantic neighbours that longtail expansion missed.
29
+
30
+ 5. **Filter and clean**
31
+ - Remove keywords below `min_volume` and above `max_kd`.
32
+ - Strip branded keywords the seed-domain doesn't own (unless the user supplied a branded seed).
33
+ - Tag each keyword with detected intent: informational, commercial, transactional, navigational.
34
+ - De-duplicate across seeds.
35
+
36
+ 6. **SERP sample for representative keywords** `DATA_getSerpResults`
37
+ - For 5–10 representative keywords (one per emerging cluster), pull top 10.
38
+ - Identify the dominant page type for each cluster (informs the template proposal in step 8).
39
+
40
+ 7. **Cluster by intent + theme**
41
+ - Group keywords by semantic similarity + intent.
42
+ - Each cluster: name, primary keyword, supporting keywords, total volume, weighted KD, dominant page type.
43
+ - Target 8–20 clusters (more granular than `seo-keyword-cluster`'s 5–12 — this skill is for niche tiers).
44
+
45
+ 8. **Propose a content tier**
46
+ - Template structure: which fields make each page unique. For `{city} apartment rentals`, the template fields are `{city}`, `{neighborhood}`, `{price_range}`, `{property_count}`. For `{tool} alternatives` it's `{tool}`, `{competitor_count}`, `{primary_use_case}`.
47
+ - URL pattern: `/{category}/{slug}/` or `/{topic}/{tool}-alternatives/` etc.
48
+ - Sample pages: 3 fully-spec'd page wireframes for representative cluster keywords.
49
+ - Internal-linking automation: how to link pages within the tier (hub-spoke from a category page, or peer-to-peer for genuinely flat structures).
50
+
51
+ 9. **Quality gates** (anti-thin-content guardrails)
52
+ - **Minimum unique data per page:** template fields must produce ≥ 5 unique attributes (counts, prices, names, dates, etc.). Pages without 5+ unique attributes are duplicates in disguise — skip those keyword variants.
53
+ - **Minimum word count:** 600 words effective content (excludes navigation, footer, boilerplate).
54
+ - **Schema requirement:** every templated page gets `Article` (or relevant type) + `BreadcrumbList`.
55
+ - **Index/noindex split:** if the variant doesn't pass the unique-data threshold, generate the page but `noindex` it.
56
+
57
+ ### 9a. Programmatic publishing — extra gates
58
+
59
+ Most users discover this skill because they want to ship pages at scale (programmatic SEO, data-driven directories, location pages). Programmatic publishing is the highest-risk path for spam-classifier blowback. Apply these *in addition* to the gates above whenever the proposed tier expects to ship 50+ templated pages.
60
+
61
+ - **Per-row uniqueness threshold (≥ 30% varying fields).** Of the template's content-producing fields (excluding nav/footer boilerplate), **at least 30% must hold values that differ from the median sibling page**. A 12-field template where 9 fields are identical across pages is templated mush — Google's spam systems are well-tuned for this since the 2024 core update. Compute: `varying_fields / content_fields ≥ 0.30` per row vs the cluster median.
62
+ - **Min unique-fact count vs parent + sibling (≥ 5 facts).** Each row carries at least 5 facts that *do not appear on the parent hub page or any sibling page in the same cluster*. Facts = numbers, dates, named entities, original quotes, photos. Synonym shuffles don't count. Sample 10 rows manually before greenlighting the tier.
63
+ - **Data-source independence.** Don't auto-publish from a single source (one CSV, one API, one scrape). If the page's only differentiator is a row from `cities.csv`, the page is a CSV row dressed as content — likely thin. Combine ≥ 2 independent data sources per page.
64
+ - **Index-bloat circuit-breaker.** After the first 50 pages ship, monitor GSC. If the index-coverage rate drops below 60% (Google indexed <60% of submitted), pause the tier and re-audit. Continuing past this signal compounds bloat across the rest of the tier.
65
+ - **Crawl-budget honesty.** Sites under 50k pages can usually crawl whatever you ship. Sites >50k must factor in crawl-budget cost: every thin programmatic page steals attention from the cornerstone content. If the site is in this band and the unique-fact count is borderline, default to noindex.
66
+
67
+ These gates are not negotiable for the programmatic path. If the proposed tier can't pass them, the right answer is fewer pages, not lower thresholds.
68
+
69
+ 10. **Synthesise** `KEYWORD-NICHE-PLAN.md`
70
+
71
+ ## Output format
72
+
73
+ Create a folder `seo-keyword-niche-{target-slug}-{YYYYMMDD}/` with:
74
+
75
+ ```
76
+ seo-keyword-niche-{target-slug}-{YYYYMMDD}/
77
+ ├── KEYWORD-NICHE-PLAN.md (synthesised plan — primary deliverable)
78
+ ├── keywords.csv (all enriched keywords with cluster + intent — load-bearing CSV the publishing team paste into CMS/sheets)
79
+ ├── 06-template-spec.md (fields, URL pattern, sample pages — load-bearing reference writers consult directly)
80
+ ├── 07-quality-gates.md (thin-content guardrails — load-bearing reference release-gate readers consult directly)
81
+ └── evidence/
82
+ ├── 01-seed-expansion.md (raw expansion per seed — raw step output)
83
+ ├── 02-question-keywords.md (DATA_getKeywordQuestions)
84
+ ├── 03-filtered-keywords.md (post min-vol / max-kd filter)
85
+ ├── 04-cluster-assignment.md (every keyword and its cluster)
86
+ └── 05-serp-samples.md (top 10 for representative cluster keywords)
87
+ ```
88
+
89
+ Top-level: `KEYWORD-NICHE-PLAN.md` + `keywords.csv` + `06-template-spec.md` + `07-quality-gates.md`. Writers consult the template spec directly when authoring; release gates consult the quality gates directly. The 01–05 step files preserve raw API/clustering outputs in `evidence/`.
90
+
91
+ `KEYWORD-NICHE-PLAN.md` shape:
92
+
93
+ ```markdown
94
+ # Keyword Niche Plan: {topic}
95
+
96
+ > Generated {YYYY-MM-DD} · Country: {country} · Seeds: {list}
97
+
98
+ ## Inventory
99
+ - Longtail keywords mined: {n}
100
+ - Question keywords: {n}
101
+ - After filter (min-vol {n}, max-kd {n}): {n}
102
+ - Clusters formed: {n}
103
+ - Estimated combined monthly volume: {n}
104
+
105
+ ## Recommended content tier
106
+
107
+ ### Template
108
+ **URL pattern:** `/{category}/{slug}/`
109
+
110
+ **Required fields per page:**
111
+ - `{slug}` — URL-friendly identifier
112
+ - `{H1}` — page primary heading
113
+ - `{TL;DR}` — first 200 words direct answer
114
+ - `{primary_keyword}` — target keyword
115
+ - `{related_keywords}` — secondary keywords from cluster
116
+ - `{unique_attributes}` — list of ≥ 5 differentiating attributes (numbers, names, dates)
117
+ - `{related_pages}` — internal-link list (3–5 sibling pages)
118
+ - `{schema_type}` — Article/Product/Other
119
+ - `{datestamp}` — last-updated date
120
+
121
+ **Sample pages:** see `06-template-spec.md` for 3 fully-spec'd wireframes.
122
+
123
+ ## Cluster build order (top 10 by priority)
124
+
125
+ | Rank | Cluster | Volume (combined) | Weighted KD | Dominant page type | Pages to ship |
126
+ |---|---|---|---|---|---|
127
+ | 1 | {cluster name} | {n} | {kd} | {type} | {n} |
128
+ | ... |
129
+
130
+ ## Quality gates (do not ship pages that fail)
131
+
132
+ 1. **Unique-data threshold:** each page has ≥ 5 unique attributes vs sibling pages in the same cluster.
133
+ 2. **Minimum word count:** 600 words effective content.
134
+ 3. **Schema:** `Article` + `BreadcrumbList` (or relevant `@type` for the page).
135
+ 4. **Internal links:** ≥ 3 outbound to siblings, ≥ 1 inbound from category hub.
136
+ 5. **Index/noindex:** noindex pages that don't pass the unique-data threshold.
137
+
138
+ ### Programmatic-only gates (apply when tier ships 50+ pages)
139
+
140
+ 6. **Per-row uniqueness ≥ 30%:** at least 30% of content-producing fields hold values that differ from the cluster median.
141
+ 7. **Min unique facts vs parent + sibling (≥ 5):** five facts per row that don't appear on the parent hub or any sibling.
142
+ 8. **Data-source independence:** ≥ 2 independent data sources per page (no single-CSV pages).
143
+ 9. **Index-bloat circuit-breaker:** pause tier if GSC index-coverage <60% after the first 50 pages.
144
+
145
+ ## Scaling estimate
146
+ - Clusters: {n}
147
+ - Pages per cluster (median): {n}
148
+ - Total pages: {n}
149
+ - At {pages/week} cadence: {n weeks} to ship the tier.
150
+ - Crawl-budget impact (for sites > 10k pages): noindex strategy keeps thin variants out of the index.
151
+
152
+ ## Risks / monitoring
153
+ - **Thin-content penalty:** the quality gates above are the guardrail. Audit at scale via `seo-technical-audit` after first 100 pages ship.
154
+ - **Index bloat:** monitor in GSC; if newly indexed pages don't accrue impressions in 60 days, candidate for noindex/consolidate.
155
+ - **Cannibalization:** monitor with `seo-subdomain` + `seo-page` after first 50 pages.
156
+
157
+ ## Recommended next step
158
+ Build a small pilot — 10 pages from the top cluster — before committing to the full tier. Apply quality gates rigorously to the pilot. Re-audit after 60 days; iterate the template based on which pilot pages indexed and ranked.
159
+ ```
160
+
161
+ `keywords.csv` columns: `keyword,volume,kd,cpc,intent,cluster,role_in_cluster,dominant_page_type,unique_attributes_estimate`
162
+
163
+ ## Tips
164
+
165
+ - Respect rate limit: 10 req/sec. Steps 2–4 fan out across all seeds; pace sequentially.
166
+ - Cost: ~30–80 credits for 5 seeds, ~150+ for 10–20 seeds. Call `DATA_getCreditBalance` before running and surface the estimate.
167
+ - **Programmatic SEO is risky.** Pages that don't pass the unique-data threshold are dead weight at best, penalty bait at worst. The quality gates in step 9 are not optional.
168
+ - The pilot recommendation is critical. 10 pages with thoughtful templates outperform 1000 pages of templated mush.
169
+ - For e-commerce / inventory-driven content (city pages, product variations), the unique-data threshold is usually easy to hit.
170
+ - For "best X for Y" content (where Y has many variants), pick variants that have genuinely distinct content — don't templatise across near-synonyms.
171
+ - Pair with `seo-keyword-cluster` for the broader pillar+spoke architecture (this skill complements, not replaces).
172
+ - Pair with `seo-content-brief` to expand individual pillar topics into full editor briefs.
173
+ - Pair with `seo-technical-audit` after first 100 pages ship to catch any thin-content / canonicalization issues.
174
+ - Don't auto-publish. The template, URL pattern, and quality gates ship from this skill; the content authoring + review remains a human responsibility.
@@ -0,0 +1,174 @@
1
+ > Example output: examples/seo-page-notion-keyboard-shortcuts-20260514/PAGE.md (upstream-only reference; route through optbrew)
2
+
3
+ # Page Intelligence
4
+
5
+ Show what a single URL ranks for, what traffic it captures, where its weak and strong points are, and what to do about it. The deliverable is an opinionated verdict — **KEEP**, **REFRESH**, **CONSOLIDATE**, or **KILL** — anchored in objective signals from SE Ranking's URL-level data.
6
+
7
+ ## Prerequisites
8
+
9
+ - SE Ranking MCP server connected.
10
+ - Claude's `WebFetch` tool available (for the page-level HTML sense-check).
11
+ - User provides: (a) a target URL, optionally (b) target market country (default: `us`), (c) primary topical keyword (auto-inferred from `<title>` + `<h1>` if not supplied).
12
+
13
+ ## Process
14
+
15
+ 1. **Validate target & preflight.** See `skills/seo-firecrawl/references/preflight.md` for the canonical 3-stage preflight (credit balance, Firecrawl availability, Google APIs). Skill-specific notes:
16
+ - Confirm the URL is fetchable; derive parent domain. If the user supplied a primary keyword, use it; otherwise infer it in step 3.
17
+ - Estimated SE Ranking cost for this skill: ~10–15 credits typical (URL overview, ranking keywords, page authority, SERP context for top 3–5 keywords).
18
+ - Firecrawl: optional with WebFetch fallback, ~1 Firecrawl credit if available. When available, step 6 recovers `og:*`, `twitter:*`, canonical, robots meta, JSON-LD types, and hreflang count from raw `<head>` — WebFetch returns markdown only and strips those fields. Without Firecrawl, the affected lines in `PAGE.md` emit `(skipped — Firecrawl not installed)`. Pass `--no-firecrawl` to treat Firecrawl as unavailable even when installed (credit conservation).
19
+ - Google APIs: tier 1 (GSC available) unlocks step 4b (GSC URL performance + URL Inspection) after the page-authority step. See `skills/seo-google/references/cross-skill-integration.md` § "seo-page" for the full recipe.
20
+
21
+ 2. **URL-level overview** `DATA_getUrlOverviewWorldwide`
22
+ - Pull keyword count, organic traffic estimate, paid keyword count, paid traffic estimate, top regions.
23
+ - Note: traffic estimates are directional — they don't replace Google Search Console.
24
+
25
+ 3. **Ranking keywords** `DATA_getDomainKeywords` (use the `url` param for exact match — not `filter_url`)
26
+ - Pull every keyword the URL ranks for in the target country, with positions.
27
+ - Sort by traffic-weighted score: `volume × CTR-by-position` (use a standard CTR curve: 1=28%, 2=15%, 3=11%, 4=8%, 5=7%, 6=5%, 7=4%, 8=3%, 9=2%, 10=2%, 11+=1%).
28
+ - Take the top 3–5 as the URL's "primary keywords" for SERP work in step 5.
29
+
30
+ 4. **Page authority** `DATA_getPageAuthority` + `DATA_getPageAuthorityHistory`
31
+ - Current PA score and its 12-month trajectory.
32
+ - Flag any drop > 5 points in the last 90 days.
33
+
34
+ 4b. **GSC URL performance + URL Inspection** *(only if google-api.json is present, tier ≥ 1)*
35
+ - Replaces the directional traffic estimate from step 2 with first-party Google data for the exact URL.
36
+ - Pull GSC search analytics for the URL (last 28 days, by query and page):
37
+ `upstream script excluded; use optbrew capability routing "{config.default_property}" --url "{target_url}" --days 28 --json`
38
+ - Pull URL Inspection (real indexation status, canonical Google sees, last crawl date):
39
+ `upstream script excluded; use optbrew capability routing "{target_url}" --site-url "{config.default_property}" --json`
40
+ - If the URL's domain isn't a verified GSC property: surface "GSC: {target_domain} not verified — add it in Search Console" and continue with SE Ranking data only.
41
+ - Surface in `PAGE.md` "## Snapshot": `GSC last 28d: {clicks}/{impressions}/{ctr}% CTR / pos {position}` and `Google sees: {INDEXED|EXCLUDED} · canonical {userCanonical} → {googleCanonical} · last crawled {date}`.
42
+ - **Feed into the verdict heuristic:** `INDEXED` + impressions > 100 + position 4–10 → harden REFRESH (clear quick-win). `EXCLUDED` (any reason) → harden KILL or CONSOLIDATE. `userCanonical ≠ googleCanonical` → flag as critical issue regardless of verdict.
43
+ - See `skills/seo-google/references/cross-skill-integration.md` § "seo-page" for the full recipe.
44
+
45
+ 5. **SERP context** `DATA_getSerpResults` and `DATA_getAiOverview`
46
+ - For each of the 3–5 primary keywords:
47
+ - Top 10 organic results (URL, title, snippet).
48
+ - SERP features present (PAA, image carousel, video, shopping, etc.).
49
+ - AIO presence and citations — is this URL cited in the AIO?
50
+
51
+ 6. **HTML sense-check** `WebFetch` (always) + `mcp__firecrawl-mcp__firecrawl_scrape` (when available)
52
+ - **WebFetch first** (free, instant): extract `<title>`, meta description, all `<h1..h6>`, lang, word count, internal-link count, image count. WebFetch returns markdown so anything in `<head>` beyond `<title>` is lost — the next bullet recovers it.
53
+ - **Firecrawl second** (1 Firecrawl credit; pass `formats: ["rawHtml"]`) — recovers what WebFetch can't see. Pin the format to `rawHtml`; the default `html` is post-processed and silently strips canonical, hreflang, and `<script type="application/ld+json">` blocks on many sites. If those head fields come back zero on a site that obviously has them (any major SaaS homepage), you forgot the `rawHtml` flag — re-run.
54
+ - From `metadata`: `og:title`, `og:description`, `og:image`, `twitter:card`, `viewport`, robots meta, canonical URL.
55
+ - From the returned `rawHtml`: every `<script type="application/ld+json">` block. Parse each as JSON, list detected `@type`s (Article, BreadcrumbList, Organization, Product, etc.). Note any block that fails to parse.
56
+ - hreflang: count `<link rel="alternate" hreflang="…">` occurrences in `rawHtml`.
57
+ - **If Firecrawl unavailable:** the WebFetch portion still runs; populate Page basics' OG / Twitter / canonical / robots / JSON-LD / hreflang lines as `(skipped — Firecrawl not installed)`. Don't infer from markdown.
58
+ - **Sense-check:** does the page actually talk about its top-ranking keyword in title and H1? If a page ranks for keywords it doesn't address textually, that's a strong consolidation signal.
59
+
60
+ 7. **Domain context** `DATA_getDomainOverviewWorldwide` (parent domain)
61
+ - Light-weight: parent DA, total keywords, total traffic. Used to contextualise the page's PA against its domain.
62
+
63
+ 8. **Cannibalization check** `DATA_getDomainPages`
64
+ - Pull the parent domain's pages ranked by organic traffic. Cap at the top 50 — that's where the cannibalization risk concentrates.
65
+ - For the candidate URL's top-3 traffic-weighted keywords (from step 3), scan the peer-page list: does any other URL on the same domain rank in the top 20 for any of those keywords?
66
+ - **Cannibalization signal:** any peer URL ranking ≤ 20 for the candidate's top-3 keywords. Record peer URL, keyword, peer position vs candidate position, peer traffic.
67
+ - **Cheaper than the old approach.** Previous versions cross-checked via `DATA_getDomainKeywords` on the parent domain — that endpoint can return tens of thousands of rows on large sites and is unnecessarily heavy for this question. `DATA_getDomainPages` ranked by traffic surfaces the high-impact peers directly.
68
+ - If no peer URL competes, this signal is "no cannibalization detected" — pass through to step 9.
69
+
70
+ 9. **Synthesise verdict**
71
+ - Apply the verdict heuristic (see Tips) to produce KEEP / REFRESH / CONSOLIDATE / KILL.
72
+ - For REFRESH, identify the top 3 specific changes (e.g., "add an H2 on 'alternatives' which 7 of 10 SERP winners use").
73
+ - Write `PAGE.md` (output spec below).
74
+
75
+ ## Output format
76
+
77
+ Create a folder `seo-page-{target-slug}-{YYYYMMDD}/` with:
78
+
79
+ ```
80
+ seo-page-{target-slug}-{YYYYMMDD}/
81
+ ├── PAGE.md (synthesised verdict + plan — primary deliverable)
82
+ ├── keywords.csv (full keyword list with positions — load-bearing CSV the auditor walks through row-by-row)
83
+ ├── 04-serp-context.md (top 10 + AIO for top 3–5 keywords — load-bearing reference for SERP-driven REFRESH discussions)
84
+ └── evidence/
85
+ ├── 01-url-overview.md (raw DATA_getUrlOverviewWorldwide)
86
+ ├── 02-keywords.md (raw DATA_getDomainKeywords filtered)
87
+ ├── 03-authority.md (PA + history)
88
+ ├── 05-page-snapshot.md (HTML extracts)
89
+ └── 06-cannibalization.md (peer pages on the same domain competing for the top-3 keywords)
90
+ ```
91
+
92
+ Top-level: `PAGE.md` + `keywords.csv` + `04-serp-context.md`. The other step files preserve raw API/HTML extracts in `evidence/` for reproducibility — auditors lean on the CSV and SERP context, not the per-call dumps.
93
+
94
+ `PAGE.md` follows this shape:
95
+
96
+ ```markdown
97
+ # Page Intelligence: {URL}
98
+
99
+ > Snapshot dated {YYYY-MM-DD} · Country: {country} · Primary keyword: {keyword}
100
+
101
+ ## Snapshot
102
+ - Ranking keywords: {n}
103
+ - Estimated monthly organic traffic: {n}
104
+ - Page authority: {PA} ({↑/↓ trajectory over 90 days})
105
+ - Primary topic: {topic}
106
+ - AIO citations: {n} of {checked} primary-keyword AIOs cite this URL
107
+ - GSC last 28d: {clicks} clicks / {impressions} impressions / {ctr}% CTR / avg position {n} *(or `not configured` / `property not verified`)*
108
+ - Google sees: {INDEXED|EXCLUDED|...} · canonical {userCanonical} {→ googleCanonical if differ} · last crawled {YYYY-MM-DD}
109
+
110
+ ## Page basics
111
+ - `<title>`: {value}
112
+ - meta description: {value | absent}
113
+ - `og:title`: {value | absent | skipped — Firecrawl required}
114
+ - `og:description`: {value | absent | skipped}
115
+ - `og:image`: {url | absent | skipped}
116
+ - `twitter:card`: {summary | summary_large_image | absent | skipped}
117
+ - `<link rel="canonical">`: {URL | self-referential | absent | skipped}
118
+ - meta robots: {index,follow | noindex,nofollow | absent | skipped}
119
+ - JSON-LD types detected: {Article, BreadcrumbList, Organization | none | skipped}
120
+ - hreflang variants: {n | skipped}
121
+
122
+ ## What this page wins
123
+ - {keyword} — position {n}, ~{volume} monthly searches, ~{traffic} monthly clicks.
124
+ - ... (top 3–5)
125
+
126
+ ## Almost-wins (page-2 refresh opportunities)
127
+ - {keyword} — position {n}, ~{volume} monthly searches. The top 3 SERP winners all do {pattern} that this page doesn't.
128
+ - ... (top 3 examples)
129
+
130
+ ## What this page misses
131
+ - {keyword} — competitors {comp1}, {comp2} rank in top 5; this page is absent.
132
+ - ...
133
+
134
+ ## Same-domain cannibalization
135
+ - {peer URL} — ranks position {n} for "{keyword}" (candidate ranks position {m}). Peer estimated traffic: {n}/mo.
136
+ - ... (only list rows where a peer URL ranks ≤ 20 for one of the candidate's top-3 keywords; if none, write "No same-domain cannibalization detected on top-3 keywords.")
137
+
138
+ ## AI Search angle
139
+ - {n} of {checked} AIO queries on the URL's keywords cite this page.
140
+ - The AIOs that DON'T cite this page tend to cite {pattern} (e.g., comparison tables, step-by-step how-tos).
141
+ - Recommended GEO move: {one specific change}.
142
+
143
+ ## Verdict: {KEEP | REFRESH | CONSOLIDATE | KILL}
144
+
145
+ Reasoning: {1–2 sentences anchored in objective signals from above}.
146
+
147
+ ### If REFRESH — top 3 changes
148
+ 1. {Specific change}
149
+ 2. {Specific change}
150
+ 3. {Specific change}
151
+
152
+ ## Raw data
153
+ - keywords.csv — full enriched ranking-keyword list
154
+ - 04-serp-context.md — per-keyword SERP top-10 with AIO
155
+ - evidence/05-page-snapshot.md — HTML extracts
156
+ ```
157
+
158
+ `keywords.csv` columns: `keyword,volume,kd,position,intent,traffic_estimate,url`
159
+
160
+ ## Tips
161
+
162
+ - Respect SE Ranking Data API rate limit: 10 requests per second. The 3–5 SERP queries in step 5 should be paced sequentially.
163
+ - Call `DATA_getCreditBalance` before running. ~10–15 credits is typical for one URL.
164
+ - Verdict heuristic:
165
+ - **KEEP**: PA stable or up; traffic stable or up; top 3 keywords held in their positions; AIO citations present where AIO appears.
166
+ - **REFRESH**: any of (PA dropped >5 in 90 days; traffic dropped >20%; a top-3 keyword fell to position 11+; AIO citations missing while competitors get cited). **Hardens** when GSC data (step 4b) shows `INDEXED` + impressions > 100 + average position 4–10 (clear quick-win territory).
167
+ - **CONSOLIDATE**: cannibalization detected (step 8) — a peer URL on the same domain ranks ≤ 20 for one or more of the candidate's top-3 keywords. CONSOLIDATE harden when the peer outranks the candidate AND captures higher traffic; otherwise CONSOLIDATE recommendation is "merge into the candidate" rather than "kill the candidate."
168
+ - **KILL**: PA <10 AND traffic <50/mo AND no top-10 keyword AND no internal links pointing to it. **Hardens** when JSON-LD schema is also absent (Firecrawl detected zero blocks) — the page has no signals for any crawler, organic or AI. **Also hardens** when URL Inspection (step 4b) returns `EXCLUDED` for any reason.
169
+ - **GSC canonical mismatch (any verdict):** if step 4b detects `userCanonical ≠ googleCanonical`, flag this as a critical issue in `PAGE.md` regardless of the verdict — it points at indexing instability that the verdict on its own can't resolve.
170
+ - Don't invent reasons. Anchor every claim in `PAGE.md` to a number from the raw data files.
171
+ - When between KEEP and REFRESH, default to REFRESH — small refreshes compound.
172
+ - The `keywords.csv` is the auditable trail. If a stakeholder questions the verdict, walk them through the CSV row by row.
173
+ - For pages with very low data (new pages, <5 ranking keywords), the verdict is unreliable. Flag as "insufficient data — re-run after 60 days" rather than forcing a verdict.
174
+ - **`DATA_getPageAuthorityHistory` all-zeros caveat:** if the endpoint returns `inlink_rank: 0` (or equivalent) for every date in the history window, treat as "insufficient history" — don't claim a drop or recommend REFRESH based on it. Often happens for very high-authority pages where the metric is saturated, or for URLs that haven't accumulated enough longitudinal data. Cross-check with `DATA_getPageAuthority` (current value) — if current PA is meaningful but history is flat-zero, flag the gap explicitly in `PAGE.md` rather than synthesising a trajectory.
@@ -0,0 +1,220 @@
1
+ > Example output: examples/seo-plan-wix-com-20260514/PLAN.md (upstream-only reference; route through optbrew)
2
+
3
+ # SEO Plan
4
+
5
+ Produce a phased SEO roadmap for a domain. Output is a single `PLAN.md` plus per-phase deliverable folders, each phase scoped to a quarter (or a 90-day sprint), each with explicit goals, work items, owners, and metrics. The plan is grounded in the site's actual competitive position — not a generic checklist.
6
+
7
+ This is the "what should we work on next quarter" skill. It does not replace specialist skills — it composes them, then sequences their outputs.
8
+
9
+ ## Prerequisites
10
+
11
+ - SE Ranking MCP server connected.
12
+ - `seo-firecrawl` available for site mapping and head metadata (optional but recommended).
13
+ - User provides:
14
+ - Target domain.
15
+ - Optionally: target country (default `us`), business type (saas / ecommerce / local / publisher / agency / b2b — auto-detected from the domain if not supplied), planning horizon (default 90 days, options: 30 / 90 / 180 / 365).
16
+ - Optionally: known constraints (engineering capacity, content budget, no JS-render changes allowed, etc.).
17
+
18
+ ## Process
19
+
20
+ 0. **Google data availability check (advisory, not blocking)**
21
+ - Run `upstream script excluded; use optbrew capability routing`. If `tier >= 0`, the downstream specialist skills (technical-audit, page, content-audit, drift) will enrich their outputs with real Google field data — and `seo-plan` ingests those richer outputs in step 4. The plan itself doesn't dispatch `seo-google` directly; it prints a one-line notice so the user knows the option is on the table:
22
+ ```
23
+ > Google APIs detected (tier {n}, available: {comma-list}). Downstream specialist
24
+ > skills (seo-technical-audit, seo-page, seo-content-audit, seo-drift) will enrich
25
+ > their outputs with real CrUX / GSC / GA4 / URL Inspection data automatically.
26
+ ```
27
+ - If creds are missing, the plan continues with SE Ranking-only data and prints:
28
+ ```
29
+ > Google APIs not configured. To enrich downstream phases with real CWV / GSC /
30
+ > GA4 / indexation data, run `optbrew capability setup (see top-level routing)`. Plan continues
31
+ > with SE Ranking data only.
32
+ ```
33
+ - This is the **lightest possible auto-spawn** — `seo-plan` doesn't run `seo-google` itself (transferring friction to a single command is theirs' anti-pattern we critiqued in `EVAL_RESULT_v2.md`); it surfaces the option so the user can opt in or out before specialist skills run. See `skills/seo-google/references/cross-skill-integration.md` § "seo-plan" for the full rationale.
34
+
35
+ 1. **Detect business type** `DATA_getDomainOverviewWorldwide`, plus a Firecrawl `scrape` of the homepage if available
36
+ - Inspect title, H1, JSON-LD types, primary nav patterns.
37
+ - Classify as one of: `saas`, `ecommerce`, `local`, `publisher`, `agency`, `b2b-services`, `marketplace`. If ambiguous, ask the user once.
38
+ - Business type drives template selection (see step 6).
39
+
40
+ 2. **Domain baseline** `DATA_getDomainOverviewWorldwide`, `DATA_getDomainOverviewHistory`, `DATA_getDomainAuthority`, `DATA_getBacklinksSummary`
41
+ - Capture: organic keywords, organic traffic estimate, DA, backlink profile health, top countries, traffic trend over the last 12 months.
42
+ - This sets the "where you are now" anchor.
43
+
44
+ 3. **Competitive frame** `DATA_getDomainCompetitors`
45
+ - Pull top 5–10 organic competitors.
46
+ - For each: organic keywords, traffic share, DA, top topical clusters they own.
47
+ - Identifies who the user is *actually* competing with on the SERP (often different from who they think).
48
+
49
+ 4. **Pull specialist inputs — confirm-then-dispatch pattern**
50
+ - **4a. Detect existing outputs.** In the current working directory, look for any folder matching the patterns below dated within the last 30 days (treat folders older than 30 days as stale and re-list them as missing):
51
+ - `seo-technical-audit-*`
52
+ - `seo-content-audit-*`
53
+ - `seo-competitor-gap-analysis-*`
54
+ - `seo-ai-search-share-of-voice-*`
55
+ - `seo-backlinks-profile-*`
56
+ - For each present folder, ingest its primary deliverable (`TECH-AUDIT.md`, `VERDICT.md` rollup, `GAPS.md`, `REPORT.md`, `PROFILE.md` respectively).
57
+ - **4b. Build the missing list.** For each prerequisite that did not have a fresh output, look up its credit-cost figure from the specialist's own GUIDE.md (read those when forming the prompt — figures may drift):
58
+ - `seo-technical-audit` → varies by page count for a fresh audit; ~6 Firecrawl credits for the modern-signals step. Cite "varies; check page count" if no recent audit cached.
59
+ - `seo-content-audit` → ~10–15 SE Ranking credits + 1 Firecrawl credit per audited URL (default cap 50; for the seo-plan top-10-pages scope, expect ~10–15 SE Ranking + ~10 Firecrawl).
60
+ - `seo-competitor-gap-analysis` → ~30–80 credits for 10 seeds.
61
+ - `seo-ai-search-share-of-voice` → ~10–20 credits (leaderboard + ~20 prompts × N domains).
62
+ - `seo-backlinks-profile` → ~25–40 SE Ranking credits.
63
+ - **4c. Print the confirmation prompt** (single block, exactly this shape, with the missing-list filtered to only what is actually missing):
64
+ ```
65
+ To produce a defensible plan, seo-plan needs outputs from N specialists not yet
66
+ run for {domain}:
67
+ - seo-technical-audit (~{N} credits)
68
+ - seo-content-audit (~{N} credits)
69
+ - seo-competitor-gap-analysis (~{N} credits)
70
+ - seo-ai-search-share-of-voice (~{N} credits)
71
+ - seo-backlinks-profile (~{N} credits)
72
+ Total estimated cost: ~{N} credits.
73
+ Run them now in this session? (y/N — default N preserves the existing v2.6 behavior of asking the user to run them manually first)
74
+ ```
75
+ - **4d. If user answers `y`:** dispatch each missing specialist in this order, ingesting each primary deliverable as it completes:
76
+ - **Parallel batch (independent):** `seo-technical-audit`, `seo-competitor-gap-analysis`, `seo-ai-search-share-of-voice`, `seo-backlinks-profile`.
77
+ - **Sequential after the batch:** `seo-content-audit` — its top-10-pages scope depends on knowing the top traffic pages from `seo-competitor-gap-analysis` / `DATA_getDomainKeywords`, so it must run after the gap-analysis batch completes.
78
+ - Each specialist runs its own `DATA_getCreditBalance` preflight and surfaces cost before proceeding (their existing behaviour — `seo-plan` does not bypass it). If any specialist aborts on a credit-balance check, surface that abort to the user and let them decide whether to top up or skip.
79
+ - After every dispatch, ingest the new folder the same way step 4a does.
80
+ - **4e. If user answers `N` (or anything else — default `N`):** fall through to the existing v2.6 behaviour — the plan opens with **Phase 0: Discovery**, and running each missing specialist becomes the first sprint's work. This preserves the user's control over credit spend in environments where the specialists should be scheduled or batched separately.
81
+
82
+ 5. **Score the four pillars**
83
+ - **Technical health** (0–100): from `seo-technical-audit` severity-weighted issue count.
84
+ - **Content quality** (0–100): average E-E-A-T+CITE score across audited pages.
85
+ - **Topical authority** (0–100): cluster coverage relative to top 3 competitors.
86
+ - **AI Search readiness** (0–100): citation share vs SoV competitors.
87
+ - The lowest pillar becomes the **lead theme** for the first phase.
88
+
89
+ 6. **Apply business-type template** (templates differ — pick one and parameterise)
90
+ - **saas** → product-led pillars + integration pages + comparison/alternatives + JTBD content.
91
+ - **ecommerce** → category page hygiene + product schema + faceted-nav indexation rules + review aggregation.
92
+ - **local** → GBP optimisation + location pages + citation cleanup (note: we don't have a `seo-local` skill yet — flag this as a manual sub-step or external).
93
+ - **publisher** → topical clusters + author E-E-A-T + freshness cadence + AI-Search citations.
94
+ - **agency** → service pages + case studies + comparison content + lead-gen LP (use `seo-agency-landing-page`).
95
+ - **b2b-services** → industry-specific landing pages + thought-leadership clusters + decision-stage content.
96
+ - Template provides default work-item categories; the lowest-pillar score from step 5 weights them.
97
+
98
+ 7. **Phase the plan** — three phases over the planning horizon, each with goals, work items, owners, metrics
99
+ - **Phase 1 (weeks 1–4 of horizon): Foundations.** Technical fixes that unblock everything else, baseline drift snapshot, 1–2 quick-win content refreshes from `seo-page` verdicts.
100
+ - **Phase 2 (weeks 5–8): Build.** Content tier from `seo-keyword-cluster` (1 pillar + 3–7 spokes), schema fixes from `seo-schema`, comparison page from `seo-competitor-pages` if competitive frame supports it.
101
+ - **Phase 3 (weeks 9–12): Compound + measure.** AI Search readiness pass via `seo-geo` on top pages, backlink-gap outreach starter from `seo-backlink-gap`, second drift comparison via `seo-drift compare`, retro + adjust.
102
+ - For longer horizons (180/365 days), repeat phases 2+3 with refreshed inputs and a quarterly retro.
103
+ - Each work item is tagged with the skill that produces it: `seo-content-brief`, `seo-schema`, `seo-page`, etc.
104
+
105
+ 8. **Pick metrics**
106
+ - **Lagging (quarterly):** organic traffic, organic keywords ranking top-10, organic conversions.
107
+ - **Leading (weekly/monthly):** technical-issue count, pages with E-E-A-T verdict ≥ 70, AI Search citation count, referring-domain count.
108
+ - One leading + one lagging per phase. Tie each metric to a current value (from step 2) and a phase-end target. Targets must be defensible — call out base rates.
109
+
110
+ 9. **Sequencing + dependencies**
111
+ - Build a dependency map: e.g., "rewrite cluster A pillar" depends on "fix `noindex` on /blog templates" depends on "run `seo-technical-audit`."
112
+ - Surface the critical path. Anything off the critical path is moveable; anything on it blocks the phase.
113
+
114
+ 10. **Synthesise** `PLAN.md`
115
+
116
+ ## Output format
117
+
118
+ Folder `seo-plan-{domain-slug}-{YYYYMMDD}/`:
119
+
120
+ ```
121
+ seo-plan-{domain-slug}-{YYYYMMDD}/
122
+ ├── PLAN.md (synthesis — primary deliverable; inlines 01-baseline, 02-competitive-frame, 07-dependencies, 08-metrics as sections)
123
+ ├── 04-phase-1-foundations.md (load-bearing — owners share single phase files in standups)
124
+ ├── 05-phase-2-build.md (load-bearing — owners share single phase files)
125
+ ├── 06-phase-3-compound.md (load-bearing — owners share single phase files)
126
+ └── evidence/
127
+ ├── 01-baseline.md (where you are now — raw data inlined into PLAN.md)
128
+ ├── 02-competitive-frame.md (who you're actually competing with — raw data inlined into PLAN.md)
129
+ ├── 03-pillar-scores.md (technical / content / topical / AI Search — scoring math)
130
+ ├── 07-dependencies-and-critical-path.md (dependency map — inlined as PLAN.md section)
131
+ └── 08-metrics.md (metric tables — inlined as PLAN.md section)
132
+ ```
133
+
134
+ Top-level: `PLAN.md` + the three phase files (`04`/`05`/`06`). Owners share single phase files in standups, so phase files stay top-level rather than collapsing into PLAN.md. The verbatim-duplicate sections (baseline, competitive frame, dependencies, metrics) are inlined into PLAN.md but the raw step files are preserved in `evidence/` along with the pillar-scoring math.
135
+
136
+ `PLAN.md` follows this shape:
137
+
138
+ ```markdown
139
+ # SEO Plan: {domain}
140
+
141
+ > Plan dated {YYYY-MM-DD} · Horizon: {n} days · Business type: {type} · Country: {country}
142
+
143
+ ## Where you are
144
+ - Organic keywords: {n} (trend: {↑↓→ over 12mo})
145
+ - Organic traffic estimate: {n}/mo
146
+ - Domain authority: {n}
147
+ - Referring domains: {n}
148
+ - Pillar scores: Technical {n}/100 · Content {n}/100 · Topical {n}/100 · AI Search {n}/100
149
+
150
+ ## Lead theme
151
+ {The lowest pillar from step 5, plus a one-line "why this is the constraint."}
152
+
153
+ ## Top 5 competitors
154
+ | Domain | DA | Organic kw | Top cluster they own |
155
+ |---|---|---|---|
156
+ | {comp} | {n} | {n} | {cluster} |
157
+
158
+ ## Phase 1 — Foundations (weeks 1–4)
159
+
160
+ **Goal:** {1-line outcome, e.g. "remove technical debt blocking content investment"}
161
+
162
+ | # | Work item | Skill / source | Owner | Effort | Phase-end metric |
163
+ |---|---|---|---|---|---|
164
+ | 1.1 | {item} | `seo-technical-audit` follow-up | {role} | {S/M/L} | {metric} |
165
+ | 1.2 | ... | | | | |
166
+
167
+ **Phase exit criteria:** {what must be true to declare Phase 1 done}
168
+
169
+ ## Phase 2 — Build (weeks 5–8)
170
+ {same shape}
171
+
172
+ ## Phase 3 — Compound + measure (weeks 9–12)
173
+ {same shape}
174
+
175
+ ## Critical path
176
+ {Ordered list of work items that block subsequent phases. Anything not on this list is moveable.}
177
+
178
+ ## Metrics
179
+
180
+ | Metric | Type | Current | Phase 1 target | Phase 2 target | Phase 3 target |
181
+ |---|---|---|---|---|---|
182
+ | Organic traffic | Lagging | {n} | {n} | {n} | {n} |
183
+ | Pages with E-E-A-T ≥ 70 | Leading | {n} | {n} | {n} | {n} |
184
+ | Technical issue count | Leading | {n} | {n} | {n} | {n} |
185
+ | AI Search citation count | Leading | {n} | {n} | {n} | {n} |
186
+ | Referring domains | Leading | {n} | {n} | {n} | {n} |
187
+
188
+ ## Constraints / caveats
189
+ {User-supplied constraints, plus anything the data flags — e.g., "DA gap to top competitor is 25 points; expect 6+ months for keyword parity."}
190
+
191
+ ## Recommended next step
192
+ Run Phase 1 work items. After week 4, run `seo-drift compare` against the baseline captured today, then adjust Phase 2 scope.
193
+ ```
194
+
195
+ ## Tips
196
+
197
+ - **Default is "no auto-dispatch."** The confirm prompt in step 4c defaults to `N`. If the user just hits Enter (or answers anything other than an explicit `y`), `seo-plan` falls through to the v2.6 Phase-0 behaviour and lists the missing specialists as the first sprint's work. This preserves user control over credit spend — important when the user is on a tight SE Ranking budget or wants to schedule specialists separately.
198
+ - **Auto-dispatch (the `y` path) is the convenience option.** When the user wants a finished plan in one session and is comfortable with the displayed credit estimate, the `y` path runs the missing specialists in the optimal parallel-then-sequential order described in step 4d, ingests their outputs, and proceeds straight into pillar scoring (step 5). No silent re-execution: every dispatch is gated by the single confirmation in step 4c.
199
+ - **Auto-dispatch respects each specialist's own credit-balance preflight.** Each specialist already calls `DATA_getCreditBalance` at its first step and surfaces cost before consuming credits — `seo-plan` does not bypass that gate. If a specialist aborts on its preflight (insufficient credits, user declines its inner cost prompt), `seo-plan` surfaces the abort and lets the user choose to top up, skip that specialist (and let it remain a Phase-0 work item), or cancel the rest of the dispatch.
200
+ - **Auto-detect business type cheaply.** Homepage `<title>`, schema `@type`, and top-nav anchors are usually enough. Ask the user only when truly ambiguous.
201
+ - **The lead theme is the lowest pillar score.** Don't pick the pillar the user is most excited about — pick the one the data says is the constraint. Surface this gap explicitly if they conflict.
202
+ - **Three phases, even for 30-day horizons.** Compress, don't drop. A 30-day plan is foundations (weeks 1–2), build (weeks 2–3), measure (week 4). The structure forces sequencing discipline.
203
+ - **Targets must be defensible.** Don't write "double organic traffic in Q1." Tie each target to a base rate from competitor data or category benchmarks. If the math doesn't support a target, say so and lower it.
204
+ - **Critical path is the deliverable.** Most teams can do *something*; few know what's blocking what. Surface the dependency chain — that's where this skill earns its keep.
205
+ - **Local SEO is a known gap.** If business type is `local`, flag that we don't have a `seo-local` skill yet and recommend manual GBP audit as a Phase 0 item. Don't pretend coverage we don't have.
206
+ - **Don't generate work items the team can't execute.** If the user said "no JS-render changes allowed," drop those items even if they're high-leverage. A plan that won't ship is worse than a smaller plan that does.
207
+ - **Update cadence.** A 90-day plan should be re-run at the 90-day mark with `seo-drift compare` against the original baseline as input. Drift output rewrites the "Where you are" section; everything downstream updates from there.
208
+
209
+ ## Works well with
210
+
211
+ - **Predecessors:**
212
+ - `seo-technical-audit`, `seo-content-audit`, `seo-competitor-gap-analysis`, `seo-ai-search-share-of-voice`, `seo-backlinks-profile` — produce inputs.
213
+ - `seo-drift baseline` — captures the snapshot the plan measures progress against.
214
+ - **Successors:**
215
+ - `seo-keyword-cluster` — when Phase 2 calls for a content tier.
216
+ - `seo-content-brief` — for each spoke article in Phase 2.
217
+ - `seo-schema` — for structured-data work items.
218
+ - `seo-competitor-pages` — when comparison content is on the plan.
219
+ - `seo-drift compare` — at end of phase to measure progress.
220
+ - `seo-page` — for individual URL keep/refresh/consolidate/kill calls in Phase 1.