Skip to main content

blog.rewrite_for_audience

blog.rewrite_for_audience translates a source document (markdown) into an original blog post for a stated audience and angle. It is not a summarizer — it leads with why-it-matters, de-jargons, connects to the audience's tools, and adds perspective, while staying grounded in source_content (no claims that aren't in the source). It is the generator pack at the heart of every *-rewrite-blog pipeline. It does not fetch sources (call doc.parse / web.scrape / research.deep first), does not insert inline citations (chain content.ground with rewrite:false after), and does not publish to a CMS (chain blog.publish to save the artifact).

Inputs

FieldTypeRequiredDefaultNotes
source_contentstringyesThe source markdown to rewrite.
audiencestringyesWho the post is for (e.g. "platform engineers").
modelstringyesA routable provider/model id.
anglestringnoThe editorial angle / thesis.
titlestringnoSuggested title.
personastringnogeneralTone preset (technical, marketing, executive, educational, or freeform).
max_tokensnumbernoCap on the LLM call.

Outputs

FieldTypeNotes
markdownstringThe rewritten blog post.
persona_usedstringThe persona that shaped the output.
modelstringThe model used.

Vault credentials needed

  • None directly — requires a configured AI gateway (gateway-gated pack).

Use it from your agent (OpenClaw chat-UI worked example)

OpenClaw chat capture pending.

Developer reference (curl)

curl -fsS -X POST http://localhost:3000/api/v1/packs/blog.rewrite_for_audience \
-H "Authorization: Bearer $JWT" \
-H 'Content-Type: application/json' \
-d '{
"source_content": "# Raw notes...",
"audience": "platform engineers",
"angle": "why this matters for CI",
"model": "openrouter/auto"
}'

Error codes

CodeTriggers
invalid_inputsource_content, audience, or model missing.
handler_failedThe model returned no usable output.

Session chaining

  • No session. Stateless; chains via content (output markdowncontent.ground / blog.publish).

Async behavior

Async: true — one gateway LLM call; call through pack.start or a SEP-1686-aware SDK to avoid client timeouts.

See also

  • Catalog row: PACKS.md.
  • Source: internal/packs/builtin/blog_rewrite_for_audience.go.
  • Companion packs: content.ground, blog.publish, doc.parse, web.scrape, research.deep.
  • Pipelines: builtin.brief-rewrite-blog, builtin.scrape-rewrite-blog, builtin.doc-rewrite-blog, builtin.research-rewrite-blog.