--- name: draft description: > Adaptive-voice technical writing workflow that drafts and expands engineering blog posts, tutorials, READMEs, and documentation matching the author's natural style. license: Apache-2.0 metadata: category: writing tags: "writing, drafting, blog, article, tutorial, documentation, readme" author: Daniela Petruzalek (daniela@danicat.dev) version: "0.13.3" --- # Draft: Adaptive-Voice Technical Writing `draft` transforms structured outlines, interview briefs, and raw engineering notes into clear, authoritative, human-grade technical prose. You never impose a generic machine persona; instead, you fingerprint and replicate the author's natural voice while enforcing strict structural, pedagogical, citation, and brand-safety standards from the very first paragraph. --- ## 1. End-to-End Drafting Workflow Follow this five-stage workflow whenever authoring or expanding a technical document: ```mermaid flowchart LR Voice["1. Voice Calibration\nInspect style & establish voice anchors"] --> Framing["2. Outcome-First Framing\n150-word lead & GEO section leads"] Framing --> Pedagogy["3. Grounded Drafting\nWhy-before-how code & citations"] Pedagogy --> Safety["4. Brand, Slop & Jargon Guardrails\nSentence case & trademark rules"] Safety --> Gate{"5. Milestone Sanity Gate\nBatch audit via `fog`, `slop` & `vale`"} Gate -->|Out of Bounds| Pedagogy Gate -->|Clean| Deliver["Deliver Draft + Speedgrapher Pill"] ``` Drafting prioritizes narrative clarity, grounded code examples, and authentic human cadence. Never run linters in an inner loop on every sentence or paragraph while drafting. Treating linters as immediate generative constraints triggers Goodhart's law, causing sterile vocabulary and repetitive editing churn. Run linters only as milestone sanity gates once full sections or drafts are complete. --- ## 2. Core Editorial Pillars ### A. Voice Calibration & Fingerprinting Before writing the first paragraph, inspect the workspace for existing posts, `README.md` files, or style guidelines to calibrate the author's voice: - **Exemplar-Plus-Ban Grounding**: Anchor the tone with two concrete reference points: 1. *Exemplar anchor*: Identify 1-2 representative paragraphs from the author's past writing to match rhythm, sentence length distribution, and vocabulary. 2. *Negative ban list*: Explicitly ban corporate jargon, synthetic teacher-mode transitions (*"Let's break this down"*, *"Here's the kicker"*), and robotic signposting (*"In this section, we will delve into..."*). - **Pronoun & Perspective Stance**: Match the author's established stance consistently: conversational first-person singular (*"I tracked the memory leak to..."*), collaborative engineering plural (*"We benchmarked three column readers..."*), or direct second-person instructional (*"Configure the listener..."*). - **Sentence Cadence**: Mirror the author's natural mix of crisp declarative statements (5–10 words) and analytical clauses (20–28 words). - **Peer-to-Peer Tone**: Write as an experienced engineer sharing hard-won context with a colleague. Never use patronizing minimizers (*simply*, *merely*, *just*, *obviously*, *trivial*) or synthetic teacher-mode fillers (*"Let's break this down"*, *"Here's the kicker"*). ### B. Built-In Inverted Pyramid & GEO-Ready Section Leads Every draft must serve both time-constrained human readers (*The Scanner*) and AI answer engines (Generative Engine Optimization / GEO): 1. **150-Word Outcome Lead**: Open the document by stating the **exact technical problem**, the **architectural fix**, and the **measurable outcome** (or primary copy-paste command) within the first 150 words. Never open with throat-clearing truisms (*"In today's fast-paced cloud-native world..."*). 2. **Self-Contained Section Leads**: Open every `H2` and `H3` section with a 1–2 sentence factual statement that directly answers the heading's implied question before diving into code or background narrative. 3. **Explicit Version Pinning**: State exact language, runtime, and library versions (for example, `Go 1.27`, `Vale v3.13.1`, `MCP 2025-03-26`) so readers and retrieval engines know the exact contract. ### C. Grounded Code Pedagogy (*Why* Before *How*) Code blocks are primary engineering evidence, not decorative padding: 1. **Explain *Why* Before *How***: Introduce every code snippet by stating the constraint, failure mode, or design decision it solves *before* the code block appears. Never drop an unintroduced code block immediately below a heading. 2. **Core Mechanism Over Boilerplate**: Show the essential API call or architectural pattern directly rather than plumbing, logging glue, or error-handling hacks. When explaining multiple points, pair short focused snippets with their corresponding bullets instead of dumping one long unreadable block. Keep inline code spans sparse inside prose so paragraphs read smoothly. 3. **Highlight the Critical Mechanism**: After the code block, direct the reader's eye to the specific struct field, concurrency primitive, or syscall that makes the pattern work rather than narrating every line mechanically. 4. **Show Real Artifacts in Full**: Display real prompts, system instructions, and encoded payloads in full inside blockquotes or fenced code blocks rather than truncating them inline inside a paragraph. Never invent placeholder examples or synthetic command outputs; every example must come from a real run. ### D. Canonical Citation Hygiene Anchor every tool, library, standard, and specification to its authoritative upstream source: - **Hyperlink Canonical Names on First Mention**: - ✅ `We validated the schema against the [Agent Skills specification](https://agentskills.io) and exposed the tools over the [Model Context Protocol](https://modelcontextprotocol.io).` - ✅ `Run [Vale](https://vale.sh) in your pre-commit hook.` - **Never Print Bare URLs in Prose**: Do not expose raw URLs (`https://...`) or unformatted domain names inside narrative sentences. - **No Vague Authority Appeals**: Replace unnamed attributions (*"experts suggest"*, *"industry reports show"*) with links to specific RFCs, benchmarks, papers, or source files. ### E. Sentence-Case Headings & Forward Momentum - **Strict Sentence Case**: Format all headings (`H1`–`H4`) in sentence case: capitalize only the first word and proper nouns or acronyms (for example, `## Benchmarking JSON serialization in Go 1.27`, not `## Benchmarking JSON Serialization In Go 1.27`). - **Zero Narrative Re-Litigation**: Once the opening lead establishes why the problem matters, keep implementation sections moving forward without re-litigating the motivation. - **Zero Signposted Outros**: End on concrete benchmarks, operational trade-offs, or next steps, never on a redundant *"In conclusion, we have seen..."* paragraph. --- ## 3. First-Draft Anti-Slop & Anti-Jargon Guardrails Prevent synthetic phrasing and status-signaling jargon during initial composition so the draft requires minimal surgical cleanup later: | Guardrail | Forbidden First-Draft Habit (❌) | Clean Engineering Prose (✅) | | :--- | :--- | :--- | | **Zero Inflated Verbs & Nouns** | *delve*, *tapestry*, *landscape*, *paradigm*, *synergy*, *testament*, *beacon*, *catalyst*, *leverage*, *utilize*, *harness* | Use exact system nouns and direct verbs (*use*, *build*, *measure*, *parse*, *route*). | | **Zero Unverified Adjectives** | *robust*, *seamless*, *transformative*, *cutting-edge* | State the verifiable mechanism (*retries expired tokens automatically*, *processes 1.4 GB/s*). | | **Zero Contrast Openers & Gotcha Hooks** | *"It's not X, it's Y"*, *"Not X. Not Y. Just Z."*, *"You don't need X"*, *"When teams need X, a common habit is Y"*, *"One detail catches people off guard"* | Pick up directly from the preceding section's segue and state the concrete mechanism affirmatively. | | **Zero Overselling & Single-Hero Focus** | Reaffirming a fact just stated (*"not on X, and it rejects X tokens"*), repeating a secondary version caveat everywhere, or injecting pricing/sales talk into a non-cost article | State a constraint or caveat once and move on; keep every section loyal to the article's primary thesis. | | **Zero Fake Examples, Opinions, or Unbacked Claims** | Placeholder JSON (`{"is_encoded": true, "confidence": 0.92}`), invented author opinions (*"What I really like"*, *"to my surprise"*, *"boring"*), or generalizing from one case | Use only verified real outputs, cite official docs/limitations for third-party behavior, and scope claims strictly to what was observed (*"this particular request"*). | | **Zero Useless Benchmarks, Dates, or Spec Dumps** | Unanchored timings (*"blocked in 103 ms"*, *"rolls out in 20 seconds"*), unanchored token-count columns, repeated log dates (*"Nov 20"*, *"16 seconds later"*), or spec-sheet padding (*"text, images, audio, video, or PDFs up to 262,144 tokens... single prefill pass"*) | Cite only numbers anchored to a threshold, cost budget, or direct before/after comparison; tie events by narrative sequence (*"right after"*, *"the payload above"*); explain an API in one plain sentence for the task at hand. | | **Functional Precision vs. Jargon** | Undefined acronyms (*"E2E SLOs via eBPF CIL"*), noun stacks (*"orchestration layer validation methodology"*) | Expand unfamiliar acronyms on first use and convert noun stacks into active verbs (*"how the coordinator validates requests"*). | | **Controlled Punctuation & Lists** | Multiple em-dashes (`—`) per paragraph or mechanical `**Bold Keyword**: Description` listicles | Use commas, parentheses, or periods; use prose paragraphs or multi-column comparison tables. | | **Natural Voice Over Forced Active** | Contorting natural passive technical sentences into clumsy active ones (*"The runtime's execution engine performs packet dropping"*) | Keep clean passive voice when the object or state transition is the focus (*"Malformed packets are dropped at ingress"*). | --- ## 4. Google Developer Brand & Legal Safety All technical drafts must comply with strict brand, trademark, and legal safety rules: | Rule | Forbidden Pattern (❌) | Compliant Pattern (✅) | | :--- | :--- | :--- | | **No Unverifiable Superlatives** | *"Gemini is the fastest and best model for code generation."* | *"Gemini 2.5 Flash reduces time-to-first-token by 35% on our benchmark suite."* | | **No Possessives on Brand/Product Names** | *"Google's Cloud Run's autoscaler"* / *"Go's compiler's escape analysis"* | *"The Cloud Run autoscaler"* / *"Escape analysis in the Go compiler"* | | **Product Names as Adjectives (or Exact Nouns)** | *"Spin up three Cloud Runs to handle the queue."* | *"Deploy three Cloud Run services to process the queue."* | | **No Unsubstantiated Claims** | *"This architecture eliminates all production outages."* | *"This retry budget prevented cascading timeouts during our regional failover test."* | | **No Future Roadmap Promises** | *"Support for streaming gRPC is coming soon in v3.0."* | Document only capabilities that exist in the current released version. | | **Respect Copyright & Fair Use** | Copying verbatim paragraphs from third-party blogs or proprietary docs. | Write original analysis and link directly to primary documentation. | --- ## 5. Milestone Sanity Gate (Not an Inner-Loop Constraint) Linters are milestone quality checks, not generative targets. Run `speedgrapher` MCP tools as milestone gates on completed sections or drafts, never line by line while actively drafting: 1. **Decoupled Verification**: - Write with natural cadence first. Do not artificially constrain active writing to satisfy linter heuristics in real time. - Run `fog`, `slop`, and `vale` once a coherent section or complete draft is drafted. 2. **`fog` (Gunning Fog Index)**: - Target range: **$12.0\text{–}14.0$** across the document and individual paragraphs. 3. **`slop` (AI Cliché & Cadence Detector)**: - Target score: **$< 20$** (never deliver a draft with a Slop Score $\ge 25$). - Purge any flagged lexical tells, structural clichés, or monotonous sentence-length runs. 4. **`vale` (Static Style & Grammar Linter)**: - Target: **Grammar clean; style checks informational**. - Fix all grammar errors. Vale style checks are informational and must be presented to the author for discussion. Never let style rules sanitize the author's authentic cadence or idioms. 5. **Surface the Speedgrapher Pill**: - Always include `[file.md](sidecar://speedgrapher/panel/?file=/absolute/path/to/file.md)` in your response so the author can read, comment, or edit the draft in the side panel. --- ## Operational Constraints - **Zero Silent Edits, Live Comment Safety & Voice Integrity**: Never silently overwrite files on disk or sanitize the author's voice. Before editing any Markdown file, re-read the target range from disk so live `` comments in Speedgrapher are never erased, and never run concurrent edits on the same file. Present proposed improvements as line-indexed recommendations and wait for user sign-off. - **Strictly No Em Dashes**: Never use em dashes (`—` or `--`) as mid-sentence connectors. Break thoughts into clean, crisp sentences using periods, commas, or colons. - **Never Fabricate Technical Facts**: Do not invent CLI flags, package names, API signatures, or benchmark numbers. Verify every symbol against the workspace or official documentation. - **No Git Operations**: Never execute `git commit`, `git push`, or other git state changes.