Skip to main content

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

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.md with 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) in essay.md's front matter, suggested from its pixels by penult 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 in misc/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: publish runs only after approve, 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.

  • 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.4

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

Source distribution (sdist)

Source distribution for penult 0.0.4
File Size Uploaded Provenance Actions
penult-0.0.4.tar.gz 62.8 kB Without provenance Details for penult-0.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 106.2 kB

Release files / penult-0.0.4.tar.gz

Download URL penult-0.0.4.tar.gz
Size 62.8 kB
Tags Source
SHA-256 checksum
How to use checksums
95e42741b9b7af32fc47f8fbc3ec31e0661f9c3419f5f62b5523e35ddd2b9136
BLAKE2b-256 checksum
How to use checksums
f72117c5b1a0f6fb0ad3ff204309b5ac3f9a045745cc481411ea3df05126f8af
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.4-py3-none-any.whl

Download URL penult-0.0.4-py3-none-any.whl
Size 43.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03f788f0ecf2ae80f419050468c3c5e9000c5171e53f2a5038ac9d48af326fa0
BLAKE2b-256 checksum
How to use checksums
8f63160e95d8fcf795ef4ac8e7a7da85064feaf8d218b76ad4c95c84323b9314
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.4

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.

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