extract-workflow-markdown-from-output-json

extract-workflow-markdown-from-output-json is a skill for Claude Code from wan-huiyan/agent-traffic-control. It costs 185 tokens per session (1,264 once invoked), scanned A, original, MIT.

A helper for saving a long Markdown document from a workflow or background agent’s JSON result to a file. It handles results that are shortened in completion messages and contain escaped characters.

In plain words
What is it for?
Use it to save generated reports, plans, documents, or prompts from structured workflow output as Markdown files.
Why use it?
It prevents missing text caused by truncated results and avoids saving visible escape codes such as \n instead of real line breaks.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions Claude Code.

Part of the agent-traffic-control plugin — 105 skills shipped together

Good fit Use it to save generated reports, plans, documents, or prompts from structured workflow output as Markdown files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/agent-traffic-control/extract-workflow-markdown-from-output-json
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add wan-huiyan/agent-traffic-control --skill extract-workflow-markdown-from-output-json
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 105 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for extract-workflow-markdown-from-output-json

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/extract-workflow-markdown-from-output-json/github.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/extract-workflow-markdown-from-output-json)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/extract-workflow-markdown-from-output-json"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/extract-workflow-markdown-from-output-json/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for extract-workflow-markdown-from-output-json

Your own site · 80×15
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/extract-workflow-markdown-from-output-json"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/extract-workflow-markdown-from-output-json.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 185 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,264 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00185 $0.01264
Opus 5 $0.00093 $0.00632
Sonnet 5 $0.00037 $0.00253
Haiku 4.5 $0.00018 $0.00126

Measured 9d ago against content hash 9e26a7ec51ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

extract-workflow-markdown-from-output-json scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/agent-traffic-control/skills/extract-workflow-markdown-from-output-json/SKILL.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Persist a Workflow's large markdown field by parsing its output JSON — never retype it

Problem

A Workflow's synthesis agent(..., {schema}) returns a big markdown deliverable in a schema field (e.g. next_prompt_markdown, report, plan). You want it on disk. The instinct is to copy it out of the completion <task-notification> (or the truncated tool result) into a Write call. Two failures follow:

  1. Truncation loss — the notification/tool result is capped (often a few hundred lines / ~25-35k tokens) with ... (truncated N chars, full result in <path>). Retyping from it silently drops everything past the cap.
  2. Escape leakage — inside the JSON the field is escaped: newlines are literal \n, quotes are \". Hand-copying (or reflowing) it often ships those escapes as literal text in the saved file, so the markdown renders as one line with visible \n.

Context / Trigger conditions

  • A Workflow / background Agent finished; its result contains a long markdown/string field you want to save as a .md (a next-session prompt, a synthesized report, generated copy).
  • The <task-notification> says full result in /private/tmp/.../tasks/<task-id>.output.
  • You're tempted to Write the content by retyping it from what you can see.

Solution

The full, unescaped result is always persisted to the output file named in the notification (.../tasks/<task-id>.output, a JSON envelope {summary, agentCount, logs, result}). Parse it and write the field — let json.load do the unescaping; never retype.

OUT="/private/tmp/.../tasks/<task-id>.output"   # path from the <task-notification>
python3 - "$OUT" <<'PY'
import json, sys
r = json.load(open(sys.argv[1]))["result"]
# navigate to the field (e.g. result.synthesis.next_prompt_markdown)
doc = r["synthesis"]["next_prompt_markdown"]
open("docs/handoffs/the_doc.md", "w").write("<your header>\n\n" + doc + "\n")
PY
  • Prepend your own header in the same script (provenance line, run id) rather than editing after.
  • If you also want a human-readable provenance/evidence doc from the other structured fields (e.g. each investigator's current_state/files_to_touch), build it in the SAME python pass — you already have the parsed object.
  • This also works for a foreground Agent whose final text you saved, and for resuming from a killed run via the agent-*.jsonl transcripts.

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 85 lines · 185 tokens per session scan A 9e26a7ec51ef

Subscribe to this mod's changes

extract-workflow-markdown-from-output-json is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed 4d ago), licensed MIT. It adds 185 tokens to every session and 1,264 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

codex-coplan

Bring in an external model (Codex) to co-develop a plan — both models draft independently, align on disagreements, and merge into one plan. Load this only when the user explicitly names Codex (e.g. "let's discuss this with Codex," "what does Codex think about this approach") — don't auto-trigger just because a plan…

jiayx01/codex-claude-skills · 92 tokens

codex-orchestrator

Delegate execution tasks to Codex (Claude plans and reviews). Load this only when the user names Codex explicitly — no matter how big the task is, if the user hasn't mentioned Codex, do it yourself.

jiayx01/codex-claude-skills · 49 tokens

good-bad-ugly

Use when the user asks to "orchestrate", "conduct", invoke "good bad ugly" / "gbu", or tackle a large multi-part coding task (audits, refactor sweeps, multi-feature sessions, "clean this up and fix everything") — anything too big for one linear pass. Runs the tiered orchestration workflow: The Good (brain) plans and…

XyndoX/good-bad-ugly · 131 tokens

orchestrate

Use only when the user explicitly types /orchestrate:orchestrate to decompose a large task, spawn a tree of parallel worker/subplanner/verifier subagents, and collect structured handoffs. Do not invoke autonomously.

odysseus0/claude-orchestrate · 54 tokens

api-testing

HTTP API testing for TypeScript (Supertest) and Python (httpx, pytest). Test REST APIs, GraphQL, request/response validation, authentication, and error handling.

secondsky/claude-skills · 39 tokens

bun-test-coverage

Use for test coverage with Bun, --coverage flag, lcov reports, thresholds, and CI integration.

secondsky/claude-skills · 26 tokens