CLAUDE.md
packages/@n8n/instance-ai/CLAUDE.mdCLAUDE.md
Quality
89/100
Scores the file, not the repository.Length
427 words
8 headings · 2 code blocksRepository
199k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# Instance AI — Development Guidelines23## Linear Tickets45- **Never set priority to Urgent (1)**. Use High (2) as the maximum.67## Engineering Standards89Follow `docs/ENGINEERING.md` for all implementation work. Key rules:1011- **No `any`, no `as` casts** — use discriminated unions, type guards, `satisfies`12- **Zod schemas are the source of truth** — infer types with `z.infer<>`, don't define types separately13- **Shared types in `@n8n/api-types`** — event types, API shapes, enums14- **Test behavior, not implementation** — test contracts, edge cases, observable outcomes15- **Tools are thin wrappers** — validate input, call service, return output. No business logic in tools.16- **Respect the layer boundaries** — Tool → Service interface → Adapter → n8n internals1718## Architecture1920Read these docs before starting any implementation:2122- `docs/architecture.md` — system diagram, deep agent pillars, package responsibilities23- `docs/streaming-protocol.md` — canonical event schema, SSE transport, replay rules24- `docs/tools.md` — tool reference, orchestration tools, domain tools, tool distribution25- `docs/memory.md` — memory tiers, scoping model, sub-agent memory26- `docs/filesystem-access.md` — filesystem architecture, gateway protocol, security model27- `docs/sandboxing.md` — Daytona/local sandbox providers, workspace lifecycle, builder loop28- `docs/configuration.md` — environment variables, minimal setup, storage, event bus2930## E2E Testing3132Tests live in `packages/testing/playwright/tests/e2e/instance-ai/`.3334### Local-build mode (no docker, no recording — hits real Anthropic API)3536```bash37cd packages/testing/playwright38export ANTHROPIC_API_KEY=sk-ant-...39pnpm test:local:instance-ai # full suite40pnpm test:local:instance-ai --grep "preview" # single test41```4243Each run gets a random port + throwaway DB — safe to run in parallel, never44touches `~/.n8n`. This mode does **not** record proxy expectations; it45bypasses the proxy stack entirely and calls Anthropic directly.4647### Recording expectations (docker required)4849To record (or re-record) proxy expectations for CI replay, run in container50mode with a real key. This captures LLM traffic + tool traces into51`expectations/instance-ai/<test-slug>/`:5253```bash54pnpm build:docker # from repo root — build the local n8n image first55cd packages/testing/playwright56ANTHROPIC_API_KEY=sk-ant-... pnpm test:container:sqlite tests/e2e/instance-ai --workers 157```5859Commit the regenerated `expectations/` files alongside the test.6061See `docs/e2e-tests.md` for the full recording/replay architecture.6263## Key Conventions6465- **Event schema**: `{ type, runId, agentId, payload? }` — defined in `streaming-protocol.md`66- **POST `/chat/:threadId`** returns `{ runId }` — not a stream67- **SSE `/events/:threadId`** delivers all events — replay via `Last-Event-ID` header or `?lastEventId` query param68- **Run lifecycle**: `run-start` (first) → events → `run-finish` (last, carries status)69- **Planned tasks**: `plan` tool for multi-step work; tasks run detached as background agents70- **Sub-agents**: stateless, native domain tools only, no MCP, no recursive delegation71- **Memory**: observational memory = thread-scoped, working memory is disabled72
Also in n8n-io/n8n
Diff this repo’s formatsOne 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 |
|---|---|---|---|---|---|
| n8n-io/n8n.agents/skills/AGENTS.md · 199k | AGENTS.md | setuparchagent-behaviour | 58/100 | 3 days ago | |
| n8n-io/n8n.github/CLAUDE.md · 199k | CLAUDE.md | styleagent-behaviour | 48/100 | 3 days ago | |
| n8n-io/n8nAGENTS.md · 199k | AGENTS.md | setupbuildtestlint-format+8 | 96/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/ai-workflow-builder.ee/AGENTS.md · 199k | AGENTS.md | agent-behaviour | 53/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/db/AGENTS.md · 199k | AGENTS.md | database | 39/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/engine/AGENTS.md · 199k | AGENTS.md | archdo-not | 59/100 | 3 days ago | |
| n8n-io/n8npackages/cli/AGENTS.md · 199k | AGENTS.md | lint-format | 55/100 | 3 days ago | |
| n8n-io/n8npackages/cli/src/modules/n8n-packages/CLAUDE.md · 199k | CLAUDE.md | stylearchdependenciesmonorepo+2 | 69/100 | 3 days ago | |
| n8n-io/n8npackages/frontend/AGENTS.md · 199k | AGENTS.md | style | 40/100 | 3 days ago | |
| n8n-io/n8npackages/frontend/editor-ui/src/app/stores/workflowDocument/CLAUDE.md · 199k | CLAUDE.md | styleagent-behaviour | 58/100 | 3 days ago | |
| n8n-io/n8npackages/nodes-base/AGENTS.md · 199k | AGENTS.md | teststylearchtypes+5 | 89/100 | 3 days ago | |
| n8n-io/n8npackages/testing/playwright/AGENTS.md · 199k | AGENTS.md | setupbuildtestlint-format+8 | 96/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| n8n-io/n8nscripts/instance-seeding/AGENTS.md · 199k | AGENTS.md | setupstyledo-not | 65/100 | 3 days ago |
Diff against .agents/skills/AGENTS.md Diff against .github/CLAUDE.md Diff against AGENTS.md Diff against packages/@n8n/ai-workflow-builder.ee/AGENTS.md Diff against packages/@n8n/db/AGENTS.md Diff against packages/@n8n/engine/AGENTS.md Diff against packages/cli/AGENTS.md Diff against packages/cli/src/modules/n8n-packages/CLAUDE.md Diff against packages/frontend/AGENTS.md Diff against packages/frontend/editor-ui/src/app/stores/workflowDocument/CLAUDE.md Diff against packages/nodes-base/AGENTS.md Diff against packages/testing/playwright/AGENTS.md Diff against packages/@n8n/agents/AGENTS.md Diff against scripts/instance-seeding/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotCMS/corecore-web/CLAUDE.md · 950 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 950 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | 3 days ago | |
| lollipopkit/flutter_server_boxCLAUDE.md · 8.3k | CLAUDE.md | buildteststylearch+2 | 98/100 | 3 days ago |
