Skip to main content

req2deck

CI

Turn a requirement into an HTML preview and a standards-compliant PPTX deck, from one shared geometry model — so the preview you approve is the deck you ship.

Ships as a DeepSeek Harness bundle (four model-facing tools), a CLI, and a Python library. MIT.

requirement ──plan──▶ deck.json ──build──▶ deck.html + deck.pptx ──qa──▶ gate

Why this exists

Most "AI makes slides" tools are two renderers glued together: HTML for the preview, a separate drawing path for the file. They drift, so what you review is not what you send.

Here there is exactly one artefact in the middle — an absolute-coordinate display list in 1280×720 design units. HTML and PPTX are both pure functions of that list. A block that fits in the preview therefore fits in the deck, because it is the same block with the same numbers.

The second design choice is that quality is enforced, not hoped for. Every build runs a 19-check gate covering overflow, legible type size, layout variety, table borders, archive integrity, and the required AI-content label and metadata. A failing deck exits non-zero.


Install

Python (CLI + library):

pip install req2deck        # the `req2deck` command, plus the importable library

From a checkout, if you want to work on it:

git clone https://github.com/hyx114514/req2deck.git req2deck
cd req2deck
pip install -e .            # gives you the `req2deck` command
# or skip the install entirely:
python run.py --help

Requires Python 3.9+ and python-pptx. The 2,491 bundled Lucide icons mean no network access and no font or asset downloads at build time.

As a DeepSeek Harness plugin: the bundle is on npm as req2deck-dsh; see dsh plugin.

can't open file 'run.py': No such file or directory

run.py is a path, not a command — it resolves relative to the current directory. Git Bash opens in your home directory, so this fails:

python run.py --help          # looks for C:\Users\<you>\run.py

cd into the checkout first, or use git -C / bash with an absolute path:

cd /d/req2deck
python run.py --help

# or from anywhere, no cd:
python /d/req2deck/run.py --help

pip install -e . avoids the issue entirely by putting req2deck on PATH. Run bash check.sh from the checkout to test every path this project depends on.


Use it in 30 seconds

req2deck plan outline.md -o deck.json    # or: plan - to read stdin
req2deck build deck.json -o out          # writes out/deck.html + out/deck.pptx

That is the whole loop. plan parses a markdown outline into a spec; build renders both artefacts and runs the gate.

The outline format

Headings are pages, - lines are bullets. That is enough for a good deck:

# 智慧零售增长方案
面向区域连锁的数字化升级路径

## 市场背景
- 区域连锁门店客流连续三年下滑
- 线上渠道占比不足 8%

## 关键指标
- 4.2亿 全年营收
- 31.5% 毛利率

## 谢谢

The first # becomes the deck title and the cover. A final ## 谢谢 becomes the closing page. ### under a heading produces a card grid.


DeepSeek Harness plugin

The bundle registers four tools the model can call. It deliberately owns no layout logic — it validates paths, spawns the Python CLI, and turns the JSON the CLI prints into text the model can read. One implementation of the deck rules, testable on its own.

Tool What it does
deck_plan Requirement or outline → spec JSON. Pass useLlm to route through a planner command.
deck_build Spec → HTML + PPTX + gate report, in one pass.
deck_qa Re-run the gate against artefacts already on disk.
deck_icons Search 2,491 Lucide names, so a hand-written spec uses a real icon.

Install into a profile

dsh plugin shells out to pnpm, so pnpm has to be on your PATH first — npm i -g pnpm, or corepack enable pnpm. On Windows, corepack enable alone is not enough: spawnSync needs a pnpm.cmd to exist, so use npm i -g pnpm.

# from npm
dsh plugin --profile web add req2deck-dsh

# from a local checkout — note the profile flag and the path spec
dsh plugin --profile web add file:$(pwd)/dsh-plugin

# or straight from the repo
dsh plugin --profile web add "https://github.com/hyx114514/req2deck.git#path:dsh-plugin"

Installing by path is enough to try it: pnpm resolves file: locally, so the bundle is active without publishing anything to npm.

Install from a plugin index

The repository also serves a format-1 plugin-market index:

https://hyx114514.github.io/req2deck/market/index.json

In a DSH build with @deepseek-ai/dsh-experimental-plugin-market-bundle enabled, open Plugins → Discover → Add index source, paste that URL, and install the entry. The index pins a commit, so the install is reproducible and needs no npm release.

dsh plugin is a thin pnpm forwarder: on success it appends any dependency declaring dsh.bundle to dsh.profile.bundles in the profile manifest, so the layer is active on the next boot.

No pnpm? Copy the directory — do not link it — into the profile's node_modules, then add the id to the bundles list by hand:

cp -r dsh-plugin ~/.dsh/profiles/web/node_modules/req2deck-dsh
# ~/.dsh/profiles/web/package.json
"dependencies": { "req2deck-dsh": "*" },
"dsh": { "profile": { "bundles": ["...", "req2deck-dsh"] } }

