argos
AGENTS.md3 starsChanged 2 months agoApache-2.0View on GitHub
Use the fff MCP tools for all file search operations instead of default tools. The UI is extracted from the desktop shell (CodeNomad-style): the desktop app is an Electron shell that loads its UI over HTTP from the local daemon, and @argos/ui is a standalone, reusable web package. For agent-driven development with long-running Vite/Electron processes, follow these patterns: Never run dev servers in the foreground. Use background processes with log capture: Two readiness states matter: 1. Vite renderer ready: Poll…
- Reads credentials
- Commits and pushes
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,774 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 repository28 other files it gives its agents.
- .agents/skills/vercel-composition-patterns/AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- argos-data-importSkill
- argos-releaseSkill
- argos-sddSkill
- awwwards-animationsSkill
- baseline-uiSkill
- bun-file-ioSkill
- design-taste-frontendSkill
- fork-syncSkill
- pi-updateSkill
- react-doctorSkill
- shadcnSkill
- tanstack-formSkill
- tanstack-pacerSkill
- tanstack-querySkill
- tanstack-rangerSkill
- tanstack-routerSkill
- tanstack-storeSkill
- tanstack-tableSkill
- tanstack-virtualSkill
- turborepoSkill
- vercel-composition-patternsSkill
- vercel-react-best-practicesSkill
- vgpuSkill
- viteSkill
- web-design-guidelinesSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
18 rules. About 0 are common, 9 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Use the fff MCP tools for all file search operations instead of default tools.
- Very specific: line 27
After completing a feature, always run bun run format and bun run lint.
- Very specific: line 28
Test: bun test, test:main, test:renderer, test:coverage, test:watch, test:ui.
- Distinctive: line 37
Never run dev servers in the foreground.
- Distinctive: line 58
Electron process launched: Check logs for errors
- Distinctive: line 69
Never run dev servers in the foreground
- Distinctive: line 70
Never assume a long-running dev command is stuck.
- Very specific: line 71
Use --filter with Turbo to avoid running all dev servers at once
- Distinctive: line 72
Check logs before assuming failure
- Very specific: line 92
All renderer↔main communication uses the typed route/client pattern.
- Very specific: line 105
Add to ARGOS_ROUTE_CATALOG in packages/shared-contracts/src/routes.ts
- Very specific: line 107
Create or extend packages/ui/api/<Domain>Client.ts
- Distinctive: line 108
Use the client from UI business code
- Very specific: line 134
Test aliases match Vite aliases: # → UI src, #api → UI api, @argos/shared → shared.
- Distinctive: line 153
Do not include AI co-authoring footers in commits.
- Very specific: line 155
Default PR base is master (this fork has a single integration branch.
- Distinctive: line 168
Follow the SDD methodology before changing code, tests, configuration, documentation, build scripts, or project structure.
- Very specific: line 173
Create one kebab-case folder per goal and keep spec.md, plan.md, and tasks.md together:
≈ “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.
Files
Repository Guidelines
Use the fff MCP tools for all file search operations instead of default tools.
Project Structure & Module Organization
The UI is extracted from the desktop shell (CodeNomad-style): the desktop app is an Electron shell that loads its UI over HTTP from the local daemon, and @argos/ui is a standalone, reusable web package.
apps/desktop/src/main/: Electron main process (the shell); presenters inpresenter/(Window/Tab/Thread/Mcp/Config/LLMProvider),eventbus.tsfor app events. Windows load UI routes from the local daemon vialib/daemonUi.ts(resolveUiUrl).apps/desktop/src/preload/: Secure IPC bridge (contextIsolation on). Typedwindow.argoshybrid bridge viacreateBridge.ts→packages/client-sdk(WebSocket→daemon for routes, IPC→main for native-only routes).packages/ui/(@argos/ui): the React 19 + TanStack Router frontend — built independently todist/, served by the daemon. App code insrc/(components/,stores,pages,lib); secondary rendererssettings/,floating/,splash/,browser-overlay/,web/. UI↔backend boundary inapi/(typed*Clientclasses over theArgosBridge).packages/ui/shadcn/: shadcn/ui components shared across renderers.packages/shared-contracts/(@argos/shared-contracts): Shared route contracts (Zod-validated), event contracts, theArgosBridgeinterface, and theARGOS_ROUTE_CATALOG.packages/shared/(@argos/shared): Shared types and utilities (web-safe; no hard electron dependency).apps/daemon/(@argos/daemon): Backend server (Bun) that serves the@argos/uibuild over HTTP and exposes/api/v1/route+/api/v1/events.apps/desktop/test/(test/main,test/renderer) andpackages/ui: Vitest suites with setup files.scripts/: Build/signing/runtime installers, architecture guards, commit checks.- Build outputs/assets:
build/,resources/,out/,dist/.
Build, Test, and Development Commands
- Install:
bun install+bun run installRuntime(first time). - Dev:
bun run dev(HMR). Inspect:bun run dev:inspect; Linux:bun run dev:linux. - Preview:
bun run start. - Type check:
bun run typecheck(covers@argos/desktopand@argos/ui; ortypecheck:node/typecheck:web). Uses TypeScript 7 (tsc, the native Go-rewrite compiler). - Lint:
bun run lint(runsagent-cleanup-guard,architecture-guard, thenoxlint). - Format:
bun run format(oxfmt). Check:bun run format:check. - After completing a feature, always run
bun run formatandbun run lint. - Test:
bun test,test:main,test:renderer,test:coverage,test:watch,test:ui. - Build:
bun run buildthenbuild:win|mac|linux(add:x64|:arm64).
Turborepo + Vite + Electron Development
For agent-driven development with long-running Vite/Electron processes, follow these patterns:
Agent Dev Workflow
Never run dev servers in the foreground. Use background processes with log capture:
# Start the dev command in background, redirect logs
bun run dev > /tmp/desktop-dev.log 2>&1 &
echo $! > /tmp/desktop-dev.pid
# Wait for Vite readiness (poll the @argos/ui dev server)
for i in {1..60}; do
curl -fsS http://127.0.0.1:5180 >/dev/null && break
sleep 1
done
# Inspect logs (never assume a long-running command is stuck)
tail -n 200 /tmp/desktop-dev.logElectron Readiness Checks
Two readiness states matter:
- Vite renderer ready: Poll
http://127.0.0.1:5180(the@argos/uidev server; it proxies/api→ daemon) - Electron process launched: Check logs for errors
In dev, the desktop shell loads windows from the @argos/ui dev server when VITE_DEV_SERVER_URL is set; otherwise (and in packaged builds) it loads from the local daemon (http://127.0.0.1:<port>).
Stopping Dev Servers
kill $(cat /tmp/desktop-dev.pid)Key Rules
- Never run dev servers in the foreground
- Never assume a long-running dev command is stuck; Vite/Electron tasks are persistent by design
- Use
--filterwith Turbo to avoid running all dev servers at once - Check logs before assuming failure
Monorepo Packages
| Package | Path | Dev Command | Notes |
@argos/desktop | apps/desktop/ | bun run dev | Electron shell only (main + preload); loads UI from the daemon (Vite 8 + vite-plugin-electron + Rolldown) |
@argos/ui | packages/ui/ | bun run --filter @argos/ui dev | React 19 frontend; builds to dist/, served by the daemon (no electron dependency) |
@argos/daemon | apps/daemon/ | cd apps/daemon && bun run dev | Backend server (Bun); serves the UI + /api/v1/route + /api/v1/events |
@argos/backend-core | packages/backend-core/ | — | Shared backend logic |
@argos/acp-runtime | packages/acp-runtime/ | — | ACP runtime (process/session/registry, host-port injected) |
@argos/mcp-runtime | packages/mcp-runtime/ | — | MCP runtime (client/server/tools, host-port injected) |
@argos/skills-runtime | packages/skills-runtime/ | — | Skills runtime (discovery/install/metadata, host-port injected) |
@argos/client-sdk | packages/client-sdk/ | — | Client SDK (IPC bridge implementation) |
@argos/electron-adapter | packages/electron-adapter/ | — | Electron utilities |
@argos/shared-contracts | packages/shared-contracts/ | — | Shared types/contracts |
@argos/shared | packages/shared/ | — | Shared utilities |
Renderer-Main Architecture (Typed Route/Client Pattern)
All renderer↔main communication uses the typed route/client pattern. Direct window.electron/window.api access and legacy presenter hooks (usePresenter/useLegacyPresenter) are removed; the architecture guard fails on reintroduction.
How it works
- Route contracts (
packages/shared-contracts/src/routes/*.routes.ts): Zod-validated input/output schemas per operation. - Bridge (
packages/shared-contracts/src/bridge.ts):ArgosBridgeinterface withinvoke(routeName, input)andon(eventName, listener). - Preload (
apps/desktop/src/preload/createBridge.ts): Creates thewindow.argoshybrid bridge (IPC for native-only routes; WebSocket→daemon for the rest). - Typed Clients (
packages/ui/api/*Client.ts): Domain-specific clients (e.g.,ChatClient,ConfigClient,SessionClient) that wrapbridge.invoke(). - Runtime wrappers (
packages/ui/api/runtime.ts): Named helpers for clipboard, paths, external open — nowindow.apidirectly.
Adding a new renderer-main capability
- Define route in
packages/shared-contracts/src/routes/<domain>.routes.ts - Add to
ARGOS_ROUTE_CATALOGinpackages/shared-contracts/src/routes.ts - Register route handler in
apps/desktop/src/main/routes/(desktop) and/orapps/daemon/src/dispatch/(daemon) - Create or extend
packages/ui/api/<Domain>Client.ts - Use the client from UI business code
Renderer transport rules
- Business code (
packages/ui/src/**,packages/ui/settings/**) reaches main/daemon only through typed clients (packages/ui/api/*Client.ts) and runtime wrappers (packages/ui/api/runtime.ts). window.electron,window.api, rawipcRendererchannels, and legacy presenter hooks (usePresenter/useLegacyPresenter) are banned in renderer code; the architecture guard fails on reintroduction.
Architecture guards
bun run lint runs three guard scripts before oxlint:
scripts/architecture-guard.mjs: Prevents directwindow.electron/window.api/legacy-presenter access in renderer code, validates bridge register, tracks hot-path edges, and enforces thebun-file-iorule (Bun.file/Bun.write in Bun-runtime code;Bun.*forbidden in shared packages)scripts/agent-cleanup-guard.mjs: Prevents new code from importing legacy presenter directories or@argos/chatscripts/route-catalog-drift-guard.mjs: Keeps theARGOS_ROUTE_CATALOGand registered route handlers in sync
Coding Style & Naming Conventions
- TypeScript + React 19 + TanStack Router; TanStack Store for state; Tailwind CSS + shadcn/ui for styles.
- Oxfmt: double quotes, semicolons, width 120, trailing commas. Run
bun run format. - OxLint for JS/TS; hooks run
lint-stagedandtypecheck. - Names: React components PascalCase (
ChatInput.tsx); variables/functionscamelCase; types/classesPascalCase; constantsSCREAMING_SNAKE_CASE.
Testing Guidelines
- Daemon (
apps/daemon):bun test(Bun's built-in runner). Imports come frombun:test, which exports a vitest-compatibleviobject (novi.hoisted/vi.stubEnv/vi.stubGlobal— see thebun-file-ioskill for workarounds). Standalone e2e harnesses live astest/e2e-*.ts(not*.test.ts) sobun testdoes not discover them. - Desktop + UI: Vitest (+ jsdom for renderer, node for main) and React Testing Library.
- Two separate desktop configs:
vitest.config.ts(main, node env) andvitest.config.renderer.ts(renderer, jsdom env). - Location mirrors source under
test/main/**andtest/renderer/**(desktop). - Names:
*.test.ts/*.test.tsx/*.spec.ts. Coverage:bun run test:coverage. - Test aliases match Vite aliases:
#→ UI src,#api→ UI api,@argos/shared→ shared.
Path Aliases
Path aliases use the # prefix (Node subpath-imports style) for internal module references, and real workspace package names for cross-package references. This avoids colliding with npm scoped packages (@scope/name).
| Alias | @argos/desktop (main) resolves to | @argos/ui resolves to |
#/ | apps/desktop/src/main/ | packages/ui/src/ |
#api | — | packages/ui/api/ |
#shadcn | — | packages/ui/shadcn/ |
#settings | — | packages/ui/settings/ |
@argos/shared | packages/shared/ | packages/shared/ |
@argos/shared-contracts | packages/shared-contracts/ | packages/shared-contracts/ |
The #/ alias is context-sensitive: a custom Vite plugin (createPathAliasPlugin in each package's vite-plugins/path-alias.ts) resolves it to src/main/ for desktop main-process files and src/ for UI files. @argos/shared and @argos/shared-contracts are real workspace packages resolved via their exports maps (with tsconfig paths pointing at source for type checking).
Commit & Pull Request Guidelines
- Conventional commits enforced by hook:
type(scope): subject≤ 50 chars; types:feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release. - Do not include AI co-authoring footers in commits.
- PRs: clear description, link issues (
Closes #123), screenshots/GIFs for UI, pass lint/typecheck/tests. Keep changes focused. - Default PR base is
master(this fork has a single integration branch; there is nodev/main). Usegh pr create --base masterfor routine feature, bugfix, docs, test, and refactor branches. Releases are cut from short-livedrelease/<version>branches and landed onmasterfollowingdocs/release-flow.md. - UI changes: include BEFORE/AFTER ASCII layout blocks to communicate structure.
Architecture Notes & Security
- Patterns: Presenter pattern in main; EventBus for inter-process events; typed route contracts as renderer-main boundary; two-layer LLM provider (Agent Loop + Provider); integrated MCP tools.
- File I/O: Bun-runtime code (
apps/daemon/src, bun-runscripts/) usesBun.file/Bun.writefor reads/writes andnode:fsfor directory APIs. Electron main and sharedpackages/*usenode:fsonly —Bun.*is forbidden there. Enforced by thebun-file-iorule inbun run lint; see thebun-file-ioskill. - Secrets: use
.env(see.env.example); never commit keys. - Toolchains: Bun 1.4.0. Windows: enable Developer Mode for symlinks.
- Build: Vite 8 with Rolldown;
vite-plugin-electronmulti-env for main/preload/renderer. - Runtimes: uv and ripgrep seeds in
runtime/— installed viabun run installRuntime. Node, uv, and ripgrep resolve at runtime through the daemon's managed toolchain service (seedocs/features/managed-toolchains).
Specification-Driven Development
Follow the SDD methodology before changing code, tests, configuration, documentation, build scripts, or project structure. See docs/spec-driven-dev.md.
Pure release metadata work does not require SDD. Version bumps, CHANGELOG.md updates, release branch management, tags, and release PR preparation should follow docs/release-flow.md without creating
docs/features/*release* folders.
Create one kebab-case folder per goal and keep spec.md, plan.md, and tasks.md together:
docs/features/<goal>/for new features, user-visible capabilities, integrations, and tools.docs/issues/<goal>/for bug fixes, regressions, failing tests, CI failures, reliability issues, and prompt/runtime problems.docs/architecture/<goal>/for refactors, migrations, dependency boundaries, shared contracts, runtime architecture, and cross-module design.
Resolve every [NEEDS CLARIFICATION] item before implementation. Move completed or stale goal folders to docs/archives/<goal>/; delete documents that only describe removed code and have no reusable decision record.
Core principles: specification-first, architectural consistency, minimal complexity, compatibility/migration awareness.
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.

