Skip to main content

Report Workflow

CI Python Tests License: MIT

Give your coding agent a folder of sources and one sentence. Get back a DOCX you can hand in — and a refusal for every claim that cannot be traced to those sources.

The package calls no LLM and needs no API key. It owns source parsing, the evidence ledger, the gates, and rendering; your agent (Claude Code, Codex, …) owns the judgment and the writing. Nothing the agent drafts reaches the page unless the numbers, quotes, and citations in it appear in your material — so an invented statistic or a fabricated reference is blocked, with the gate and the reason that stopped it.

What comes out

Three pages of a pipeline-rendered DOCX report: a title-and-abstract page, a table of contents, and a page with a line chart derived from the source data with a self-contained caption.

A finished document, and the audit trail that says why each sentence was allowed to ship. Both are in this repository, produced by the example below:

Seven document types — lab report, academic paper, business report, proposal, two admissions formats, and a general one — in English or Chinese, optionally following your own Word template. The quantitative analysis a grader looks for (a fitted slope against theory, R², a budget total) is computed from your data and registered as citable evidence, so the agent never has to invent it.

Profiles, Chinese-document handling, templates, and the gate list: docs/OUTPUT.md.

Drive it from your agent

pip install report-workflow
git clone https://github.com/0Smallcat0/report-workflow
cp -r report-workflow/agent_skill ~/.claude/skills/report-workflow

That last line installs the skill for Claude Code (on Windows, copy the same folder to %USERPROFILE%\.claude\skills\report-workflow). Then ask in your own words:

Use report-workflow to turn the files in ./data into a business report for the operations manager: what changed, what it costs, whether to adopt it.

The skill hands the agent the contract — prepare the sources, write claims and prose against the evidence ledger, submit for validation — and the pipeline answers. A claim it cannot support comes back blocked with the gate that caught it, so the agent has to fix the sentence, not the verdict.

No agent to hand? The same path runs offline with a scripted author standing in for one:

python examples/source_to_report.py

Three files and one sentence in, the DOCX and QA pack above out. Swap the paths at the top of that script for your own material; the honest note about what it does on your agent's behalf is in examples/README.md.

The CLI

The same pipeline, driven by hand or from a script:

report-workflow prepare --prompt "write an engineering lab report" \
  --source source.txt --output out --profile engineering_lab_report \
  --preflight-decisions preflight.json
report-workflow validate --job-id <job_id>
report-workflow render   --job-id <job_id>

Exit codes: 0 success, 1 crash, 2 hard-block, 3 waiting for user decisions or agent-authored artifacts. Add --reference-docx your.docx to follow your own Word template. Between prepare and validate something has to write the claims, outline, and drafts — that is the agent's half.

MCP server

Any MCP-capable agent can call the gates as tools — draft with its own judgment, then ask verify_claims whether each claim may ship. This is the gate surface, not the whole pipeline: rendering a DOCX still goes through the skill or the CLI. Payloads: docs/mcp.md.

claude mcp add report-workflow -- report-workflow-mcp

The gate on its own

No pipeline, no schema, no API key — pass an answer and the source it was supposed to be grounded in:

from report_workflow import verify

result = verify(
    answer="The error rate fell to 0.2% [1].",
    sources={"1": "The error rate fell to 3.5% under the structured workflow."},
)
result["publishable"]                      # False
result["sentence_results"][0]["checker"]   # "FE"
result["sentence_results"][0]["reason"]    # "Claim number '0.2'% not found in evidence content..."

A pure function of (answer, sources): same verdict every run, zero tokens, works offline and in CI. Scope, stated plainly: a fidelity gate, not a general hallucination detector. It catches invented numbers, fabricated citations, misquotes, and unit swaps; it does not judge meaning, so a fluent paraphrase that reverses the source is out of scope. That boundary is measured on 10,000 outside pairs, with catch rates, baselines, and the comparison to LLM-as-judge tools: docs/EVIDENCE.md.

Runnable, no local install: Open In Colab

Install

pip install report-workflow covers the gates, verify(), and the report-workflow CLI — the whole source-to-DOCX pipeline. Add pandoc 3.x for full rendering; without it the renderer falls back to python-docx with degraded table and layout fidelity. Clone the repository for the agent skill, the example scripts, and the benchmarks: pip install ships the package, not the examples.

pip install -r requirements.txt
pip install -e .
pandoc --version

Optional: pip install -e .[mcp] for the MCP server, mmdc for Mermaid diagrams, TAVILY_API_KEY / SERPER_API_KEY / SERPAPI_API_KEY for web research, notebooklm-py for NotebookLM sync.

If the report-workflow command fails silently — common on Windows when a stale report-workflow.exe sits on PATH — use python -m report_workflow, which always runs against the interpreter you invoke.

Where to go next

Specified, integrated, and verified by its author, with coding agents doing much of the implementation — the deterministic gates and the benchmark harness exist so a human, not a model, holds the final "is this correct?" decision.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

report_workflow-4.27.1.tar.gz (556.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

report_workflow-4.27.1-py3-none-any.whl (419.4 kB view details)

Uploaded Python 3

File details

Details for the file report_workflow-4.27.1.tar.gz.

File metadata

  • Download URL: report_workflow-4.27.1.tar.gz
  • Upload date:
  • Size: 556.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for report_workflow-4.27.1.tar.gz
Algorithm Hash digest
SHA256 3ff5a9fb635a62fbc3f197b218a88f51fe7d3faff62dc47788b1209492ca55fe
MD5 b6818f006a83f61502de338173155cf3
BLAKE2b-256 55798d77e9e3b135c07f4b578d2d0806cdc294bc759b0653b82ff1290a438d74

See more details on using hashes here.

Provenance

The following attestation bundles were made for report_workflow-4.27.1.tar.gz:

Publisher: release.yml on 0Smallcat0/report-workflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file report_workflow-4.27.1-py3-none-any.whl.

File metadata

File hashes

Hashes for report_workflow-4.27.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff55fe89fb33ed3174046f18b8352e7e46a2f7136f78e603d51b80b118d9e0c1
MD5 26f5321b937bfc8476ce16543cb7b996
BLAKE2b-256 4ed893c0620d9aefcaaf7e034b9d24053bf75f6f0a3405029df36e1cf6de94cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for report_workflow-4.27.1-py3-none-any.whl:

Publisher: release.yml on 0Smallcat0/report-workflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

4.39.0

2 files

4.38.0

2 files

4.37.0

2 files

4.36.1

2 files

4.36.0

2 files

4.35.0

2 files

4.34.0

2 files

4.33.0

2 files

4.31.0

2 files

4.29.1

2 files

4.29.0

2 files

4.28.2

2 files

4.28.1

2 files

4.28.0

2 files

This release

4.27.1 This release

2 files

4.27.0

2 files

4.23.1

2 files

4.23.0

2 files

4.22.1

2 files

4.22.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page