โ—†PromptShop

N8n Conventions

This skill provides a quick reference guide to n8n's coding conventions, best practices, and architectural patterns.

Install

npx promptshop add n8n-conventions

Details

What This Skill Does

This skill provides a quick reference guide to n8n's coding conventions, best practices, and architectural patterns. It covers Type

Script, error handling, frontend development with Vue 3, backend structure, testing, database usage, and common commands. It's designed for n8n developers who need a fast reminder of critical rules and patterns.

When to Use

Quickly check Type

  • Script best practices.
  • Review error handling conventions.
  • Find frontend development guidelines.
  • Understand backend architecture.
  • Check testing procedures.
  • Find common commands.

Key Features

Type

Script best practices (any, satisfies).Error handling with Unexpected

Error. Vue 3 Composition A

PI guidelines. C

  • SS variable usage.
  • Backend Controller โ†’ Service โ†’ Repository pattern.
  • Testing with Vitest and Playwright.

Manual Installation

Manual installation

View Full Skill Content

The complete markdown content that gets installedn8n Quick Reference

๐Ÿ“š Full Documentation: General: /A

GENTS.md - Architecture, commands, workflows Frontend: /packages/frontend/A

GENTS.md - C

SS variables, timing

Use this skill when you need quick reminders on critical patterns.

Critical Rules (Must Follow)

Type

Script: Never any โ†’ use unknown Prefer satisfies over as (except tests) Shared types in @n8n/api-types

Error Handling: import { Unexpected

Error } from 'n8n-workflow'; throw new Unexpected

Error('message', { extra: { context } }); // D

ON'T use deprecated Application

Error

Frontend: Vue 3 Composition A

PI (</code>)</li>

<li>C

SS variables (never hardcode px) - see <code>/packages/frontend/A

GENTS.md</code></li>

<li>All text via i18n (<code>$t('key')</code>)</li> <li><code>data-testid</code> for E2E (single value, no spaces)</li> </ul> <p><strong>Backend:</strong></p> <ul><li>Controller โ†’ Service โ†’ Repository</li> <li>Dependency injection via <code>@n8n/di</code></li> <li>Config via <code>@n8n/config</code></li> <li>Zod schemas for validation</li> </ul> <p><strong>Testing:</strong></p> <ul><li>Vitest (unit), Playwright (E2E)</li> <li>Mock external dependencies</li> <li>Work from package directory: <code>pushd packages/cli && pnpm test</code></li> </ul> <p><strong>Database:</strong></p> <ul><li>S

QLite/Postgre

SQL only (app DB)</li>

<li>Exception: DB nodes (My

SQL Node, etc.) can use DB-specific features</li>

</ul> <p><strong>Commands:</strong></p> <pre><code class="language-bash">pnpm build &gt; build.log 2&gt;&amp;1 # Always redirect <p>pnpm typecheck # Before commit</p> <p>pnpm lint # Before commit</code></pre></p> <h2>Key Packages</h2> <p>| Package | Purpose |</p> <p>|---------|---------|</p> <p>| <code>packages/cli</code> | Backend A

PI |</p>

<p>| <code>packages/frontend/editor-ui</code> | Vue 3 frontend |</p> <p>| <code>packages/@n8n/api-types</code> | Shared types |</p> <p>| <code>packages/@n8n/db</code> | Type

ORM entities |</p>

<p>| <code>packages/workflow</code> | Core interfaces |</p> <h2>Common Patterns</h2> <p><strong>Pinia Store:</strong></p> <pre><code class="language-typescript">import { S

TORES } from '@n8n/stores';

<p>export const use

MyStore = define

Store(S

TORES.M

Y_STORE, () => {</p>

<p> const state = shallow

Ref([]);</p>

<p> return { state };</p> <p>});</code></pre></p> <p><strong>Vue Component:</strong></p> <pre><code class="language-vue">&lt;script setup lang=&quot;ts&quot;&gt; <p>type Props = { title: string };</p> <p>const props = define

Props<Props>();</p>

<p>&lt;/script&gt;</code></pre></p> <p><strong>Service:</strong></p> <pre><code class="language-typescript">import { Service } from '@n8n/di'; <p>import { Config } from '@n8n/config';</p> <p>@Service()</p> <p>export class My

Service {</p>

<p> constructor(private readonly config: Config) {}</p> <p>}</code></pre></p> <hr> <p>๐Ÿ“– <strong>Need more details?</strong> Read <code>/A

GENTS.md</code> and <code>/packages/frontend/A

  • GENTS.md</code></p></div></div></div></details></div><div class="sr-only" aria-hidden="true"><div class="max-w-none overflow-hidden"><div class="skill-content [&amp;_pre]:bg-muted [&amp;_code]:bg-muted [&amp;_hr]:border-border [&amp;_blockquote]:border-border [&amp;_blockquote]:text-muted-foreground [&amp;_a]:text-primary [&amp;_th]:border-border [&amp;_th]:bg-muted [&amp;_td]:border-border [&amp;_a]:text-sm [&amp;_a]:underline [&amp;_blockquote]:border-l-4 [&amp;_blockquote]:pl-4 [&amp;_blockquote]:text-sm [&amp;_blockquote]:italic [&amp;_code]:break-all [&amp;_code]:rounded [&amp;_code]:px-1.5 [&amp;_code]:py-0.5 [&amp;_code]:text-xs [&amp;_h1]:mb-4 [&amp;_h1]:text-2xl [&amp;_h1]:font-semibold [&amp;_h2]:mb-3 [&amp;_h2]:mt-8 [&amp;_h2]:text-xl [&amp;_h2]:font-semibold [&amp;_h3]:mb-2 [&amp;_h3]:mt-6 [&amp;_h3]:text-lg [&amp;_h3]:font-medium [&amp;_hr]:my-6 [&amp;_li]:mb-1 [&amp;_ol]:mb-3 [&amp;_ol]:list-decimal [&amp;_ol]:pl-6 [&amp;_ol]:text-sm [&amp;_p]:mb-3 [&amp;_p]:text-sm [&amp;_p]:leading-relaxed [&amp;_pre]:mb-4 [&amp;_pre]:max-w-full [&amp;_pre]:overflow-x-auto [&amp;_pre]:rounded-lg [&amp;_pre]:p-4 [&amp;_pre]:text-xs [&amp;_pre_code]:break-normal [&amp;_pre_code]:bg-transparent [&amp;_pre_code]:p-0 [&amp;_strong]:font-semibold [&amp;_table]:w-full [&amp;_table]:border-collapse [&amp;_table]:text-sm [&amp;_td]:border [&amp;_td]:px-3 [&amp;_td]:py-2 [&amp;_th]:border [&amp;_th]:px-3 [&amp;_th]:py-2 [&amp;_th]:text-left [&amp;_ul]:mb-3 [&amp;_ul]:list-disc [&amp;_ul]:pl-6 [&amp;_ul]:text-sm"><h1>n8n Quick Reference</h1>.
<p><strong>๐Ÿ“š Full Documentation:</strong></p> <ul><li><strong>General:</strong> <code>/A

GENTS.md</code> - Architecture, commands, workflows</li>

<li><strong>Frontend:</strong> <code>/packages/frontend/A

GENTS.md</code> - C

SS variables, timing</li>

</ul> <p>Use this skill when you need quick reminders on critical patterns.</p> <h2>Critical Rules (Must Follow)</h2> <p><strong>Type

Script:</strong></p>

<ul><li>Never <code>any</code> โ†’ use <code>unknown</code></li> <li>Prefer <code>satisfies</code> over <code>as</code> (except tests)</li> <li>Shared types in <code>@n8n/api-types</code></li> </ul> <p><strong>Error Handling:</strong></p> <pre><code class="language-typescript">import { Unexpected

Error } from 'n8n-workflow';

<p>throw new Unexpected

Error('message', { extra: { context } });</p>

<p>// D

ON'T use deprecated Application

Error</code></pre></p>

<p><strong>Frontend:</strong></p> <ul><li>Vue 3 Composition A

PI (<code><script setup lang="ts"></code>)</li>

<li>C

SS variables (never hardcode px) - see <code>/packages/frontend/A

GENTS.md</code></li>

<li>All text via i18n (<code>$t('key')</code>)</li> <li><code>data-testid</code> for E2E (single value, no spaces)</li> </ul> <p><strong>Backend:</strong></p> <ul><li>Controller โ†’ Service โ†’ Repository</li> <li>Dependency injection via <code>@n8n/di</code></li> <li>Config via <code>@n8n/config</code></li> <li>Zod schemas for validation</li> </ul> <p><strong>Testing:</strong></p> <ul><li>Vitest (unit), Playwright (E2E)</li> <li>Mock external dependencies</li> <li>Work from package directory: <code>pushd packages/cli && pnpm test</code></li> </ul> <p><strong>Database:</strong></p> <ul><li>S

QLite/Postgre

SQL only (app DB)</li>

<li>Exception: DB nodes (My

SQL Node, etc.) can use DB-specific features</li>

</ul> <p><strong>Commands:</strong></p> <pre><code class="language-bash">pnpm build &gt; build.log 2&gt;&amp;1 # Always redirect <p>pnpm typecheck # Before commit</p> <p>pnpm lint # Before commit</code></pre></p> <h2>Key Packages</h2> <p>| Package | Purpose |</p> <p>|---------|---------|</p> <p>| <code>packages/cli</code> | Backend A

PI |</p>

<p>| <code>packages/frontend/editor-ui</code> | Vue 3 frontend |</p> <p>| <code>packages/@n8n/api-types</code> | Shared types |</p> <p>| <code>packages/@n8n/db</code> | Type

ORM entities |</p>

<p>| <code>packages/workflow</code> | Core interfaces |</p> <h2>Common Patterns</h2> <p><strong>Pinia Store:</strong></p> <pre><code class="language-typescript">import { S

TORES } from '@n8n/stores';

<p>export const use

MyStore =