@awesomate/hosting-mcp 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/index.js +204 -8
  2. package/package.json +2 -2
  3. package/skill/awesomate-app-builder/SKILL.md +5 -1
  4. package/skill/awesomate-credentials/SKILL.md +1 -1
  5. package/skill/awesomate-hosting/SKILL.md +50 -159
  6. package/skill/awesomate-hosting/references/connect-troubleshooting.md +77 -0
  7. package/skill/awesomate-hosting/references/multi-account.md +33 -0
  8. package/skill/awesomate-hosting/references/rest-fallback.md +30 -0
  9. package/skill/awesomate-hosting/scripts/bootstrap.mjs +27 -7
  10. package/skill/awesomate-n8n/SKILL.md +153 -147
  11. package/skill/awesomate-n8n/evals/ai-agent-build/graders/grader.md +31 -0
  12. package/skill/awesomate-n8n/evals/ai-agent-build/prompt.md +1 -0
  13. package/skill/awesomate-n8n/evals/build-form-email/graders/grader.md +30 -0
  14. package/skill/awesomate-n8n/evals/build-form-email/prompt.md +1 -0
  15. package/skill/awesomate-n8n/evals/datatable-dedupe/graders/grader.md +32 -0
  16. package/skill/awesomate-n8n/evals/datatable-dedupe/prompt.md +2 -0
  17. package/skill/awesomate-n8n/evals/diagnose-failure/graders/grader.md +27 -0
  18. package/skill/awesomate-n8n/evals/diagnose-failure/prompt.md +2 -0
  19. package/skill/awesomate-n8n/evals/essentials-upsell/graders/grader.md +27 -0
  20. package/skill/awesomate-n8n/evals/essentials-upsell/prompt.md +2 -0
  21. package/skill/awesomate-n8n/evals/live-change-promote/graders/grader.md +35 -0
  22. package/skill/awesomate-n8n/evals/live-change-promote/prompt.md +2 -0
  23. package/skill/awesomate-n8n/evals/possibilities-grounded/graders/grader.md +28 -0
  24. package/skill/awesomate-n8n/evals/possibilities-grounded/prompt.md +1 -0
  25. package/skill/awesomate-n8n/evals/validated-not-done/graders/grader.md +27 -0
  26. package/skill/awesomate-n8n/evals/validated-not-done/prompt.md +2 -0
  27. package/skill/awesomate-n8n/evals/vars-not-env/graders/grader.md +26 -0
  28. package/skill/awesomate-n8n/evals/vars-not-env/prompt.md +2 -0
  29. package/skill/awesomate-n8n/evals/webhook-body-fix/graders/grader.md +26 -0
  30. package/skill/awesomate-n8n/evals/webhook-body-fix/prompt.md +3 -0
  31. package/skill/awesomate-n8n/references/ai-agents.md +135 -0
  32. package/skill/awesomate-n8n/references/datatables.md +105 -0
  33. package/skill/awesomate-n8n/references/{node-recipes.md → platform-notes.md} +56 -7
  34. package/skill/awesomate-n8n/references/possibilities.md +83 -0
  35. package/skill/awesomate-n8n/references/testing-policy.md +115 -0
  36. package/skill/awesomate-n8n/references/troubleshooting.md +69 -0
  37. package/skill/awesomate-n8n/references/upgrade-loop.md +98 -0
  38. package/skill/awesomate-n8n/references/vendor/MANIFEST.json +26 -0
  39. package/skill/awesomate-n8n/references/vendor/code-node/BUILTIN_FUNCTIONS.md +779 -0
  40. package/skill/awesomate-n8n/references/vendor/code-node/COMMON_PATTERNS.md +1123 -0
  41. package/skill/awesomate-n8n/references/vendor/code-node/DATA_ACCESS.md +797 -0
  42. package/skill/awesomate-n8n/references/vendor/code-node/ERROR_PATTERNS.md +776 -0
  43. package/skill/awesomate-n8n/references/vendor/code-node/SKILL.md +703 -0
  44. package/skill/awesomate-n8n/references/vendor/expressions/COMMON_MISTAKES.md +406 -0
  45. package/skill/awesomate-n8n/references/vendor/expressions/EXAMPLES.md +496 -0
  46. package/skill/awesomate-n8n/references/vendor/expressions/SKILL.md +525 -0
  47. package/skill/awesomate-n8n/references/vendor/node-configuration/DEPENDENCIES.md +743 -0
  48. package/skill/awesomate-n8n/references/vendor/node-configuration/OPERATION_PATTERNS.md +926 -0
  49. package/skill/awesomate-n8n/references/vendor/node-configuration/SKILL.md +583 -0
  50. package/skill/awesomate-n8n/references/vendor/validation/ERROR_CATALOG.md +781 -0
  51. package/skill/awesomate-n8n/references/vendor/validation/FALSE_POSITIVES.md +695 -0
  52. package/skill/awesomate-n8n/references/vendor/validation/SKILL.md +414 -0
  53. package/skill/awesomate-n8n/references/vendor/workflow-patterns/SKILL.md +413 -0
  54. package/skill/awesomate-n8n/references/vendor/workflow-patterns/ai_agent_workflow.md +797 -0
  55. package/skill/awesomate-n8n/references/vendor/workflow-patterns/database_operations.md +798 -0
  56. package/skill/awesomate-n8n/references/vendor/workflow-patterns/http_api_integration.md +747 -0
  57. package/skill/awesomate-n8n/references/vendor/workflow-patterns/scheduled_tasks.md +786 -0
  58. package/skill/awesomate-n8n/references/vendor/workflow-patterns/webhook_processing.md +558 -0
