agentleFS
rorerore/minimap/AGENTS.md

minimap

AGENTS.md3 starsChanged 12 days agoMITView on GitHub

This repo dogfoods the packaged minimap app. Minimap exposes two capabilities, each shipped as a self-contained skill with its own bundled runtime and lifecycle scripts: All server interaction goes through scripts in <skill>/scripts/: When a user service is installed, these scripts manage its stable runtime. Restart does not deploy checkout or skill changes: run node <new-skill>/scripts/service.mjs update explicitly to deploy that skill's bundled runtime. Copying a skill refreshes its files, including its bundled runtime, without deploying them to the service.…

  • 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 31,542 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 repository2 other files it gives its agents.

The file

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

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    All server interaction goes through scripts in <skill>/scripts/:

    line 10
  2. Very specific:

    Spec subsystem extension: add new render functions to ui/spec/render.js and new composer/form functions to ui/spec/composer.js.

    line 87

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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

This repo dogfoods the packaged minimap app. Minimap exposes two capabilities, each shipped as a self-contained skill with its own bundled runtime and lifecycle scripts:

  • For roadmap planning, roadmap file updates, and pickup, resume, investigation, testing, or completion of assigned roadmap work in this repo, follow package/minimap/skills/minimap-roadmap/SKILL.md. Treat the roadmap files as canonical and keep behavior aligned with the minimap roadmap contract in package/minimap/CONTRACT.md.
  • For spec/design review on a specific file, follow package/minimap/skills/minimap-spec-review/SKILL.md. The skill works from any repo.

Server lifecycle — use the packaged scripts only

All server interaction goes through scripts in <skill>/scripts/:

  • start-server.cjs — start (or detect + reuse a running instance)
  • status.mjs — print status; exit 0 running, 1 stale, 3 not running
  • stop-server.mjs — graceful shutdown via POST /api/shutdown; cleans stale registry
  • restart-server.mjs — compose stop + start

When a user service is installed, these scripts manage its stable runtime. Restart does not deploy checkout or skill changes: run node <new-skill>/scripts/service.mjs update explicitly to deploy that skill's bundled runtime. Copying a skill refreshes its files, including its bundled runtime, without deploying them to the service. Refresh older skill copies before using managed lifecycle commands; they may reuse a compatible healthy service but do not understand service ownership. Service installation/update requires explicit environment-change approval; follow the migration guide.

The canonical start-server.cjs bootstrap defaults UV_THREADPOOL_SIZE to 8 only when absent, before importing the existing launcher in the same process. Restart applies the same default to its new child. Explicit overrides are retained; reused servers are unchanged. The legacy start-server.mjs entrypoint remains supported without this bootstrap default.

Do not curl the server directly, send signals to it (process.kill, taskkill), poke $MINIMAP_HOME/server.json by hand, or invoke node package/minimap/server.js directly. The scripts handle every state (running, stale registry, port busy, race with another launcher) and stay correct on Windows where signal-based stop is unreliable.

A single running server transparently serves both modes for any number of repos. The launchers detect an already-running instance via $MINIMAP_HOME/server.json + /health and reuse it.

Tri-tree sync

Top-level package/minimap/ is the source of truth. After any change to server, CLI, API, UI, or scripts, run:

node scripts/sync-mirrors.mjs

It rewrites both runtime trees (package/minimap/skills/minimap-roadmap/runtime/ and package/minimap/skills/minimap-spec-review/runtime/) from the top-level files. The unit test test/sync-mirrors.test.js runs the script and re-verifies byte-identity in CI; test/roadmap.test.js's portability test additionally guards against any runtime/ tree introducing install-time dependencies (skills install via copy, never npm install).

