RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/CLAUDE.md/n8n-io/n8n

CLAUDE.md

packages/frontend/editor-ui/src/app/stores/workflowDocument/CLAUDE.md
CLAUDE.md

Quality

58/100

Scores the file, not the repository.

Length

554 words

8 headings · 4 code blocks

Repository

199k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
n8n-io/n8n/packages/frontend/editor-ui/src/app/stores/workflowDocument/CLAUDE.mdRawGitHub
1# workflowDocument store — Agent Guidelines
2 
3## Core pattern: apply/public method split
4 
5Every composable in this folder follows a two-layer pattern:
6 
7**Public methods** (exposed) — represent user intent. Handle normalization,
8deduplication, and preparation. Call apply methods internally.
9 
10**Apply methods** (private) — the **only** functions that mutate refs. Each
11apply method writes to the ref and fires an event hook. Never expose apply
12methods from the composable.
13 
14```
15Component → publicMethod() → normalize → applyXxx() → ref + event hook
16```
17 
18This split exists to support CRDT in the future: local user actions,
19remote CRDT sync, and undo/redo all converge on the same private apply
20methods inside the composable.
21 
22## Event hooks
23 
24Every composable exposes change notifications via `createEventHook` from
25`@vueuse/core`. Event payloads must extend `ChangeEvent` from `./types.ts`:
26 
27```typescript
28import { createEventHook } from '@vueuse/core';
29import type { ChangeEvent, ChangeAction } from './types';
30 
31type MyChangeEvent = ChangeEvent<{ /* domain-specific fields */ }>;
32const onMyChange = createEventHook<MyChangeEvent>();
33```
34 
35- Fire `void onMyChange.trigger(...)` inside every apply method
36- Expose only the `.on` subscriber: `onMyChange: onMyChange.on`
37- Use `CHANGE_ACTION.ADD | UPDATE | DELETE` for the `action` field
38 
39## Reactivity invariant: events carry reactive references
40 
41When an apply method emits a node (or any tracked entity) in its event
42payload, the payload must contain the **reactive proxy** read back from the
43ref — NOT the raw input received by the apply method.
44 
45Vue creates proxies lazily on read from a reactive container. The raw object
46passed into the apply method and the proxy returned by `nodes.value[i]` share
47underlying state but are different JS references. Subscribers that store the
48raw reference lose reactivity on subsequent property mutations: property reads
49on the raw object create no dependencies, and downstream computeds never
50invalidate when the underlying node is mutated through its proxy.
51 
52Pattern — read back from the ref after the mutation, emit the proxy:
53 
54```typescript
55function applyAddNode(node: INodeUi) {
56 nodes.value.push(node);
57 const reactiveNode = nodes.value[nodes.value.length - 1]; // proxy
58 void onChange.trigger({
59 action: CHANGE_ACTION.ADD,
60 payload: { node: reactiveNode },
61 });
62}
63```
64 
65This invariant is locked by the `addNode emits the reactive proxy from
66nodes.value` test in `useWorkflowDocumentNodes.test.ts`. Any new apply method
67that emits a tracked entity must follow the same pattern and add an
68equivalent test.
69 
70## Adding a new composable — checklist
71 
721. Create event hook with typed payload extending `ChangeEvent`
732. Write private `apply*()` methods — each mutates the ref and fires the hook
743. Write public methods — normalize input, then call apply
754. Return: readonly refs, public methods, `onXxxChange: hook.on`
765. Never return apply methods
77 
78## Anti-patterns
79 
80| Don't | Do instead |
81|-------|------------|
82| Mutate refs outside apply methods | All ref writes go through apply |
83| Expose apply methods from composable | Keep them private (not in return) |
84| Use action objects / `onChange` router | Public methods call apply directly |
85| Use `dataPinningEventBus` or global event bus | Use scoped `createEventHook` |
86| Import global stores inside composable | Inject dependencies via function params |
87 
88## Dependency injection
89 
90Composables receive external dependencies as constructor params, not via
91global store imports. This keeps them testable and makes coupling explicit:
92 
93```typescript
94export function useWorkflowDocumentFoo(deps: {
95 getNodeByName: (name: string) => INodeUi | undefined;
96}) { ... }
97```
98 
99## Reference implementation
100 
101See `useWorkflowDocumentActive.ts` — the simplest complete example of the
102apply/public pattern with event hooks.
103 

