⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
daily_hacker_news_digest
Fetch the top 10 Hacker News stories and send a daily email digest.
// RATINGS
// README
Requirements
- Node.js ≥ 20
- An OpenAI-compatible LLM API (OpenAI, Groq, OpenRouter, Ollama, etc.)
Install
Install from a clone of this repository (the package is not published to npm yet):
git clone https://github.com/just-claw-it/n8n-to-claw.git
cd n8n-to-claw
npm install
npm run build
Run the CLI:
node dist/cli/index.js convert workflow.json
Optional — install the n8n-to-claw command globally from the repo:
npm install -g .
n8n-to-claw convert workflow.json
Usage
From a local workflow JSON file:
n8n-to-claw convert workflow.json
From the n8n REST API:
n8n-to-claw convert \
--n8n-url https://my-n8n.example.com \
--api-key <n8n-api-key> \
--workflow-id <workflow-id>
Useful flags:
# Parse only — summarise nodes/warnings, skip LLM
n8n-to-claw convert workflow.json --dry-run
# Print full IR + prompt + known node list, then exit (no LLM call)
n8n-to-claw convert workflow.json --inspect
# Write a reproducible debug bundle (IR + prompts + LLM + validation traces)
n8n-to-claw convert workflow.json --debug-bundle
# Print LLM prompt + raw response + tsc output to stderr
n8n-to-claw convert workflow.json --verbose
# Override output directory
n8n-to-claw convert workflow.json --output-dir ~/my-skills
# Overwrite an existing skill output without prompting
n8n-to-claw convert workflow.json --force
# Print CLI version
n8n-to-claw --version
# Verify LLM_* and that the OpenAI-compatible endpoint is reachable (use before convert, especially local Ollama)
n8n-to-claw check-llm
Debug logging:
DEBUG=n8n-to-claw n8n-to-claw convert workflow.json
Debug bundle artifacts (--debug-bundle):
debug-bundle/meta.json— source, status, model/timeouts, retry historydebug-bundle/ir.json— normalized IR snapshot (raw payload stripped)debug-bundle/warnings.parse.json+warnings.transpile.jsondebug-bundle/prompt-attempt-<n>.txt+llm-response-attempt-<n>.txtdebug-bundle/validation-attempt-<n>.json
Environment variables
Required:
| Variable | Description |
|---|---|
LLM_BASE_URL | OpenAI-compatible API base URL (e.g. https://api.openai.com/v1) |
LLM_API_KEY | API key |
LLM_MODEL | Model name (e.g. gpt-4o, llama-3.3-70b-versatile on Groq, anthropic/claude-3.5-sonnet via OpenRouter) |
Optional:
| Variable | Default | Description |
|---|---|---|
LLM_TIMEOUT_MS | 60000 | Per-request LLM timeout in milliseconds |
LLM_MAX_RETRIES | 3 | Max retries on 429 rate-limit or 5xx errors |
LLM_MAX_TOKENS | 4096 | Max completion tokens per request; lower values can finish sooner on slow local models (Ollama) but may truncate output |
DEBUG | — | Set to n8n-to-claw to enable structured debug logging |
N8N_TO_CLAW_FORCE_LLM | — | If 1, skip deterministic templates and always call the LLM |
Copy .env.example to .env, fill in values, then source .env (or export the variables in your shell).
After setting LLM_*, run n8n-to-claw check-llm to confirm connectivity. That uses the same env as convert and fails fast with hints if the URL is wrong, Ollama is not running, or a remote agent cannot reach your machine’s localhost.
Example (OpenAI):
export LLM_BASE_URL=https://api.openai.com/v1
export LLM_API_KEY=sk-...
export LLM_MODEL=gpt-4o
Example (Groq / GroqCloud — not xAI Grok):
export LLM_BASE_URL=https://api.groq.com/openai/v1
export LLM_API_KEY=gsk_...
export LLM_MODEL=llama-3.3-70b-versatile
Example (local Ollama — transpile sends a large system prompt + workflow; an 8B CPU model can take many minutes per attempt. ollama run "ping" is not comparable workload.)
export LLM_BASE_URL=http://127.0.0.1:11434/v1
export LLM_API_KEY=ollama
export LLM_MODEL=llama3.1:8b
export LLM_TIMEOUT_MS=900000
# Optional: cap output length to reduce generation time (may truncate; retry may still help)
# export LLM_MAX_TOKENS=2048
Output
Skills are written to ~/.openclaw/workspace/skills/<workflow-name>/:
~/.openclaw/workspace/skills/my-workflow/
├── SKILL.md # OpenClaw skill descriptor
├── skill.ts # Node.js implementation
├── credentials.example.env # Generated if the workflow uses credentials
├── warnings.json # List of every degraded/stubbed node
└── skill-meta.json # Provenance: tool version, workflow fingerprint, transpile status
If the generated skill.ts fails TypeScript validation after two LLM attempts, the output goes to draft/ instead:
~/.openclaw/workspace/skills/my-workflow/
├── draft/
│ ├── SKILL.md
│ └── skill.ts # Fix TypeScript errors, then move up one level
├── warnings.json
└── skill-meta.json # Still at skill root (includes status: draft when applicable)
Model recommendation
Minimum: GPT-4o or Claude Sonnet tier.
Small Ollama models (7B–13B) will produce syntactically broken or logically incorrect skill.ts output. The tool will catch compilation errors and retry once with the error injected into the prompt, but logical correctness is not guaranteed even with large models — always review generated skills before using them.
Pipeline
┌─────────┐ ┌─────────────────┐ ┌───────────────────────┐ ┌─────────┐
│ Input │───▶│ Parse (IR) │───▶│ Transpile (LLM) │───▶│ Package │
│ file/ │ │ normalize n8n │ │ prompt → SKILL.md + │ │ write │
│ n8n API │ │ JSON to IR │ │ skill.ts → tsc check │ │ to disk │
└─────────┘ └─────────────────┘ └───────────────────────┘ └─────────┘
Graceful degradation
| Node situation | Behaviour |
|---|---|
| Unknown node type | Emits a stub with the original node JSON and a TODO comment |
| Credential references | Generates credentials.example.env with placeholder env var names |
| Webhook trigger | Maps to OpenClaw native webhook support |
Database node (postgres, mysql, etc.) | Attempts bash CLI fallback (psql, sqlite3); falls back to TODO stub |
n8n expression (={{ ... }}) | Annotated in generated code as requiring runtime resolution |
| Broken TypeScript (attempt 1) | Retries once with the compiler error injected into the prompt |
| Broken TypeScript (attempt 2) | Written to draft/ with a warning |
All degraded nodes are listed in warnings.json with name, type, and reason.
Node coverage
A generated dashboard lists every node type that appears in test-fixtures/, its resolved category, and whether it was mapped via EXACT_MAP, a prefix/suffix fallback, or unknown. Regenerate it with npm run coverage:nodes (requires a successful npm run build). After npm run build, you can refresh only the markdown with npm run coverage:nodes:write. CI fails if the committed file does not match a fresh regeneration.
**479 node t
// HOW IT'S BUILT
KEY FILES