@karmaniverous/stan
    Preparing search index...

    Getting Started

    This guide walks you through setting up STAN in an existing repository and using it effectively in chat.

    Install the STAN CLI globally (pick one):

    npm i -g @karmaniverous/stan
    # or
    pnpm add -g @karmaniverous/stan
    # or
    yarn global add @karmaniverous/stan

    From your repository root:

    stan init
    

    What this does:

    • Creates stan.config.yml with sensible defaults.
    • Ensures .gitignore entries for .stan/output/, .stan/diff/, .stan/dist/, and .stan/patch/.
    • Ensures documentation metadata under .stan/system/ and creates required directories. The project prompt (.stan/system/stan.project.md) is created on demand by STAN when repo‑specific requirements emerge (no template is installed).
    • Writes an initial diff snapshot to .stan/diff/.archive.snapshot.json.

    You can re-run stan init safely. Use --force to accept defaults; otherwise you’ll be prompted.

    Minimal example:

    stanPath: .stan
    includes: []
    excludes: []
    scripts:
    build: npm run stan:build
    lint: npm run lint
    test: npm run test
    typecheck: npm run typecheck

    Key settings:

    • stanPath (default .stan): STAN workspace folder.
    • scripts: commands whose combined stdout/stderr become deterministic text outputs (e.g., test.txt).
    • includes/excludes: glob controls for archiving; text files are included, binaries automatically excluded.
    • Optional:
      • maxUndos (history depth for snapshot undo/redo; default 10).
      • patchOpenCommand (editor open command; default "code -g {file}").

    Build and snapshot:

    stan run
    

    This:

    • Runs configured scripts (in parallel by default).
    • Writes outputs to .stan/output/*.txt.
    • Creates .stan/output/archive.tar (full snapshot of text files) and .stan/output/archive.diff.tar (changed files).
    • Logs a concise “archive warnings” summary to the console (binary exclusions, large text call‑outs).

    To update the baseline snapshot without writing archives:

    stan snap
    

    Patch iterations:

    stan patch              # read unified diff from clipboard
    stan patch --check # validate only (writes to sandbox)
    stan patch -f fix.patch # read from a file

    On failure, STAN writes a compact FEEDBACK packet and (when possible) copies it to your clipboard—paste it into chat to get a corrected diff.

    STAN ships a small “bootloader” system prompt that reliably loads your attached system prompt from archives:

    How to use with a third‑party client (TypingMind example):

    1. Create a custom agent and paste the entire bootloader into the agent’s System Prompt.
    2. Model: GPT‑5 (or your preferred GPT‑like model); set “High” reasoning effort and max_output_tokens to 32,000 if available.
    3. Start a fresh chat with this agent each time you attach a new archive set.
    4. Attach the latest .stan/output/archive.tar (and archive.diff.tar if present). The bootloader will locate and load .stan/system/stan.system.md from the archive automatically.
    5. Begin the discussion (e.g., “Here are my archives; please review the plan in .stan/system/stan.todo.md and propose next steps.”).

    Notes:

    • The bootloader performs an integrity‑first tar read and refuses to proceed if .stan/system/stan.system.md cannot be found. Attachments are the source of truth.
    • If you paste a previous handoff block, STAN uses it as input (does not generate a new handoff unless you explicitly ask).
    • [ ] stan init successfully created config and docs.
    • [ ] stan run produced text outputs and archive.tar/archive.diff.tar.
    • [ ] You can attach archives in chat and the bootloader loads stan.system.md.
    • [ ] Patches round‑trip cleanly (stan patch --check before applying).
    • “Missing system prompt”: Attach an archive containing .stan/system/stan.system.md (or attach that file directly as stan.system.md).
    • Patch failures: Use --check to validate; reply in chat with the FEEDBACK packet to receive a corrected diff.
    • Large text files flagged: Consider adding globs to excludes to trim runtime noise from archives.