agentleFS
M0xooM0xoo/wisp/AGENTS.md

wisp

AGENTS.md0 starsChanged 17 days agoMITView on GitHub

How to work on wisp v2. README.md says what wisp does, ARCHITECTURE.md maps the code, and docs/adr/ records why each decision was made. This file holds the rules a change has to follow. The step-by-step how-tos are in .claude/skills/ (any agent can read them, not only Claude). docs/v2-plan.md is the plan and where everything stands (every item and v1 feature marked done or to do): read it first, its §3 (the owner's decisions) before any change, and update it in…

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. WispAgents/wisp★ 17100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,117 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository11 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Ask the graph: run .agents/bin/monoflow graph impact <file> before you change a contract (an api/ package, @wisp/protocol, @wisp/kernel).

    line 12
  2. Very specific:

    Interceptors read and decide; they never write: Follow-up work goes in the verdict's then.

    line 70
  3. Very specific:

    Every user-facing string goes through t('key').

    line 102
  4. Very specific:

    Nothing on the hot path blocks: no sync I/O in request handlers or the runner (*Sync calls are refused by tools/check outside startup and …

    line 117
  5. Distinctive:

    Keep v1's behaviour and ask under *Questions* there.

    line 138
  6. Very specific:

    Before changing a file, read the tasks that shaped it: wisp tasks --touching <path> (or wisp blame <file>:<line>), or the files in …

    line 167

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

How to work on wisp v2. README.md says what wisp does, ARCHITECTURE.md maps the code, and docs/adr/ records why each decision was made. This file holds the rules a change has to follow. The step-by-step how-tos are in .claude/skills/ (any agent can read them, not only Claude). docs/v2-plan.md is the plan and where everything stands (every item and v1 feature marked done or to do): read it first, its §3 (the owner's decisions) before any change, and update it in the same commit when you finish an item.

Before you change anything

  • Read ARCHITECTURE.md, and the ADR for the area you are touching.
  • Ask the graph: run .agents/bin/monoflow graph impact <file> before you change a contract (an api/ package, @wisp/protocol, @wisp/kernel). It lists every package your change reaches.
  • A decision that changes the architecture (a new package kind, a new dependency, a new kind of state, a new wire message, a rule in tools/check turned off) gets a new ADR in docs/adr/, in the same PR. Use the record-decision skill. An ADR is never edited after it merges; a later ADR supersedes it.

Commands

From clone to a running, debuggable wisp (logs, debugger, one test per area, troubleshooting): docs/dev.md.

npm install                      # once: links the TypeScript (UI) workspaces
npm run doctor                   # is this checkout ready? toolchain, deps, monoflow, builds, ports: one ok/warn/FAIL line each with its fix; exit 1 on FAIL; --json for agents
cargo build                      # the Rust workspace (one shared target dir per machine)
npm run check                    # structure rules for both sides (layers, cycles, CSS, state, manifests, OpenAPI, sizes; rust-layers, -sans-io, -unsafe, -sizes, -manifests)
npm run typecheck                # tsc strict for every TS package, tests, dev and gallery included (tools/typecheck.ts: 4 programs in parallel)
cargo fmt --all                  # format the Rust workspace (rustfmt.toml); CI runs `cargo fmt --all --check`
cargo clippy --workspace --all-targets -- -D warnings
cargo deny check                 # licences, advisories, bans, sources (deny.toml)
cargo test -p <crate> --test <file> <name>  # the test you're writing: that's all a coder runs
.agents/bin/monoflow graph impact <file>   # before changing a contract
# full suites, e2e, monoflow verify and qa/*.mjs are the outer loop: PR CI and one batched pass (WISP_OUTER_LOOP=1)
npm run dev                      # dev mode: `wisp serve` from this checkout on :4800 (next free if busy) with home ~/.wisp-dev, + Vite HMR proxying /api to it; prints the URL. Rust edits under crates/ or plugins/*/host rebuild + restart it (r+Enter by hand, --no-watch to skip); Ctrl-C stops all it started
npm run dev:desktop              # the same + the Tauri window on Vite's URL, as dev.wisp.dev (tauri.dev.conf.json), attached to :4800 (never 4477, never ~/.wisp); options: npm run dev -- --help

Language and runtime (ADR-0013)

  • Rust for everything but the UI. The kernel, store, sync, HTTP edge, process supervision, the MCP server, the CLI, the grid and every plugin's backend (harness runners included) are Rust crates. TypeScript + Solid only for UI packages (packages/{protocol,sync,client,tokens,ui,shell}, plugins/*/ui, apps/web).
  • One Rust toolchain: rust-toolchain.toml pins the version (rustup installs it on the first cargo call) and every CI workflow installs that same version, so rustfmt and clippy agree everywhere. Bump it on purpose, in its own PR (the file and .github/workflows/{suite,tauri,tauri-package,tauri-windows}.yml together).
  • Rust (plan §9.2): edition 2024; unsafe forbidden except wisp-proc's reviewed sys module; clippy pedantic with the workspace's short allow list; no unwrap/expect/panic outside tests; one thiserror enum per crate, mapped to WireError {code, message, retry} at the edge; a tracing span per command; core crates are sans-IO (no tokio, fs, net or clock: inject them).
  • TypeScript (UI only): strict, exactOptionalPropertyTypes, noUncheckedIndexedAccess, no any, erasable syntax only. Wire types come from Rust (ts-rs); never hand-edit a generated file.
  • Distribution: wisp-agents on npm is a dependency-free launcher plus per-platform binary packages (npm/). A new Rust dependency is pinned in the root Cargo.toml and justified in an ADR.

Plugins (ADR-0003)

  • Everything is a plugin. The kernel knows no feature: there is no if (harness === 'claude') outside plugins/claude.
  • A plugin talks to others only through their api package: commands (do something), events (something happened), interceptors (refuse or change something), extension points (provide an implementation), topics (watch data), services (a long-lived handle). It never imports another plugin's host or ui.
  • Built-ins get no private API. Whatever a built-in plugin can do, a user's plugin can do through the same manifest and API. If a built-in needs more, add an extension point, and then everyone has it.
  • Every registration belongs to a scope. Timers, subscriptions, child processes and watchers go through ctx.scope, so switching a plugin off frees everything it made.
  • Default deny. A new command, route or MCP tool is unreachable until a capability set names it (plugins/*/host/wisp-plugin.json permissions, packages/kernel/src/capabilities.ts).
  • Interceptors read and decide; they never write. Follow-up work goes in the verdict's then.

Data (ADR-0004, ADR-0005)

  • One write path: a command runs in one store transaction and every row it writes is recorded in change. Nothing writes files or rows behind the store's back.
  • Plugins own their tables, under their own prefix, with their own forward-only migrations.
  • Secrets stay in ~/.wisp/secrets.json (0600), never in the database.
  • Clients never poll. They subscribe to topics and resume from their cursor.

UI (ADR-0006, ADR-0007)

  • Kit components only. App and plugin UI code has no CSS: no class, no style (except CSS custom properties such as --sb-w), no .css files. A kit change may land in the same PR as the feature that needs it.
  • State has one home: server data in the entity store (written only by sync and command patches), derived values as selectors, what's open in navigation (navigate(intent)), flows as machines, drafts in the drafts store, settings in the settings store. Everything else is a local signal.
  • Every action answers within one frame (design/feedback.md, ADR-0017): the optimistic result, an immediate navigation with a skeleton, the new thing appearing where it goes, or the pressed control's pending state. Commands declare optimistic or pending; kit controls bind to commands; navigate() never waits on data. qa/feedback.mjs fails any click with no visible change within 100 ms.
  • Writes are commands: an idempotency key and a declared optimistic patch (or optimistic: 'none'). The UI updates at once and rolls back with a toast on reject.
  • Nothing jumps: keyed lists move rows in place, entry animations run once per mount, and a list over 200 rows uses VirtualList.
  • v2 looks exactly like v1 (design/foundation.md, ADR-0016): the kit reproduces v1's values element by element, and qa/parity.mjs diffs every screen against design/v1-reference/ (pixels and computed metrics, every width, theme and state). Features never pick a number.
  • Nothing wraps that shouldn't (design/layout.md, ADR-0012): control text (buttons, pills, chips, tabs, row titles, bar labels) never wraps; bars are one line and collapse items to their icon, then into More, by declared priority; only Wrap groups may wrap. qa/layout.mjs checks it at 320–1440 px.
  • Every user-facing string goes through t('key'). Every element a plugin may restyle has a data-part.
  • A UI change follows design/ and ends with design/checklist.md: seen in real Chrome at desktop and phone widths, in light and dark.

Performance is a feature (ADR-0011)

wisp aims to be the fastest dev tool there is. Speed is checked like correctness:

  • Budgets fail CI (tools/budgets.ts, plan §8): initial JS ≤ 120 KB br, initial CSS ≤ 30 KB br, server cold start → first response ≤ 150 ms, idle RSS ≤ 120 MB with 5k sessions, list query ≤ 5 ms on 5k sessions, append ≥ 20k events/s, write amplification ≤ 15× payload, p99 patch latency ≤ 150 ms (one heavy user: 5k sessions, 10 running, 4 clients), tap → frame ≤ 50 ms p95 and 0 long tasks while streaming on a 4×-throttled CPU. A miss blocks the merge, or needs a new ADR that changes the budget.
  • Measure, don't guess: a change to a hot path (store writes, the sync outbox, harness parsing, the list, the transcript) comes with its bench run (spikes/*/) before and after, in the PR.
  • Nothing on the hot path blocks: no sync I/O in request handlers or the runner (*Sync calls are refused by tools/check outside startup and tests), no full-list work per event, no JSON re-serialisation of whole sessions.
  • Lazy by default: plugins activate on their first event, UI extensions load with import(), and only open or running sessions stay in memory.
  • The UI does the least work: fine-grained signals (one row repaints), keyed lists that move nodes, VirtualList past 200 rows, no layout reads after writes in one frame, no :has() on large boxes.

Meet users where they work (ADR-0040)

  • Every feature works inside wisp and from where the user already is: their harness (Claude Code, Codex, …) through wisp's MCP tools and skill, git (trailers, hooks), CI (the GitHub Action), chat channels, editors later. Never require a user to change their flow or their harness. Tracking works passively (adopt, hooks). Each feature's ADR lists the places it reaches; a command without MCP exposure fails tools/check unless it's marked ui-only with a reason.

Porting from v1

  • Port the intent, not the bugs (docs/v2-port-intent.md): write the feature's intent first, look for v1's bugs in that area (issues, flaky tests, FIXMEs, the plan §4.6.1 bug classes) before porting, fix them in v2 with a test that would fail on v1, and list each in docs/v1-bugs-fixed.md. Unsure whether it's a bug? Keep v1's behaviour and ask under Questions there.

Tests

  • Coders code (owner, 2026-11-09): write the code and its named tests, run only the test you are writing, keep it compiling with cargo check/clippy. Full suites, e2e and UI gates are the outer loop (PR CI, the final batched pass); .agents/bin/no-suites.sh refuses them in agent sessions.
  • Tests sit next to the code (<package>/test/*.test.ts). They need no network and no real harness.
  • Pure code (deciders, reducers, machines, parsers, the sync merge) gets property or model-based tests.
  • Anything an agent, a peer or a released client reads (wisp blocks, MCP tools, protocol shapes) has goldens under test/goldens/. Changing one is a deliberate act in the PR.
  • A test that fails only some of the time is flaky: fix it, never retry it.

Git and CI

  • Rust builds: share one target dir (CARGO_TARGET_DIR) per machine; never run two full cargo build --workspace at once on a shared machine.
  • main is protected. Work on a branch, open a PR. Commit by file name, never git add -A.
  • PR CI (.github/workflows/suite.yml) on Linux, Node 22 and 24: npm run check, npm run typecheck, the Cargo workspace once through its own steps (fmt, clippy, test --no-fail-fast), then node tools/ci-verify.ts: every other package's checks, each once (the typecheck step's programs, one vitest run, monoflow for the rest; ADR-0069, ADR-0072). Label a PR ci:full to run every OS. monoflow reports the affected set; it does not skip anything until gate G14 passes (ADR-0001).
  • User-facing changes get a CHANGELOG.md entry under Unreleased.
  • Releasing is merging the version bump (Cargo.toml workspace version and npm/wisp-agents/package.json; see the release skill).

wisp: the tasks behind this code

Before changing a file, read the tasks that shaped it: wisp tasks --touching <path> (or wisp blame <file>:<line>), or the files in .wisp/tasks/. They hold what was asked, the agent's report and its transcript.

Decision ledger and learned rules

Two tools keep agents in line with what was already decided:

  • decisions/ is the decision ledger (decision-ledger). Each D-NNNN.yml is one accepted decision with its reason and scope. Agents get the repo-wide ones at session start and the ones scoped to a file right before editing it; an edit that breaks a decision's check is refused. Don't edit the records: propose with decisions add --propose "..." --reason "..." --scope <glob>, or decisions supersede D-NNNN ... to change one; a person accepts with decisions review. The v1 rules were imported as D-0001 to D-0046 (scoped to v1's files); v2's owner decisions are D-0047 onward (D-0055 supersedes D-0043), with the full dated list in docs/v2-plan.md §3.
  • .corrections/ holds lint rules learned from the corrections people make to agent code (ingrain). It starts empty: ingrain mine and ingrain propose add rules once corrections repeat, and they start in shadow mode.

Setup on your machine: brew install wispagents/tap/decision-ledger wispagents/tap/ingrain, then decisions init and ingrain init (installs the git pre-commit hooks; the Claude Code hooks are already in .claude/settings.json and do nothing if the tools aren't installed). CI runs both checks on every PR (.github/workflows/ledger.yml).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.