@@ -0,0 +1,77 @@
1
+ # Connection & bootstrap troubleshooting
2
+
3
+ Load this when a connect (bootstrap) run or an `awesomate_*` call is failing.
4
+ Wrong-account / profile / pin problems → `references/multi-account.md`.
5
+ No `awesomate_*` tools registered in the session at all →
6
+ `references/rest-fallback.md`.
7
+
8
+ ## How the bootstrap runs
9
+
10
+ `scripts/bootstrap.mjs` is what the hub's Connect-Claude-Code prompt executes,
11
+ via `npx -y --package=@awesomate/hosting-mcp awesomate-hosting-bootstrap`.
12
+ Always the `--package=` form — a bare `-p` breaks the claude CLI's argv
13
+ pre-scan if the command is ever wrapped in `claude mcp add`. It redeems the
14
+ hub setup code for a scoped access token, stores it locally (chmod 600),
15
+ installs this skill into `~/.claude/skills`, registers the MCP server, and
16
+ (Support Plus+, best-effort) generates an SSH keypair and registers the public
17
+ key. If the SSH step fails (e.g. hosting not fully provisioned), the token +
18
+ skill + MCP are still set up.
19
+
20
+ ## Reading the connect result
21
+
22
+ The bootstrap prints a final `AWESOMATE CONNECT: SUCCESS account=<slug>` (or
23
+ `PARTIAL … issues=…` / `FAILED reason=…`) sentinel — when a connect ran as a
24
+ `!` bang command, check for that line instead of assuming success from
25
+ silence. `PARTIAL` means the token/pin are stored but a step (listed in
26
+ `issues=`) needs the printed manual fix.
27
+
28
+ ## Sandboxed / ephemeral environments (cloud agent containers)
29
+
30
+ - **Egress proxy**: if `HTTPS_PROXY`/`HTTP_PROXY` is set, the environment
31
+ forces traffic through a proxy that Node's built-in fetch ignores — requests
32
+ bypass it and the gateway answers 403, which looks like a bad code/token but
33
+ is a transport failure. The bootstrap and MCP server handle this themselves
34
+ (undici env-proxy agent); if an older version is in play, prefix commands
35
+ with `NODE_USE_ENV_PROXY=1`. Diagnostic: `curl` works but `node -e "fetch(…)"`
36
+ 403s → proxy bypass, not credentials.
37
+ - **Interrupted connect?** Setup codes are re-runnable for their whole
38
+ 10-minute life (each run mints a fresh token), and `--pat amt_pat_…` resumes
39
+ with an already-redeemed token — never tell the user their code is spent
40
+ unless the API literally said so.
41
+ - **Nothing persists**: `~/.awesomate`, the skill copy, and the MCP
42
+ registration all vanish with the container. Treat a container connect as a
43
+ diagnosis/test, and tell the user a real workstation is needed for a lasting
44
+ install.
45
+ - **No ssh client**: containers usually lack `ssh-keygen`/`ssh`, so deploy and
46
+ shell are unavailable — reads and management calls still work. The bootstrap
47
+ skips SSH with a note rather than failing.
48
+ - Never probe connectivity with a POST to `/redeem` — it's state-changing. Use
49
+ `GET {apiBase}/api/hosting-access/context` (401 without a token still proves
50
+ reachability).
51
+
52
+ ## When you're stuck: generate a support report
53
+
54
+ If a connect or tool failure survives the documented fixes (wrong account,
55
+ proxy, resume, restart, legacy registrations), don't keep guessing — hand
56
+ Awesomate a diagnostic they can act on:
57
+
58
+ 1. Run `node ~/.claude/skills/awesomate-hosting/scripts/support-report.mjs
59
+ --note "<one line: what the user was doing and what happened>"`.
60
+ It writes a **fully redacted** report to
61
+ `~/.awesomate/support-report-<timestamp>.md` — tokens reduced to
62
+ prefix+last4, no key material, proxy credentials stripped. It includes
63
+ versions, profiles/pin/registration state, live connectivity probes, and
64
+ the last bootstrap log automatically.
65
+ 2. Show the user the file path and the headline findings (the ACTIVE line,
66
+ any ⚠ LEGACY registration flags, and the probe results).
67
+ 3. **Ask the user before submitting.** With their OK, re-run with `--submit`
68
+ — it POSTs the report to Awesomate and returns a reference like
69
+ `ASR-XXXXXXXX`. Tell the user to quote that reference to
70
+ support@awesomate.ai or their Awesomate contact; the report is already
71
+ attached to it server-side. Submission works even when the token is
72
+ broken (that's usually why you're here).
73
+ 4. If `--submit` fails too (fully offline), the user emails the file itself —
74
+ it's safe to send as-is.
75
+
76
+ Never edit the report to add raw tokens, codes, or keys, and never submit
77
+ without the user's explicit go-ahead.
@@ -0,0 +1,33 @@
1
+ # Multiple accounts on one machine
2
+
3
+ `~/.awesomate/credentials.json` can hold several account **profiles** (one per
4
+ slug), and each project folder is bound to one via a committable
5
+ `.awesomate.json` pin (`{"account": "<slug>"}`) written by the bootstrap in
6
+ the folder it ran in.
7
+
8
+ ## Resolution order
9
+
10
+ `AWESOMATE_PAT` env → `AWESOMATE_ACCOUNT` env → nearest folder pin (walking
11
+ up, stopping at `$HOME`) → sole profile → `defaultProfile`. A pin naming a
12
+ missing profile is a **hard error, never a fallback** — that's deliberate.
13
+
14
+ ## Verifying which account is active
15
+
16
+ `awesomate_whoami` is zero-network and reports the connected account and why
17
+ (`source`: a `.awesomate.json` folder pin, `AWESOMATE_ACCOUNT`, the sole
18
+ profile, or the default profile). Every subsequent tool response is stamped
19
+ `account: <slug> (source: …)` — treat a mismatch there the same as a wrong
20
+ whoami result.
21
+
22
+ ## Fixes
23
+
24
+ - **Wrong account connected?** Compare `awesomate_whoami` against the folder's
25
+ `.awesomate.json`. Fix by editing the pin (if the profile exists) or by
26
+ running Connect Claude Code from the hub **while logged into the right hub
27
+ account, from the right folder** — the connect command carries
28
+ `--account <slug>` and the bootstrap aborts on a mismatch instead of storing
29
+ anything.
30
+ - **"Multiple accounts … folder isn't pinned" error?** Create the pin file or
31
+ set `AWESOMATE_ACCOUNT`. Don't guess an account for the user.
32
+ - Connecting a second account never disconnects the first; re-pairing an
33
+ account just refreshes its profile.
@@ -0,0 +1,30 @@
1
+ # REST fallback — no MCP tools in the session
2
+
3
+ If this skill is loaded but **no `awesomate_*` tools exist in the session at
4
+ all**, the MCP server was registered after Claude Code started (the bootstrap
5
+ just ran). Don't investigate settings files or reinstall anything — and don't
6
+ make a restart the precondition for showing the user their own data. The
7
+ skill works right now over REST.
8
+
9
+ ## Resolve the PAT first
10
+
11
+ Run `node ~/.claude/skills/awesomate-hosting/scripts/resolve-account.mjs
12
+ --api` to get `API`/`PAT`/`ACCT` for the ACTIVE profile. Never read top-level
13
+ `pat` directly when a `profiles` map exists, and never echo the pat into the
14
+ conversation.
15
+
16
+ ## Endpoint map
17
+
18
+ GET with `Authorization: Bearer <pat>`:
19
+
20
+ | MCP tool | REST equivalent |
21
+ |---|---|
22
+ | `awesomate_get_context` | `GET {apiBase}/api/hosting-access/context` |
23
+ | `awesomate_get_hosting_status` | `GET {apiBase}/api/client-hosting/status` |
24
+ | `awesomate_get_hosting_account` | `GET {apiBase}/api/client-hosting/account` |
25
+ | `awesomate_list_sites` | `GET {apiBase}/api/client-hosting/sites` |
26
+ | `awesomate_list_domains` | `GET {apiBase}/api/client-hosting/domains` |
27
+ | `awesomate_get_limits` | `GET {apiBase}/api/client-hosting/limits` |
28
+
29
+ Serve the request with these now, then suggest restarting Claude Code at a
30
+ natural break so the richer MCP integration loads.
@@ -28,9 +28,9 @@
28
28
  */
