morrislu-taipei/tigerai-n8n-skill-pack/code-to-workflow
Claude Code and agent skill by morrislu-taipei/tigerai-n8n-skill-pack
- community
Checking that the SKILL.md file is still in the repository.
Convert an existing program / system into an n8n workflow that preserves enterprise governance — login, audit, version control, handover, cross-system orchestration. Use when the user asks to "把這個程式 / 專案 / 系統移到 n8n", "Code2n8n this repo", "port this codebase to n8n", "convert this serverless function / web app / script into n8n", or anytime the input is a running codebase and the desired output is an n8n workflow plus the docs/validation that go with it.
Install
npx vskill@latest install morrislu-taipei/tigerai-n8n-skill-pack/code-to-workflowSKILL.md
Code2n8n — Code → n8n Workflow
The marquee Code2n8n skill. Input: an existing program or system (Python / TypeScript / Apps Script / Netlify Functions / Express / Flask / shell pipelines / Lambda). Output: an n8n workflow (or set of workflows) that performs the same behaviour, plus the SDD / FIELD-MAPPING / PROVENANCE / CREDITS / install docs that make it deployable, auditable, and handover-ready.
This skill encodes the methodology proven by the three case studies in this pack:
| Case | Upstream | What was ported | |
|---|---|---|---|
| `examples/google-workspace-admin-workflow/` | 1,373-line Google Apps Script | 7 n8n workflows (setup + 2 cores + 4 entries) + 11-subfolder Drive structure + 9-section Doc + dual Sheets with dropdowns + Calendar events + Gmail notify | |
| `examples/line-ai-customer-service/` | Netlify Functions + Supabase + React | core-message-router + entry-line + approach-C admin UI (4 admin workflows) | |
| `examples/line-ai-customer-service-onprem/` | Same system, but Docker on-prem | 37-node "dynamic-brain" workflow + Qdrant RAG + Ollama integration + 5-phase V&V |
Read at least one before using this skill — they are the empirical ground truth behind every step below.
Restricted Agent mode (Portal)
Check for the host marker[PORTAL-RESTRICTED-AGENT-MODE v1](system prompt or session context; rules in `spec/agent-restricted-mode.en.md`). No marker: this Skill applies as written. Marker present: the adjustments below override the steps they name. This text is only a hint; real enforcement is the host's tool allowlist, and the Skill's behavior here is "comply with the host's restrictions".
- Scope: the Agent only outputs workflow JSON (Layer 3 note and node
notesincluded). It does not write files, commit, push, import into n8n, or activate. Input is what the user pastes or what host read-only tools return (names per the host); do not clone or fetch on your own. - Step 1.5 (security audit): still runs as analysis. Put the findings in the Layer 3 note and the conversation; do not write a
SECURITY-CAVEATS.mdfile. - Step 5 (workflow design): unchanged, except credentials. Reference only names from the host's
credentialMap. NoSTUB-fake credentials and no invented names. A needed credential that is not in the map gets nocredentialsfield, and "Administrator must create: type=..., suggested name=..." goes into the nodenotesand the Layer 3 "Credentials to be added". - Step 6 (3-layer funnel): Layer 2 (local n8n REST import roundtrip,
_n8n_import_test.mjs) is not available; the Agent has no n8n access and no shell. Use the host's static check tool as the substitute, at most N rounds (set by the host), and say plainly that Layer 2 and Layer 3 are pending. The line "do not declare done until Layer 1 + 2 both pass" means here: do not claim done, passed, or ready; restate the host's result as it is. - Step 7 (documentation outputs) and hard rule 7: no document files are written;
activestaysfalse. Put the essentials (portability verdict, known gaps, credentials needed) in the Layer 3 note, and offer longer SDD-style text in the conversation only if the user asks. - Closing blocks: the security scan result is a faithful restatement of the host's check result, or "Security scan not run: <reason>".
When to trigger
| The user says... | Means trigger this skill | |
|---|---|---|
| "把這個 repo / 程式 / 系統移到 n8n" | ✅ | |
| "Code2n8n 一下" / "幫我做 Code2n8n" | ✅ | |
| "this codebase to n8n" / "port to n8n" | ✅ | |
| "把這個 serverless function 改寫成 workflow" | ✅ | |
| "我的 Python 腳本想丟給營運維護" | ✅ (means: turn it into n8n so non-engineers can manage it) | |
| "把這個 Lambda / Apps Script / Express app 視覺化" | ✅ | |
| "原生化" / "改成 n8n 原生 node" | ❌ — that's the sibling skill `n8n-code-to-native`, node-level refactor inside an existing workflow | |
| "幫我用便利貼描述需求然後產 workflow" | ❌ — that's `sticky-note-to-workflow`, starts from intent, not from code |
Hard rules
- Never strip the upstream license / attribution. Code2n8n is a derivative-work pattern. Always copy LICENSE, write a CREDITS.md, and record the attribution chain (upstream → derivative changes → this pack). The MIT case study (line-ai-customer-service-onprem) is the template.
- Scrub secrets before commit. Real API keys, JWTs, OAuth tokens, hard-coded passwords in
.env*/docker-compose.yml/config.*.json/ source code must be replaced with env-var placeholders. Do agrep -rn "sk-[a-zA-Z0-9]\{20,\}\|ghp_\|AIza\|password.*=.*[a-zA-Z0-9]\{8,\}"pass before staging. - Audit auth + injection before calling the port "enterprise-grade". Most AI-coded POCs ship with
/me-always-returns-true style auth stubs, plaintext passwords, missing middleware, and identifier-injection patterns (rawreq.bodykeys concatenated into SQL). The real-world example `line-ai-customer-service-onprem` has all of these — see its `SECURITY-CAVEATS.md`. If you find these and don't fix them, you MUST publish a SECURITY-CAVEATS.md (or equivalent), downgrade any "enterprise-ready" / "production" wording, and tell the reader exactly what to harden before deploying. Disclose, don't silently patch — silent patching misrepresents the case study and lets the next porter inherit the same blind spot. - Don't claim n8n can replace a UI. If the input has a React SPA / admin dashboard / interactive console, n8n cannot host that natively. Use the frontend portability decision tree (Step 4 below) and document the choice honestly in the SDD.
- Preserve fidelity. If the upstream has "10 default tasks" / "14 dropdown choices" / "5 reminder offsets", the port keeps those exactly — and
PROVENANCE.mdmaps each preserved item to the upstream line number, pinned to a specific commit SHA. - Always validate before declaring done. Run the 3-layer funnel (Step 6 below) — especially the local n8n REST import. Lint passing alone is not enough.
- Tag local imports. Any workflow imported into the user's local n8n must carry
[Claude YYYY-MM-DD]name prefix +claude-import-YYYY-MM-DDtag +active: false. See the memory noten8n-local-import-marking. - Security review is a real gate, not a caption. Run `n8n-security-governance` during Step 1.5. Record evidence, severity, status, owner, target version, and a PASS / CONDITIONAL / BLOCKED decision.
- Every release must be traceable and reversible. The reviewed workflow JSON, SDD, security artifacts, tests, Git commit SHA, workflow internal version, n8n release tag, and rollback target must describe the same release.
The 7-step methodology
Step 1 — Source inventory
Read the upstream repo and list:
| Inventory item | What to write down | |
|---|---|---|
| Entry points | webhook paths, cron schedules, CLI args, form submissions, queue consumers | |
| Side effects | DB writes, file IO, emails, push notifications, external API POSTs | |
| External calls | every fetch / request / SDK call (LINE / OpenAI / Gemini / Supabase / Slack / …) | |
| Data stores | DB schema tables + columns, Redis keys, S3 buckets, vector DBs | |
| UI vs backend | which files are HTML/JSX/SPA (UI), which are server-side (logic). UI does not port to n8n. | |
| Sensitive config | which env vars / secrets the app needs at runtime. Plan how to feed them to n8n. |
Step 1.5 — Security audit (mandatory before any "enterprise" claim)
Run `n8n-security-governance` for the full security, version-control, CI/CD, and rollback gate. Most AI-coded POCs ship with severe auth / injection holes that you MUST detect before you tell the user the port is deployable. Minimum checklist:
| Check | Where to look | How | |
|---|---|---|---|
Real auth on /me / session check | routes/auth.ts (or equivalent) | /me must verify a cookie / JWT, not return a constant authenticated: true | |
Middleware protecting /api/* data routes | server entry (index.ts, app.js) | Look for app.use('/api', requireAuth, …) — if absent, every data endpoint is open | |
| Password handling | login route + user table schema | bcrypt/argon2 hash required; plaintext is automatic fail | |
| Identifier injection | any Object.keys(req.body)+f => ${f}=$${i}`` pattern | Field NAMES from request body concatenated into SQL → injection. Use a whitelist of allowed columns | |
| Value injection | every query(SELECT … WHERE x = '${...}') | Even with parameterised values, look for string-interpolated identifiers (table / column names) | |
| CSRF on state-changing routes | POST / PATCH / DELETE handlers | Need CSRF token or SameSite=Strict cookies | |
| Rate limiting on login | /api/auth/login route | Should have express-rate-limit or similar | |
| Audit logging on settings / user-state writes | Look for an audit table or INSERT INTO audit_log | Absence is fine for POC; required for "enterprise" | |
| Secret exposure | GET /api/settings, n8n credential listing endpoints | Check whether the response body includes API keys / tokens. Should never return raw secrets | |
| File upload | multer / formidable configs | Auth required, MIME whitelist, size cap, scan, sanitise filename, isolated storage |
If any check fails and you do not fix it, you MUST publish a `SECURITY-CAVEATS.md`-style file in the example folder with: the file/line of each issue, repro instructions, the correct fix pattern, and a "DO NOT DEPLOY AS-IS" banner in the README. The on-prem LINE CS case in this pack is the template — read it before doing your own audit so you know what the artifact looks like.
If you do fix something the upstream had wrong, the patches must show up in your CREDITS.md as your contribution, separate from the upstream's design.
For a small repo (<2000 lines) this fits in one Python snippet:
Output: a markdown table that becomes the basis of docs/field-mapping.md.
Step 2 — Partition decision (the rubric)
For each piece of logic, decide one of three fates:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/tigerai/code-to-workflow/SKILL.md
Popularity
- Repository stars
- 80
- Repository forks
- 19
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/morrislu-taipei/tigerai-n8n-skill-pack/code-to-workflow)