Skip to content

Ian-Louw/potion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

129 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§ͺ Potion

The magic potion for Claude Code β€” plans are prompts, disk is memory,
evidence or it didn't happen.

License Release Skills Agents Hooks Brewed with itself

graph LR
  init --> discuss --> plan --> execute --> verify
  verify -->|pass| ship
  verify -->|"gaps (≀3 cycles)"| plan
Loading

Plus utilities: /potion:pause Β· /potion:resume Β· /potion:learn Β· /potion:investigate β€” and /potion:brew runs the whole crank end-to-end, stopping only at human gates.

Eleven skills. Two agents. One hook. No ceremony. This repo's own .potion/ is the live proof β€” potion brews itself, and it red-teamed its own verifier with five seeded defects. It caught all five.

⚑ Why

A lean project framework distilled from the best of GSD, Superpowers, and gstack β€” minus their combined ~1MB of ceremony. Each got one thing profoundly right:

Framework βœ… Kept ❌ Cut
GSD βœ… durable disk state
βœ… goal-backward planning
βœ… mechanical verification
❌ 27 commands
❌ milestone bureaucracy
❌ 625KB of prompts
Superpowers βœ… skill-writing craft
βœ… Iron Laws, rationalization counters
❌ ceremony on trivial tasks
gstack βœ… evidence-based verification
βœ… circuit breakers
βœ… compounding learnings
❌ 48 skills
❌ duplicated preambles

Potion keeps the mechanisms and cuts the mass. Every skill is under ~150 lines. Shared rules live in one core document. Enforcement lives in state files and verification ladders, not in ALL-CAPS pleading.

The five laws that matter most

(five of eleven β€” the full canon with rationale is in PHILOSOPHY.md)

  1. The filesystem is the memory (Law 1). Progress is derived from which artifacts exist, never from a status field. State can't drift when it's computed from disk.
  2. Plans are prompts (Law 2). A PLAN.md is executed verbatim by a fresh agent. If a plan needs interpreting, it's a bad plan.
  3. Goal-backward beats forward (Law 3). Don't ask "what should we build?" Ask "what must be TRUE when we're done?" β€” then derive what must exist and what must be wired.
  4. Evidence before claims (Law 4). "Should work now" is not a state of the world. Confidence is not evidence. Run it, read the output, then speak.
  5. Less is more (Law 10). One skill per failure mode. If a skill doesn't prevent a real, observed failure, it doesn't ship.

Full rationale in PHILOSOPHY.md. Shared rules every skill inherits are in core/CORE.md.

Quickstart: your first brew

Install the plugin (needs node on PATH):

/plugin marketplace add Ian-Louw/potion
/plugin install potion@potion

The toy project: a CLI guess-the-number game in Node β€” plain stdin, no framework, so every step has a real command to run. Make it a repo (Potion requires git β€” commits are its ground truth):

mkdir guess && cd guess && git init

1. /potion:init β€” answer a few questions about goals and scope. You get:

.potion/
β”œβ”€β”€ PROJECT.md    # goals, key decisions, out-of-scope
└── STATE.md      # position digest β€” where you are, always current

2. /potion:discuss β€” lock the decisions before any planning. For the toy: you decide "stdin interface, no deps" and it lands in DISCUSSION.md under Decisions β€” from here on it's binding, not a suggestion an agent can drift past.

3. /potion:plan β€” a goal-backward plan appears:

.potion/phases/01-core-game/
β”œβ”€β”€ DISCUSSION.md
└── PLAN-01.md

The plan's frontmatter is its contract β€” must_haves lists what must be TRUE when done, what must EXIST on disk, and what must be WIRED together (the key_links).

4. /potion:execute β€” a fresh worker reads PLAN-01.md verbatim and runs it: one atomic commit per task, deviations handled by four fixed rules. When it finishes, SUMMARY-01.md appears next to the plan β€” the summary's existence is the completion record; there is no status field to drift.

5. /potion:verify β€” the four-step protocol: deterministic checks, a blind static audit (the auditor is told nothing about what the worker claimed), runtime evidence, verdict. For the toy that means actually playing a round of guess-the-number and saving the transcript:

.potion/phases/01-core-game/
β”œβ”€β”€ PLAN-01.md
β”œβ”€β”€ SUMMARY-01.md
β”œβ”€β”€ VERIFICATION.md            # verdict: pass
└── evidence/
    └── 01-game-transcript.txt

verdict: pass β€” that's not the agent's opinion, that's the ladder.

From here, /potion:brew automates the crank β€” plan β†’ execute β†’ verify β†’ gap-cycle in one command, stopping only at human gates. Decisions stay yours: brew refuses to run without a locked DISCUSSION.md.

πŸ” Closed loops by design

Potion's phase cycle is a closed loop in the loop-engineering sense: a bounded goal, an independent checker, durable state, and a human checkpoint β€” with budgets and kill switches, not vibes:

Loop layer Potion mechanism
Contract must_haves (truths / artifacts / key links) + locked decisions
State .potion/ β€” progress derived from artifacts on disk; strays route to ## Parked, nothing evaporates; session continuity is rewritten whenever Position moves
Checker blind verifier: deterministic checks first, then exists β†’ substantive β†’ wired; runtime proof lands in evidence/ and VERIFICATION.md cites it by path; evidence only counts against a fresh build serving HEAD
Budgets 3-strike fix breaker, 3-cycle gap-flywheel cap (counter on disk), quick-task ratchet
Human checkpoint Rule 4 deviations, human_needed flags, ship gate
Ratchet pitfalls promote to permanent check entries the verifier runs on every pass β€” each a POSIX-sh command with an exact expect, mechanically MATCH / MISMATCH / BROKEN; learnings travel forward too, delivered as keys in every worker's spawn digest

And this is how the actors sit β€” the "plans are prompts" story, drawn:

graph TB
  P["πŸ“œ PLAN-01.md<br/>(a prompt, not a doc)"]
  O["🎯 Orchestrator<br/>routes, never implements"]
  W["πŸ”¨ Fresh worker<br/>executes the plan verbatim"]
  V["πŸ•΅οΈ Blind verifier<br/>told nothing of what workers claimed"]
  D[("πŸ§ͺ .potion/ on disk<br/>the only memory")]
  O -->|"spawns with a pointer"| W
  P -->|"read first, executed verbatim"| W
  W -->|"atomic commits + SUMMARY"| D
  O -->|"spawns blind"| V
  V -->|"exists β†’ substantive β†’ wired"| D
  D -->|"progress = artifacts, never a status field"| O
Loading

Built with itself: this repo's .potion/ is a real Potion project β€” the loop above brewed every release. Then the mischief audit (.potion/phases/09-mischief/) red-teamed the verifier itself: five classed defects seeded behind a sealed answer key β€” stub, wired-but-wrong, phantom commit, orphaned artifact, missing artifact. Caught 5/5, and it flagged the fabricated "verified live" claims unprompted.

The Operator Test governs everything: if the agent cannot prove it is done, you are not engineering a loop β€” you are automating drift.

🧠 Knowledge that compounds

Every pass verdict harvests what the phase taught into an append-only journal β€” and the knowledge keeps working after it's written:

  • Journal β€” .potion/learnings.jsonl: append-only, newest-wins by key, never hand-edited. Ground truth.
  • Cross-repo promotion β€” entries that clear the bar (confidence β‰₯ 8, generalizable, born inside the verified loop) promote to ~/.claude/potion/knowledge.jsonl. What one repo learns, every repo knows. External text never crosses the boundary β€” only loop-born entries do.
  • Distillation pages β€” journals distill into readable pages (.potion/knowledge/), each claim citing the journal entry it came from. Pages are a regenerable cache: when page and journal disagree, the journal wins and the page gets rebuilt.
  • Lint β€” four hunts (contradictions, stale claims, orphans, coverage gaps) keep journal and pages honest. The safety line: cache fixes are automatic, truth changes are human-gated. Always.

Planners grep both journals into plans; workers get matching entry keys in their spawn digest. Pitfalls with teeth promote to permanent check entries the verifier runs on every pass.

πŸ“¦ What's in the box

Repo layout β€” what ships in the plugin
potion/
β”œβ”€β”€ core/CORE.md            # shared contract: voice, questions, evidence, statuses
β”œβ”€β”€ skills/                 # init, discuss, plan, execute, verify, ship, brew,
β”‚                           #   pause, resume, learn, investigate
β”œβ”€β”€ agents/                 # potion-worker (executor), potion-verifier (auditor)
β”œβ”€β”€ hooks/                  # session-start: restores position + surfaces learnings
β”œβ”€β”€ templates/              # PROJECT.md, STATE.md, PLAN.md, SUMMARY.md,
β”‚                           #   VERIFICATION.md, continue-here.md
└── PHILOSOPHY.md

State lives in your repo at .potion/:

The .potion/ state tree β€” every file, one line each
.potion/
β”œβ”€β”€ PROJECT.md              # goals, locked decisions, out-of-scope (with why)
β”œβ”€β”€ STATE.md                # <60-line digest: position, recent decisions, resume point
β”œβ”€β”€ learnings.jsonl         # append-only insights, newest-wins
β”œβ”€β”€ knowledge/              # distilled pages β€” regenerable cache over the journal
β”œβ”€β”€ continue-here.md        # transient pause file (deleted on resume)
└── phases/NN-slug/
    β”œβ”€β”€ DISCUSSION.md       # Decisions / Claude's Discretion / Deferred
    β”œβ”€β”€ PLAN-NN.md          # the prompt an executor runs verbatim
    β”œβ”€β”€ SUMMARY-NN.md       # existence of this file = plan complete
    β”œβ”€β”€ VERIFICATION.md     # ladder results + structured gaps
    └── evidence/           # runtime proof artifacts, referenced by path from VERIFICATION.md

Install

# from GitHub (Claude Code)
/plugin marketplace add Ian-Louw/potion
/plugin install potion@potion

Alternative: clone the repo and run claude --plugin-dir path/to/potion for a zero-setup trial. Either way, install the whole plugin β€” do NOT copy skills/ alone into a skills directory: the shared contract in core/, the templates/, hooks/, and agents/ are load-bearing and only load through the plugin system.

Only runtime dependency: node on PATH (for the session-start hook).

Credits

Standing on the shoulders of GSD, Superpowers, and gstack. Potion is a distillation, not a replacement β€” if you want more machinery, those projects have it.

MIT licensed. Brewed with Claude Code.

About

πŸ§ͺ The magic potion for Claude Code β€” plans are prompts, disk is memory, evidence or it didn't happen. A lean closed-loop framework that brews itself, red-teams its own verifier, and keeps the receipts.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors