Skills for Real Engineers. Straight from my .agents directory.
n8n-code-python
Agent skill fromczlonkowski/n8n-skills
Write Python in n8n Code nodes (native Python, `language` pythonNative, n8n 2.x). Use when the user explicitly wants Python in a Code node, when migrating old Pyodide/"Python (Beta)" code that used _input/_json/_node/_now, or when a Python Code node fails with NameError, "Security violations detected", "Import of standard library module … is disallowed", "__build_class__ not found", "A 'json' property isn't a dictionary", or "Python runner unavailable". Covers the only two variables (_items/_item), dict-only access, imports blocked by default, the sandbox's denied builtins, accepted return shapes, and how errors interact with onError. JavaScript is the default for Code nodes — native Python has no n8n helpers and, by default, no imports. EXCEPTION — for Python in the AI-agent-callable Custom Code Tool (@n8n/n8n-nodes-langchain.toolCode), use the n8n-code-tool skill instead (input is _query, return must be a string).
How to install n8n-code-python
npx skills add czlonkowski/n8n-skills# or add only this skill to Claude Code: copy the folder
skills/n8n-code-python/
# into
~/.claude/skills/n8n-code-python/ (all projects)
.claude/skills/n8n-code-python/ (one project)
1# Python Code Node (native)23Since n8n 2.0 the Code node's Python runs as **native Python in a task runner** (`language:4"pythonNative"`). The old Pyodide "Python (Beta)" is gone, and with it every n8n helper it had:5`_input`, `_json`, `_node`, `_now`, `_today` and `_jmespath` all raise `NameError` now. Code copied6from old templates, forum posts or older docs usually breaks on this.78---910## JavaScript first — stronger than before1112Native Python gives you two variables and plain Python, and **by default no imports**: no13`json`, `datetime` or `re`. Everything n8n-specific (`$('Node')`, `$jmespath`, Luxon,14`this.helpers.httpRequest`, static data) exists only in JavaScript. Use Python only when the user15explicitly asks for it. Even then, first check whether an expression, Edit Fields, or a native16node (Crypto, Date & Time, HTML, XML) does the job. See **n8n-code-javascript** and the transform17gatekeeper in **n8n-expression-syntax**.1819---2021## Quick start2223```python24# Run Once for All Items (default mode)25return [26 {"json": {"name": it["json"]["name"], "revenue": it["json"]["revenue"]}}27 for it in _items28 if it["json"].get("active")29]30```3132```python33# Run Once for Each Item34row = _item["json"]35return {"json": {**row, "name_upper": (row.get("name") or "").upper()}}36```3738Node config: `{"language": "pythonNative", "mode": "runOnceForAllItems" | "runOnceForEachItem",39"pythonCode": "..."}` on `n8n-nodes-base.code` typeVersion 2.4041---4243## The only inputs: `_items` and `_item`44…
Excerpt shown under the repository's MIT license.
More skills in n8n-skills
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
