Project Claude Code, Agent Skills, Hooks, Python
n8n Workflow Guard Skill Pack
A PreToolUse Bash hook that denies n8n import:workflow and API pushes until a validator clears the exported JSON of missing error workflows, inline secrets, and unlisted community nodes. Agent Skills hold the fix steps.
37
risky changes caught across 3 Git repositories
Live demo
Try to import a workflow.
Pick a sample export or paste your own n8n workflow JSON. This page runs the same three checks in your browser. Nothing is uploaded.
Press "Run import" to send the command through the hook.
Hook output (JSON)
No decision yet.
Checks
Three things an export must clear.
Missing error workflow
The export must name an error workflow in its settings, so failed runs reach the error handler.
Inline secrets
Tokens and keys typed straight into node parameters are rejected. They belong in n8n credentials.
Unlisted community nodes
Any node from outside n8n's own packages must be on the repository's allowlist.
How it works
A deny at the last safe moment.
- Claude Code is about to run a Bash command. The PreToolUse hook sees it first.
- If the command is an n8n import or an API push, the hook runs the validator on the exported workflow JSON.
- A clean export passes with no decision, so the normal permission flow applies. Any finding returns a deny with the reason.
- Claude reads the reason, opens the matching Agent Skill, applies the fix steps, and tries again.
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/n8n-guard.py"
}
]
}
]
}
}The same validator belongs in CI, where it covers changes made outside Claude Code.