

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# apps/daemon/AGENTS.md23Follow the root `AGENTS.md` and `apps/AGENTS.md` first. This file records daemon-specific code organization and editing rules.45## Role67`apps/daemon` is the local Express + SQLite daemon and owns:89- `/api/*` HTTP routes and SSE streams.10- The `od` CLI entrypoint in `src/cli.ts`.11- Project persistence, generated files, artifacts, media, skills, design systems, plugins, MCP, connector credentials, automation state, agent spawning, and static serving.12- The daemon sidecar entry under `sidecar/`.1314The daemon is not a shared library for the web app. Do not import daemon private `src/` modules from `apps/web`; shared web/daemon contracts belong in `packages/contracts`.1516## Source Layout1718- `src/server.ts` is the composition root: create process-wide services, build dependency objects, install middleware, and register route modules. Keep request/domain logic out of `server.ts` unless the route is genuinely bootstrap-wide.19- `src/cli.ts` is the CLI composition root: parse top-level commands, dispatch subcommands, and format process output. Keep substantial command implementation in domain modules or focused `*-cli.ts` helpers.20- `src/server-context.ts`, `src/route-context-contract.ts`, `src/route-registration-guard.ts`, and small root constants/startup helpers may stay at the top level because they describe daemon-wide wiring.21- `src/routes/` contains domain route registrars that were split out of `server.ts`. New daemon domain endpoints should normally land here.22- Legacy route files still at `src/*-routes.ts` may remain until touched. When making meaningful changes in one, prefer moving it to `src/routes/<domain>.ts` if the move is small and mechanically safe.23- `src/http/` owns shared HTTP helpers, error/result adapters, origin checks, and route mounting utilities.24- `src/services/` owns reusable daemon services that are not tied to Express request/response objects.25- `src/runtimes/` owns agent runtime definitions, spawning, parser integration, executable discovery, and runtime environment shaping. Agent argument definitions belong in `src/runtimes/defs/`.26- `src/prompts/` owns daemon-side prompt construction. Keep mirrored BYOK/API wording in `packages/contracts/src/prompts/` when the same text is exposed outside the daemon.27- `src/plugins/`, `src/connectors/`, `src/registry/`, `src/research/`, `src/media-adapters/`, `src/live-artifacts/`, `src/storage/`, and `src/critique/` own their named domains. Prefer adding code inside the existing domain folder before creating a new top-level folder.28- Team resource storage is Vela-owned. Daemon adapters under `src/collab/vela-cli-*` must invoke Vela through `src/integrations/vela-command.ts`, which shares the login/agent binary resolver and environment. Do not add Resource Hub tokens, direct HTTP clients, or a second content-addressed drive implementation to Open Design. `od resource` is only a thin Vela CLI compatibility entry point.29- `tests/` contains daemon tests. Keep test paths roughly parallel to `src/` when useful.3031Do not edit generated `dist/` output.3233## Top-Level `src/` Hygiene3435Do not keep adding unrelated files directly under `src/`. The top level is currently crowded, so use these rules for new code and for touched legacy files:3637- New domain code belongs in a domain folder, not in `src/<feature>.ts`, unless it is a daemon-wide primitive.38- New route code belongs in `src/routes/` or an existing route subfolder such as `src/routes/plugins/`.39- New runtime or stream-parser code belongs in `src/runtimes/`, with runtime definitions in `src/runtimes/defs/`.40- New provider/integration client code belongs in the existing domain folder when one exists, or under `src/integrations/<provider>.ts` for provider-specific glue.41- New persistence/storage abstractions belong in `src/storage/` unless they are tightly coupled to the legacy SQLite facade in `src/db.ts`.42- New prompt construction belongs in `src/prompts/`.43- New plugin, connector, registry, research, media adapter, live-artifact, critique, metrics, logging, QA, or GenUI code belongs in the matching existing folder.44- New general-purpose helpers should be avoided. If a helper has a real owner, put it with that owner. If it is daemon-wide infrastructure, use a focused folder such as `src/http/`, `src/services/`, `src/storage/`, or `src/runtimes/` instead of creating another top-level utility file.4546When touching a legacy top-level file:4748- Prefer a small, safe move into an existing domain folder when imports are straightforward and the change is already about that domain.49- Do not mix a broad mechanical move with behavior changes unless the move is required to make the behavior change understandable.50- If a file is split, keep the public function names stable at call sites where possible and move tests with the behavior they cover.51- Use temporary root-level compatibility exports only when they materially reduce churn; remove them in the same PR if the diff stays small.5253Suggested ownership for common legacy top-level families:5455- `project-routes.ts`, `import-export-routes.ts`, `mcp-routes.ts` -> `src/routes/`. (Route modules already split out, such as `routes/chat.ts`, `routes/terminal.ts`, and `routes/social-share.ts`, are done; do not list them here.)56- `copilot-stream.ts`, `acp.ts`, `agents.ts`, `run-*`, `agent-*`, `*-diagnostics.ts` -> usually `src/runtimes/` or a future `src/runs/` folder, depending on ownership. (`claude-stream.ts`, `qoder-stream.ts`, `json-event-stream.ts`, and `runs.ts` already live under `src/runtimes/`.)57- `design-systems-cli-help.ts`, `tools-design-systems-cli.ts`, `claude-design-import.ts` when used only there -> `src/design-systems/`. (Core design-system modules, design tokens, `swift-colors.ts`, and `frontmatter.ts` are already under `src/design-systems/`.)58- `inline-assets.ts`, `lint-artifact.ts`, `pdf-export.ts`, `document-preview.ts`, `static-spa.ts` -> `src/artifacts/` or the existing artifact owner. (The `artifact-*` family already moved under `src/artifacts/`.)59- `memory*.ts`, `orbit*.ts`, `automation-*.ts`, `routines.ts`, `prompt-*`, `handoff-*`, `finalize-design.ts` -> keep with their domain; introduce folders when touching multiple related files.6061The `media-*` family has already moved into `src/media/`; no media modules remain at the top level.6263These are migration targets, not permission to do a large cleanup PR. Move only what helps the current change or removes active ambiguity.6465## Route Structure6667Route modules should follow this shape:6869```ts70import type { Express } from 'express';71import type { RouteDeps } from '../server-context.js';7273export interface RegisterExampleRoutesDeps extends RouteDeps<'http' | 'paths'> {74 example: ExampleService;75}7677export function registerExampleRoutes(app: Express, ctx: RegisterExampleRoutesDeps): void {78 // app.get/post/patch/delete(...)79}80```8182Guidelines:8384- Keep one exported registrar per domain, except where the existing file already has a small family of closely related registrars.85- Declare a narrow `Register*RoutesDeps` type. Pick only the `ServerContext` keys the route uses, and add explicit service interfaces for domain-specific dependencies.86- Add the registrar dependency type to `src/route-context-contract.ts` when it should be covered by the server context assertion.87- Register the route from the matching semantic section in `src/server.ts`.88- Use existing route helpers from `src/http/` when they fit. Do not invent another error envelope if a contract already exists.89- Keep parsing/validation near the route boundary and push reusable behavior into named helpers or services.90- Do not add new route handlers directly to `server.ts` unless they are bootstrap-wide process metadata such as health/version.9192## Dependency Boundaries9394- `src/server-context.ts` is the route dependency map. If a route needs a new cross-route dependency, add it there deliberately and keep its type narrow.95- Prefer explicit domain service interfaces in route files over `any` or `unknown`.96- Use types from the implementation module or `packages/contracts` instead of restating response shapes by hand.97- Keep `packages/contracts` pure. Do not move daemon-only Node, SQLite, Express, filesystem, or process types into contracts.98- Daemon data paths must follow the root **Daemon data directory contract**. Route all daemon-owned data through `RUNTIME_DATA_DIR` or constants derived from it.99100## CLI and Surface Parity101102User-facing capabilities must be reachable through both:103104- Web/API routes in the daemon.105- `od` CLI subcommands in `src/cli.ts`.106107When adding a user-facing capability, close the loop in one change: contract type, daemon route, web surface if applicable, and CLI command with `--json` plus `--prompt-file <path|->` for long prompts where relevant.108109## Runtime and Agent Changes110111- Parser changes belong beside the matching runtime stream helper and should include focused parser tests.112- Runtime definition changes belong in `src/runtimes/defs/`.113- For agent-stream/parser changes, replay a mock CLI trace from `mocks/` when practical instead of burning provider budget.114- Preserve Claude stream-json bookkeeping in `src/runtimes/claude-stream.ts` and `src/server.ts`; do not close stdin on `tool_use` stop reasons.115116## Tests117118- Tests belong under `apps/daemon/tests/`, not under `src/`.119- Use the cheapest layer that can observe the behavior: pure helper test, route-level Vitest with `startServer`, then broader integration only when necessary.120- For bug fixes, prefer a red spec that fails before the fix.121- If a test depends on native modules such as `better-sqlite3`, make sure local dependencies were built for the active Node version before blaming the code.122123## Commands124125Common daemon checks:126127```bash128pnpm --filter @open-design/daemon typecheck129pnpm --filter @open-design/daemon test130pnpm --filter @open-design/daemon build131```132133Focused tests from `apps/daemon`:134135```bash136pnpm exec vitest run -c vitest.config.ts tests/<file>.test.ts137```138139For local runtime validation, start through the repo control plane, not daemon package lifecycle aliases:140141```bash142pnpm tools-dev run web --daemon-port <port> --web-port <port>143```144145## Review Checklist146147Before handing off daemon changes, check:148149- Route logic is in a route module, not newly embedded in `server.ts`.150- New route deps are explicit and covered by `route-context-contract.ts` where appropriate.151- Shared DTOs or error shapes live in `packages/contracts` when the web or CLI consumes them.152- CLI parity is handled or explicitly not applicable.153- Daemon data paths derive from the resolved daemon data root.154- Tests are under `tests/` and relevant checks were run.155
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nexu-io/open-designpackages/AGENTS.md · 87k | AGENTS.md | archdependenciesmonorepo | 86/100 | 14 days ago | |
| nexu-io/open-designAGENTS.md · 87k | AGENTS.md | setupteststylearch+9 | 74/100 | 14 days ago | |
| nexu-io/open-designapps/daemon/src/critique/AGENTS.md · 87k | AGENTS.md | archtesting-strategymonorepo | 52/100 | 14 days ago | |
| nexu-io/open-designapps/packaged/AGENTS.md · 87k | AGENTS.md | monorepodo-not | 54/100 | 14 days ago | |
| nexu-io/open-designdesign-templates/AGENTS.md · 87k | AGENTS.md | apiui | 43/100 | 14 days ago | |
| nexu-io/open-designplugins/AGENTS.md · 87k | AGENTS.md | stylearchsecuritydo-not | 68/100 | 14 days ago | |
| nexu-io/open-designskills/AGENTS.md · 87k | AGENTS.md | no sections | 39/100 | 14 days ago | |
| nexu-io/open-designtools/AGENTS.md · 87k | AGENTS.md | testing-strategy | 82/100 | 14 days ago | |
| nexu-io/open-designtools/pack/AGENTS.md · 87k | AGENTS.md | styletesting-strategyperformancedeployment+1 | 85/100 | 14 days ago | |
| nexu-io/open-designtools/serve/AGENTS.md · 87k | AGENTS.md | testing-strategydo-not | 65/100 | 9 days ago | |
| nexu-io/open-design.github/AGENTS.md · 87k | AGENTS.md | stylearchgitapi+3 | 83/100 | 9 days ago | |
| nexu-io/open-designapps/landing-page/AGENTS.md · 87k | AGENTS.md | apideploymentmonorepo | 82/100 | 14 days ago | |
| nexu-io/open-designapps/web/src/components/Theater/AGENTS.md · 87k | AGENTS.md | testarchmonorepo | 72/100 | 14 days ago | |
| nexu-io/open-designapps/AGENTS.md · 87k | AGENTS.md | testarchmonorepo | 90/100 | 14 days ago | |
| nexu-io/open-designdesign-systems/_schema/AGENTS.md · 87k | AGENTS.md | archtesting-strategyapi | 58/100 | today | |
| nexu-io/open-designe2e/AGENTS.md · 87k | AGENTS.md | teststylearchtesting-strategy+3 | 93/100 | today |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/nexu-io-open-design-apps-daemon-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.