Archiet's core algorithm in one file: PRD text -> Flask app ZIP, in <700 LOC of pure stdlib.
Project description
archiet-microcodegen
Archiet's core algorithm in one file. PRD text → manifest → genome → rendered Flask app → ZIP, in <700 LOC, with zero imports from
app.*,agents.*, or templates. Pure stdlib. No LLM calls.
Inspired by Karpathy's microgpt.py philosophy: this file is the complete algorithm; everything else in Archiet is just efficiency on top.
Install
pip install archiet-microcodegen
Use
archiet-microcodegen path/to/prd.md --out ./out/
Or pipe to a ZIP:
archiet-microcodegen path/to/prd.md > app.zip
As a library:
from archiet_microcodegen import microcodegen
prd_text = open("prd.md").read()
zip_bytes = microcodegen(prd_text)
What you get
The generated output is a working Flask + Postgres CRUD app with:
- JWT-cookie auth (register / login / logout / me) — never localStorage
- Full CRUD per extracted entity (list / create / get / update / delete)
- Per-tenant row scoping (no
Query.all()data leaks across users) - JSON error handlers, CORS scoped to
FRONTEND_URL, per-ZIP random secrets - A single-page HTML demo at
/that lets you exercise every entity from a browser - A
docker-compose.ymlwith healthcheck-gated Postgres startup - A
Dockerfileready for Cloud Run / Fly / Railway
The whole algorithm runs in four stages:
parse_prd(text) → manifest— regex extraction of entities, fields, user stories, integrationsmanifest_to_genome(manifest) → genome— maps to the canonical IR Archiet uses internallyrender_genome(genome) → {path: content}—string.Template-based Flask renderingpack(files) → bytes— stdlibzipfile
Why this exists
This isn't the production Archiet pipeline — it's the spec. The full platform (https://archiet.com) adds:
- LLM-powered PRD extraction (chunked, overlap+dedup)
- 12+ stack renderers (Flask, FastAPI, Django, NestJS, Laravel, Go, Java, Rails, .NET, Tauri+Rust, Salesforce, SAP CAP, Dynamics)
- Capability emission, frontend (Next.js / Expo), stub-filling, quality scoring, delivery gates
- Cross-stack parity enforcement and verification
But none of that changes the core algorithm. If a bug doesn't reproduce in microcodegen, it's in an efficiency layer, not the spec. If a new top-level genome key isn't in microcodegen, the genome doesn't have that key yet.
What's NOT included
- No LLM calls (the deterministic zone — see CLAUDE.md
LLM-BOUNDARY) - No frontend, no mobile, no payment integration, no rate limiting, no audit logging
- No Alembic migrations (uses
db.create_allon first boot) - No multi-stack output (Flask only; that's the algorithmic baseline)
For the full platform, see https://archiet.com.
License
MIT. See LICENSE.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file archiet_microcodegen-0.1.0.tar.gz.
File metadata
- Download URL: archiet_microcodegen-0.1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0fdcb03915196a703872c6dc633f93a876221ccad5695fa3ad8e10154d156ad
|
|
| MD5 |
3769f59f033e43356e6fa6d53c839dee
|
|
| BLAKE2b-256 |
d31062f17e9284a63977d94efe79978423ef18ff3d42bd49d50e64917f1dccdd
|
File details
Details for the file archiet_microcodegen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: archiet_microcodegen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1533a95291affcfc11843ef2fea2988c35d7a1652c39d0d8d751aecbbf004307
|
|
| MD5 |
6c87be7a141741724805c8de7c1524ba
|
|
| BLAKE2b-256 |
0cea480b3a747a5402c0ffe3864401c11094166fe64f7ca1487ad711537715ba
|