Free, open source blog writer for Claude Code. Researches current sources, writes answer-first posts for Google and AI answers, has an independent reviewer score each one out of 100 and ships only after five delivery gates. 32 skills, 30 /blog commands, 5 agents. Active development at AI-Marketing-Hub/claude-blog; public releases ship here.
Python agent-skillsaiai-citationsai-contentai-marketingai-marketing-hubblogblog-writingclaude-codeclaude-code-skillclaude-pluginclaude-skillcontent-creationcontent-optimizationcontent-strategyeeatgeomultilingualopen-sourceseo
feat(blog-cluster): semantic topic-cluster planning + execution engine
Daniel3117e9ef5f12
diff --git a/skills/blog-cluster/SKILL.md b/skills/blog-cluster/SKILL.mdnew file mode 100644index 0000000..82f8eed--- /dev/null+++ b/skills/blog-cluster/SKILL.md@@ -0,0 +1,325 @@+---+name: blog-cluster+description: >+ Semantic topic cluster planning and automated execution engine for claude-blog.+ Performs SERP-based keyword research, groups keywords by search intent and+ SERP overlap, builds a hub-and-spoke cluster architecture, generates an+ interactive SVG cluster map, and executes the full cluster by orchestrating+ blog-write calls with shared cluster context and automatic internal-link+ injection. Fills the strategy-to-execution gap: blog-strategy plans the+ blueprint, blog-cluster builds the house.+ Use when user says "blog cluster", "topic cluster", "content cluster",+ "cluster plan", "cluster execute", "pillar content", "hub and spoke",+ "content ecosystem", "cluster map".+license: MIT+compatibility: Requires Claude Code and claude-blog (provides blog-write, blog-chart, blog-image)+metadata:+ author: AgriciDaniel+ version: "1.7.0"+ category: blog+user-invokable: true+argument-hint: "[plan|execute] [seed-keyword|cluster-plan.json]"+---++# Blog Cluster (Semantic Topic Cluster Engine)++Plans and executes entire interlinked content ecosystems from a single seed+keyword. Three layers: Semantic Clustering (the brain), Cluster Architecture+(the structure), and Execution Engine (the machine).++> Adapted from the **semantic-cluster-engine** submission by Lutfiya Miller+> (winner, AI Marketing Hub Pro Challenge, March 2026, 95/100 Exemplary).+> Original repository: https://github.com/Drfiya/semantic-cluster-engine+> This port keeps the Plan + Execute architecture and the cluster context+> innovation, removes brand-specific (ScienceExperts.ai) styling and image+> prompts, and routes through claude-blog's existing sub-skills.++## Commands++| Command | What it does |+|---------|--------------|+| `/blog cluster` | Interactive. Asks whether to plan or execute. |+| `/blog cluster plan <seed-keyword>` | SERP-based semantic analysis. Outputs cluster plan + map. |+| `/blog cluster plan --from strategy [path]` | Imports existing `blog-strategy` cluster build plan and validates against SERP data. |+| `/blog cluster execute [path-to-plan]` | Sequential `blog-write` calls with cluster context and auto-interlinks. |++## Key references (load on demand)++- `references/semantic-clustering.md` (SERP overlap analysis, intent classification, keyword universe expansion)+- `references/cluster-architecture.md` (hub-and-spoke specs, schema strategy, link-density rules)+- `references/execution-workflow.md` (execution order, context injection, scorecard, failure handling)++## Cross-references to existing claude-blog skills++| Skill | When this skill calls it |+|-------|--------------------------|+| `/blog strategy` | Upstream planning. `plan --from strategy` consumes its Cluster Build Plan tables. |+| `/blog write` | Per-post execution. Each spoke and the pillar are produced by `blog-write` with a prepended cluster-context block. |+| `/blog chart` | Invoked internally by `blog-write` for inline SVG charts. No direct call from this skill. |+| `/blog image` | Optional hero image generation per post (graceful fallback if `nanobanana-mcp` is not configured). |+| `/blog seo-check` | Recommended after execution for per-post on-page validation. |+| `/blog cannibalization` | Recommended after execution to confirm zero keyword overlap across the cluster. |+| `/blog schema` | Recommended after execution to add `BreadcrumbList`, `ItemList`, and `Article` schema. |++This skill never modifies files belonging to other skills. It calls them via the Task tool or as orchestrated sub-skills.++## Command Routing++1. Parse the user's command to determine the sub-command.+2. If the user typed only `/blog cluster`, ask: "Would you like to **plan** a new cluster or **execute** an existing plan?"+3. Route:+ - `plan <keyword>` to the Plan Phase (below)+ - `plan --from strategy [path]` to the Strategy Import flow (below)+ - `execute [path]`, `build`, or `run` to the Execute Phase (below)++---++## Plan Phase: `/blog cluster plan <seed-keyword>`++Reference: `references/semantic-clustering.md`++### Step 1. Seed keyword expansion++Use WebSearch to expand the seed into a keyword universe of 30 to 50 phrases:++1. Direct search of `<seed>` to capture related searches and "People also ask".+2. Long-tail expansion: `<seed> guide`, `<seed> tips`, `<seed> tools`, `<seed> examples`, `<seed> vs`, `best <seed>`, `how to <seed>`.+3. Question mining: `what is <seed>`, `how does <seed> work`, `why <seed>`, `<seed> for beginners`.+4. Intent variants: add commercial modifiers (best, top, review, comparison, pricing), informational modifiers (guide, tutorial, explained, examples), and transactional modifiers (buy, download, tool, software, service).+5. Year freshness: `<seed> 2026`.++### Step 2. Semantic clustering++Group the expanded keywords using the priority rules in `references/semantic-clustering.md`:++1. **SERP Overlap Analysis** is the primary signal. Two keywords with 5 or more shared top-10 results target the same intent and belong in one post.+2. **Intent Classification** assigns each keyword to informational, commercial, transactional, or navigational.+3. **Entity Mapping** identifies the people, products, frameworks, and organizations Google associates with the topic.+4. **Grouping** combines keywords that share intent and topical proximity. Each group becomes one branch of the hub and spoke.++### Step 3. Cluster architecture design++Reference: `references/cluster-architecture.md`++Build the hub and spoke:++- **Pillar (hub)**: targets the broadest keyword. Word count 2,500 to 4,000. Template `pillar-page`. Links down to every spoke.+- **Spokes**: each targets a long-tail cluster. Word count 1,200 to 1,800. Template auto-selected by intent. Links up to the pillar and across to siblings.++Cluster formation rules:++- 2 to 5 clusters per pillar.+- 2 to 4 spokes per cluster.+- Total: 1 pillar plus 5 to 15 spokes.+- Every spoke targets a unique primary keyword (zero cannibalization).++### Step 4. Internal link matrix++For each spoke `S`:++- `S` to Pillar (always; anchor text uses the pillar's primary keyword).+- Pillar to `S` (always; anchor text uses `S`'s primary keyword).+- `S` to other spokes in the same cluster (2 to 3 links each, contextual anchors).+- `S` to spokes in adjacent clusters (0 to 1 links, only when semantically relevant).++Verify every spoke has at least 3 incoming links. Count total planned interlinks.++### Step 5. Generate output files++All plan and execute artifacts go into a single subdirectory of the current working directory:++```+<cwd>/+└── cluster-<seed-keyword-slug>/+ ├── cluster-plan.json+ ├── cluster-map.html+ ├── pillar-<slug>.md (Execute Phase)+ ├── <spoke-slug>.md (Execute Phase, one per spoke)+ └── cluster-scorecard.md (Execute Phase)+```++#### `cluster-plan.json` schema++```json+{+ "seed_keyword": "<seed>",+ "generated_at": "YYYY-MM-DDTHH:MM:SSZ",+ "pillar": {+ "id": "P",+ "title": "Title of the pillar",+ "primary_keyword": "broadest keyword",+ "secondary_keywords": ["..."],+ "search_volume_estimate": "high|medium|low",+ "template": "pillar-page",+ "word_count_target": 3000,+ "cluster": "pillar"+ },+ "clusters": [+ {+ "name": "Cluster A: Theme",+ "intent": "informational|commercial|transactional",+ "color": "#2563eb",+ "posts": [+ {+ "id": "A1",+ "title": "Post title",+ "primary_keyword": "long-tail keyword",+ "secondary_keywords": ["..."],+ "search_volume_estimate": "high|medium|low",+ "template": "how-to-guide",+ "word_count_target": 1500,+ "links_to": ["P", "A2"],+ "links_from": ["P", "A2"]+ }+ ]+ }+ ],+ "total_posts": 9,+ "total_interlinks": 23,+ "estimated_total_words": 18000+}+```++Note: volume estimates are relative indicators (high, medium, low) derived from SERP signals, not absolute search volumes. For precise data, the user should consult Ahrefs, SEMrush, or DataForSEO (claude-blog provides the `seo-dataforseo` companion sibling).++#### `cluster-map.html` (XSS-safe)++A static, self-contained HTML file with an embedded SVG visualization. Hard rules for the writer:++- No inline `<script>` blocks. No `onclick`, `onmouseover`, or any `on*` event attributes anywhere in the document.+- No external script `<src>` references.+- Every text label drawn into the SVG (titles, keywords, cluster names) must be escaped: replace `&` with `&`, `<` with `<`, `>` with `>`, `"` with `"`, and `'` with `'` before insertion.+- Hover effects use CSS `:hover` only. No JavaScript.+- Use `<title>` child elements inside SVG nodes for accessible tooltips (browser native, no script).++The map shows: a central pillar node, color-coded cluster groups radiating outward, spoke nodes within each cluster, and link lines connecting related nodes.++### Step 6. Present plan to user++Show a summary table of clusters and posts, total interlinks, estimated words, and the file paths. Ask for confirmation before proceeding to execution. Wait for explicit user approval. Do not auto-execute.++---++## Strategy Import: `/blog cluster plan --from strategy [path]`++Bridges `blog-strategy` output into a cluster plan.++1. Locate strategy output. Scan the current directory (or the user-specified path) for a file containing a `Cluster Build Plan` table with the columns `# | Spoke Topic | Template | Target Keyword | Word Count | Internal Links` (the format produced by `/blog strategy`).+2. Parse the table. Extract the pillar row (marked `P`), the spoke rows, template assignments, target keywords, word counts, and link relationships.+3. Validate and enrich. Run SERP overlap validation (Plan Phase Step 2) on each keyword. Add volume estimates and verify cluster groupings semantically.+4. If SERP data contradicts the strategy table, flag the conflict; do not silently override the user's strategic intent.+5. Generate `cluster-plan.json` and `cluster-map.html` using the same outputs as the standard Plan Phase.+6. Present the converted plan with any SERP-based adjustments highlighted, and wait for user confirmation.++---++## Execute Phase: `/blog cluster execute [path-to-plan]`++Reference: `references/execution-workflow.md`++### Step 1. Load plan++Read `cluster-plan.json` from the user-specified path or the most recent `cluster-*/cluster-plan.json` in the working directory. Validate JSON structure. If no plan exists, return: "No cluster plan found. Run `/blog cluster plan <seed-keyword>` first."++### Step 2. Determine execution order++1. Pillar page first (so spokes can link to a known filename).+2. Then spokes, ordered by `(cluster priority, search_volume_estimate desc, post id alphabetical)`. Cluster priority is the sum of estimated volumes within the cluster (highest first).+3. Alternating between clusters when more than 2 clusters exist diversifies the early content spread.++### Step 3. For each post: build cluster context and call `blog-write`++Construct the cluster context block (full schema in `references/execution-workflow.md`) and prepend it to the topic prompt passed to the Task tool invoking `blog-write`. The context tells `blog-write` the cluster name, the post's role (pillar or spoke), the primary and secondary keywords, the chosen template, the word count target, the list of already-written posts (link to these), the list of upcoming posts (use `[INTERNAL-LINK]` placeholders), and the linking requirements for this post.++The context also instructs `blog-write` to run autonomously: skip topic clarification, skip outline approval, do not auto-detect template, do not pause.++Output format: standard markdown (`.md`) by default, matching `blog-write`'s default. If the user explicitly requests HTML, set the platform target accordingly. Do not impose any brand-specific CSS or wordmark; that is the user's responsibility downstream.++### Step 4. Per-post optional hero image++If `nanobanana-mcp` is configured, call `/blog image generate` via the Task tool to produce a 16:9 hero image for the post and place it in `cluster-<slug>/images/<post-slug>-hero.png`. Insert a standard markdown image reference in the post's frontmatter (`coverImage:`) and at the top of the body. If the MCP is unavailable or fails, log a warning and continue without images. Image generation is non-blocking.++### Step 5. Backward link injection++After each post is written:++1. Scan all previously written posts in the cluster directory for `[INTERNAL-LINK: keyword -> filename.md]` markers that reference the just-written post.+2. Replace each match with a real markdown link: `[keyword](filename.md)`.+3. Add a cluster metadata block to the post's frontmatter on first pass (`cluster:`, `cluster_role:`, `cluster_group:`).++### Step 6. Failure handling++If `blog-write` fails for a single post (timeout, error, or quality gate fail), log the failure and continue with remaining posts. Do not abort the cluster. The scorecard will mark the gap and recommend a retry with `/blog write` invoked manually for that post.++If the user cancels mid-execution, save progress and note completed posts. On the next `/blog cluster execute`, detect already-written files and resume from the next unwritten post.++### Step 7. Generate `cluster-scorecard.md`++After all attempted posts complete, produce a markdown scorecard covering:++- Per-post status (written, failed, skipped) with file path and word count.+- Per-post quality score (call `/blog analyze` on each in parallel) and the cluster average.+- Cluster cohesion score: a 0 to 100 composite of link reciprocity, intent diversity, template diversity, and keyword coverage (formula in `references/execution-workflow.md`).+- Internal-link audit: outgoing and incoming counts per post, orphan flags, unresolved `[INTERNAL-LINK]` markers.+- Cannibalization check: any two posts sharing primary keyword, or any pair with greater than 70% keyword overlap. Recommend running `/blog cannibalization` for a deeper pass.+- Image generation summary: hero images generated vs. skipped.+- Recommended next actions: schema generation (`/blog schema`), per-post SEO validation (`/blog seo-check`), repurposing (`/blog repurpose`).++### Step 8. Final report++Return a concise summary to the user with totals, the scorecard path, and the next-action commands.++---++## Output Artifacts (summary)++| File | Phase | Format |+|------|-------|--------|+| `cluster-plan.json` | Plan | JSON |+| `cluster-map.html` | Plan | Static HTML + inline SVG, no JavaScript |+| `pillar-<slug>.md` | Execute | Markdown (or platform-detected format) |+| `<spoke-slug>.md` | Execute | Markdown (or platform-detected format) |+| `images/<post-slug>-hero.png` | Execute (optional) | PNG via `blog-image` |+| `cluster-scorecard.md` | Execute | Markdown |++---++## Quality Gates++| Gate | Check | Action on fail |+|------|-------|----------------|+| Cluster minimum | At least 2 clusters with at least 2 posts each | Warn during plan; suggest expansion |+| Cannibalization | No two posts share primary keyword | Block execution; require plan adjustment |+| Link completeness | Every post has 3 or more incoming internal links | Warn in scorecard |+| Word count | Pillar at least 2,500 words; spokes at least 1,200 words | Pass to `blog-write` as a hard constraint |+| Intent diversity | At least 2 distinct intents across clusters | Warn in scorecard |+| Template diversity | At least 3 distinct templates across the cluster | Warn in scorecard |++---++## Error Handling++| Scenario | Action |+|----------|--------|+| Seed keyword too broad (more than 50 keyword variants) | Suggest narrowing the focus before clustering. |+| Seed keyword too narrow (fewer than 5 keyword variants) | Offer a smaller cluster (pillar plus 2 to 3 spokes) or suggest broadening. |+| WebSearch unavailable | Fall back to Claude's reasoning for keyword expansion and grouping. Note the reduced accuracy in the scorecard. |+| `blog-write` fails for one post | Log, skip, continue. Mark the gap in the scorecard. |+| `blog-write` not installed | Return: "blog-cluster requires claude-blog. Install it before running this skill." |+| `cluster-plan.json` malformed | Validate JSON and report parse errors with line numbers. |+| User cancels execution | Save progress; resume on next invocation with already-written posts auto-detected. |+| `nanobanana-mcp` not configured | Skip hero image generation; warn once at start of execute, not per post. |++---++## Differentiation from related claude-blog skills++| Skill | Role | What blog-cluster adds |+|-------|------|------------------------|+| `blog-strategy` | Plans 3 to 5 content pillars and draws hub-and-spoke diagrams as a strategic exercise | Performs SERP-based semantic clustering, then executes the plan into real, interlinked posts. |+| `blog-calendar` | Schedules publication dates around topic clusters | Does not build clusters or write posts; this skill does both. |+| `blog-cannibalization` | Detects keyword overlap in existing content | Diagnostic only. blog-cluster prevents cannibalization at the planning stage. |+| `blog-write` | Writes one post at a time | blog-cluster orchestrates many `blog-write` calls with shared cluster context and bidirectional linking. |+| `blog-outline` | Generates a single SERP-informed outline | blog-cluster generates an outline-equivalent across an entire cluster, then writes the posts. |++blog-cluster is the general contractor: it analyzes the topic, draws the data-driven plan, and builds the entire structure from a single seed keyword.diff --git a/skills/blog-cluster/references/cluster-architecture.md b/skills/blog-cluster/references/cluster-architecture.mdnew file mode 100644index 0000000..551e74a--- /dev/null+++ b/skills/blog-cluster/references/cluster-architecture.md@@ -0,0 +1,204 @@+# Cluster Architecture: Hub-and-Spoke Linking & Schema++> Reference document for `blog-cluster`. Loaded on demand during Plan Phase+> Step 3 and during scorecard generation.++## Why hub and spoke?++Google's algorithm rewards **topical authority**, which means proving deep+coverage of an entire subject area. The hub-and-spoke pattern is the+structural shape that demonstrates this authority to both search engines and+AI citation systems.++```+ ┌──────────────────┐+ │ PILLAR PAGE │+ │ (hub, 2,500w+) │+ └────────┬─────────┘+ │+ ┌─────────────────┼──────────────────┐+ │ │ │+ ┌──────▼──────┐ ┌──────▼─────┐ ┌────────▼────┐+ │ Cluster A │ │ Cluster B │ │ Cluster C │+ │ (2-4 posts) │ │ (2-4 posts)│ │ (2-4 posts) │+ └──────┬──────┘ └──────┬─────┘ └────────┬────┘+ │ │ │+ ┌────┼────┐ ┌────┴────┐ ┌───┴───┐+ A1 A2 A3 B1 B2 C1 C2+ (Spokes, 1,200 to 1,800 words each)+```++For deeper background on link architecture and anchor distribution rules+shared across all claude-blog skills, see `skills/blog/references/internal-linking.md`.+This document focuses on the cluster-specific overlay.++## Pillar (hub) anatomy++| Attribute | Requirement |+|-----------|-------------|+| Word count | 2,500 to 4,000 |+| Template | `pillar-page` |+| Primary keyword | Broadest, highest-volume keyword in the cluster |+| Coverage | Touches every sub-topic covered by spokes (one section per spoke minimum) |+| Depth | Broad but substantive; each section can stand alone |+| Outgoing links | One contextual link to every spoke |+| Incoming links | One contextual link from every spoke |+| Internal-link density | 8 to 12 internal links total (cluster-internal plus existing-site links) |+| Schema | `Article` plus `BreadcrumbList` plus `ItemList` (the spokes) |++The pillar is written first during execution so that every spoke can link to+a real filename instead of a placeholder.++## Spoke (supporting post) anatomy++| Attribute | Requirement |+|-----------|-------------|+| Word count | 1,200 to 1,800 |+| Template | Auto-selected by intent (table below) |+| Primary keyword | One specific long-tail keyword unique to this spoke |+| Coverage | Deep dive into one specific aspect of the cluster |+| Outgoing links | Pillar (mandatory) + 2 to 3 same-cluster siblings + 0 to 1 cross-cluster |+| Incoming links | Pillar (mandatory) + 1 to 2 same-cluster siblings |+| Internal-link density | 5 to 7 internal links total |+| Schema | `Article` (with `isPartOf` referencing the pillar) plus `BreadcrumbList` |++### Template selection by intent++| Intent and signal | Template |+|-------------------|----------|+| Informational + "how to" | `how-to-guide` |+| Informational + "what is" | `faq-knowledge` |+| Informational + deep topic | shorter pillar pattern (1,500 to 2,000) |+| Commercial + "best" / "top" | `listicle` |+| Commercial + "X vs Y" | `comparison` |+| Commercial + "review" | `product-review` |+| Research + data | `data-research` |+| Tutorial + code or tools | `tutorial` |+| Industry opinion | `thought-leadership` |+| Expert quotes | `roundup` |++## Internal-link injection rules (cluster-specific)++Mandatory links per spoke:++1. **Spoke to pillar** (one link minimum)+ - Anchor: pillar primary keyword (natural variation allowed)+ - Position: within the first 3 paragraphs and again in the conclusion+ - Example: `For a complete walkthrough, see our [AI marketing guide](pillar.md).`+2. **Pillar to each spoke**+ - Anchor: spoke's primary keyword+ - Position: in the relevant section of the pillar body+3. **Sibling spokes (same cluster)**+ - 2 to 3 cross-links per spoke within the cluster+ - Anchor: target spoke's primary keyword (use natural variation)+ - Position: contextually relevant paragraphs++Optional links:++4. **Cross-cluster** (one per spoke maximum)+ - Only when topically relevant+ - Strengthens the overall cluster web without diluting topical focus++### Anchor text strategy (overrides only the cluster context; site-wide rules from `skills/blog/references/internal-linking.md` still apply)++Within a single cluster, vary anchors to avoid repetition. Distribution+target across all internal links produced by `blog-cluster`:++| Anchor type | Target share | Example for primary keyword "ai marketing for small business" |+|-------------|--------------|----------------------------------------------------------------|+| Exact match | 5 to 10 percent | "ai marketing for small business" |+| Partial match | 25 to 35 percent | "ai marketing tactics for small businesses", "small business AI marketing playbook" |+| Branded or descriptive | 20 to 30 percent | "our complete guide", "the case study we ran" |+| Semantic or related | 30 to 40 percent | "AI tools that fit a lean budget", "automating outreach with AI" |++Hard rule: never reuse the same exact anchor text for the same destination+across more than one source post.++### Link-density targets++| Post type | Min outgoing | Min incoming | Max total internal |+|-----------|--------------|--------------|--------------------|+| Pillar | One per spoke | One per spoke | 12 |+| Spoke | 3 (pillar + 2 siblings) | 2 (pillar + 1 sibling) | 7 |++## Schema markup strategy++Schema generation is delegated to `/blog schema` after the cluster is+written. This document specifies the schema *shape* the cluster requires.++### Pillar page schema++```json+{+ "@context": "https://schema.org",+ "@type": "Article",+ "headline": "<pillar title>",+ "description": "<meta description>",+ "isPartOf": {+ "@type": "WebPage",+ "name": "<site name>"+ },+ "about": {+ "@type": "Thing",+ "name": "<seed keyword>"+ },+ "hasPart": [+ {"@type": "Article", "headline": "<spoke title>", "url": "<spoke url>"}+ ]+}+```++Pair with an `ItemList` enumerating the spokes:++```json+{+ "@context": "https://schema.org",+ "@type": "ItemList",+ "name": "<cluster name>",+ "itemListElement": [+ {"@type": "ListItem", "position": 1, "url": "<spoke url>", "name": "<spoke title>"}+ ]+}+```++### Spoke schema++```json+{+ "@context": "https://schema.org",+ "@type": "Article",+ "headline": "<spoke title>",+ "isPartOf": {+ "@type": "Article",+ "headline": "<pillar title>",+ "url": "<pillar url>"+ }+}+```++### BreadcrumbList (every post)++```json+{+ "@context": "https://schema.org",+ "@type": "BreadcrumbList",+ "itemListElement": [+ {"@type": "ListItem", "position": 1, "name": "Blog", "item": "<blog url>"},+ {"@type": "ListItem", "position": 2, "name": "<Pillar Title>", "item": "<pillar url>"},+ {"@type": "ListItem", "position": 3, "name": "<Post Title>", "item": "<post url>"}+ ]+}+```++## Cannibalization prevention++Verify before execution:++1. No two posts share the same primary keyword.+2. No two posts target keywords with greater than 70 percent SERP overlap.+3. H1 and title tag are unique across all cluster posts.+4. Meta descriptions do not repeat the same keyword phrase verbatim.++If a violation is detected during planning, the planner must adjust before+execution. Run `/blog cannibalization` after execution as an independent+audit pass.diff --git a/skills/blog-cluster/references/execution-workflow.md b/skills/blog-cluster/references/execution-workflow.mdnew file mode 100644index 0000000..77ab70e--- /dev/null+++ b/skills/blog-cluster/references/execution-workflow.md@@ -0,0 +1,252 @@+# Execution Workflow: Order, Context Injection, Scorecard++> Reference document for `blog-cluster`. Loaded on demand during Execute Phase.++## Execution order++The order in which posts are written matters for two reasons:++1. The pillar must exist before any spoke can link to its real filename.+2. High-priority posts written first establish authority on the most+ impactful terms while subsequent posts add supporting depth.++### Priority algorithm++```+1. Pillar always first (establishes the hub).+2. Sort clusters by combined estimated search volume (highest first).+3. Within each cluster, sort posts by estimated volume (highest first).+4. If more than 2 clusters, alternate between clusters for the first pass+ (diversifies the early content spread).+```++### Example queue++```+Seed: "AI marketing for small business" (3 clusters, 1 pillar + 7 spokes)++1. [P] AI Marketing for Small Business: Complete 2026 Guide+2. [B1] Best AI Marketing Tools for Small Business in 2026 (Cluster B, top volume)+3. [A1] How to Use AI for Small Business Marketing (Cluster A, top volume)+4. [C1] How Much Does AI Marketing Actually Cost a Small Business?+5. [B2] AI Social Media Tools for Small Business Compared+6. [A2] AI Content Creation for Small Business: Tools and Workflow+7. [C2] AI Marketing ROI: A Small Business Case Study+8. [A3] ChatGPT for Small Business Marketing: 12 Practical Use Cases+```++## Context injection per `blog-write` call++The key innovation of this skill is the **cluster context block** prepended+to every `blog-write` invocation. It tells the writer exactly how this post+fits into the larger structure and forces autonomous (headless) operation.++### Context block format++```+=== CLUSTER CONTEXT ===++CLUSTER: "<seed-keyword>" Topic Cluster+ROLE: [Pillar Page | Supporting Post]+CLUSTER GROUP: [Cluster name, e.g., "Cluster A: Content Creation"]+POSITION: Post <N> of <total> in execution queue++PRIMARY KEYWORD: <keyword>+SECONDARY KEYWORDS: <keyword1>, <keyword2>, <keyword3>+TEMPLATE: <template-type from blog-write template list>+WORD COUNT TARGET: <N> words++--- ALREADY WRITTEN (LINK TO THESE) ---+1. "<title>" at <filename.md> (primary keyword: <kw>)+ LINK INSTRUCTION: include one contextual link with anchor "<kw>" or natural variation.+2. "<title>" at <filename.md> (primary keyword: <kw>)+ LINK INSTRUCTION: include one contextual link if topically relevant.++--- NOT YET WRITTEN (USE PLACEHOLDERS) ---+- "<title>" (primary keyword: <kw>) will be written later in this execution+- "<title>" (primary keyword: <kw>) will be written later in this execution++For posts not yet written, insert a marker in the body in this exact format:+[INTERNAL-LINK: <anchor text> -> <expected-filename.md>]+The execution engine will replace it with a real link after the target is written.++--- LINKING REQUIREMENTS ---+- Minimum outgoing internal links in this post: <N>+- MUST link to: pillar page (filename: <pillar-filename.md>)+- SHOULD link to: same-cluster spokes listed above+- MAY link to: cross-cluster spokes if topically relevant (max 1)++=== AUTOMATION INSTRUCTIONS ===+- This is an automated cluster execution. Do NOT ask the user for input.+- Skip topic clarification (Phase 1 of blog-write). All parameters are above.+- Use the specified TEMPLATE; do not auto-detect.+- Use the specified WORD COUNT TARGET as a hard constraint.+- Skip outline approval. Write directly from the constraints.+- Keep standard research, image sourcing, and chart generation active.+- Proceed through all blog-write phases autonomously.++=== END CLUSTER CONTEXT ===++(Topic prompt continues below.)+```++### How `blog-write` consumes the context++The cluster context is prepended to the topic prompt. `blog-write` treats it+as a set of hard constraints and runs in headless mode:++1. PRIMARY KEYWORD becomes the main SEO target.+2. SECONDARY KEYWORDS appear in subheadings and body naturally.+3. TEMPLATE is loaded directly (no auto-detection).+4. WORD COUNT TARGET is enforced.+5. Topic clarification is skipped; all parameters are provided.+6. Outline approval is skipped; the writer proceeds directly.+7. Real links are inserted to ALREADY WRITTEN posts using the listed filenames.+8. `[INTERNAL-LINK: ... -> ...]` markers are inserted for posts NOT YET WRITTEN.+9. Cluster metadata is appended to the post's frontmatter.++### Cluster metadata frontmatter++Every post in the cluster receives this frontmatter block in addition to the+standard `blog-write` frontmatter:++```yaml+cluster: "<seed-keyword>"+cluster_role: "pillar" # or "supporting"+cluster_group: "<cluster name, e.g. 'Cluster A: Content Creation'>"+cluster_position: "<N>/<total>"+```++## Backward link injection (after each post)++After `blog-write` completes for a post, the engine performs a backward+pass that resolves placeholders in previously written posts:++1. Read every previously written post in `cluster-<slug>/`.+2. Search for `[INTERNAL-LINK: <anchor> -> <expected-filename.md>]` markers+ that match the just-written filename.+3. Replace each match with a real markdown link: `[<anchor>](<filename.md>)`.+4. If no marker exists but a topically relevant insertion point is obvious+ (the post discusses the new post's topic), insert one natural link inside+ an existing paragraph. Never add standalone link lines.++### Insertion rules++- Insert links inside existing paragraphs, never on their own line.+- Use the new post's primary keyword (or a variation) as anchor text.+- Do not add more than one backward link per existing post per new post.+- Do not exceed the per-post link-density caps in `cluster-architecture.md`.++## Optional hero image generation++If `nanobanana-mcp` is configured (check via `blog-image`'s `get_image_history`+call), generate a 16:9 hero image per post:++1. Build a topic-aware prompt from the post's title and primary keyword.+2. Call `/blog image generate` via the Task tool.+3. Save to `cluster-<slug>/images/<post-slug>-hero.png`.+4. Add `coverImage: "images/<post-slug>-hero.png"` to the post frontmatter.+5. Insert `` near the top of the body.++If the MCP is unavailable, log one warning at the start of execution and+proceed without images. Do not retry per post. Do not block.++## Failure handling++| Scenario | Behavior |+|----------|----------|+| `blog-write` returns an error or times out | Log the failure with reason. Mark this post as `failed` in the scorecard. Continue with the next post in the queue. Never abort the cluster. |+| `blog-write` returns content below the word-count floor | Log a warning. Keep the post. Mark as `under_target` in the scorecard. |+| `blog-write` fails the answer-first or sources quality gate | Log the gate that failed. Keep the file as `<slug>.draft.md`. Recommend manual `/blog rewrite`. |+| Image generation fails | Continue without an image. Note the skipped post in the scorecard. |+| User cancels mid-execution | Save progress. On next `/blog cluster execute`, scan the directory for already-written files and resume from the next unwritten post. Note the resume in the scorecard. |+| Filesystem write fails | Abort the current post, log the OS error, attempt the next post. Do not retry the failed post automatically. |++## Per-post status log++After each post, append a status line to the running log:++```+Post <N>/<total>: "<title>"+ Status: written | failed | under_target | resumed+ File: <filename.md>+ Word count: <N> (target: <N>)+ Outgoing internal links: <N>+ Backward links injected into prior posts: <N>+ Template: <template>+ Hero image: generated | skipped (reason)+ Time: <approximate seconds>+```++## Cluster scorecard generation++After all posts in the queue have been attempted (written, failed, or+skipped), produce `cluster-<slug>/cluster-scorecard.md`:++### Sections to include++1. **Summary**: seed keyword, total posts attempted, total written, total+ failed, total words, total internal links, approximate execution time.+2. **Per-post quality scores**: call `/blog analyze` on each successful post+ in parallel via Task. Record the 5-category score and the cluster average.+3. **Cluster cohesion score** (0 to 100, formula below).+4. **Link audit**: per-post outgoing and incoming counts; orphan-spoke flags+ (less than 2 incoming links); list of unresolved `[INTERNAL-LINK]` markers.+5. **Cannibalization check**: any two posts sharing primary keyword (block);+ any pair with greater than 70 percent keyword overlap (warn). Recommend+ `/blog cannibalization` for a deeper pass.+6. **Image summary**: hero images generated, hero images skipped (with reasons).+7. **Coverage analysis**: a per-cluster table (name, posts written, intent,+ status), and a list of identified keywords with no targeting post.+8. **Recommended next actions** (the ordered list below).++### Cluster cohesion score formula++```+cohesion = round(+ 0.40 * link_reciprocity_pct # 0..100, % of cluster links that are bidirectional+ + 0.25 * incoming_coverage_pct # 0..100, % of posts with at least 3 incoming links+ + 0.20 * intent_diversity_pct # 0..100, distinct intents / max possible+ + 0.15 * template_diversity_pct # 0..100, distinct templates / total posts+)+```++Bands: 90+ exemplary, 80-89 strong, 70-79 acceptable, below 70 needs work.++### Recommended next actions (default order)++1. Run `/blog seo-check` on each post for on-page validation.+2. Run `/blog schema` to add `BreadcrumbList`, `ItemList`, and `Article` markup.+3. Run `/blog cannibalization` across the full cluster directory.+4. Run `/blog repurpose` on the pillar to seed social, email, and YouTube assets.+5. For any post flagged `under_target` or `failed`, run `/blog rewrite` or `/blog write` manually.+6. Optional: `/blog audio` for narration of the pillar; `/blog calendar` to schedule publication.++## Resume capability++If a previous execution was interrupted:++1. Scan `cluster-<slug>/` for files matching the planned spoke slugs.+2. Mark matched posts as `pre_existing` in the queue.+3. Skip them during this execution.+4. Run only the backward-link injection pass on pre-existing posts (in case+ they reference posts that were not yet written when they were created).+5. Note in the scorecard: `Resumed execution. <N> posts pre-existing.`++## Output directory layout++```+<cwd>/+└── cluster-<seed-slug>/+ ├── cluster-plan.json+ ├── cluster-map.html+ ├── images/ (created if blog-image is available)+ │ ├── pillar-<slug>-hero.png+ │ └── <spoke-slug>-hero.png+ ├── pillar-<slug>.md+ ├── <spoke-slug>.md (one per spoke)+ └── cluster-scorecard.md+```++Slug rules: lowercase, hyphens only, no special characters. Match+`blog-write`'s default slug convention so the two skills agree on filenames.diff --git a/skills/blog-cluster/references/semantic-clustering.md b/skills/blog-cluster/references/semantic-clustering.mdnew file mode 100644index 0000000..dc000bf--- /dev/null+++ b/skills/blog-cluster/references/semantic-clustering.md@@ -0,0 +1,179 @@+# Semantic Clustering: Keyword Grouping & Intent Classification++> Reference document for `blog-cluster`. Loaded on demand during Plan Phase.++## What is semantic clustering?++Semantic clustering groups keywords by **meaning and search intent**, not by+word similarity. Two keywords that look different can share the same intent+and should be targeted by one post, not two competing posts. Conversely, two+keywords that share most of their letters can have completely different+intents and require separate posts.++Example:++- "best CRM software" and "top CRM tools 2026" share commercial-comparison+ intent. They belong in the same post.+- "CRM definition" is informational and educational. It belongs in a separate+ post (or a separate FAQ entry inside the pillar).++## The four-step clustering process++### Step 1. Build the keyword universe from the seed++Use WebSearch to expand the seed keyword into 30 to 50 candidate phrases:++1. Direct search of the seed; capture related searches and "People also ask".+2. Long-tail expansion: append `guide`, `tips`, `tools`, `examples`, `vs`, `best`, `how to`.+3. Question mining: prepend `what is`, `how does`, `why`, append `for beginners`.+4. Intent variants: add commercial (best, top, review, comparison, pricing), informational (guide, tutorial, explained, examples), and transactional (buy, download, tool, software, service) modifiers.+5. Year freshness: append `2026`.++Drop near-duplicates (variants that differ by only a stop word or plural).++### Step 2. SERP overlap analysis (the strongest signal)++Two keywords belong in the same post when Google returns substantially the+same top-10 results for both. This is the single most reliable signal for+intent matching, and no paid SEO tool is required.++Method:++1. WebSearch keyword A. Note the top 10 organic result URLs (domain plus path).+2. WebSearch keyword B. Note the top 10 organic result URLs.+3. Count the overlap: how many URLs appear in both result sets?++Thresholds:++| Shared top-10 URLs | Interpretation | Action |+|--------------------|----------------|--------|+| 7 to 10 | Same intent, same SERP | Must be the same post |+| 4 to 6 | Very similar intent | Should be the same post |+| 2 to 3 | Related but distinct | Separate posts; interlink heavily |+| 0 to 1 | Different intent | Must be separate posts |++Optimization: do not test every pair. First group by initial intent guess+(Step 3), then verify SERP overlap within each candidate cluster.++### Step 3. Intent classification++Classify each keyword into one of four intents. Intent drives template+selection and cluster grouping.++| Intent | Linguistic signals | Typical template | User goal |+|--------|--------------------|------------------|-----------|+| Informational | what is, how to, guide, explained, tutorial, why | how-to-guide, faq-knowledge, tutorial, pillar-page | Learn |+| Commercial | best, top, review, comparison, vs, alternative | listicle, comparison, product-review | Evaluate |+| Transactional | buy, pricing, download, tool, software, service, free | listicle (with CTAs), product-review | Take action |+| Navigational | brand names, specific products, "<brand> login" | (excluded) | Find a known page |++Rules:++- Group informational keywords into educational clusters.+- Group commercial keywords into evaluation clusters.+- Treat transactional keywords as standalone or attach to a commercial cluster.+- Exclude navigational keywords from topic clusters; they belong to brand pages.++### Step 4. Entity mapping++Use WebSearch to identify the key entities Google associates with the topic:++- People (industry leaders, authors, researchers)+- Products and tools (software, services, platforms)+- Concepts (frameworks, methodologies, theories)+- Organizations (companies, institutions, standards bodies)++Entities help confirm cluster boundaries. Keywords that reference the same+set of entities likely belong in the same cluster.++### Step 5. Hub vs. spoke decision++For each candidate cluster:++- The **hub** (pillar) targets the broadest, highest-volume keyword across+ the entire seed set. There is exactly one pillar per seed.+- The **spokes** target specific long-tail keywords within each cluster.++Promote a keyword to pillar candidate when it scores highest on:++1. Volume estimate (Step 6 below).+2. Centrality: it is referenced by, or related to, the largest number of+ other keywords in the universe.+3. Intent breadth: it is informational and broad enough to anchor sub-topics+ of multiple intents.++## Search volume estimation (without paid tools)++| Signal | Volume estimate |+|--------|-----------------|+| Appears in Google autocomplete | Medium to High |+| Has a "People also ask" block | Medium to High |+| Multiple dedicated articles from major publications | High |+| Forum / Reddit discussions only | Low to Medium |+| Niche blogs only, no major publications | Low |++Label each keyword as `high`, `medium`, or `low`. This is sufficient for+relative prioritization within a cluster. For absolute numbers, the user can+run `/blog google` (Keyword Insights) or use DataForSEO via `seo-dataforseo`.++## Cluster naming convention++`Cluster <Letter>: <Theme> (<intent>)`++Example: `Cluster A: Content Creation (informational)`.++## Worked example: seed = "AI marketing for small business"++Keyword universe (selected, 12 of ~35):++1. ai marketing for small business+2. how to use ai for small business marketing+3. best ai marketing tools for small business+4. ai marketing automation small business+5. small business ai email marketing+6. ai content creation for small business+7. ai social media tools for small business+8. how much does ai marketing cost+9. ai marketing roi small business+10. small business ai marketing case study+11. chatgpt for small business marketing+12. ai marketing strategy for small business++SERP overlap pass (sampled):++- 1 vs. 12: 8 of 10 URLs match. Same post (pillar candidate).+- 2 vs. 6: 6 of 10 URLs match. Same post.+- 3 vs. 7: 5 of 10 URLs match. Same post (commercial-tools cluster).+- 8 vs. 9: 4 of 10 URLs match. Borderline; keep separate, interlink.++Intent classification:++- Informational: 1, 2, 6, 12, 4, 5, 11+- Commercial: 3, 7+- Transactional: (none pure)+- Mixed (informational + commercial): 8, 9, 10++Resulting cluster map:++| ID | Role | Title | Primary keyword | Intent | Template |+|----|------|-------|-----------------|--------|----------|+| P | Pillar | AI Marketing for Small Business: Complete 2026 Guide | ai marketing for small business | informational | pillar-page |+| A1 | Spoke | How to Use AI for Small Business Marketing (Step by Step) | how to use ai for small business marketing | informational | how-to-guide |+| A2 | Spoke | AI Content Creation for Small Business: Tools and Workflow | ai content creation for small business | informational | how-to-guide |+| A3 | Spoke | ChatGPT for Small Business Marketing: 12 Practical Use Cases | chatgpt for small business marketing | informational | listicle |+| B1 | Spoke | Best AI Marketing Tools for Small Business in 2026 | best ai marketing tools for small business | commercial | listicle |+| B2 | Spoke | AI Social Media Tools for Small Business Compared | ai social media tools for small business | commercial | comparison |+| C1 | Spoke | How Much Does AI Marketing Actually Cost a Small Business? | how much does ai marketing cost | informational+commercial | data-research |+| C2 | Spoke | AI Marketing ROI: A Small Business Case Study | ai marketing roi small business | informational | case-study |++Result: 1 pillar + 7 spokes across 3 clusters (Content Creation, Tools, Economics). Intent diversity: 2. Template diversity: 5. Total interlinks (planned): roughly 22.++## Anti-patterns++| Anti-pattern | Why it fails | Fix |+|--------------|--------------|-----|+| Grouping by word similarity | "email marketing" and "email etiquette" share words but not intent | Use SERP overlap plus intent |+| One keyword per post | Wastes effort and risks thin content | Group keywords with shared SERPs |+| Mixing intents in one cluster | Dilutes both ranking signals | Separate by intent first |+| More than 5 clusters per pillar | Spreads authority too thin | Cap at 5 clusters |+| Single-post clusters | No internal-linking mass | Minimum 2 spokes per cluster |