Prose
Keep your mental model while agents write the code. Prose puts the why beside the code. The agent writes the explanation next to the code it explains, and reads it again as it works. A read-only command shows the repository as a document.
prose.amitkaps.com is this repository, read with prose. Open src/parser.ts to see a source file as one document, with its prose in order and the code between.
Where to go
- Design: what it is, why it's built this way, and what it isn't.
- Usage: set it up on a project, deploy its site, and the snippet to give your agents.
- Writing: how to write
@prose, and what to put in it. - Reading: what each page of the renderer shows.
The plan has where it is and what's next, and lessons has what building it taught. The rest is in docs/, and building and releasing prose itself is in development.
Two things
@prose, a convention for writing human-oriented meaning into source code. A comment whose first word is@proseexplains the code around it, in markz's Markdown. Every other comment stays an ordinary comment.prose, a read-only command. It opens any repository in the browser as a Markdown-first document, locally or as a static site. Each file reads as one document, with its prose in order and the code between.prose checkwarns about form a machine can be sure of, andprose stylegives advice on sentences.
/** @prose
* # State
*
* One count for the whole page, so every button changes the same number.
*/
let count = 0;
Install and run
prose needs Node 26 or newer, the Node it's built and tested on.
npm install -g @amitkaps/prose
prose . # read this repository in the browser
prose build # the same pages as static files, from the last commit
prose check # what the text gets wrong, by file and line
prose style # advice on how the text reads
prose rules # the rules to write prose by, for an agent
Or without installing: npx @amitkaps/prose ..
prose check fails when it finds anything, so it can run in CI. prose style is for the writer of a file, right after writing it, and always passes (usage). prose rules prints the rules from the docs of the version installed (usage). prose help lists every command (usage).
Folders
- docs/
The writing that spans the code. It covers what prose is for, how to use it and how it works, and reads best in this order.
- src/
The package. The parser reads
@proseout of a file, the tree walk finds the files, and the renderer turns them into pages, served or written out. Each file's own prose says how it works. - tests/
One test file for each source file that has logic, run with
pnpm run test. The build and server tests run againstfixtures/simple, a small committed project, becauseprose buildreadsHEAD. It's a counter on one static page, with file prose in all three files and headed comments, so it covers the parser and every kind of page.
Docs
Code
- .gitattributes
The fixtures are sample projects the tests read, so prose doesn't hold them to its own rules (usage).
- .gitignore
Dependencies, build output, secrets, and the output of prose and Cloudflare's Vite plugin. None of them should reach a commit or the published site.
- cloudflare.config.ts
Cloudflare builds this repository's own site from
main. It serves it as a Worker with static assets, which are only the pagesprose buildwrites, with no code. - pnpm-workspace.yaml
pnpm 12 reads project settings from here, not from
.npmrcorpackage.json. It's a settings file, not a workspace. craftz writes it, the same in every repository, so a change here is a change to the rules. - vite.config.ts
One config for formatting, linting, tests and the build, all run through
vp. There's no app to build. The one plugin prepares the files the browser gets, for the build and the tests alike.
No prose yet
Other files