Claude Skill Package
Internal documentation for @n8n-as-code/claude-skill - the Claude Agent Skill for n8n workflow development.
๐ฆ Package Overviewโ
- Location:
packages/claude-skill/ - Purpose: Package
@n8n-as-code/agent-clias a Claude Agent Skill - Type: Distribution package (not published to NPM, distributed as ZIP)
- Dependencies:
@n8n-as-code/agent-cli
๐๏ธ Architectureโ
Package Structureโ
packages/claude-skill/
โโโ package.json # NPM metadata with build/validate scripts
โโโ build.js # Generates dist/n8n-architect/
โโโ validate.js # Validates SKILL.md format
โโโ templates/ # Source files
โ โโโ SKILL.md # Main skill file (CRITICAL)
โ โโโ scripts/
โ โโโ n8n-search.sh # Wrapper for agent-cli search
โ โโโ n8n-get.sh # Wrapper for agent-cli get
โ โโโ n8n-list.sh # Wrapper for agent-cli list
โโโ README.md # User-facing documentation
โโโ CHANGELOG.md # Version history
Build Outputโ
dist/
โโโ n8n-architect/ # Ready-to-distribute skill
โ โโโ SKILL.md
โ โโโ README.md
โ โโโ scripts/
โโโ install.sh # Helper script for local install
๐ง Developmentโ
Building the Skillโ
cd packages/claude-skill
npm run build
This:
- Runs
validate.jsto check SKILL.md format - Runs
build.jsto generatedist/n8n-architect/ - Copies templates and generates installation files
Validating SKILL.mdโ
npm run validate
Checks:
- โ Valid YAML frontmatter
- โ
Required fields:
name,description - โ Field constraints (max lengths, format)
- โ No forbidden content (XML tags)
- โ
Bash commands use
npx -yflag
Testing Locallyโ
npm run build
cd dist
./install.sh # Installs to ~/.claude/skills/
Then test in Claude Code or create ZIP for Claude.ai.
๐ SKILL.md Formatโ
The core file must follow Anthropic's specification:
---
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.getAgentsContent() - Use
npx -y @n8n-as-code/agent-cli(the-yflag is critical) - 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 in
@n8n-as-code/agent-cli
๐ Content Consistencyโ
The skill reuses content from agent-cli's AiContextGenerator:
// packages/agent-cli/src/services/ai-context-generator.ts
private getAgentsContent(n8nVersion: string): string {
return [
`## ๐ญ Role: Expert n8n Engineer`,
`You manage n8n workflows as **clean, version-controlled JSON**.`,
// ... same content used in SKILL.md
].join('\n');
}
This ensures AGENTS.md (for Cursor/Windsurf) and SKILL.md (for Claude) stay synchronized.
๐ฆ Distributionโ
Via GitHub Releasesโ
When a changeset is merged:
- CI builds all packages including
claude-skill dist/n8n-architect/is created- Manual step: Create ZIP and attach to GitHub Release
Via NPM (Future)โ
Currently not published to NPM. If needed in the future:
- Remove
"private": truefrom package.json - Add to
.github/workflows/release.yml - Update
filesarray in package.json
๐งช Testing Checklistโ
Before releasing:
-
npm run validatepasses -
npm run buildsucceeds - SKILL.md has valid YAML frontmatter
- Test in Claude.ai (upload ZIP)
- Test in Claude Code (local install)
- Verify NPX commands execute correctly
- Check that Claude follows instructions
- Test example prompts work
๐ง Scripts Referenceโ
npm run buildโ
Generates distributable package in dist/n8n-architect/
npm run validateโ
Validates SKILL.md format and content
npm run cleanโ
Removes dist/ directory
๐ Release Processโ
This package follows the monorepo's Changeset workflow:
- Make changes to
templates/SKILL.mdor build scripts - Create changeset:
npm run changeset
# Select: @n8n-as-code/claude-skill
# Choose version bump - Commit:
git add . && git commit - CI handles: Version bump, build, and release creation
๐ Key Dependenciesโ
- @n8n-as-code/agent-cli: Provides the CLI commands executed by the skill
- Node.js: Required for NPX execution
- Bash: Scripts are bash-based
๐ Validation Rulesโ
Implemented in validate.js:
| Rule | Constraint |
|---|---|
| Name length | Max 64 chars |
| Name format | Lowercase, hyphens only |
| Description length | Max 1024 chars |
| Forbidden words in name | "anthropic", "claude" |
| NPX flag | Must use -y to avoid prompts |
๐ Common Issuesโ
Build fails with "Invalid YAML"โ
- Check YAML frontmatter syntax
- Ensure proper indentation
- No tabs, only spaces
Scripts don't execute in Claudeโ
- Verify scripts use
npx -yflag - Check bash shebang:
#!/bin/bash - Ensure scripts are marked executable
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
templates/SKILL.mdfollowing guidelines above - Run
npm run validate && npm run build - Test in Claude.ai or Claude Code
- Create changeset and submit PR
See Contribution Guide for general guidelines.