This guided walkthrough takes you from a fresh repo to a complete STAN loop with a small change set applied via patches.
Prereqs:
You can use any repo. For a throwaway demo:
mkdir stan-demo && cd stan-demo
git init
echo '{"name":"stan-demo","version":"0.0.0","type":"module"}' > package.json
echo 'export const hello = () => "Hello";' > hello.js
Add basic scripts:
npm i -D eslint vitest
npm pkg set scripts.test="vitest --run"
npm pkg set scripts.lint="eslint ."
npm pkg set scripts.typecheck="echo ok" # replace with tsc if you have TS
npm i -g @karmaniverous/stan
stan init
What this does:
stan.config.yml
.stan/{output,diff,dist,patch}
in .gitignore.stan/system/
and initial diff snapshotOptional: edit stan.config.yml
to map STAN scripts to your repo’s tasks.
stan run
This:
.stan/output/*.txt
..stan/output/archive.tar
and .stan/output/archive.diff.tar
.Attach .stan/output/archive.tar
(and archive.diff.tar
if present) to your AI chat.
Tip: If you need a new chat, ask STAN for a “handoff” block, paste it at the top of the new chat, and attach the latest archives. STAN will verify the signature and resume with full context.
Iterate in chat. When STAN proposes changes, it will return a plain unified diff (no base64) like:
diff --git a/hello.js b/hello.js
--- a/hello.js
+++ b/hello.js
@@ -1,1 +1,2 @@
-export const hello = () => "Hello";
+export const hello = () => "Hello world";
+export const shout = () => "HELLO WORLD";
Apply it locally:
stan patch
If you want to validate without changing files:
stan patch --check
On failures, STAN writes a compact FEEDBACK packet (and copies it to your clipboard when possible). Paste that into chat and STAN will return a corrected diff.
.stan/system/stan.todo.md
current with each change set.stan run -p
to print the plan without side effects.-q
for sequential execution, -c
to include outputs inside archives and remove them from disk.stan.config.yml
as needed.diff --git
, ---/+++
, and @@
hunks (no base64).