mvm
AGENTS.md43 starsChanged 3 months agoApache-2.0View on GitHub
Backing: shipped-source Validation: check-all This file is the short, always-applicable rule index loaded into every session. The fuller AI-assisted issue-to-PR playbook lives in public/src/content/docs/contributing/ai-coding-workflow.md; human environment setup in public/src/content/docs/contributing/development.md. If you change anything this file describes, update this file in the same change. - No placeholders in shipped docs or guidance. Do not land TODO, TBD, placeholder, <...>, or similar stand-ins where contributors need concrete instructions. - Task context has one route. Start from the GitHub issue, read only the…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/graft.mdcCursor rule
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
34 rules. About 1 is common, 15 are distinctive, and 18 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
No placeholders in shipped docs or guidance: Do not land TODO, TBD, placeholder, <...>, or similar stand-ins where contributors need …
- Very specific: line 17
Task context has one route: Start from the GitHub issue, read only the ADRs/contracts it links, then use Graft for implementation discovery.
- Very specific: line 20
Docs update with behavior changes: If commands, flags, or behavior move, update the matching docs in the same change, including …
- Very specific: line 23
No scratch files in the repo tree: Never write temporary/intermediate files under the working tree.
- Very specific: line 29
Builder VM requirement: All Nix builds/evals, Firecracker operations, mvmctl runtime commands (anything that boots, talks to, or manages …
- Distinctive: line 72
Run the requested test from its worktree:
- Distinctive: line 91
Before every real invocation, obtain explicit operator authorization for both the billable VM and transfer of the tracked-file checkout …
- Very specific: line 105
Do not pass --keep-instance to either entry point unless the operator explicitly requests an interactive diagnostic host.
- Very specific: line 121
The main checkout stays on synchronized
main: Verify at the start and end of every task: clean, on main, synced with origin/main (git … - Distinctive: line 135
No assistant or tool attribution in pull requests: Never name an AI assistant, coding agent, model, or tool (Claude Code, Codex, Kimi, Qwen …
- Distinctive: line 142
Every change — code, docs, dependency bumps, refactors, bug fixes — is developed in a git worktree.
- Distinctive: line 203
No task is complete without all of:
- Distinctive: line 205
Tests first: Write or update tests covering the new/changed behavior before marking a task done.
- Very specific: line 206
All tests green: Run cargo test --workspace and confirm zero failures.
- Very specific: line 207
Zero clippy warnings/errors: Run cargo clippy --workspace -- -D warnings and fix all findings before calling a feature done.
- Very specific: line 232
If a function can fail, test that it fails correctly (Err, not panic).
- Very specific: line 262
Never use sleep N && <check> as a wait strategy.
- Distinctive: line 287
After roughly 50 tool calls without reaching the session goal, stop and re-plan.
- Distinctive: line 290
Before launching a subagent, declare its exact workspace paths, environment setup, read-only or write scope and tools, and a …
- Distinctive: line 292
If any pre-flight item is unknown, do not launch it.
- Distinctive: line 296
Every change is evaluated through a security lens:
- Very specific: line 298
Never log, store, or expose secrets/tokens/keys/credentials/user data in plaintext — in code, logs, config, or error messages.
- Common: line 306
No hardcoded secrets — environment, secure config, or runtime injection only.
- Distinctive: line 307
Consider attack surface in every feature: listeners, file permissions, IPC channels, CLI commands.
- Very specific: line 314
Run cargo clippy --workspace -- -D warnings after every code change.
- Very specific: line 331
Never .unwrap() in production code — use .expect("descriptive message") so a panic explains what failed and where.
- Very specific: line 337
Never cite a plan, ADR, PR, sprint, or workstream in a code comment — process artifacts belong in specs, commit messages, and PR …
- Distinctive: line 347
Never reimplement existing functionality.
- Distinctive: line 373
Follow the existing pattern — match surrounding naming, idiom, and layout.
- Very specific: line 403
Async (Tokio): no blocking calls in async context (tokio::fs, offload CPU work with spawn_blocking/rayon).
- Very specific: line 409
Do not ship TODO, TBD, placeholder values, pseudo-code, or stub implementations where a concrete answer is required.
- Distinctive: line 420
Keep guides aligned with shipped behavior, not aspirational features.
- Very specific: line 423
Never put agent-created scratch or intermediate files anywhere in a worktree, including gitignored paths.
- Distinctive: line 439
Never immediately repeat an identical failed command.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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.
Files
Agent Working Agreement
Backing: shipped-source Validation: check-all
This file is the short, always-applicable rule index loaded into every session.
The fuller AI-assisted issue-to-PR playbook lives in
public/src/content/docs/contributing/ai-coding-workflow.md; human environment
setup in public/src/content/docs/contributing/development.md. If you change
anything this file describes, update this file in the same change.
Documentation and editing hygiene
- No placeholders in shipped docs or guidance. Do not land
TODO,TBD,placeholder,<...>, or similar stand-ins where contributors need concrete instructions. - Task context has one route. Start from the GitHub issue, read only the
ADRs/contracts it links, then use Graft for implementation discovery. Never
recursively read
specs/or treat a legacy plan as current work. - Docs update with behavior changes. If commands, flags, or behavior move,
update the matching docs in the same change, including
public/src/content/docs/reference/cli-commands.mdwhen CLI surface changes. - No scratch files in the repo tree. Never write temporary/intermediate
files under the working tree; use
/tmpinstead (except local.agent-memory/notes/findings).
Execution boundaries
Builder VM requirement. All Nix builds/evals, Firecracker operations,
mvmctl runtime commands (anything that boots, talks to, or manages microVMs),
and Linux-specific syscalls MUST run inside the project builder VM — never a
Lima VM; do not use limactl for this repo. The builder VM is the Linux
execution boundary.
Builder VM images are treated as published artifacts produced by the mvm-images
repository and are downloaded and verified by default. Building the builder VM
from a local mvm-images checkout is a contributor-only, opt-in path and is
not performed automatically. Operator-facing knobs:
- To opt into a local builder-image build for a single invocation, set
MVM_IMAGES_DIRto anmvm-imagescheckout and setMVM_ALLOW_LOCAL_BUILDER_BUILD=1in the same environment. WithoutMVM_ALLOW_LOCAL_BUILDER_BUILDpresent,mvmctlwill prefer the published builder image even when anmvm-imagescheckout is available locally. MVM_BOOT_IMAGEcontinues to acceptbuild/fetchvalues, but abuildrequest withoutMVM_ALLOW_LOCAL_BUILDER_BUILDis refused rather than silently falling back.
Owner-approved exceptions (unchanged):
- Lima as a test-environment KVM provider only — a virtual
/dev/kvmfor Firecracker / Linux-KVM E2E tests that cannot run on the builder VM or GitHub-hosted runners. Modeled as a test/dev-tierVmBackend, refused by prod admission (like the Docker fallback tier). Never for builds/evals. - Native macOS HVF live lifecycle tests and teardown benchmarks — explicit HVF test/benchmark commands, because the Linux builder VM cannot provide Hypervisor.framework. All other runtime commands still require the builder VM.
mvmctl machine run --hypervisor wasm(or any explicitwasmbackend target) — runs awasm32-wasip1module under hostwasmtime; no KVM, no Firecracker/jailer/seccomp/netns tooling. May run on the macOS host.
Cargo defaults to the macOS host. cargo test / check / build run on
the host so worktrees do not deadlock on shared builder state. Tests needing
Linux (vsock, jailer/seccomp, dm-verity, network namespaces, /dev/kvm,
/proc/net) are gated #[cfg(target_os = "linux")] and only those sub-targets
run inside the builder VM. mvmctl via cargo run (build, machine run,
machine stop, machine logs, machine ls) runs inside the builder VM
(explicit wasm target excepted).
Disposable GCP KVM test host. Linux/KVM E2E tests that cannot run on the builder VM or GitHub-hosted runners have one repository-owned remote lifecycle. Run the requested test from its worktree:
just lab::gcp-kvm just bdd::live-ciThe command creates an Intel C3 Spot VM with nested KVM, uploads only files
tracked by git from the current worktree, prepares the pinned
Rust/Zig/Firecracker
toolchain, runs the exact argument vector after lab::gcp-kvm, downloads a
result archive under the printed /tmp path, and deletes the outer VM on
success or failure. Put artifacts that must be downloaded in
$MVM_GCP_KVM_RESULTS_DIR. Use the direct
scripts/run-gcp-kvm-test.sh [options] -- PROGRAM [ARG ...] entry point for
project, zone, machine, result-directory, dry-run, or diagnostic options.
This host is a test/dev-tier KVM provider only. Never use it for Nix builds or evals, ordinary compilation, or work the builder VM can perform. The VM has no Google service account or OAuth scopes and refuses project-wide SSH keys. Before every real invocation, obtain explicit operator authorization for both the billable VM and transfer of the tracked-file checkout unless that exact run was already authorized.
Issue #3655's destructive witness is the pinned preset:
just lab::cve-3655-gcp --dry-run
just lab::cve-3655-gcpIt delegates host ownership to the generic runner and supplies only the pinned CVE bootstrap and witness command. Do not substitute an ad-hoc cloud VM.
Do not pass --keep-instance to either entry point unless the operator
explicitly requests an interactive diagnostic host. When requested, the runner prints exact
gcloud compute ssh and gcloud compute instances delete commands. Run the
printed delete command as soon as diagnosis ends and verify the instance is
gone. If automatic cleanup reports a failure, use that same printed delete
command immediately; never leave a retained or uncertain instance billable.
Git: one operator, one main
Git runs only from the main mvm/ checkout — never from inside a worktree
directory, never from inside the builder VM. Act on a worktree's branch with
git -C /path/to/.worktrees/mvm-<slug> <cmd> from the main checkout. This
serializes the shared .git/objects, packed refs, and hooks and eliminates the
contention that has caused lost work. Cargo/nix/firecracker/mvmctl run from each
worktree's own directory; only git is centralized.
The main checkout stays on synchronized main. Verify at the start and end
of every task: clean, on main, synced with origin/main
(git fetch origin && git pull --ff-only origin main). Never do change work on
a topic branch there; if one lands there accidentally, preserve changes, switch
back, sync, and attach the branch to a worktree. After any PR merge, sync main
immediately. The only git commands targeting main are read-only (git log,
git show) or routine sync.
Never commit directly to main. Main advances only via merged PRs —
including docs-only and typo fixes. Reasons: parallel agents sharing .git can
wipe local-only commits with routine recovery moves; the full
clippy/nextest/supply-chain matrix only runs on PRs; PR history is the audit
trail. Push to a branch and open a PR.
No assistant or tool attribution in pull requests. Never name an AI
assistant, coding agent, model, or tool (Claude Code, Codex, Kimi, Qwen Code,
etc.) in PR titles, bodies, contributor lists, acknowledgements, commit
trailers, or generated-by notices; no assistant Co-authored-by trailers.
Worktree workflow for all changes
Every change — code, docs, dependency bumps, refactors, bug fixes — is developed in a git worktree. No docs-only or trivial-change exception.
cd /path/to/mvm # main checkout
mkdir -p ../.worktrees
branch=feat/example # choose feat/, fix/, docs/, or chore/
git worktree add ../.worktrees/mvm-example -b "$branch"
cd ../.worktrees/mvm-example # code + cargo live hereBranch names: feat/<slug>, fix/<slug>, chore/<slug> (docs topics:
docs/<slug>). All git work happens from the main checkout:
git -C ../.worktrees/mvm-<slug> status|add|commit|push. Agents inside a
worktree do not invoke git directly; a read-only git -C <main> status is
acceptable. Remove the worktree after merge (git worktree remove ...).
Isolate mutable state per worktree by overriding three env vars (or just
source scripts/dev-env.sh, resolved relative to the worktree root; bin/dev
builds and runs this checkout's mvmctl via just embed on the dev
contributor surface (so it can verify published image-set signatures),
with pair-isolated state; .envrc.example covers direnv users):
export MVM_HOME="$PWD/.mvm-test"
export CARGO_TARGET_DIR="$PWD/.mvm-test/target"
export CARGO_HOME="$PWD/.mvm-test/cargo"These exports apply to commands in the current shell until it is closed or the variables are unset.
Still shared between worktrees — vary microVM and TAP names if two worktrees
run microVMs concurrently: .git/objects + packed refs + hooks (the git rule
above is what keeps these safe), the builder VM's /var/lib/mvm/, br-mvm
bridge, and TAP devices; the Nix store (shared by design; Nix locking handles
it). The builder VM itself is shared across worktrees — never fork a
per-worktree VM (boot cost, duplicated tens-of-GB store, warm-cache loss).
One-time per clone: just maint::hooks points core.hooksPath at
.githooks/. The pre-commit hook runs cargo fmt --all (auto-restaging),
scoped stable clippy -D warnings, nix fmt for staged .nix files, and
actionlint for workflow changes — never the full test suite; heavy gates run
in CI (MVM_SKIP_CLIPPY=1 bypasses the clippy pass).
The DX rule: binary development is single-repo
Developing the binaries that run inside a microVM — agent, egress client,
protocol crates — happens entirely in this repository. A guest-binary-only
change must never require an mvm-images checkout, edit, or release: the
dev-tier build arms rebuild and boot the new binaries from this checkout, and
image assembly consumes them without a recipe change. mvm-images is entered
deliberately, only for image-definition work (packages, kernels, roles), and
even then this repo stays the front door (bin/dev build image-set). The
acceptance test is the one-clone bootstrap: a contributor who clones only
mvm and follows the quickstart never needs to know the image repository
exists. The repo split has a queue-wall tripwire: keep it under 20 minutes,
or re-open the topology decision.
Definition of Done
No task is complete without all of:
- Tests first: Write or update tests covering the new/changed behavior before marking a task done. Unit tests for logic, integration tests for CLI and cross-crate interactions.
- All tests green: Run
cargo test --workspaceand confirm zero failures. New tests must pass alongside all existing tests. - Zero clippy warnings/errors: Run
cargo clippy --workspace -- -D warningsand fix all findings before calling a feature done. Never suppress a clippy lint with#[allow(...)]— fix the underlying issue instead. - Compiling workspace: Run
cargo check --workspace(or fullcargo test/cargo build) and fix any errors before you finish. Never leave the workspace in a non-compiling state.--all-targetsis not exhaustive: it silently skips targets behindrequired-features(themvm-conformancecucumber runner needs--features bdd), and on macOS it cannot compilecfg(target_os = "linux")files at all — including Linux-gated test files, whichjust check::linuxalso misses because that recipe is--libonly. Changing the shape of a shared type (adding a struct field, a trait method, an enum variant) therefore needsjust check::gatedbefore pushing. Skipping it surfaces in CI ascheck-nextest-groupsfailing with "cargo nextest list failed", which names neither the file nor the field. - Keep the issue authoritative: GitHub issues own work status, remaining
scope, dependencies, and acceptance criteria. Link the PR to its issue and
leave verification results in the PR. Do not create or update a shared
sprint, refactor, delivery, or progress dashboard in
specs/. - Update active technical documents only when their substance changes: ADRs own durable decisions and contracts own stable interfaces. An exceptional new plan is an immutable design attachment linked to one issue, never a progress ledger. When implementation changes a durable decision, update or supersede the owning ADR. Legacy plans are frozen historical inputs and are not completion gates.
Test expectations
- Broad BDD coverage of user-visible workflows (
mvm-conformance,--features bdd); add/update scenarios when behavior changes, and keep focused unit and integration tests for lower-level logic and failure paths. - New types: serde roundtrip tests, default-value tests where applicable.
- New protocol/wire code: roundtrip through mock I/O (
UnixStream::pair()), error-path tests (invalid input, wrong keys, malformed data). - New CLI flags/commands: integration tests in
tests/cli.rs(help text, argument parsing). - Security code: positive path, negative path (tampered/invalid rejected), and edge cases (replay, wrong key, expired session).
- If a function can fail, test that it fails correctly (
Err, not panic).
Waiting model
Pick the wait primitive from the condition being observed:
- Owned live resources → events. Processes, child handles, sockets, pipes, eventfd, kqueue filters, pidfd: arm the observer before triggering the transition, block on the event; keep a bounded deadline, a compatibility fallback, and a final identity/state verification before cleanup.
- Time conditions → timers. TTLs, leases, backoff, health cadence, watchdogs: monotonic clock, explicit cancellation.
- Crash recovery / external state → reconciliation. State owned by another process, service, or a crashed predecessor has no trustworthy live event: re-read at a bounded cadence; every pass idempotent under stale/duplicated observations.
- Durable markers are evidence, not wakeups. A file/record may be the cross-process source of truth while an owned event accelerates the foreground path; never delete or trust durable state solely because a best-effort notification fired.
- Measure before converting compatibility polls. Boot/readiness markers and attach/recovery paths may keep bounded polling until profiling shows a user-visible cost and an ownership-safe event exists; record why a remaining poll is timer-driven, externally owned, or a recovery fallback.
An event-driven change does not imply a repo-wide async runtime — use the smallest event primitive matching the existing ownership boundary.
No sleep-polling and long operations
Never use sleep N && <check> as a wait strategy. For CI, use
gh pr checks <n> --watch or a background watch. Owned processes use an
armed event handle, not a sleep loop. Reconcile externally owned state only
when no event source exists: at most five polls with escalating backoff, and
record the event that would replace the poll.
Commands expected to exceed 60 seconds (builds, workspace tests, image builds, CI watches) run as background tasks. Wait on the task notification or handle; do not extend a foreground timeout and rerun the same command.
Scoped feedback and worktree shell
Debug with just tests::scoped <crate> <filter>: read the failure, make one
change, and rerun that scoped test. Run the full workspace suite once before
declaring the task done, not after each edit. Source scripts/dev-env.sh once
per worktree shell and then use plain commands; do not repeat inline
MVM_HOME/CARGO_TARGET_DIR/CARGO_HOME or cd prefixes. Use
bin/dev for a one-off mvmctl call from an unconfigured shell. A genuinely
one-command override is an exception, not the default.
Session and delegation discipline
Think once at each decision point, then act; after two reasoning turns with no action, make the tool call, ask, or write and test a hypothesis. At each plan phase boundary, record decisions, files touched, blocker, and exact next step. After roughly 50 tool calls without reaching the session goal, stop and re-plan; close finished sessions and split long multi-part efforts.
Before launching a subagent, declare its exact workspace paths, environment setup, read-only or write scope and tools, and a denial/missing-path fallback. If any pre-flight item is unknown, do not launch it.
Privacy & security
Every change is evaluated through a security lens:
- Never log, store, or expose secrets/tokens/keys/credentials/user data in plaintext — in code, logs, config, or error messages.
- Validate and sanitize all inputs at system boundaries (CLI args, config files, network data, vsock messages).
- Least privilege everywhere; default to secure configurations (encryption on, auth required, restrictive permissions) — users opt out, never opt in.
- Guard secrets in transit and at rest; signing, encryption, and secure channels (vsock, not plaintext TCP) for sensitive communication.
- No hardcoded secrets — environment, secure config, or runtime injection only.
- Consider attack surface in every feature: listeners, file permissions, IPC channels, CLI commands.
- Security tests are mandatory for every security-relevant path (positive, negative, edge).
Clippy: zero warnings, always
Run cargo clippy --workspace -- -D warnings after every code change; the CI
pre-commit hook treats warnings as errors.
- Never suppress with
#[allow(...)]— fix the underlying issue; a genuinely necessary suppression needs a comment and explicit approval. #[allow(clippy::too_many_arguments)]is banned outright, everywhere. The instant a function trips it, introduce a dedicated params struct with a builder (::builder()or#[derive(Default)]+with_*setters + validatedbuild()) and thread that value through. The only legitimate suppression is bindgen-generated FFI (crates/deps/libkrun-sys/src/sys.rs); convert any existing hand-written suppression to a builder as you touch it.- Fix warnings immediately; common findings: too many arguments (→ builder),
redundant closures, unnecessary owned parameters, single-arm matches (→
if let), and unused imports/variables.
No unwrap() in production code
Never .unwrap() in production code — use .expect("descriptive message") so a
panic explains what failed and where. unwrap() is acceptable only in test code
(#[cfg(test)] modules and tests/).
No spec references in code comments
Never cite a plan, ADR, PR, sprint, or workstream in a code comment — process
artifacts belong in specs, commit messages, and PR descriptions. The
check-no-spec-refs-in-comments lint (a CI gate) fails the build on any such
reference. Keep the reasoning, drop the citation. Spec numbers remain fine
in string literals that are genuinely runtime data (error messages, audit-log
fields); the lint scans comment text only. Record why-a-decision-was-made in the
commit message or the owning spec, and link the code from there.
Reuse first; compose small, testable units
Never reimplement existing functionality. Before writing anything, search for an existing helper, type, trait impl, or crate that does the job — grep the workspace, check facade re-exports, read the module the work belongs in. If a helper is almost right, extend it; don't fork a second copy. Duplicated logic drifts, doubles the test surface, and is the most common source of bugs here.
- Use the helpers. All
~/.mvmpaths go throughmvm-core::confighelpers (mvm_home,vm_state_dir,mvm_keys_dir,mvm_cache_dir, …) — never build them fromstd::env::var("HOME")+.join(...), which ignoresMVM_HOMEand breaks worktree isolation. Shell/VM ops go through theShellEnvironment/BuildEnvironmenttraits. - Small, single-purpose functions you can write a focused test for; if you can't test it, split it. A helper extracted to be testable ships with tests in the same change — positive, negative, and edge paths.
- Make illegal states unrepresentable — newtypes over bare
String/u64, enums over stringly-typed flags,Option/Resultover sentinels. - Don't over-abstract (YAGNI). Traits/builders/generics for a real second case or genuine construction complexity, not speculatively.
- Builder pattern for multi-field construction (also kills
too_many_argumentsat the source). - Traits for behavior that varies (
VmBackend,ShellEnvironment) — never amatchscattered across call sites. One impl is one path, not the only path. - Structs over loose tuples/params; match exhaustively on owned enums —
no
_ =>catch-alls, so new variants break the build where they must be handled. - Follow the existing pattern — match surrounding naming, idiom, and layout.
Rust best practices
External best-practices guide;
where this file states a stricter rule (clippy, unwrap(), reuse-first), this
file governs.
- API & types: builder over many-input functions; trait for multiple
behaviors; borrowed args (
&str,&[T],impl AsRef<Path>), return owned only when needed; newtypes;#[must_use]where dropping is a bug; minimal visibility (pub(crate)beforepub);#[non_exhaustive]on growing public shapes; deriveDebug,Clone,PartialEq,Defaultwhere sensible. - Idioms & errors: propagate with
?;thiserrorin libraries,anyhow/eyreonly at app boundaries; context on errors (.with_context/.map_err); iterators over index loops;if let/let else; minimize macros — prefer functions andFrom/TryFrom/AsRef;&selfover&mut self;Cow<'_, str>for maybe-borrowed strings;unsafeconfined to small blocks each with a// SAFETY:comment;TryFrom/try_into()over lossyas; explicitchecked_*/saturating_*where arithmetic can overflow;.get()/.first()over slice indexing in fallible contexts; libraries returnResultrather than panicking (document deliberate panics under# Panics);OnceLock/LazyLockfor real globals; RAIIDropguards for cleanup (never rely onDropacrossmem::forget). - Dependencies & tooling: small audited dependency set (
cargo audit,cargo deny,cargo machete); aggressive clippy (--all-targets --all-features; pedantic/nursery via[lints]with per-lint justification over group disables);cargo fmt --checkin CI; explicit MSRV; minimal default features behind cargo features (mvm-corecarries no async runtime by default). - Async (Tokio): no blocking calls in async context (
tokio::fs, offload CPU work withspawn_blocking/rayon); bound concurrency withSemaphore/JoinSet; no repo-wide runtime for event-driven changes (see Waiting model).
No placeholders in shipped plans, code, or guidance
Do not ship TODO, TBD, placeholder values, pseudo-code, or stub
implementations where a concrete answer is required. Read existing code
before planning a change; compute unknown values before writing the plan, or
specify the exact command, source, and verification for execution time.
Operator-supplied install-time values need an explicit error, not a checked-in
placeholder.
Documentation and scratch files
User-facing behavior changes update the matching docs in the same PR, including the CLI reference for commands, flags, defaults, or environment variables. Keep guides aligned with shipped behavior, not aspirational features; do not mark work done while docs are stale. Verify the changed reference against code.
Never put agent-created scratch or intermediate files anywhere in a worktree,
including gitignored paths. Use /tmp for logs, merge scratch, screenshots,
and snapshots; .agent-memory/notes/ is the sole findings exception.
Graft context graph
For repo orientation, use the indexed graft/ graph before raw source search
when available. Use graft ask "<question>" --source for ranked code spans,
graft grep "<literal>" for exhaustive indexed matches,
graft skeleton <file> for an API surface, and graft callers <symbol>
for call edges; raw search is for unindexed files or missing results. Use the
equivalent graft MCP tools first when this harness exposes them. Refresh the
graph with graft build after large code changes.
Retry discipline
Never immediately repeat an identical failed command. Read the full error,
form a root-cause hypothesis, change one thing, then rerun a scoped command.
For cargo/mvmctl one-offs, mvm_run from scripts/dev-env.sh records a
failed-command fingerprint in .mvm-test/last-failed-cmd and refuses an
identical retry; clear it only after diagnosis. At three failures on one task,
record what failed, why, and the next single change in the failure journal
before another attempt. If the same hypothesis fails twice, change strategy.
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
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.

