---
name: publish
description: >
Editorial review and publication readiness workflow that audits prose
quality, resolves or injects inline review comments, and verifies technical
SEO, GEO, and frontmatter metadata.
license: Apache-2.0
metadata:
category: writing
tags: "review, publish, seo, geo, metadata, localization, blog"
author: Daniela Petruzalek (daniela@danicat.dev)
version: "0.13.3"
---
# Publish: Editorial Review, Inline Annotations & SEO/GEO Release Gate
`publish` is Speedgrapher's unified quality and authoritative release gate. It operates in two progressive stages mirroring Speedgrapher's two-plane architecture:
- **Stage A (Prose and Structural Review: All Markdown Files)**: Audits readability (`fog`), AI-trope density (`slop`), static grammar/style (`vale`), macro-narrative flow, and bidirectional inline review comments (``).
- **Stage B (Second-Plane Technical SEO, GEO, and Localization: Blog Posts and Web Pages)**: Audits discoverability via the `seo` MCP tool (`doc_type: "page"` or `"doc"`), enforces the dual-purpose frontmatter split (`summary` vs. `description`), validates Generative Engine Optimization (GEO) signals, and guides idiomatic multi-language localization.
---
## 1. Two-Stage Review & Release Pipeline
```mermaid
flowchart TD
Target["Target Markdown File (.md)"] --> Comments{"Inline ``\nMode?"}
Comments -->|Resolve Human Comments| Resolve["Rewrite targeted paragraphs\n& remove resolved comment tags"]
Comments -->|Annotate File In-Place| Annotate["Insert ``\nbelow flagged paragraphs"]
Comments -->|Standard Audit| StageA["Stage A: Prose & Narrative Audit\nRun `fog`, `slop`, `vale`"]
Resolve --> StageA
Annotate --> StageB
StageA --> StageB["Stage B: Second-Plane `seo` Gate\nRun `seo` (`page` or `doc`), GEO & Localization"]
StageB --> Output["Deliver Scorecard, Indexed Fixes\n& Release Checklist + Speedgrapher Pill"]
```
Whenever you review or prepare a `.md` file for release, always surface the side-panel pill at the top of your response:
> Open [file.md](sidecar://speedgrapher/panel/?file=/absolute/path/to/file.md) to inspect live diagnostics, inline comments, and SEO telemetry in the side pane.
---
## 2. Stage A: Prose Quality Gate & Inline Review Comments (All Markdown Files)
### A. Quantitative MCP Prose Diagnostics
Run `fog`, `slop`, and `vale` on the target `.md` file using its absolute `path`:
| MCP Tool | Scope & Granularity | Target Threshold | Action When Out of Bounds |
| :--- | :--- | :--- | :--- |
| **`fog`** | Document-wide & per-paragraph Gunning Fog Index (`paragraphs[]`). | **12.0 – 14.0** | Check readability balance when paragraph density falls outside the 12.0–14.0 target range. |
| **`slop`** | Document-wide & per-paragraph 4-Dimension AI Slop Score (`0–100`). | **$< 20$** (Clean) **$\ge 25$** (Warning) | Flag lexical tells (*delve*, *tapestry*, *leverage*, *utilize*, *robust*, *quietly*), negative parallelism (*"It's not X, it's Y"*), and uniform-cadence paragraphs. |
| **`vale`** | Static style & grammar linter (`Google`, `proselint`, `write-good`). | **Grammar clean; style informational** | Vale grammar checks must always be fixed. Vale style checks are informational and presented to the user for discussion. Style rules must never override authentic author voice. |
### B. Qualitative Editorial Audit Criteria
Inspect the manuscript line by line against six qualitative standards:
1. **Inverted-Pyramid & Macro-Narrative Momentum**: Does the opening 150 words state the core problem, solution, and headline metric? Do later sections maintain forward momentum without re-litigating the introduction?
2. **Functional Precision vs. Status-Signaling Jargon**: Are domain acronyms defined on first use? Have bureaucratic noun stacks been replaced with active verbs?
3. **Canonical Citation Hygiene**: Are tools, libraries, and open standards hyperlinked by their canonical name on first mention (for example, `[Model Context Protocol](https://modelcontextprotocol.io)`), with zero bare URLs printed in prose?
4. **Grounded Code Pedagogy**: Is every code block introduced with *why* before *how*?
5. **Sentence-Case Headings**: Do all headings (`H1`–`H4`) use strict sentence case?
6. **Google Developer Brand & Legal Safety**: Flag unverifiable superlatives (*"fastest"*, *"best"*), possessives on product names (*"Google's Cloud Run's"*), unsubstantiated claims, or mentions of unreleased roadmaps (*"coming soon"*).
7. **Reader-First Signal Over Noise**: Flag and strip useless benchmarks (timings or counts without a clear target, baseline, or cost bound), useless log dates or timestamp gaps (*"Nov 20"*, *"16 seconds later"*), and documentation spec-sheet dumps before release.
### C. Bidirectional Inline Review Comment Workflow (``)
Speedgrapher uses HTML comments placed immediately below a paragraph as a zero-lock-in review bus, written either as plain `` tags or with UI metadata attributes ``:
1. **Resolving Human Comments (`Human -> Agent`)**:
- When the file contains `` or `` comments added by the author, locate every comment block.
- Edit the preceding paragraph (or add the requested code/table) to fulfill the author's note while keeping `fog` ($12\text{–}14$) and `slop` ($< 20$) in bounds.
- **Delete each resolved `` or `` comment** from the file once addressed.
2. **Injecting Agent Annotations (`Agent -> Human`)**:
- When the user asks you to *annotate the file in place* or *leave inline review comments* (instead of rewriting the prose directly), insert concise `` comments directly beneath the affected paragraphs:
```markdown
The orchestration layer utilizes a distributed lock methodology to facilitate state synchronization across worker nodes.
```
### D. Mandatory Stage A Output: Scorecard + Line-Indexed Recommendations
Structure every editorial review using this exact template so the author can evaluate and apply findings by ID:
```markdown
## Editorial Review: ``
Open [file.md](sidecar://speedgrapher/panel/?file=/absolute/path/to/file.md)
### 1. Editorial Review Scorecard
| Dimension | Score / Status | Target | Assessment |
| :--- | :--- | :--- | :--- |
| **Readability (`fog`)** | `` (`` hotspot paragraphs) | `12.0 – 14.0` | `[Pass / Needs Simplification / Check Depth]` |
| **AI Slop (`slop`)** | `/100` | `< 20` (Warn `>= 25`) | `[Pass / Minor Tells / High Slop Warning]` |
| **Static Analysis (`vale`)** | ` errors, warnings` | Grammar clean; style informational | `[Grammar errors resolved; style warnings summarized for discussion]` |
| **Technical SEO (`seo`)** | `/100` (`/7` checks) | `>= 85` (`7/7` passed) | `[Summary of metadata, heading, alt-text, and link checks]` |
| **Narrative & Jargon Hygiene** | `[Strong / Needs Tightening]` | Inverted pyramid & plain English | `[1-sentence assessment of 150-word lead, jargon, and citations]` |
### 2. Executive Assessment
[2–3 concise sentences summarizing the draft's core strengths, voice alignment, and highest-leverage improvements.]
### 3. Line-Indexed Recommendations
[Exhaustive numbered list of every specific issue identified. Never group distinct line edits.]
- `[1] Line | Dimension: | Context: "" | Suggestion: ""`
- `[2] Line | Dimension: | Context: "" | Suggestion: ""`
```
Unless the user explicitly asked you to auto-fix or annotate the file in a single pass, invite them to respond with selective commands (`"apply all"`, `"apply 1, 3, 5"`, `"annotate in file"`, or `"discuss 2"`).
---
## 3. Stage B: Second-Plane Technical SEO, GEO & Localization Gate
For blog posts, tutorials, and web documentation (`doc_type: "page"`), execute the full second-plane discoverability audit using the `seo` MCP tool.
### A. The Dual-Purpose Metadata Split (`title`, `summary`, `description`, `canonical`)
Static site generators (Hugo, Astro, Next.js) and AI retrieval pipelines consume frontmatter fields for distinct purposes. Always separate the human feed teaser from the search/LLM factual answer:
| Frontmatter Field | Length Target | Primary Consumer | Writing Strategy | Example |
| :--- | :--- | :--- | :--- | :--- |
| **`title`** | **30–60 chars** | Browser tabs, SERP headlines, social cards | Front-load the primary technical subject and concrete mechanism in sentence case. | `"Zero-allocation JSON parsing in Go 1.27"` |
| **`summary`** | **80–180 chars** | Human readers browsing blog index cards, RSS feeds, and newsletters | Write a compelling editorial hook that highlights the engineering tension or debugging story without giving away every detail. | `"When our telemetry cluster hit 40% CPU in reflection stalls, we replaced encoding/json with a pre-compiled column reader."` |
| **`description`** | **120–160 chars** | Search engine snippets (``) and LLM/RAG retrieval indices (GEO) | Write a self-contained, factual answer stating *what* the article covers, exact runtime versions, and the measurable result. | `"Learn how to build a zero-allocation JSON column reader in Go 1.27 that cuts CPU overhead by 44% and keeps p99 latency under 1.2 ms."` |
| **`canonical`** | **Valid HTTPS URL** | Search engine crawlers (``) | Specify the authoritative URL for syndicated or cross-posted articles. | `"https://example.dev/blog/zero-alloc-json-go/"` |
```yaml
---
title: "Zero-allocation JSON parsing in Go 1.27"
date: 2026-10-12
summary: "When our telemetry cluster hit 40% CPU in reflection stalls, we replaced encoding/json with a pre-compiled column reader."
description: "Learn how to build a zero-allocation JSON column reader in Go 1.27 that cuts CPU overhead by 44% and keeps p99 latency under 1.2 ms."
canonical: "https://example.dev/blog/zero-alloc-json-go/"
tags: ["go", "performance", "json", "memory-management"]
---
```
### B. The 7-Point `seo` Verification Gate (`checks[]`)
Run `speedgrapher`'s `seo` MCP tool (`path`, `doc_type: "page"` for web posts or `"doc"` for repository docs, and target `keyword`) and verify all seven `checks[]` pass:
1. **`Title Tag` (`30–60 chars`)**: Clear `title` frontmatter key or document `# H1` between 30 and 60 characters (and containing the target `keyword` when provided).
2. **`Meta Description` (`120–160 chars`)**: `description` frontmatter field (or ``) present and between 120 and 160 characters (skipped in `doc_type: "doc"` mode).
3. **`H1 Tag`**: Exactly one `H1` (`# ` or `