repo study · v0.6
Understand the code before your AI changes it.
Took over a codebase, or about to touch logic you don't know well? One command maps a flow from the code itself and writes a living document your team and your AI can both use.
Map the flow
stet study "reconciliation"
✓ Studied "reconciliation" → docs/flows/reconciliation.md5 key files · 2 supporting · 3 entry points · 1 tests · flow diagram (mermaid)src/recon/engine.jssrc/integrations/xero.jsapi/recon_service.py! 6 of 7 files in this flow aren't protected by a lock — suggestions are in the doc.Next: stet context --flow reconciliation and ask your AI to explain it (prompt in the doc).
Use the words your code uses: "reconciliation", "xero sync", "checkout", "export".
What's in the document
flowchart LRr0["POST /reconcile"] --> routes/recon.jsroutes/recon.js --> recon/engine.jsintegrations/xero.js --> recon/engine.jsrecon/engine.js --> recon/rules.jsrecon/engine.js --> money/round.js
Get the explanation from your AI
stet context --flow reconciliation # the doc + every file in the flow, copied to your clipboard
Paste it into ChatGPT or Claude with the prompt at the bottom of the doc. It asks the AI to explain the flow step by step from the entry points, naming files and functions, listing business rules and edge cases, and flagging what looks risky or untested — using only the code provided. Paste the answer into the doc's How it works section.
Protect what you just understood
The doc lists unprotected files and gives you the commands, for example:
stet lock add "Reconciliation works" --cmd "node --test tests/recon.test.js" --protect "src/recon/**"stet lock add "Reconciliation output is stable" --snapshot "node scripts/recon-sample.js"
See snapshot locks for locking behaviour without writing a test.
Keep it true
stet study # lists flows; flags ones whose code changed since writtenstet study "reconciliation" # refresh: the generated part updates, your notes stay
stet status shows out-of-date flows, and stet handoff links every flow, so a new developer or CTO starts from them. Imports and routes are understood for JavaScript/TypeScript and Python; other languages get key files, functions and tests.