Claude Adapter
This page documents the Claude-specific adapter built from packages/skills. It is not a standalone package anymore.
๐ฆ Package Overviewโ
- Source package:
packages/skills/ - Build script:
packages/skills/scripts/build-claude-adapter.js - Purpose: Package shared n8n instructions as a Claude Agent Skill
- Type: Generated distribution artifact, not a published npm package
- Source of truth:
AiContextGenerator.getSkillContent()
๐๏ธ Architectureโ
Source And Output Structureโ
packages/skills/
โโโ src/services/ai-context-generator.ts
โโโ scripts/build-claude-adapter.js
โโโ dist/adapters/claude/
โ โโโ n8n-architect/
โ โ โโโ SKILL.md
โ โ โโโ README.md
โ โโโ install.sh
โโโ package.json
Build Outputโ
packages/skills/dist/adapters/claude/
โโโ n8n-architect/
โ โโโ SKILL.md
โ โโโ README.md
โโโ install.sh
The build also mirrors SKILL.md into the repository plugin tree under plugins/claude/n8n-as-code/skills/n8n-architect/.
๐ง Developmentโ
Building the adapterโ
cd packages/skills
npm run build:adapters
This:
- Loads the compiled
AiContextGeneratorfromdist/ - Generates
SKILL.mdviagetSkillContent() - Writes the Claude distribution files into
dist/adapters/claude/ - Mirrors the skill into the plugin distribution tree
From the workspace root, the compatibility entrypoint is:
npm run build:claude-plugin
What is actually generatedโ
The builder writes:
packages/skills/dist/adapters/claude/n8n-architect/SKILL.mdpackages/skills/dist/adapters/claude/n8n-architect/README.mdpackages/skills/dist/adapters/claude/install.shplugins/claude/n8n-as-code/skills/n8n-architect/SKILL.md
There is no separate validate.js or hand-maintained template directory in the current implementation.
Local verificationโ
cd packages/skills
npm run build
npm run build:adapters
Then inspect the generated files in dist/adapters/claude/ and verify that SKILL.md contains the current shared guidance.
Testing Locallyโ
cd packages/skills
npm run build
npm run build:adapters
cd dist/adapters/claude
./install.sh
That installs n8n-architect into ~/.claude/skills/ for Claude Code. For hosted Claude flows, zip the generated n8n-architect/ directory.
๐ SKILL.md Formatโ
The generated file must follow Anthropic's skill format:
---
name: n8n-architect # lowercase, hyphens, max 64 chars
description: Expert assistant... # max 1024 chars, explains WHEN to use
---
# n8n Architect
## Instructions
[Markdown content with instructions for Claude]
## Examples
[Usage examples]
Content Guidelinesโ
DO:
- Reuse content from
AiContextGenerator.getSkillContent() - Use
npx n8nac skills(via then8nacunified CLI) - Provide concrete examples in bash code blocks
- Keep instructions imperative and clear
DON'T:
- Invent parameters or hallucinate capabilities
- Remove YAML frontmatter
- Use vague language
- Add commands not supported by
n8nac skills
๐ Content Consistencyโ
The adapter is derived from the same source used for agent context generation. In practice:
// packages/skills/src/services/ai-context-generator.ts
public getSkillContent(distTag?: string): string {
// Builds Claude skill content from shared command references and guidance
}
This keeps AGENTS.md and the Claude adapter aligned around the same workflow rules, command forms, and TypeScript examples.
๐ฆ Distributionโ
Repository distributionโ
The generated adapter lives in the repository output tree and plugin tree. It can be zipped for Claude-compatible distribution, but it is not versioned as its own npm package.
Release relationshipโ
Changes to Claude instructions should usually be treated as changes to @n8n-as-code/skills, because that package owns the generator and build script.
๐งช Testing Checklistโ
Before releasing:
-
cd packages/skills && npm run buildsucceeds -
cd packages/skills && npm run build:adapterssucceeds - Generated
SKILL.mdhas valid YAML frontmatter - Test in Claude.ai (upload ZIP)
- Test in Claude Code (local install)
- Verify NPX commands execute correctly
- Confirm generated guidance still matches current
n8nac skillscommands
๐ง Scripts Referenceโ
cd packages/skills && npm run buildโ
Compiles the package and copies JSON assets into dist/assets/.
cd packages/skills && npm run build:adaptersโ
Generates the Claude adapter distribution files.
npm run build:claude-pluginโ
Workspace-level convenience script that builds the Skills package and its Claude adapter.
๐ Release Processโ
The adapter follows the Skills package lifecycle:
- Make changes to
packages/skills/src/services/ai-context-generator.tsorpackages/skills/scripts/build-claude-adapter.js - Commit with a conventional message so CI can infer the bump level
- Push to
nextfor prerelease validation - Merge
nextintomainand let the release PR apply the final version bump
๐ Key Dependenciesโ
- n8nac: The unified CLI that exposes
@n8n-as-code/skillscommands vianpx n8nac skills - @n8n-as-code/skills: Owns the shared generator and command surface
- Node.js: Required for build and NPX execution
๐ Common Issuesโ
Adapter content is staleโ
- Rebuild
packages/skillsbeforebuild:adapters - Check whether the source change was made in
AiContextGeneratorrather than a generated file
Generated files do not match the current CLIโ
- Verify the command examples still use
npx --yes n8nac skills - Check
packages/skills/tests/ai-context-generator.test.tsfor the expected canonical forms
Skill not recognized by Claudeโ
- Verify YAML
namefield matches reference - Check
descriptionexplains WHEN to use - Ensure SKILL.md is in root of distribution folder
๐ Referencesโ
๐ค Contributingโ
To improve this package:
- Understand the Claude Agent Skills spec
- Edit the shared generator in
packages/skills/src/services/ai-context-generator.ts - Run
cd packages/skills && npm run build && npm run build:adapters - Test in Claude.ai or Claude Code
- Commit with a conventional message and submit PR
See Contribution Guide for general guidelines.