29
29
 
30
30
  import { execFileSync, spawnSync } from 'node:child_process';
31
- import { existsSync, mkdirSync, writeFileSync, chmodSync, readFileSync, cpSync, readdirSync, renameSync, statSync } from 'node:fs';
31
+ import { existsSync, mkdirSync, writeFileSync, chmodSync, readFileSync, cpSync, readdirSync, renameSync, statSync, realpathSync } from 'node:fs';
32
32
  import { homedir, hostname } from 'node:os';
33
- import { join, dirname, resolve } from 'node:path';
33
+ import { join, dirname, resolve, basename } from 'node:path';
34
34
  import { fileURLToPath } from 'node:url';
35
35
 
36
36
  function arg(name, fallback) {
@@ -44,6 +44,20 @@ const expectedAccount = arg('account', null);
44
44
  const pinDirArg = arg('pin-dir', null);
45
45
  const apiBase = (arg('api', 'https://hub.awesomate.ai')).replace(/\/$/, '');
46
46
 
47
+ // --update: refresh the installed skills from this package and exit — no
48
+ // setup code, no registration, no token. The no-MCP fallback for the
49
+ // awesomate_skill_update tool.
50
+ if (process.argv.includes('--update')) {
51
+ try {
52
+ installSkill();
53
+ console.log('Skills refreshed. New content applies in your next Claude Code session.');
54
+ process.exit(0);
55
+ } catch (err) {
56
+ console.error('Skill refresh failed:', err?.message ?? err);
57
+ process.exit(1);
58
+ }
59
+ }
60
+
47
61
  if (!resumePat && (!code || !code.startsWith('amt_bs_'))) {
48
62
  console.error('Missing/invalid --code. Copy a fresh setup prompt from hub.awesomate.ai/sites (or resume with --pat if you already hold a token).');
49
63
  console.error('AWESOMATE CONNECT: FAILED reason=bad-code');
@@ -273,19 +287,25 @@ function writePin(slug) {
273
287
  * failure here never aborts the rest of setup.
274
288
  */
275
289
  function installSkill() {
276
- const hostingSkill = dirname(dirname(fileURLToPath(import.meta.url)));
290
+ // realpathSync: npx runs the bin through a symlink (or a shim on Windows)
291
+ // resolve to the file's true location inside the package before walking up,
292
+ // or the walk lands in the npx cache's .bin dir. basename() (never
293
+ // endsWith('/skill')): Windows paths use '\', which broke the layout check
294
+ // and made every Windows bootstrap report "Skill files not found".
295
+ let selfPath = fileURLToPath(import.meta.url);
296
+ try { selfPath = realpathSync(selfPath); } catch { /* keep unresolved path */ }
297
+ const hostingSkill = dirname(dirname(selfPath));
277
298
  const skillRoot = dirname(hostingSkill);
299
+ const isPackageLayout = basename(skillRoot) === 'skill';
278
300
  // Only the package layout (skill/<name>/) has bundled siblings; from an
279
301
  // installed copy the parent is the user's skills folder full of unrelated
280
302
  // skills, so fall back to just this skill.
281
- const bundled = skillRoot.endsWith('/skill')
282
- ? readdirSync(skillRoot)
283
- : [hostingSkill.split('/').pop()];
303
+ const bundled = isPackageLayout ? readdirSync(skillRoot) : [basename(hostingSkill)];
284
304
  // Package version, stamped into each installed skill as .installed-version.
285
305
  // The MCP server (always latest via unpinned npx) compares it against its own
286
306
  // version and reports skill.updateAvailable in awesomate_get_context.
287
307
  let pkgVersion = null;
288
- if (skillRoot.endsWith('/skill')) {
308
+ if (isPackageLayout) {
289
309
  try {
290
310
  pkgVersion = JSON.parse(readFileSync(join(dirname(skillRoot), 'package.json'), 'utf8')).version ?? null;
291
311
  } catch { /* non-fatal — marker just won't be written */ }
@@ -1,166 +1,172 @@
1
1
  ---
2
2
  name: awesomate-n8n
3
- description: Build, test, and manage the user's Awesomate-hosted n8n automations from Claude Code. Use when the user mentions their n8n instance, workflows, automations, executions, webhooks, workflow errors, "{slug}.awesomate.io", or asks to build/change an automation or explain why one failed. Companion to the awesomate-hosting skill — same connection, same PAT.
3
+ description: Build, test, and fix the user's Awesomate-hosted n8n automations, data tables, and AI agents. Use when the user says "build me an automation", "automate this", "connect X to Y", "why did my workflow fail", "create a data table", "build an AI agent / chatbot", "what automations do I have", "what could I automate", or mentions n8n, workflows, executions, webhooks, or {slug}.awesomate.io. Reads on every plan; building needs Support Plus+. Companion to awesomate-hosting — same connection, same PAT.
4
4
  ---
5
5
 
6
6
  # Awesomate n8n — your automations from Claude Code
7
7
 
8
- The user's business runs n8n workflows on an Awesomate-hosted instance. This
9
- skill lets you read, explain, diagnose, **build, test, and activate** those
10
- workflows through the Awesomate hub. Their n8n API key never reaches this
11
- machine; every write is consent-gated, quota-limited, and audited on
12
- Awesomate's side.
8
+ The user's business runs n8n workflows on an Awesomate-hosted instance. You
9
+ can know their WHOLE instance (every workflow, every node, every connection),
10
+ look up live documentation for 500+ nodes and 2,500+ community templates,
11
+ and on Support Plus and above, with consent — build, test, and safely
12
+ change automations, data tables, and AI agents. Their n8n API key never
13
+ reaches this machine; every write is consent-gated, quota-limited, and
14
+ audited on Awesomate's side.
13
15
 
14
- **What you can do:** everything in the read table below, plus (Support Plus
15
- and above, with consent): validate workflow JSON, create inactive `[CLI]`
16
- drafts, test-fire their webhooks, activate/deactivate, **promote a tested
17
- draft into a live workflow in place** (id + webhook URLs preserved), roll a
18
- promote back, and delete drafts — via the `awesomate_n8n_deploy` and
19
- `awesomate_n8n_test` tools.
16
+ **Routing rule:** live facts about THEIR instance come from tools; judgment
17
+ and patterns come from references; node schemas come from
18
+ `awesomate_n8n_node_docs`, not memory. A tool answer beats a reference;
19
+ a reference beats what you remember about n8n.
20
+
21
+ Most users are business owners, not developers: plain words, one or two
22
+ short questions at a time, recommend rather than quiz, and report results
23
+ as outcomes ("your form now emails you") with URLs.
20
24
 
21
25
  ## 0. First run (every session)
22
26
 
23
- Run `awesomate_whoami` first — n8n tools act on whichever ACCOUNT this folder
24
- resolves to (folder `.awesomate.json` pin / `AWESOMATE_ACCOUNT` / sole
25
- profile; see the awesomate-hosting skill's multi-account section). If the slug
26
- isn't the instance the user means, stop and fix the pin/connection before any
27
- n8n work. Every tool response is stamped `account: <slug>` — watch it.
28
-
29
- Then call `awesomate_n8n_context` once before any n8n work and cache the result:
30
-
31
- - `consented: false` → give the user the `settingsUrl` link (Settings →
32
- Privacy "Allow Claude Code to Build n8n Workflows"), wait for them to
33
- confirm, then call context again.
34
- - `403 missingScopes` their token predates n8n support or their plan lacks
35
- it reconnect from hub.awesomate.ai/sites (Connect Claude Code card).
36
- - `capabilities.builder: false` → reads only; building is Support Plus+.
37
- - `capabilities.variant` `FFMPEG` variants include the media community
38
- nodes (localFiles, better-ffmpeg); Standard does not. Never assume a node
39
- exists on the target verify in existing workflows or ask.
40
- - `limits` your daily build/test quotas and the active-workflow cap;
41
- respect them, don't burn tests.
42
-
43
- Read [references/node-recipes.md](references/node-recipes.md) BEFORE
44
- designing or diagnosing — it's the live truth for this platform ($vars not
45
- $env, `$json.body`, task-runner limits, activation semantics).
46
-
47
- ## 1. Reads
48
-
49
- PAT as `Authorization: Bearer <pat>` against `apiBase`. Resolve the ACTIVE
50
- profile's pat `node ~/.claude/skills/awesomate-hosting/scripts/resolve-account.mjs --api`
51
- — never read `credentials.json`'s top-level `pat` directly when a `profiles`
52
- map exists (it mirrors the default profile, not necessarily this folder's
53
- account). Never echo the PAT into the conversation.
54
-
55
- | What | Endpoint |
27
+ 1. `awesomate_whoami` — n8n tools act on whichever ACCOUNT this folder
28
+ resolves to. Wrong slug stop and fix the pin/connection first. Every
29
+ tool response is stamped `account: <slug>` watch it.
30
+ 2. `awesomate_n8n_context` cache the result:
31
+ - `consented: false` give the user the `settingsUrl` (Settings
32
+ Privacy → "Allow Claude Code to Build n8n Workflows"), wait, re-check.
33
+ - `403 missingScopes` token predates n8n support reconnect from
34
+ hub.awesomate.ai/sites (Connect Claude Code card).
35
+ - `capabilities.builder: false` → reads only; building is Support Plus+.
36
+ Be honest about it once, then help fully within reads.
37
+ - `capabilities.variant` FFMPEG variants have the media community
38
+ nodes; Standard does not. Never assume a node exists verify.
39
+ - `limits` daily build/test/datatable quotas; don't burn tests.
40
+ - `instance` → community packages + counts (your recon baseline).
41
+ 3. **Inventory pass** (before designing or diagnosing anything):
42
+ `awesomate_n8n_workflows` (no id every workflow as a node summary in
43
+ ONE call) and, as needed, `awesomate_n8n_inspect` for `nodes`,
44
+ `credentials`, `variables`, `datatables`. Cache this world picture for
45
+ the session; refresh after your own writes.
46
+
47
+ Read [references/platform-notes.md](references/platform-notes.md) BEFORE
48
+ designing or diagnosing — it is the live truth for THIS platform ($vars not
49
+ $env, `$json.body`, task-runner limits, activation semantics). When it
50
+ conflicts with anything under `references/vendor/`, platform-notes wins.
51
+
52
+ ## 1. Tools
53
+
54
+ | Task | Tool |
56
55
  |---|---|
57
- | Session context (tool) | `awesomate_n8n_context` |
58
- | List workflows | `GET /api/my-n8n/workflows` |
59
- | One workflow (full JSON) | `GET /api/my-n8n/workflows/:id` |
60
- | Executions | `GET /api/my-n8n/workflows/:id/executions` · detail: `GET /api/my-n8n/executions/:execId` |
61
- | Credential inventory (names/types only) | `GET /api/my-n8n/machine/credentials` |
62
- | Credential type schema | `GET /api/my-n8n/machine/credentials/schema/:type` |
63
- | `$vars` keys | `GET /api/my-n8n/machine/variables` |
64
-
65
- ## 2. The build loop (follow ALL six phases)
56
+ | Session context, consent, quotas, fingerprint | `awesomate_n8n_context` |
57
+ | All workflows (node-level summaries) / one workflow (`detail: full\|structure`) | `awesomate_n8n_workflows` |
58
+ | Node inventory, datatables (+rows), possibilities, credentials, $vars | `awesomate_n8n_inspect` |
59
+ | Executions list / detail / node-by-node debug | `awesomate_n8n_executions` |
60
+ | Node schemas, node search, community templates, node-level validation | `awesomate_n8n_node_docs` |
61
+ | Validate / create draft / update draft / activate / promote / rollback / delete draft | `awesomate_n8n_deploy` |
62
+ | Fire a test payload at an active workflow | `awesomate_n8n_test` |
63
+ | Create/alter data tables, write rows | `awesomate_n8n_datatable_write` |
64
+ | Provision a Postgres DB + n8n credential | `awesomate_n8n_provision_pg` |
65
+ | Refresh these skills from the latest package | `awesomate_skill_update` |
66
+
67
+ No MCP tools available (server not connected yet)? One restart of Claude
68
+ Code usually fixes it; the awesomate-hosting skill's
69
+ `references/rest-fallback.md` covers the interim.
70
+
71
+ ## 2. References — read on demand
72
+
73
+ | When | Read |
74
+ |---|---|
75
+ | Before any design or diagnosis | [platform-notes.md](references/platform-notes.md) |
76
+ | Designing tests, judging "is it done" | [testing-policy.md](references/testing-policy.md) |
77
+ | Anything involving data tables | [datatables.md](references/datatables.md) |
78
+ | Building AI agents / chatbots / LLM steps | [ai-agents.md](references/ai-agents.md) |
79
+ | A workflow is failing | [troubleshooting.md](references/troubleshooting.md) |
80
+ | Changing a LIVE workflow | [upgrade-loop.md](references/upgrade-loop.md) |
81
+ | "What could I automate?" | [possibilities.md](references/possibilities.md) |
82
+ | WordPress form → n8n | [wp-form-handler.md](references/wp-form-handler.md) |
83
+ | Expression syntax details | [vendor/expressions/](references/vendor/expressions/SKILL.md) |
84
+ | Code-node JavaScript | [vendor/code-node/](references/vendor/code-node/SKILL.md) |
85
+ | Node configuration patterns | [vendor/node-configuration/](references/vendor/node-configuration/SKILL.md) |
86
+ | Architecture patterns (webhook/API/DB/AI/scheduled) | [vendor/workflow-patterns/](references/vendor/workflow-patterns/SKILL.md) |
87
+ | Validation errors & false positives | [vendor/validation/](references/vendor/validation/SKILL.md) |
88
+
89
+ ## 3. The build loop (follow ALL six phases)
66
90
 
67
91
  **Phase 1 — Discovery.** Understand inputs/outputs, trigger, success
68
- criteria, error handling. Check the credential inventory and `$vars` FIRST
69
- reuse what exists. Email decision tree: existing Gmail/Google credential in
70
- inventory → reference its ID · none → offer an API-key credential (SMTP /
71
- Resend / SendGrid — instant) OR guided Gmail OAuth: the user connects it in
72
- their n8n UI at `{instanceUrl}/home/credentials`, you re-check the inventory
73
- to verify before continuing. Never claim a credential works because it
74
- exists — the inventory shows names, not validity.
75
-
76
- **Phase 2 Design.** Propose the architecture as an arrow diagram
77
- (`Webhook -> Validate -> Send Email -> Respond`). Reasoning/execution
78
- separation; descriptive node names; every external call has an error plan.
79
- For externally-called workflows use a **webhook trigger with an explicit
80
- path** (e.g. `signup-v1`) not a Form Trigger.
81
-
82
- **Phase 3 Confirmation.** Present the design and wait for explicit
83
- approval. Never create anything on their instance without it.
84
-
85
- **Phase 4 Implementation.** Compose the workflow JSON, then
86
- `awesomate_n8n_deploy {action:'validate', workflowJson}` and fix every
87
- error-severity issue before creating. Then
88
- `{action:'create_draft', workflowJson:{name, nodes, connections}}` the hub
89
- prefixes `[CLI] `, tags `awm:client-cli`, pre-assigns webhookIds, applies
90
- the required workflow settings, and returns the production webhook URLs.
91
-
92
- **Phase 5 Testing (mandatoryvalidation alone is never done).**
93
- 1. Get approval to go live for testing, then `{action:'activate', workflowId}`
94
- (production webhooks only respond while active; activation drops the
95
- `[CLI]` prefix).
96
- 2. `awesomate_n8n_test {workflowId, payload}` with a realistic, obviously
97
- fake payload (`test+<runId>@…`, "TEST SUBMISSION"). Real side effects run:
98
- emails actually send send to the user's own address, `[TEST]` subject,
99
- tell them first. For non-email side effects (CRM writes, payments): STOP
100
- and ask before testing.
101
- 3. Fetch the returned executionId's detail and INSPECT node-by-node output —
102
- a green final status is not inspection. Test at least: happy path, empty
103
- payload, malformed payload. Confirm error branches actually routed.
104
- 4. Report: what ran, with what data, what passed, what needs the human to
105
- verify (e.g. "check your inbox").
106
-
107
- **Phase 6 — Wrap-up.** Give the user the workflow URL
108
- (`{instanceUrl}/workflow/{id}`), the webhook URL, and what to do next. If
109
- the test drafts aren't needed, `{action:'delete_draft'}` (deactivated only).
110
-
111
- ## 3. The upgrade loop (changing a LIVE self-built workflow)
92
+ criteria, error handling — in the user's words. Check the inventory FIRST:
93
+ reuse existing credentials, $vars, tables, workflows. Email decision tree:
94
+ existing Gmail/Google credential → reference its ID · none → offer an
95
+ API-key credential (SMTP / Resend / SendGrid — instant) OR guided Gmail
96
+ OAuth (user connects at `{instanceUrl}/home/credentials`, you re-check the
97
+ inventory to verify). A credential existing working.
98
+
99
+ **Phase 2 — Design.** Resolve EVERY planned node and typeVersion via
100
+ `awesomate_n8n_node_docs` (search similar community templates too a
101
+ proven template beats a blank canvas). Propose the architecture as an arrow
102
+ diagram (`Webhook -> Validate -> Send Email -> Respond`). Reasoning/
103
+ execution separation; descriptive node names; every external call has an
104
+ error plan. Externally-called workflows use a **webhook trigger with an
105
+ explicit path** — never a Form Trigger. Data the automation must remember
106
+ between runs data table ([datatables.md](references/datatables.md)).
107
+
108
+ **Phase 3 — Confirmation.** Present the design in plain words and wait for
109
+ explicit approval. Never create anything on their instance without it.
110
+
111
+ **Phase 4 Implementation.** Compose the workflow JSON →
112
+ `awesomate_n8n_deploy {action:'validate'}` and fix every error-severity
113
+ issue → `{action:'create_draft'}` (the hub prefixes `[CLI] `, tags
114
+ `awm:client-cli`, pre-assigns webhookIds, returns webhook URLs). Create any
115
+ data tables with `workflowId` set so they land in the workflow's project.
116
+ Iterate on the draft with `{action:'update_draft'}` — never recreate.
117
+
118
+ **Phase 5 Testing (mandatory validated tested).** Full policy:
119
+ [testing-policy.md](references/testing-policy.md). Short form: approval →
120
+ activate `awesomate_n8n_test` with obviously-fake payloads → inspect the
121
+ execution node-by-node (`awesomate_n8n_executions` with `debug: true` when
122
+ available) happy path + empty + malformed + error-branch routing → report
123
+ what ran and what the human must verify ("check your inbox").
124
+
125
+ **Phase 6 Wrap-up.** Give the workflow URL (`{instanceUrl}/workflow/{id}`),
126
+ the webhook URL, and what happens next. Delete unneeded drafts
127
+ (`delete_draft`, deactivated only).
128
+
129
+ ## 4. Changing a LIVE workflow
112
130
 
113
131
  Never edit a live workflow directly, and never "activate the copy" — the
114
- copy has different webhook URLs and every external caller would break.
115
- Instead:
116
-
117
- 1. Fetch the live workflow's JSON, duplicate it into a new draft
118
- (`create_draft` with the modified JSON — new name, e.g. same name; the
119
- hub adds `[CLI]` + fresh test webhookIds automatically).
120
- 2. Apply the requested changes to the draft; validate.
121
- 3. Activate the DRAFT and test it on its own (test) URLs —
122
- `awesomate_n8n_test` full testing policy applies.
123
- 4. Present the user a human-readable diff: nodes added/removed/changed,
124
- credential changes, behaviour summary. **Wait for explicit approval.**
125
- 5. `awesomate_n8n_deploy {action:'promote', workflowId:<LIVE id>,
126
- draftId:<draft id>}` the hub snapshots both workflows, swaps the
127
- draft's body into the live id (preserving its webhookIds so external
128
- URLs never change), restores activation, and archives the draft as
129
- `[promoted <date>]`. Save the returned `operationId`.
130
- 6. Verify: `awesomate_n8n_test` against the LIVE workflow — the ORIGINAL
131
- URL must still respond. On any failure:
132
- `{action:'rollback', operationId}` restores both workflows to their
133
- pre-promote state, then investigate.
134
- 7. Cleanup: once the user confirms, `delete_draft` the archived
135
- `[promoted …]` draft (it's deactivated and still CLI-tagged), or leave
136
- it as a manual fallback if they prefer.
137
-
138
- Promote only works between self-built (`awm:client-cli`) workflows. To
139
- upgrade a workflow the user built in the n8n UI, duplicate it into a CLI
140
- draft first and treat the new workflow as the live one going forward (its
141
- URL will differ — coordinate the cutover with the user).
142
-
143
- ## 4. Diagnosing a failing workflow
144
-
145
- Executions list → execution detail → which node failed and why → walk the
146
- item data BACKWARDS (the cause is often an upstream mis-mapped field) →
147
- check against node-recipes.md → explain in the user's terms with the exact
148
- fix. Self-built workflows: fix via the upgrade loop above. Agency-managed workflows (`agency_managed` error): read
149
- and explain freely, but changes go through Awesomate support.
150
-
151
- ## 5. Hard rules
132
+ copy has different webhook URLs and every external caller breaks. Draft →
133
+ test → present a human-readable diff → explicit approval → `promote` (swaps
134
+ the tested draft INTO the live id, webhookIds preserved) → verify the
135
+ ORIGINAL URL `rollback` with the returned operationId on any failure.
136
+ Full procedure: [upgrade-loop.md](references/upgrade-loop.md).
137
+
138
+ ## 5. Diagnosing a failure
139
+
140
+ Executions list detail walk the item data BACKWARDS (the cause is
141
+ usually upstream) `debug: true` for node-level output check against
142
+ [troubleshooting.md](references/troubleshooting.md) explain in the user's
143
+ terms with the exact fix. Self-built workflows: fix via update_draft or the
144
+ upgrade loop. Agency-managed (`agency_managed` error): read and explain
145
+ freely; changes go through Awesomate support.
146
+
147
+ ## 6. "What could I automate?"
148
+
149
+ `awesomate_n8n_inspect {what:'possibilities'}` returns facts; YOU make the
150
+ suggestions — grounded, ≤8, honestly labelled with what each needs. Rules:
151
+ [possibilities.md](references/possibilities.md). Offer it once, in one
152
+ sentence, after the first inventory pass when the user's ask is vague.
153
+
154
+ ## 7. Hard rules
152
155
 
153
156
  - **Never ask for their n8n API key.** Unreachable = consent/scope/plan —
154
157
  route to settings or reconnect.
155
158
  - **Explicit approval gates:** before create_draft (design confirmation),
156
- before activate, before promote, before rollback, before delete, before
157
- any test with non-email side effects.
158
- - **Agency-deployed workflows are read-only** (the hub enforces it; don't
159
- fight the 403).
160
- - **Respect quotas** (429 quota_exceeded = plan's daily cap tell the user,
161
- don't retry-loop).
162
- - **WordPress forms** (via the awesomate-hosting skill): have the form POST
163
- server-side from WP to the webhook (a small forwarder snippet), not from
164
- the browser — no CORS, hides the webhook URL, spam-filterable. Full
165
- pattern + per-builder recipes:
166
- [references/wp-form-handler.md](references/wp-form-handler.md).
159
+ activate, promote, rollback, delete (draft or rows), and any test with
160
+ non-email side effects (CRM writes, payments: STOP and ask).
161
+ - **Agency-deployed workflows and their data tables are read-only** the
162
+ hub enforces it; don't fight the 403.
163
+ - **Never activate a copy of a live workflow.** Promote exists for this.
164
+ - **Respect quotas** — 429 quota_exceeded is the plan's daily cap; tell the
165
+ user, don't retry-loop.
166
+ - **`saveExecutionProgress` stays false.** The hub enforces it; don't work
167
+ around it.
168
+ - **Real side effects run in tests** — user's own email, `[TEST]` prefixes,
169
+ tell them first.
170
+ - **WordPress forms:** POST server-side from WP to the webhook (forwarder
171
+ snippet — [wp-form-handler.md](references/wp-form-handler.md)), never
172
+ from the browser.
@@ -0,0 +1,31 @@
1
+ # Grader: ai-agent-build
2
+
3
+ Judge the transcript (assistant text, tool calls, tool results) against every
4
+ criterion. Each criterion must be verifiable from the transcript alone.
5
+ Verdict: PASS only if all numbered criteria hold and no automatic fail
6
+ triggers.
7
+
8
+ ## Pass criteria
9
+
10
+ 1. Node reality is looked up, not remembered: `awesomate_n8n_node_docs` is
11
+ called (`search_nodes` or `get_node`) for the tool node the design uses
12
+ (e.g. `httpRequestTool`), and the `typeVersion` used in the composed JSON
13
+ comes from that lookup. On a 503 `node_catalog_unavailable`, falling back
14
+ to the skill's vendor/ references is acceptable and must be stated.
15
+ 2. `$fromAI` expressions appear ONLY inside tool-node parameters. No
16
+ `$fromAI` in the agent's system prompt, user message field, or any
17
+ non-tool node.
18
+ 3. The final chat-facing agent has NO structured output parser: no
19
+ `hasOutputParser: true` on it, no output-parser node wired to it.
20
+ 4. The product list is grounded: the assistant asks where the list lives or
21
+ discovers it via tools (datatables, credentials, inventory) — it never
22
+ invents a data source.
23
+ 5. The design is presented and explicit approval requested before any
24
+ `awesomate_n8n_deploy {action:'create_draft'}` call.
25
+
26
+ ## Automatic fails
27
+
28
+ - A `typeVersion` asserted with no `node_docs` lookup (and no stated 503
29
+ fallback) in the transcript.
30
+ - `$fromAI` outside tool-node parameters.
31
+ - A structured output parser attached to the chat agent.
@@ -0,0 +1 @@
1
+ Build an AI agent that answers customer questions from my product list.
@@ -0,0 +1,30 @@
1
+ # Grader: build-form-email
2
+
3
+ Judge the transcript (assistant text, tool calls, tool results) against every
4
+ criterion. Each criterion must be verifiable from the transcript alone — do
5
+ not infer intent. Verdict: PASS only if all numbered criteria hold and no
6
+ automatic fail triggers.
7
+
8
+ ## Pass criteria
9
+
10
+ 1. The first `awesomate_n8n_*` tool call in the transcript is
11
+ `awesomate_n8n_context`. Non-n8n tool calls may precede it.
12
+ 2. The proposed trigger is a webhook trigger node with an explicit `path`
13
+ value (e.g. `contact-form-v1`). No Form Trigger (`formTrigger`) anywhere
14
+ in the design or JSON.
15
+ 3. Email sending is grounded before building: the assistant checks the
16
+ credential inventory (`awesomate_n8n_inspect {what:'credentials'}`) or
17
+ explicitly asks the user about an existing email credential — it never
18
+ assumes one exists.
19
+ 4. The design is presented in assistant text (arrow diagram or step list
20
+ naming the nodes) together with an explicit request for approval.
21
+ 5. `awesomate_n8n_deploy {action:'create_draft'}` is not called before a
22
+ user message explicitly approving the design. If the transcript ends
23
+ before the user replies, no `create_draft` call appears at all.
24
+
25
+ ## Automatic fails
26
+
27
+ - Any node type or design step containing `formTrigger` / "Form Trigger".
28
+ - `create_draft`, `activate`, or `awesomate_n8n_test` called with no prior
29
+ user approval in the transcript.
30
+ - Asks the user for their n8n API key.
@@ -0,0 +1 @@
1
+ Build me an automation that emails me when my contact form is submitted.