Do not hand-edit files under package/minimap/skills/*/runtime/ — they are derived. Edit the top-level copy and run the sync script.

Skill-doc drift check — after every behavior change

Behavior changes ship in code + tests, but the prose docs under package/minimap/skills/*/SKILL.md and package/minimap/skills/*/references/*.md describe that same behavior to agents. Tri-tree sync only handles runtime/ byte-identity; skill docs are not auto-synced and silently rot. Caught real drift twice in one session: the apply-cascade was widened from exact-quote to range-overlap (commit e0456c6) but references/http.md still claimed exact-quote; --json-stdin made the CLI multi-line-capable but references/http.md still framed CLI as "single-line text only."

Before declaring a behavior change done, grep the skill docs for the OLD behavior's keywords:

# After changing the cascade, anchor logic, status semantics, etc.:
grep -rn "<old-behavior-phrase>" package/minimap/skills/*/SKILL.md package/minimap/skills/*/references/

# Sanity sweeps that catch most drift:
grep -rn "exact quote\|same quote\|same old quote" package/minimap/skills/
grep -rn "single-line\|short.*--text\|--text-file\|--quote-file" package/minimap/skills/

If the grep finds anything, fix it in the same change set as the behavior. The drift is invisible until a future agent reads the doc and follows the wrong rule, which makes it the kind of bug that survives review (the doc lives in a different file than the code) but stings every agent reading the contract.

This applies to changes in: anchor cascades, comment/suggestion shapes, CLI flag semantics, HTTP route bodies/responses, error codes, server lifecycle. It does NOT apply to UI-only changes that don't reach the documented surface (DOM rendering, layout, etc.).

Frontend module map

ui/index.html loads app.js as a native ES module. App.js imports leaf modules directly; the static server serves whatever path the import asks for, so no bundler.

ModuleConcernDOM-touching?Tests
ui/api.jsSingle fetch wrapper + every HTTP endpoint as a typed-ish method (api.loadWorkspace, api.saveItem, etc.). Sets X-Minimap-Repo only on roadmap endpoints.Notest/ui-api.test.js
ui/state.jscreateState({ overrides }) returning { get, set, update, subscribe }. app.js aliases state = stateContainer.get() so existing direct mutation continues to work.Notest/ui-state.test.js
ui/markdown.jsHand-rolled markdown→HTML renderer. Pure string in / string out.Notest/ui-markdown.test.js
ui/filters.jsPure board filter / lens / group derivation. State-aware shims (itemMatchesCurrentFilters, getFilteredBoardItemIds, getVisibleBoardGroups) stay in app.js and delegate here.Notest/ui-filters.test.js
ui/spec/anchors.jsPure offset / text-mapping helpers (whitespace map, rendered selection → source quote, etc.). The state-aware wrappers live in app.js.Notest/ui-spec-anchors.test.js
ui/spec/render.jsSpec doc render, comment & suggestion cards, margin layout, anchor decoration, participants. Initialized via wireSpecRender({ dom, state, api, helpers }).YesPlaywright
ui/spec/composer.jsComment + suggestion form composer, selection-toolbar, anchor-mode UI, suggestion preview/apply/rollback callbacks. Initialized via wireSpecComposer({ dom, state, api, helpers }).YesPlaywright
ui/spec/index.jsSingle-call aggregator. Exports initSpec({ dom, state, api, helpers }) that wires render + composer in one shot. App.js imports leaf modules directly for everything else; only the wire call goes through here.NoCovered transitively
ui/app.jsRoadmap-side render, board edit / drag / drop, scope panel, item editor, route hash, setup view, top-level event wiring, init.YesPlaywright

DOM-touching modules are exercised end-to-end via Playwright (playwright/roadmap-ui.spec.js). Pure-logic modules have node --test units that run in milliseconds.

Backend module map

FileConcernTests
package/minimap/server.jsHTTP listener. handleApi dispatches via a routes table ([{method, pattern, handler}]) using matchRoute from src/router.js. Helpers withJsonBody and requireFileFromBody factor out body validation.test/roadmap.test.js, test/server-router.test.js
package/minimap/src/router.jsmatchRoute(routes, method, pathname) — pure, exported, unit-tested. Imported by both the test and server.js.test/server-router.test.js
package/minimap/src/roadmap.jsWorkspace parsing/serialization, board ↔ item logic, frontmatter handling, lens derivation. Pure-functional core.test/roadmap.test.js
package/minimap/src/sessions.jsSpec session storage (per-file JSONL files), comment + suggestion lifecycle, anchor resolution cascade, suggestion apply/rollback with writeAllOrNothing for atomic-ish multi-file writes.test/roadmap.test.js, test/sessions-atomic.test.js
package/minimap/src/server-registry.js$MINIMAP_HOME/server.json reader / writer.test/roadmap.test.js

UI conventions

  • Every void api.foo(...) call MUST be followed by .catch(...). Wrappers like persistGroupOrder / loadWorkspace / saveCurrentItem already do try { await api.foo() } catch (e) { setBanner(e.message, "error") } internally, so void persistGroupOrder() is fine — the wrapper has the catch. The lint test test/ui-lint-promises.test.js enforces this for bare api.* call sites.
  • Spec subsystem extension: add new render functions to ui/spec/render.js and new composer/form functions to ui/spec/composer.js. Use the captured DOM, STATE, API, HELPERS bindings rather than re-querying. New DOM elements need an entry in the dom: {...} object passed to initSpec in app.js.
<!-- agent-workflow:agents-section:start -->

agent-workflow

This repository uses agent-workflow with agent-redline risk classification.

PathWhat
agent-workflow.yamlPer-repo config. Edit cautiously.
agent-redline-policy.yamlPer-repo redline policy (zones, boundaries, checkpoints). Architecture-review required.
.agent-redline/suppressions.yamlSuppression markers for redline.
.agent-workflow/tasks/<slug>.mdOne Work Record per non-exempt task. Slug derives from branch name.
scripts/agent-workflow-check.pyCI checker; scripts/agent-workflow-runtime.py/.sh/.ps1 are runtime adapters.
<skill>/templates/checkpoints/Per-checkpoint reference docs.
docs/agent-redline/skills/Redline's per-checkpoint reference docs.
.claude/hooks/Claude Code hooks that keep the workflow engaged in plan mode (see below).
.codex/hooks.jsonCodex hooks for the seed and structured-mutation guard; project trust is required.
.opencode/plugins/agent-workflow.mjsStable OpenCode 1.x guard; OpenCode 2 beta unsupported.

Start: invoke /agent-workflow or the runtime's native command. If unavailable, read .claude/skills/agent-workflow/SKILL.md or .agents/skills/agent-workflow/SKILL.md.

Plan mode: for every non-exempt task, the plan's first implementation step must be "Invoke the /agent-workflow skill to create the Work Record and classify risk, before any code edit." Do that first on approval. The hook checks plans that touch configured hooks.guardedPaths (default src/) as supplemental enforcement; it is a nudge, not the applicability decision or CI gate.

Local check before pushing: POSIX: bash scripts/agent-workflow-runtime.sh codex check --repo-root . --slug <slug>. PowerShell: & scripts/agent-workflow-runtime.ps1 codex check --repo-root . --slug <slug>.

The adapter tries PYTHON, .venv, then platform fallbacks. Missing prerequisites block with guidance. Exit codes: 0 clean, 1 advisory, 2 blocking. CI posts it.

Native mutation coverage is version/surface/tool-specific: verified requires a denied operation with unchanged target; installation, trust, or a direct evaluator pass is insufficient. Record every other combination as degraded. Shell mutations bypass the guard; CI validates final artifacts/applicability, not pre-edit ordering or direct pushes. Evaluator failure returns deny; native prevention requires that evidence.

<!-- agent-workflow:agents-section:end -->

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.