pct is a CLI-only prompt compiler for reusable macro expansion, redundancy pruning, and information-theoretic analysis.
- compiles prompt intent locally
- resolves macro dependencies as a DAG
- removes repeated instructions
- measures token, entropy, semantic, and graph metrics
- stores reproducible run artifacts in
.pct/history
python3 pct.py init
python3 pct.py macro add secure --depends-on input_validation --body "Return structured error messages."
python3 pct.py macro list
python3 pct.py macro show secure
python3 pct.py compile examples/hello.pct
python3 pct.py compile examples/hello.pct --stats
python3 pct.py compile examples/hello.pct --semantic --graph
python3 pct.py compile examples/hello.pct --all
python3 pct.py analyze examples/hello.pct --json
python3 pct.py history list --limit 5
python3 pct.py history show 20260727T152627Z_hello_9423ce6b72 --json
python3 pct.py bench examples/ --format md- token counts
- compression and amplification ratios
- Shannon entropy
- entropy delta
- type-token ratio
- lexical density
- sentence counts and average sentence length
- semantic similarity proxies
- macro graph overlap and dependency depth
- artifact fingerprints and hashes
The project is intentionally narrow:
- CLI only
- file-based storage
- deterministic outputs
- research-friendly metrics
- no web UI
- no database
- no agent runtime
- Initialize the workspace with
pct init. - Inspect or edit macros under
.pct/macros/. - Compile
examples/hello.pct. - Review the compiled prompt and report.
- Use
pct benchto compare multiple prompts. - Use
pct history listandpct history showto audit previous runs.
pct is a strong solo-dev portfolio project because it combines:
- compiler-style design
- information-theory framing
- deterministic transformation
- metrics-first evaluation
- reproducible artifacts