penult
From an idea to a publication draft: the penultimate step, where the essay exists, is illustrated, sounds like its author, and waits for them to say go.
pip install penult
The seed is a GitHub issue. An agent, with the penult skill, turns it into an essay posted as a comment on that issue for the author to review, and, once the author approves, into an unpublished Substack or Medium draft through article. penult never publishes to a platform; the draft is as public as the issue it is posted on.
penult start https://github.com/you/essays/issues/30 # workspace docs/<slug>/ in the repo: seed.md, brief.md, state
penult status docs/<slug> # stage, files, what comes next
penult check docs/<slug> # ductus + penlike over essay.md; the report goes under ~/.local/share/penult, not the repo
penult image-search "a 1995 modem" --folder docs/<slug> # credited stock / public-domain candidates
penult image-generate "<prompt>" --name hero --folder docs/<slug> # at most 2 automatically; prompts past that are kept for you
penult layout docs/<slug> --apply # size class per image (a square hero becomes an inset), into the front matter
penult render docs/<slug> && penult post docs/<slug> # the essay as an issue comment, images by raw URL
penult approve docs/<slug> --note "good to go" # the author's words; this gates publishing
penult publish docs/<slug> # an unpublished Substack draft; you press Publish
penult finish docs/<slug> [--url <public url>] # link on the issue, close it, archive the text as a Discussion; repeat with --url once it is public
What penult holds, and what the agent does
The thinking is the agent's: the research that checks every claim and finds the critiques, the draft, the passes that make it sound like the author. The penult skill lays that out and names the skills that own each step (do-research, penlike and its author-choice guide, deslop, ductus, illustration).
penult holds what should not be improvised twice:
- the workspace:
docs/<slug>/next to the issue, with the seed as fetched, the brief (angle, audience, voice, platform, image budget, assumptions), the research notes,essay.md,images.mdwith every candidate, prompt and credit,img/, and a state file; - the thin-seed gate: a seed with no thesis or too few words is reported, and the agent asks the author before researching;
- the image budget: paid generation capped per essay (two by default); every prompt is kept so the author can try the rest by hand;
- the layout rules: each image has a size class (
inset,normal,large,full) inessay.md's front matter, suggested from its pixels bypenult layout(a square or portrait image, or a non-landscape hero, is an inset; landscape, diagrams and charts take the column) and honoured both in the comment (<img width>) and on Substack (python-substack's image marker); the research behind the rules is inmisc/docs/research/; - the review loop: the essay rendered for a GitHub comment (title, subtitle, images turned into raw URLs and sized, captions drawn small under them), posted and updated in place, refusing while an image is not pushed;
- the approval gate:
publishruns only afterapprove, of the exact text that was posted, and only makes a draft; images in the comment are pinned to the pushed commit so the links outlive the branch.
Your preferences stay private
Voices, platform, image budget, where the article credentials file is: penult prefs shows them, penult prefs-set <key> <value> changes one. They live under ~/.local/share/penult (set PENULT_DATA_DIR to move it), never in a project folder. Credentials are never read by penult itself; publish hands the path of the credentials file to article.
| Preference | Default | Meaning |
|---|---|---|
voice_models |
["me"] |
the penlike models the style pass writes with; the first is the base voice |
voice_register |
essay |
the penlike register to measure against |
audience |
non-technical readers, or software engineers, managers and scientists | narrowed per essay in the brief |
platform |
substack |
where publish sends the approved essay (substack or medium) |
max_generated_images |
2 |
paid images generated automatically per essay |
min_image_prompts |
5 |
prompts the agent writes into images.md |
inset_width |
400 |
how wide an inset image is drawn, in CSS pixels, in the comment and on Substack |
article_env_file |
~/.config/article/.env |
the article credentials file |
article_state_path |
~/.local/share/article/pipeline_state.json |
the article state file |
workspace |
docs/{slug} |
where a workspace goes in the issue's repository |
research_depth |
deep |
the do-research depth |
From Python
Every command is a function in penult.tools, taking and returning JSON-ready values. The in-memory store (files=), the issue fetcher (fetch=), the command runner (runner=), the image searcher and generator (searcher=, generator=) are keyword arguments, which is how the tests run without a network:
import penult
started = penult.start("https://github.com/you/essays/issues/30", into="docs/my-essay")
penult.image_generate("a woodcut of a modem", name="hero", folder="docs/my-essay")
penult.render("docs/my-essay"); penult.post("docs/my-essay")
Install the skill
gh skill install thorwhalen/penult penult --agent claude-code # needs a GitHub CLI with `gh skill`
Or copy (or symlink) penult/data/skills/penult/ into your agent's skills folder; it ships with the package. Extras: pip install 'penult[publish]' for the Substack step, 'penult[images]' for search and generation, 'penult[style]' for the checks.
Related
- article: Markdown to an unpublished Substack draft, and syndication with canonical URLs. penult's publishing step.
- penlike: how an author writes, and the author-choice guide (
penlike guide). - ductus: which passages read as machine-written, and why.
- illustration: existing images with licence and attribution.
Metadata
Release files for penult 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| penult-0.0.5.tar.gz | 66.7 kB | Without provenance | Details for penult-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| penult-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for penult-0.0.5-py3-none-any.whl |
Total release size: 112.8 kB
Release files / penult-0.0.5.tar.gz
| Download URL | penult-0.0.5.tar.gz |
|---|---|
| Size | 66.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41153e9ca622754ef68ad5fba72cca9e03d354865a75f731999c00b5cdf5e876
|
|
BLAKE2b-256 checksum How to use checksums |
e9b7abcbce53aedd768c4ffa107d1be89b4ac578058c26afa92a6af8c63dd6da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / penult-0.0.5-py3-none-any.whl
| Download URL | penult-0.0.5-py3-none-any.whl |
|---|---|
| Size | 46.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
633607dfa719caa3f23ff78e438aff8136f531a6e7120d40781a1698732b3673
|
|
BLAKE2b-256 checksum How to use checksums |
6d8d573bee04a6e7201e64252499ac4350a9d5c968b2bf757ac8729fd4d21042
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for penult 0.0.5
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.