Sections

  • workflowDocument store — Agent Guidelines
  • Core pattern: apply/public method split
  • Event hooks
  • Reactivity invariant: events carry reactive references
  • Adding a new composable — checklist
  • Anti-patterns
  • Dependency injection
  • Reference implementation

What it covers

code-styleagent-behaviour

Stack — with the evidence

typescript

(1.00)

langchain

(1.00)

turborepo

(1.00)

biome

(1.00)

node

(0.95)

supabase

(0.70)

postgres

(0.70)

vite

(0.70)

vitest

(0.70)

pytest

(0.70)

eslint

(0.70)

ruff

(0.70)

javascript

(0.60)

monorepo

(0.60)

pnpm

(0.60)

terraform

(0.60)

github-actions

(0.60)

python

(0.50)

Format

CLAUDE.md

Claude Code's memory file. Shaped like AGENTS.md but with two things it lacks: @path imports, so shared rules live in one place, and a user-scope layer that follows the developer across repos rather than shipping with the code.

What the corpus says about it

Repository

Owner
n8n-io
Language
—
License
—
Archived
no

All configs in this repo

Also in n8n-io/n8n

Diff this repo’s formats

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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
n8n-io/n8n.agents/skills/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16setuparchagent-behaviour58/1003 days ago
n8n-io/n8n.github/CLAUDE.md · 199kCLAUDE.mdtypescriptlangchain+17styleagent-behaviour48/1003 days ago
n8n-io/n8nAGENTS.md · 199kAGENTS.mdtypescriptlangchain+16setupbuildtestlint-format+896/1003 days ago
n8n-io/n8npackages/@n8n/ai-workflow-builder.ee/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16agent-behaviour53/1003 days ago
n8n-io/n8npackages/@n8n/db/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16database39/1003 days ago
n8n-io/n8npackages/@n8n/engine/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16archdo-not59/1003 days ago
n8n-io/n8npackages/@n8n/instance-ai/CLAUDE.md · 199kCLAUDE.mdtypescriptlangchain+16buildteststyletesting-strategy+189/1003 days ago
n8n-io/n8npackages/cli/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16lint-format55/1003 days ago
n8n-io/n8npackages/cli/src/modules/n8n-packages/CLAUDE.md · 199kCLAUDE.mdtypescriptlangchain+16stylearchdependenciesmonorepo+269/1003 days ago
n8n-io/n8npackages/frontend/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16style40/1003 days ago
n8n-io/n8npackages/nodes-base/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16teststylearchtypes+589/1003 days ago
n8n-io/n8npackages/testing/playwright/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+17setupbuildtestlint-format+896/1003 days ago
n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16buildteststylearch+3100/1003 days ago
n8n-io/n8nscripts/instance-seeding/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16setupstyledo-not65/1003 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/@n8n/instance-ai/CLAUDE.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/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.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
dotCMS/corecore-web/CLAUDE.md · 950CLAUDE.mdjavanode+13teststylearchtesting-strategy+3100/1003 days ago
Adit-Jain-srm/NightmareNetCLAUDE.md · 45CLAUDE.mdtypescriptpython+18buildtestlint-formatstyle+6100/1003 days ago
nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4kCLAUDE.mdtypescriptnode+16setupbuildstylearch+2100/1003 days ago
microsoft/playwrightCLAUDE.md · 94kCLAUDE.mdtypescriptjavascript+10buildtestlint-formatstyle+7100/1003 days ago
dotCMS/coreCLAUDE.md · 950CLAUDE.mdjavanode+9setupbuildteststyle+799/1003 days ago
lollipopkit/flutter_server_boxCLAUDE.md · 8.3kCLAUDE.mddartflutter+8buildteststylearch+298/1003 days ago
skillrecordings/egghead-nextCLAUDE.md · 1.4kCLAUDE.mdtypescriptnode+14setupbuildtestlint-format+897/1003 days ago
MetaMask/metamask-design-systemCLAUDE.md · 34CLAUDE.mdtypescriptnode+12buildtestlint-formatstyle+597/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack