Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pct

pct is a CLI-only prompt compiler for reusable macro expansion, redundancy pruning, and information-theoretic analysis.

What it does

  • 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

Commands

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

Reported Metrics

  • 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

Project Shape

The project is intentionally narrow:

  • CLI only
  • file-based storage
  • deterministic outputs
  • research-friendly metrics
  • no web UI
  • no database
  • no agent runtime

Demo Flow

  1. Initialize the workspace with pct init.
  2. Inspect or edit macros under .pct/macros/.
  3. Compile examples/hello.pct.
  4. Review the compiled prompt and report.
  5. Use pct bench to compare multiple prompts.
  6. Use pct history list and pct history show to audit previous runs.

Why it matters

pct is a strong solo-dev portfolio project because it combines:

  • compiler-style design
  • information-theory framing
  • deterministic transformation
  • metrics-first evaluation
  • reproducible artifacts

About

CLI-only prompt compiler for reusable macro expansion, redundancy pruning, and information-theoretic analysis.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages