Skip to main content

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-cli as 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:

  1. Runs validate.js to check SKILL.md format
  2. Runs build.js to generate dist/n8n-architect/
  3. 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 -y flag

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 -y flag 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:

  1. CI builds all packages including claude-skill
  2. dist/n8n-architect/ is created
  3. Manual step: Create ZIP and attach to GitHub Release

Via NPM (Future)โ€‹

Currently not published to NPM. If needed in the future:

  1. Remove "private": true from package.json
  2. Add to .github/workflows/release.yml
  3. Update files array in package.json

๐Ÿงช Testing Checklistโ€‹

Before releasing:

  • npm run validate passes
  • npm run build succeeds
  • 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:

  1. Make changes to templates/SKILL.md or build scripts
  2. Create changeset:
    npm run changeset
    # Select: @n8n-as-code/claude-skill
    # Choose version bump
  3. Commit: git add . && git commit
  4. 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:

RuleConstraint
Name lengthMax 64 chars
Name formatLowercase, hyphens only
Description lengthMax 1024 chars
Forbidden words in name"anthropic", "claude"
NPX flagMust 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 -y flag
  • Check bash shebang: #!/bin/bash
  • Ensure scripts are marked executable

Skill not recognized by Claudeโ€‹

  • Verify YAML name field matches reference
  • Check description explains WHEN to use
  • Ensure SKILL.md is in root of distribution folder

๐Ÿ“– Referencesโ€‹

๐Ÿค Contributingโ€‹

To improve this package:

  1. Understand the Claude Agent Skills spec
  2. Edit templates/SKILL.md following guidelines above
  3. Run npm run validate && npm run build
  4. Test in Claude.ai or Claude Code
  5. Create changeset and submit PR

See Contribution Guide for general guidelines.