mcode
Copilot instructions8 starsChanged 8 months agoApache-2.0View on GitHub
Single-test examples:
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this copilot-instructions.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
- Very specific: line 61
When testing via MCP or app APIs, use a fresh dev instance started with npm run dev.
- Very specific: line 66
If you change agent support, check the full integration path: runtime adapter in src/main/session/agent-runtimes/*, session …
≈ “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 Instructions for mcode
Build, test, and lint commands
# Development
npm run dev
# Static checks
npm run typecheck
npm run lint
# Build
npm run build
npm run build:mac
npm run package
# Tests
npm test
npm run test:unit
# MCP / integration suites
# Start the dev app in one terminal first
npm run dev
# Then run the suite tests in another terminal
npm run test:mcpSingle-test examples:
# Single unit test file
npx vitest run --config vitest.unit.config.mts tests/unit/renderer/stores/session-store.test.ts
# Single unit test by name
npx vitest run --config vitest.unit.config.mts tests/unit/renderer/stores/session-store.test.ts -t "selectSession"
# Single MCP / integration test file
npx vitest run --config vitest.config.mts tests/suites/session-lifecycle.test.ts
# Single MCP / integration test by name
npx vitest run --config vitest.config.mts tests/suites/session-lifecycle.test.ts -t "creates a session"High-level architecture
src/main/index.tsis the composition root for the Electron main process. It wires together the PTY broker client,SessionManager,TaskQueue, git/file/search services, analytics trackers, hook server, updater, sleep blocker, and IPC registration.- Terminal/session execution is split from the Electron app itself. PTY lifecycle is managed through the broker layer in
src/main/pty/*, with the broker entry bundled fromsrc/broker/entry.ts, so sessions can survive app restarts. - Session orchestration lives under
src/main/session/.session-manager.tsis the central coordinator; agent-specific launch/resume behavior is implemented behind runtime adapters insrc/main/session/agent-runtimes/*. Session status and attention are driven by the state logic insession-state-machine.ts. - Hook-driven monitoring is a core part of the app, not an add-on.
src/main/hooks/hook-server.tsreceives agent hook events, while the bridge/config files insrc/main/hooks/*-hook-config.tsreconcile external CLI hook setup for Codex, Gemini, and Copilot. These events feed session state, task dispatch readiness, git refreshes, and token/input tracking. - The renderer is a React app organized around Zustand stores in
src/renderer/stores/*.src/renderer/App.tsxcomposes the shell, whilesrc/renderer/hooks/useAppInitialization.tshydrates sessions, layout, tasks, accounts, and hook runtime state from the main process on startup. - Main/renderer communication is intentionally typed. The preload bridge in
src/preload/index.tsexposeswindow.mcode.*, and channel/type definitions are centralized insrc/shared/ipc-contract*.ts. Renderer code should go through this bridge rather than importing Electron APIs directly. - UI layout has two distinct modes: tiling/kanban for agent sessions and a bottom terminal panel for terminal-style workflows. Layout state is persisted through the layout repository/store path rather than being owned by individual components.
- MCP automation is a first-class surface.
src/devtools/mcp-server.tsstarts the app’s MCP server and registers tool groups fromsrc/devtools/tools/*. The integration suites intests/suites/*talk to a running dev app through the MCP client intests/mcp-client.ts. - Repo-level MCP config lives in
.mcp.json. It points at the localmcode-devtoolsserver and includes Playwright MCP for browser/UI automation when a session needs to verify renderer behavior from the outside.
Key conventions
- Existing docs in
CLAUDE.md,GEMINI.md, andCONTRIBUTING.mdall reinforce the same pattern: if a feature is added, prefer exposing it through existing automation surfaces or new MCP-accessible capabilities so it can be verified by agents. - When testing via MCP or app APIs, use a fresh dev instance started with
npm run dev; do not rely on an already-running packaged app. The app explicitly isolates dev data from packaged data insrc/main/index.ts. - React components follow one-component-per-file with PascalCase filenames. Zustand stores use the
*-store.tssuffix. - Shared types/constants/contracts belong in
src/shared/, not duplicated acrossmainandrenderer. - Database schema conventions matter: SQLite migrations are numbered SQL files in
db/migrations/, and table names use plural snake_case. - Tailwind is configured through the Vite plugin and CSS
@themeusage; this repo does not use atailwind.config.*file. - If you change agent support, check the full integration path: runtime adapter in
src/main/session/agent-runtimes/*, session persistence/store code, hook bridge/config, typed APIs, and relevant tests in bothtests/unitandtests/suites. - Suite tests are intentionally sequential (
vitest.config.mtsdisables file parallelism), while unit tests usevitest.unit.config.mtsand run in parallel. Do not assume the two suites have the same runtime model.
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.

