noggin
Copilot instructions0 starsChanged 5 months agoMITView on GitHub
You're working on noggin — a working-memory tree tool for in-flight work. Read these before suggesting changes. - engine/ is the engine source of truth: the in-process API (noggin-api.mjs + .d.mts), the file/memory providers, the YAML/JSON serializers, the JSON schema, and the agent skill protocol (SKILL.md). Pure data model + verbs, no CLI or host knowledge. Also carries the canonical repo version in its package.json (propagated to every other manifest by scripts/bump-version.mjs). - cli/ is the noggin argv CLI —…
In this repositoryOne other file it gives its agents.
- nogginSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 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.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 125
After editing anything in engine/ or cli/, run node scripts/sync-skill.mjs before committing.
- Very specific: line 131
Prefer adding to engine/noggin-api.mjs (engine) or engine/providers/file.mjs (file provider) over duplicating logic in extension/src/.
- Very specific: line 135
Keep cli/noggin.mjs thin: argv parsing + output formatting only.
- Very specific: line 161
Don't introduce a closedAt field or anything similar.
- Very specific: line 213
Run node docs/site/build.mjs --out docs/site/dist locally.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
Copilot project instructions
You're working on noggin — a working-memory tree tool for in-flight work. Read these before suggesting changes.
Where things live
engine/is the engine source of truth: the in-process API (noggin-api.mjs+.d.mts), the file/memory providers, the YAML/JSON serializers, the JSON schema, and the agent skill protocol (SKILL.md). Pure data model + verbs, no CLI or host knowledge. Also carries the canonical repo version in itspackage.json(propagated to every other manifest byscripts/bump-version.mjs).cli/is thenogginargv CLI — a thin client of@noggin/engine, published asnoggin-clion npm. Containsnoggin.mjs,error-messages.mjs(CLI-flavored error catalog), and the CLI-flavoredREADME.md.mcp/is thenoggin-mcpstdio MCP server — another thin client of@noggin/engine, published asnoggin-mcpon npm. Containsnoggin-mcp.mjs, its ownerror-messages.mjs, and its ownREADME.md.extension/is the VS Code extension. ESM TypeScript host + React webview for the tree.plugin/is the agent-plugin distribution.desktop/is the Electron desktop app. As of Phase 4 of the noggin-rpc plan, the engine runs in the main process behind acreateNogginRpcServer; the renderer is a sandboxed browser bundle that drives verbs viaRemoteNoggin(@noggin/ui/remote) overElectronIpcTransport.BrowserWindowuses standard secure defaults (contextIsolation: true,nodeIntegration: false,sandbox: true). Three preload bridges:window.shell(legacy file dialogs),window.nogginRpcIpc('noggin-rpc'channel),window.modalIpc(separate channel for host.show* React modals).ui/is@noggin/ui— shared React components plus the@noggin/ui/remotesubpath which exports theRemoteNogginoptimistic adapter (Phase 3 of the noggin-rpc plan).plugin/skills/noggin/andextension/skills/noggin/are auto-synced flat copies ofengine/+cli/noggin.mjs+mcp/noggin-mcp.mjsplus a bundled MCP server. Don't edit them — editengine/,cli/, ormcp/and runnode scripts/sync-skill.mjs. Other consumers (desktop/,ui/) depend on@noggin/engineas a workspace package and have noskills/folder.
Architecture in one paragraph
The engine lives in engine/noggin-api.mjs: the Noggin class
(live document + in-process verb queue + file watcher +
onDidChange/onDidError events), pure applyX(doc, opts, ctx?)
verb functions over a NogginDocument, error types, and the
response envelope helpers (formatSuccess/formatError). The file
provider is engine/providers/file.mjs (fileNoggin(path, opts?):
Promise<Noggin>). YAML/JSON serializers are in
engine/serializers/{yaml,json}.mjs. cli/noggin.mjs is the thin
CLI that parses argv, imports @noggin/engine, opens a
fileNoggin, and calls verb methods. The extension hosts the engine
in process (via NogginHandle) for the command-palette commands,
the status bar, and the language-model tools; as of Phase 5 of the
noggin-rpc plan, the extension's webview drives a separate engine
instance behind a createNogginRpcServer over postMessage, and
mounts the same @noggin/ui React App the desktop renderer ships.
Both engine instances watch the same file:// and stay in sync via
the file provider's watcher. All verbs are async; per-Noggin
calls serialize through an internal Promise chain.
Conventions
- The engine + a provider is the only sanctioned way to read or
write a noggin. Don't
fs.readFilethe YAML directly. For raw document I/O without a liveNoggin, usecli/serializers/{yaml,json}.mjs. If you need behaviour the API doesn't expose, add it to the engine or the file provider. - Path syntax: absolute
/1/2/3, or relative./../-/+/./X/../X/-/X/+/X. Don't store paths long-term — use the opaquekeyinstead. - Item shape:
{ key, parentKey, title, done, createdAt, notes[] }. NoclosedAt— closing appends a system note{ timestamp, text: 'closed' }. The note's timestamp is the close time. Reopening withedit --opendoes NOT modify notes; the historical close stays in the log. - Two distinct versions:
SCHEMA_VERSIONversions the on-diskNogginDocument;RESPONSE_ENVELOPE_VERSIONversions the{ status, envelopeVersion, verb, data|error }wrapper used by CLI--jsonoutput and the extension's LM tools. They rev independently. - All
Nogginverb methods returnPromise. The CLI's main(), every cmdX handler, every extension call site needsawait. - The extension is fully ESM (
"type": "module",moduleResolution: "Node16"). All relative imports need explicit.jssuffixes (TS rewrites to runtime paths). - The React webview lives in
extension/src/webview/and is bundled by esbuild (extension/esbuild.mjs). The extension HOST is also bundled (out/extension.js) so it can inline@noggin/rpc+@noggin/engine(both source-only workspace packages);tscis used for typecheck only (--noEmit). React + react-dnd + react-arborist are devDependencies because esbuild inlines them into the bundle — they don't ship at runtime. - UI primitives (menus, dialogs, popovers, tooltips, comboboxes,
any other generic overlay/keyboard-managed widgets) use
@radix-ui/react-*. Do not hand-roll these and do not pull in a competing library (MUI, Chakra, Ant, Headless UI, etc.). The constraint is:@noggin/uimust not force consumers to install a theme provider, a CSS reset, or a style system (Tailwind, CSS-in-JS, etc.) — Radix is unstyled and provider-free, which preserves that. Domain widgets stay specialized (react-arboristfor the tree,@codemirror/*for the note editor); the Radix rule is for the generic primitives layer underneath them. - The engine's golden test suite (
engine/test/*.test.mjs) is the safety net for any refactor ofnoggin-api.mjs. Don't change behaviour without updating tests; don't change tests without thinking about whether you're locking in a bug.cli/test/*.test.mjsandmcp/test/*.test.mjsare just smoke tests for CLI / MCP bootstrap.
Project workflow
- Releases are continuous on push to main. Every push runs
.github/workflows/release-extension.ymlwhich auto-bumps the patch version and publishes to the Marketplace. - Override the bump with
[minor]or[major]in the commit message. - Skip the release entirely with
[skip release](use this for docs-only edits). - After editing anything in
engine/orcli/, runnode scripts/sync-skill.mjsbefore committing. CI rejects merges where the synced copies have drifted.
When suggesting code
- Prefer adding to
engine/noggin-api.mjs(engine) orengine/providers/file.mjs(file provider) over duplicating logic inextension/src/. If the extension wants something behavioural, it usually belongs in one of those. - Keep
cli/noggin.mjsthin: argv parsing + output formatting only. - New verbs require:
- Pure
applyX(doc, opts, ctx?)function innoggin-api.mjs(throwNogginErrorwith stablecode). - Async method on the
Nogginclass that wrapsapplyXvia_mutate/_maybeMutatefor the verb queue. - Type declarations in
noggin-api.d.mts(Promise-returning). - CLI dispatcher entry in
noggin.mjs(async cmdX + await on the noggin verb call). - Golden tests in
engine/test/(for the verb itself) and a CLI smoke test incli/test/if the argv mapping is non-trivial. - Documentation in
cli/README.mdand (if agent-relevant)engine/SKILL.md. - A page in
docs/site/generators/api.mjs'sPAGESmanifest. Verb options usually go on theVerb optionspage; the verb method itself is already reflected on theverbspage via theVerbsinterface. See "Documentation guardrails" below.
- Pure
- Any new public engine export (a
@publictype, function, class, or constant added toengine/noggin-api.d.mtsor a provider.d.mts) must be routed to a page in the API-reference tree. The docs site's build has a drift audit that fails if a public symbol isn't referenced by any page. See "Documentation guardrails" below for the checklist. - New extension UI gestures should call existing verbs through
NogginHandleandawaitthe result. Don't reach into the YAML or spawn the CLI. - Don't introduce a
closedAtfield or anything similar. Closure is recorded as a note. (We removedclosedAtdeliberately — seedocs/plans/2026-06-api-extraction.mdand the surrounding commits.)
Documentation guardrails
The docs site (docs/site/) has three drift-prevention mechanisms.
Understand them before touching the API reference:
- The API-reference tree is generated per-symbol.
docs/site/generators/api.mjsruns TypeDoc against the.d.mtsentry points listed indocs/site/typedoc.json, then splits the output into one page per exported symbol (or a tight cluster of related symbols) driven by thePAGESmanifest at the top of that file. Each entry maps{ slug, title, intro, symbols: [{module, name}] }to a rendered page underapi/. - Every group has a hand-authored overview. Group index pages
live under
docs/site/pages/api/<group>/index.mdand appear at the top of the group in the sidebar. When you add a new group inPAGES, also add its overview markdown file and its nav entry indocs/site/template.mjs. - The build audits drift.
buildApiPages()fails the whole docs build if a public engine symbol isn't referenced by any page inPAGES(orphaned symbol) or ifPAGESreferences a symbol TypeDoc didn't emit (ghost entry). The failure message names the symbol and the fix. Do not paper over drift by adding the symbol toEXPECTED_ORPHANS— prefer either routing it to a page or marking it@internalin the source.
When you add a public engine export
- Type / interface / class → add an entry to
PAGESunder the most-appropriate group. Small related types (e.g. all the verb options) share a page; substantial ones (a newNoggin-scale interface) get their own. - Function → same. Small related pure functions can share a
page (see
Path utilities,Document utilities). Standalone entry points (openNoggin,bindNogginVerbs) get their own page. - Constant → the
Constantspage unless it belongs with a specific type semantically. - New provider → add the
.d.mtstotypedoc.json, add the module name toMODULE_FILESinapi.mjs, add aMODULE_FALLBACK_SLUGSentry pointing at the narrativeproviders/<name>/page, and write the narrative page. Do NOT create per-symbol API pages for provider-specific symbols (openXNoggin,xProvider,OpenXOptions, ...); the narrative page owns them. - New group of pages under API/ → new PAGES entries + new
pages/api/<group>/index.mdoverview + new subgroup block intemplate.mjs'sNAVunder theAPItop-level group. - Run
node docs/site/build.mjs --out docs/site/distlocally. The drift audit will tell you what's missing.
When you rename / remove a public engine export
- The audit will flag the manifest entry as a ghost. Update or
remove the entry in
PAGES. - Grep the narrative markdown (
docs/site/pages/**/*.md) for the old name in case anything cross-refs it.
Other generated pages
The narrative sections stay in docs/site/pages/**/*.md — normal
markdown, no generator. Sources of truth for other generated pages
are listed in docs/site/README.md.
Documentation hierarchy
README.md— end-user landing.CONTRIBUTING.md— anything about working on noggin (build, test, release, architecture). When in doubt, this is where contributor-facing docs go.cli/README.md— user reference for the CLI binary surface (install, argv, exit codes). Verb/schema/JSON envelope reference lives inengine/README.md.engine/SKILL.md— what the LLM sees when invoking noggin. Behavioural protocol for chat agents.extension/README.md— shown as the Marketplace listing. Keep it user-facing; contributor stuff belongs inCONTRIBUTING.md.docs/plans/— historical design proposals, frozen at the time they were written. Don't update them when the code changes; they're snapshots.
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.

