← CorezoidCONTENT HISTORY

Update to Corezoid

Snapshot Oct 9, 2026 · 00:04 UTC · version 3.9.0

Collection source: downloaded plugin package.

WHAT CHANGED · RULE-BASED ANALYSIS

First saved snapshot

No earlier snapshot is available to establish a change.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "description": "Optimizes a Corezoid process JSON — reduces tact consumption by merging nodes, cleans data flow, fills missing node titles, and adds resilience patterns. Activate when the user says \"optimize\", \"improve\", \"reduce tacts\", \"merge nodes\", \"clean up process\", \"what can be improved\", \"show optimizations\", or any phrase implying they want to make a process faster, cheaper, or more readable. Two modes: plan-only (analysis + report, no changes) and auto (plan + execute immediately).\n",
  "included_files": [],
  "name": "corezoid-process-optimizer",
  "skill_md_contents": "---\nname: corezoid-process-optimizer\ndescription: >\n  Optimizes a Corezoid process JSON — reduces tact consumption by merging nodes,\n  cleans data flow, fills missing node titles, and adds resilience patterns.\n  Activate when the user says \"optimize\", \"improve\", \"reduce tacts\", \"merge nodes\",\n  \"clean up process\", \"what can be improved\", \"show optimizations\", or any phrase\n  implying they want to make a process faster, cheaper, or more readable.\n  Two modes: plan-only (analysis + report, no changes) and auto (plan + execute immediately).\n---\n\n# Corezoid Process Optimizer\n\n## Mode and scope detection\n\nDetermine **mode** and **scope** from the user's phrasing before doing anything else.\n\n### Mode\n\n| User intent | Mode |\n|-------------|------|\n| \"optimize\", \"apply\", \"fix\", \"improve\" — action verb | **AUTO** — analyze, plan, execute |\n| \"show\", \"what can\", \"suggest\", \"check\" — analysis verb | **PLAN** — analyze, report, wait |\n\nIn PLAN mode, after presenting the report ask:\n> \"Apply all? Apply by group? (1 — tacts, 2 — data, 3 — naming, 4 — resilience)\"\n\n### Scope\n\nThe user may request a specific optimization group. Detect from keywords:\n\n| Keyword(s) in request | Scope — run only |\n|-----------------------|------------------|\n| \"tacts\", \"tact\", \"state changes\", \"nodes\", \"merge\" | Group 1 |\n| \"data\", \"payload\", \"cleanup\", \"garbage\", \"fields\" | Group 2 |\n| \"names\", \"naming\", \"titles\", \"readability\", \"descriptions\" | Group 3 |\n| \"resilience\", \"semaphors\", \"timeouts\", \"stability\" | Group 4 |\n| No group keyword — general request | All groups |\n\nIf scope is a single group — run Phase 1 analysis only for that group. Skip all others entirely.\nStill run `lint-process` first (its findings feed Group 1 regardless).\n\nExamples:\n- \"optimize by tacts\" → AUTO + Group 1 only\n- \"show tact optimizations\" → PLAN + Group 1 only\n- \"add missing semaphors\" → AUTO + Group 4 only\n- \"optimize\" → AUTO + all groups\n\n---\n\n## Step 0 — Resolve process\n\nResolve `PROCESS_PATH` before calling any tools:\n1. Check if the user provided a path, name, or ID.\n2. If not — ask: \"Which process? Provide a file path, name, or ID.\"\n3. If name or ID — search locally: `find . -name \"*.conv.json\"`.\n4. Read and parse the file.\n5. Call **`lint-process`** — record findings. They become Group 1 quick-wins.\n\n---\n\n## Step 1 — Analyze\n\nBuild a node map: `id → { title, obj_type, logics[], sems[], outgoing edges }`.\n\nTrace the execution graph from the Start node following `go.to_node_id` and `err_node_id` edges.\n\nCollect candidates for all four groups below.\n\n---\n\n## Group 1 — Tact Reduction\n\n> Formula: SC = (N – 1) × T. Every node transition costs one state change. Fewer nodes = fewer tacts.\n\n### 1.1 Merge consecutive set_param nodes\n\nDetect chains A → B → C where all nodes have `type: \"set_param\"`, connected sequentially with no branching.\n\nMerge condition: all nodes share the same `err_node_id` (or all have none).\nIf `err_node_id` values differ — flag as candidate, do not merge automatically.\n\nMerge action: combine all `extra` and `extra_type` objects into the first node. Remove subsequent nodes. Reconnect routing to where the chain ended.\n\nTacts saved: (chain length − 1) per task.\n\n---\n\n### 1.2 Merge consecutive code nodes\n\nDetect chains of `type: \"api_code\"` nodes connected sequentially with no branching.\n\nMerge condition: all share the same `err_node_id`.\nIf different — flag only; note that error handling must be unified first.\n\nMerge action: concatenate `src` fields in order, separated by `\\n// ---\\n`. Keep one `err_node_id`. Remove subsequent nodes. Reconnect routing.\n\nTacts saved: (chain length − 1) per task.\n\n---\n\n### 1.3 Merge consecutive condition nodes checking the same field\n\nDetect chains of `type: \"go_if_const\"` nodes where all check the **same `arg` field**.\n\nMerge action: combine all `conditions[]` arrays into the first node. Each original branch keeps its own `to_node_id`. Remove subsequent condition nodes.\n\nDo NOT merge if conditions check different fields — different semantics, merging hurts readability.\n\nAfter merging, add a note to the plan:\n> \"Merged conditions on field '{{field}}'. Review combined node for readability.\"\n\nTacts saved: (chain length − 1) per task.\n\n---\n\n### 1.4 Replace api_rpc with api_copy when reply is unused\n\nDetect `api_rpc` nodes where no downstream node references any field that could only originate from the called process's reply.\n\nCheck: scan all downstream `extra`, condition `arg`/`val`, and `src` fields for parameter names not present in the task before the call. If none found — candidate for api_copy.\n\nThis change requires confirmation even in AUTO mode. Present:\n> \"Node '[title]' calls process but does not use the reply. Replace with api_copy (fire-and-forget)? [yes/no]\"\n\nIf confirmed: change `type: \"api_rpc\"` → `type: \"api_copy\"`. Switch `extra`/`extra_type` to `data`/`data_type` per the api_copy schema (see `${CLAUDE_PLUGIN_ROOT}/docs/node-structures.md`).\n\n---\n\n### 1.5 Remove dead nodes\n\nApply lint findings:\n- **Orphaned nodes** — remove from `scheme.nodes`.\n- **No-op conditions** — re-route the incoming edge to the single destination; remove the condition node.\n- **Unused set_params** — if the node sets only unused variables, remove the node. If mixed, remove only the unused keys from `extra`/`extra_type`.\n\n---\n\n## Group 2 — Data Cleanup\n\n### 2.1 Inline payload cleanup after API calls\n\nAfter each `type: \"api\"` node, identify response fields not referenced by any downstream node.\n\nDo NOT add a new cleanup node — inline the cleanup into the nearest existing downstream node:\n- **code node**: prepend `delete data.<field>;` at the top of `src`.\n- **set_param node**: set_param cannot delete keys. Find the next code node and add the delete there. If no downstream code node exists — flag for the user, do not create a new node.\n\n---\n\n### 2.2 Remove dead code inside code nodes\n\nInside each `api_code` node's `src`, detect:\n- `data.x = data.x` — self-assignment, remove.\n- Variables declared but never read after declaration — flag for user review.\n- Large commented-out blocks — flag for user review.\n\n---\n\n## Group 3 — Readability\n\nRun this group when:\n- User explicitly requested it, OR\n- AUTO mode is active.\n\n**Critical nodes always get titles filled** regardless of mode:\n\n| Node type | Always fill `title` if empty |\n|-----------|------------------------------|\n| `api_code` | Yes |\n| `api` | Yes |\n| `api_rpc` | Yes |\n| `api_copy` | Yes |\n| `obj_type: 2` (End/Error) | Yes |\n\n### Title inference rules\n\n| Node type | Inference |\n|-----------|-----------|\n| `api` | `\"[METHOD] [hostname][path]\"` from the `url` field |\n| `api_rpc` | `\"Call @[alias]\"` or `\"Call [conv_id]\"` |\n| `api_copy` | `\"Copy → @[alias]\"` or `\"Copy → [conv_id]\"` |\n| `api_code` | First meaningful line of `src` (strip `data.`, max 40 chars) |\n| `set_param` | `\"Set [key1], [key2], ...\"` (first 3 keys) |\n| `go_if_const` | `\"Check [arg field]\"` |\n| `obj_type: 2`, icon `error` | `\"Error\"` |\n| `obj_type: 2` | `\"Final\"` |\n\nNever overwrite an existing non-empty `title`.\n\n### 3.1 Fill process params array\n\nIf `params: []` and the Start node clearly receives input (inferred from downstream references to fields never set internally) — propose a `params` array.\n\nAlways ask for confirmation before applying — field types cannot be reliably inferred.\n\n---\n\n## Group 4 — Resilience\n\n### 4.1 Add missing time semaphors\n\n| Node type | Severity | Default timeout |\n|-----------|----------|-----------------|\n| `api_callback` (Waiting for Callback) | 🔴 Critical — always add | 3600 sec |\n| `api` (API Call) | 🟡 Important — add without asking | 30 sec |\n| `api_rpc` (Call a Process) | 🟢 Recommended — add without asking | 60 sec |\n\nSemaphor `to_node_id` must point to a valid error node.\nIf no suitable error node exists — create one at `x + 300`, same `y` as the parent node.\nUse `obj_type: 2` with `title: \"Timeout\"` and connect the semaphor to it.\n\nSemaphor JSON:\n```json\n{\n  \"type\": \"time\",\n  \"value\": 30,\n  \"dimension\": \"sec\",\n  \"to_node_id\": \"<error_node_id>\"\n}\n```\n\n---\n\n## Step 2 — Plan report\n\nPresent findings in this format before executing anything:\n\n```\n## Optimization Plan: <Process Title> (<ID>)\n\n### Group 1 — Tact Reduction\n| # | Type               | Nodes                                 | Tacts saved |\n|---|--------------------|---------------------------------------|-------------|\n| 1 | Merge set_param    | \"Set ref\" → \"Set amount\" → \"Set cur\"  | 2/task      |\n| 2 | Merge code         | \"Parse\" → \"Validate\"                  | 1/task      |\n| 3 | Remove orphaned    | \"Old handler\" (abc123)                | 1/task      |\n| 4 | rpc→copy ⚠️ confirm | \"Send notification\"                   | wait saved  |\n\nTotal nodes removed: N | Tacts saved: X/task\n\n### Group 2 — Data Cleanup\n| # | After node          | Fields to remove          | Inline into          |\n|---|---------------------|---------------------------|----------------------|\n| 1 | \"Call Stripe API\"   | payment_method_details... | \"Parse response\"     |\n\n### Group 3 — Readability\n| # | Node (id)      | Suggested title                        |\n|---|----------------|----------------------------------------|\n| 1 | api (abc123)   | \"POST api.stripe.com/v1/charges\"       |\n| 2 | api_rpc (def)  | \"Call @payment-process\"                |\n\n### Group 4 — Resilience\n| # | Node                    | Issue                         | Action             |\n|---|-------------------------|-------------------------------|--------------------|\n| 1 | \"Call SMS API\"          | Missing timeout semaphor      | Add 30sec          |\n| 2 | \"Wait callback\" 🔴      | Missing timeout semaphor      | Add 3600sec        |\n\n### Requires action outside this process\n- Hardcoded URL in \"Call Stripe API\" → use /corezoid-variable-manager\n- Numeric conv_id 1307813 (×3 nodes)  → use /corezoid-alias-manager\n```\n\n---\n\n## Step 3 — Execute\n\n### Execution order\n\nAlways apply in this sequence:\n1. Group 1 — tact reduction (graph changes first)\n2. Group 4 — resilience (semaphors reference the now-clean graph)\n3. Group 2 — data cleanup (inline into final node set)\n4. Group 3 — naming (operates on final nodes)\n\n### Confirmation rules\n\n| Change | Confirm in AUTO | Confirm in PLAN |\n|--------|----------------|-----------------|\n| Merge set_param / code / condition | No | Yes per group |\n| api_rpc → api_copy | **Always** | **Always** |\n| Add semaphors | No | Yes per group |\n| Fill titles (critical nodes) | No | No |\n| Fill titles (other nodes) | No | Yes per group |\n| Fill `params` array | **Always** | **Always** |\n| Create variable for hardcoded value | **Always** | **Always** |\n\n### After all changes\n\n1. Write updated JSON to `PROCESS_PATH`.\n2. Call **`lint-process`** — fix any errors before proceeding.\n3. Call **`push-process`**.\n4. Notify the user: \"Deployed. Please **refresh the page** in Corezoid to see the updated process.\"\n\n---\n\n## Boundaries — what the optimizer does not do\n\n| Finding | Action |\n|---------|--------|\n| Hardcoded URLs / tokens | Flag + point to `/corezoid-variable-manager` |\n| Numeric conv_id without alias | Flag + point to `/corezoid-alias-manager` |\n| Full Markdown documentation | Point to `/corezoid-process-tech-writer` |\n| Cross-process audit | Point to `/corezoid-project-review` |\n| Extract subprocess (architecture) | Discuss with user + point to `/corezoid-create` |\n\n---\n\n## Reference Documents\n\n| Path | When to read |\n|------|-------------|\n| `${CLAUDE_PLUGIN_ROOT}/docs/node-structures.md` | JSON schemas for all node types |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/set-parameters-node.md` | set_param merge rules |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/code-node.md` | Code node structure |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/api-call-node.md` | API Call semaphor configuration |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/call-process-node.md` | api_rpc vs api_copy decision |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/copy-task-node.md` | api_copy structure |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/waiting-for-callback-node.md` | api_callback critical semaphor |\n| `${CLAUDE_PLUGIN_ROOT}/docs/process/error-handling.md` | Error node patterns |\n| `${CLAUDE_PLUGIN_ROOT}/docs/process/node-positioning-best-practices.md` | Positioning new nodes |\n"
}

SHA-256 of public snapshot: 926c0c0038718973b760005cf011ec790947cad840fc0d87adff501c7386e3e8