The copy has to be physical. The bundle imports @deepseek-ai/dsh-tools and @deepseek-ai/schemastery as peers, which Node resolves by walking up from the package's real path — and $DSH_HOME/profiles/node_modules already carries that closure. A symlink or junction is resolved back to its source directory, so the walk escapes the profile and the import fails with Cannot find package '@deepseek-ai/schemastery'.

Point it at Python

Two ways, pick one.

1. Profile patch (recommended, survives dsh plugin update). Edit ~/.dsh/profiles/web/cordis.patch.yml and set the row's config:

- id: req2deck
  config:
    pythonDir: /absolute/path/to/req2deck   # a checkout holding run.py
    # python: python3                        # otherwise REQ2DECK_PYTHON, then `python`
    # workspace: /path/to/decks              # base for relative tool paths
    # plannerCommand: your-llm-cli           # needed only for deck_plan useLlm

A patch replaces the row's whole config, so restate any other key you set. pythonDir is required in practice: the plugin falls back to python -m req2deck, which only resolves after pip install req2deck.

2. Ad-hoc overlay, for one run:

dsh --profile web --patch ./my-extra.yml

Verify the layer landed:

dsh --profile web --dump-config | tail -20

You should see the req2deck row with your config. Then start dsh as usual and ask for a deck.

Configuration reference

Key Default Meaning
pythonDir '' Checkout holding run.py. Empty → python -m req2deck.
python '' Interpreter. Empty → REQ2DECK_PYTHON → python.
workspace '' Base for relative tool paths. Empty → session cwd.
plannerCommand '' Shell command printing deck JSON on stdout. Only for useLlm.

The CLI

Four verbs. Exit codes are part of the contract the plugin and CI rely on: 0 clean, 1 build or QA failure, 2 bad usage, 3 planning failure.

req2deck plan   <outline|->  [-o deck.json] [-t TITLE] [--command CMD]
                             [--timeout SEC] [--max-repeats N] [-j] [-q]
req2deck build  deck.json    [-o out] [--stem NAME] [--no-html] [--no-pptx]
                             [--strict] [--report PATH] [-j] [-q]
req2deck qa     deck.json    [--html PATH] [--pptx PATH]
req2deck icons  [query]      [-n LIMIT]

Every verb takes -j/--json and prints one JSON line, which is what makes the CLI safe to drive from another process.

$ req2deck plan - -j < outline.md
{"specPath": "/abs/deck.json", "slides": 6, "title": "智慧零售增长方案", "warnings": []}

$ req2deck build deck.json -o out -j
{"passed": true, "htmlPath": "out/deck.html", "pptxPath": "out/deck.pptx", "report": "PASS …"}

plan - reads stdin, so an outline never has to touch the disk. Windows pipes default to the console codepage, so the CLI pins UTF-8 itself rather than trusting the caller.

Hand-writing a spec

plan is a convenience, not a requirement. build takes any spec in this shape — useful when you want exact control:

{
  "meta": { "title": "2025 年度业务复盘" },
  "theme": { "preset": "ink-brass" },
  "slides": [
    { "layout": "cover", "title": "2025 年度业务复盘", "lead": "增长结构、效率与 2026 年的赌注" },
    { "layout": "stats", "title": "关键数字", "items": [
        { "value": "4.2亿", "title": "全年营收", "text": "同比 +18%" },
        { "value": "31.5%", "title": "毛利率", "text": "提升 2.1pt" }
    ] },
    { "layout": "chart", "title": "季度营收", "categories": ["Q1","Q2","Q3","Q4"],
      "series": [{ "name": "订阅", "values": [42, 51, 63, 78] }] },
    { "layout": "closing", "title": "谢谢" }
  ]
}

Layout names are forgiving: title_slide, kpi, roadmap, swot, flow, testimonial and ~40 other aliases resolve to the canonical names. Field names too — subtitle → lead, bullets → items, headings → headers. If you give no layout at all, the presence of keys infers one.

See examples/deck.json for a complete 8-page deck.


The 18 layouts

Layout Needs Use for
cover title Opening page (once per deck)
section title Chapter divider
agenda 2–6 items Table of contents
bullets 2–6 items Prose points
columns 2–4 items Parallel short points
cards 2–9 items Feature grid, optional icons
stats 2–4 items KPI callouts (value + title)
quote title Pull quote
chart 2–12 categories, series Column, bar, line, area, pie, doughnut
table 2–8 headers, 2–12 rows Tabular data with real borders
comparison exactly 2 items A vs B, each with points
timeline 2–5 items Milestones (kicker = date)
process 2–5 items Sequential steps
funnel 2–5 items Conversion stages
pyramid 2–4 items Hierarchy levels
matrix 2–4 items 2×2 quadrant / SWOT
image_split title Image beside text
closing — Final page (once per deck)

Chart series accept three shapes and all work: a mapping ({"订阅": [42, 51]}), a list of pairs ([["订阅", [42, 51]]]), or a list of objects ([{"name": "订阅", "values": [42, 51]}]).

Themes

One seed hue in, a complete contrast-checked palette out — so any brand colour can drive a deck and text stays legible:

ink-brass · teal-marigold · forest-copper · plum-gold · slate-coral (light) · midnight-teal · carbon-lime · indigo-amber (dark)

Or bypass the presets:

{ "theme": { "dominant": "#0F4C4A", "accent": "#D98324", "mode": "dark" } }

Contrast is computed, not assumed. The test suite asserts every preset meets WCAG AA on every generated surface.


The quality gate

build and qa run the same 19 checks. A deck only reports passed: true when all of them pass.

PASS slides present   6 page(s)
PASS layout variety   max 1 use(s) of one layout across 4 body page(s)
PASS opens with cover first page is 'cover'
PASS text overflow    0 block(s) dropped lines
PASS readable size    0 run(s) under 13 design units
PASS table borders    64 border edge(s) for 1 table(s), expected >= 4
PASS aigc metadata    7 keys, flat JSON
PASS aigc label       label on the last slide
…

Notable ones:

  • layout variety — no single body layout may repeat more than max(2, round(body_pages × 0.4)) times. This is what stops a seven-slide deck from being seven bullet lists.
  • text overflow — measured against the real font metrics, not guessed. Zero dropped lines is the only acceptable answer.
  • readable size — every run is at least 13 design units, so nothing can shrink into illegibility to make it fit.
  • table borders — counts actual <a:lnL/R/T/B> elements. PowerPoint's default table style renders no visible borders, which looks broken; this check catches that.

AI content labelling

Both artefacts carry the markings required by the 网络安全标准实践指南 — 人工智能生成合成内容标识方法:

  • Visible: 内容由AI大模型生成,请仔细甄别 on the last slide, and in the HTML footer.
  • Metadata: docProps/custom.xml gets an AIGC property whose value is a flat JSON string with exactly seven keys — Label, ContentProducer, ProduceID, ReservedCode1, ContentPropagator, PropagateID, ReservedCode2 — with custom.xml registered in [Content_Types].xml and _rels/.rels.

This is a hard requirement of the gate, not an optional flag: you cannot build a deck without it.


Development

python -m unittest discover -s tests -v   # 24 tests, no pytest needed
node dsh-plugin/test.mjs                  # 17 contract tests
python run.py build examples/deck.json -o out -j

The Python suite uses only the standard library, so it runs anywhere Python does.

The plugin suite imports @deepseek-ai/dsh-tools and @deepseek-ai/schemastery, which the harness provides as peers. From a bare clone those are not installed, so either npm install --no-save @deepseek-ai/dsh-tools @deepseek-ai/schemastery, or run the suite from an installed profile copy, which already resolves them:

cd ~/.dsh/profiles/web/node_modules/req2deck-dsh
REQ2DECK_REPO=/d/req2deck node test.mjs

REQ2DECK_REPO tells the pipeline tests where run.py lives, because from an installed copy the parent directory is the profile's node_modules.

Layout of the repo

python/req2deck/
  cli.py           the four verbs and the exit-code contract
  planner.py       outline parsing, plus a hook for an external LLM
  spec.py          load, normalise (aliases), validate
  layouts.py       the 18 builders: spec dict -> display list
  geometry.py      the display-list primitives
  theme.py         one seed colour -> contrast-checked palette
  frame.py         shared header/footer/page-number chrome
  icons.py         Lucide SVG path parser -> primitives
  render_html.py   display list -> one self-contained HTML file
  render_pptx.py   display list -> PPTX via python-pptx
  qa.py            the 19 checks
dsh-plugin/
  src/index.js     the Cordis plugin: four tools over the CLI
  cordis.patch.yml the bundle binding
tests/             the Python suite
examples/          a complete hand-written spec
check.sh           environment self-check: paths, python, dsh, git remote

License

MIT. Bundled Lucide icons are ISC, with the Feather-derived subset under MIT — both texts are in python/req2deck/assets/icons/LICENSE.

Metadata

Release files for req2deck 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for req2deck 1.1.1
File Size Uploaded Provenance Actions
req2deck-1.1.1.tar.gz 302.3 kB Without provenance Details for req2deck-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for req2deck 1.1.1
File Interpreter ABI Platform Actions
req2deck-1.1.1-py3-none-any.whl Python 3 none any Details for req2deck-1.1.1-py3-none-any.whl

Total release size: 1.5 MB

Release files / req2deck-1.1.1.tar.gz

Download URL req2deck-1.1.1.tar.gz
Size 302.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0cbbea5ba3ff36d4747afdf4a08ada091b09586fa47713ba0cd6b6453d0ac25d
BLAKE2b-256 checksum
How to use checksums
0f42c1c3dbf59800ef824396e9e308eccee5911689fc5cde35e3aa7f86179838
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / req2deck-1.1.1-py3-none-any.whl

Download URL req2deck-1.1.1-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
728b7a9eab04910b328d4f50bbd627d88be629ceb3ad1f659ceaf700028cf7b4
BLAKE2b-256 checksum
How to use checksums
db3d85dbed0953609819713eba1b060822ca7f2ee11d1a44363c3d05b8ae0c0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for req2deck 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files No provenance

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