← 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": "Corezoid state diagram editing specialist. Use when the user wants to modify, update, or fix an existing Corezoid state diagram — add or remove a state, change a transition, add a side effect on transition, fix the wiring of an api_callback state node, or rework transitions. Activate when the user says \"edit a state diagram\", \"add a state\", \"remove a state\", \"change transitions\", \"fix state diagram\", \"update state machine\", \"поправить state diagram\", \"изменить состояния\", or refers to modifying a .conv.json with conv_type \"state\".\n",
  "included_files": [],
  "name": "corezoid-state-diagram-edit",
  "skill_md_contents": "---\nname: corezoid-state-diagram-edit\ndescription: >\n  Corezoid state diagram editing specialist. Use when the user wants to modify,\n  update, or fix an existing Corezoid state diagram — add or remove a state, change\n  a transition, add a side effect on transition, fix the wiring of an api_callback\n  state node, or rework transitions. Activate when the user says \"edit a state\n  diagram\", \"add a state\", \"remove a state\", \"change transitions\", \"fix state\n  diagram\", \"update state machine\", \"поправить state diagram\", \"изменить состояния\",\n  or refers to modifying a .conv.json with conv_type \"state\".\n---\n\n# Edit an Existing Corezoid State Diagram\n\nYou are a specialist in modifying Corezoid **state diagrams** (`conv_type: \"state\"`) using the `corezoid` MCP server.\n\nA state diagram is a long-lived data store; modifying it means changing the set of states, the data conditions that drive transitions between them, or the side effects performed on transition. The driver processes that read / write the diagram are usually edited separately via `/corezoid-edit`.\n\nRead `${CLAUDE_PLUGIN_ROOT}/docs/state-diagrams/state-diagram-overview.md` for a refresher on the model before editing.\n\n---\n\n## Identify the State Diagram (MANDATORY FIRST STEP)\n\n**Before doing anything else**, resolve `PROCESS_PATH`:\n\n1. Check whether the user already provided an identifier — a file path, state diagram name, or numeric id — in the current message or conversation history.\n2. If no identifier is provided, ask:\n   > \"Please specify the state diagram — a file path (e.g. `1863140_User_Status.conv.json`), a name, or a state diagram id.\"\n   Do **not** call any MCP tools until the user provides one.\n3. If the user gives a **name or id**, search the local working directory for the matching `.conv.json` using `find` / `grep`.\n4. Open the file and **confirm `\"conv_type\": \"state\"`** at the root. If `conv_type` is `\"process\"`, this is a regular process — hand off to `/corezoid-edit` instead.\n5. Once `PROCESS_PATH` is confirmed, analyze the file before changing anything.\n\n---\n\n## Step 1: Analyze the State Diagram\n\nRead the file and map out:\n\n- The list of state nodes (every node with `obj_type: 0` whose first logic is `api_callback`). Note each state's `id`, `title`, and outbound `go_if_const` transitions.\n- The Start node and which state it routes to (the initial state).\n- Any helper nodes between states (Set Parameters, Code, Modify Task, Copy Task, Delay, Queue).\n- Terminal nodes (`obj_type: 2`).\n\n> 🔍 If you see `obj_type: 3` state nodes, you are looking at the legacy state-node format. The current Corezoid format uses `obj_type: 0` with `api_callback` as the first logic. Convert old nodes to the new format only if the user explicitly asks — otherwise leave them as-is and edit in place.\n\nMake sure you also locate any **driver processes** that reference this state diagram (search the project for `conv[<sd_id>]`, `conv[@<alias>]`, and `api_copy` nodes with `conv_id: <sd_id>`). When editing, you may need to update those drivers too.\n\n---\n\n## Step 2: Plan the Edit\n\nCategorise the change before touching JSON:\n\n| Change type | What to touch |\n|---|---|\n| Add a new state | Insert a new `obj_type: 0` state node with `api_callback` + transitions + self-loop. Wire at least one inbound transition from an existing state's `go_if_const`. |\n| Remove a state | Delete the node and re-route every inbound transition that pointed to it. Search the file for `to_node_id: \"<deleted_id>\"`. |\n| Change a transition condition | Edit the `conditions` array of the relevant `go_if_const` in the source state. |\n| Re-target a transition | Change `to_node_id` of the relevant `go_if_const`. |\n| Add a side effect on transition | Insert a Modify Task / Copy Task / Set Parameters node between the source state and the target state. Update the source state's `go_if_const.to_node_id` to point at the new helper, and have the helper `go` to the original target. |\n| Rename a state | Change `title` only — the `id` must stay the same to preserve drivers that reference it. |\n| Add an alias | Hand off to `/corezoid-alias-manager`. |\n\n---\n\n## Step 3: Apply Changes\n\nEdit `PROCESS_PATH` directly.\n\n### Core rules\n\n- Connect nodes only through `go` / `go_if_const` `to_node_id` fields.\n- Every node that has `err_node_id` (Code, Set Parameters, Copy Task, Modify Task, Queue) must point at a real End: Error node — never to a state node.\n- Node ids are 24-character hex: `^[0-9a-f]{24}$`. For new nodes, generate fresh ids; **never reuse** an old id, even if its node was deleted.\n- Use descriptive `title` values — they are the state names visible on the canvas and dashboards.\n- Layout: keep states roughly on the same `y` lane (≈ 400); increment `x` by ≈ 320–400 between adjacent states. Start at `y = 100`. End nodes at the bottom.\n\n### State node invariants (do not break these)\n\nFor every state node:\n\n- `obj_type: 0`\n- First logic is exactly `{ \"type\": \"api_callback\" }` (no extra fields)\n- Every outbound transition is a `go_if_const` between the `api_callback` and the trailing `go`\n- The final logic is `{ \"type\": \"go\", \"to_node_id\": \"<self_id>\" }` — the \"stay here\" fallback\n- `extra` contains `\"icon\":\"state\"`\n- No `err_node_id` on `api_callback`\n\nIf you add or modify transitions, the order matters — **first matching `go_if_const` wins**. Put more specific conditions first.\n\n### Allowed logics\n\nOnly these logics may appear inside a state diagram. Adding anything else will fail validation on push.\n\n| Allowed | Type |\n|---|---|\n| Start | `go` (`obj_type: 1`) |\n| State | `api_callback` + `go_if_const`s + self-`go` |\n| Condition | `go_if_const` |\n| Code | `api_code` |\n| Set Parameters | `set_param` |\n| Copy Task (fan-out) | `api_copy` with `mode: \"create\"` |\n| Modify Task (by ref) | `api_copy` with `mode: \"modify\"` |\n| Delay | semaphor-only |\n| Queue | `api_queue` |\n| End | (`obj_type: 2`) |\n\n**Forbidden:** `api`, `api_rpc`, `api_rpc_reply`, `db_call`, `git_call`, `api_sum`, `api_form`. If the user asks to add one of these, push back: move the side effect into the driver process and explain why.\n\n### Common pitfalls\n\n- Adding a state but forgetting to wire any inbound transition → unreachable state.\n- Deleting a state but leaving a `go_if_const` somewhere with `to_node_id` pointing to the deleted id → push will fail with \"unknown node\".\n- Reordering transitions accidentally: the **first matching `go_if_const` wins**, so order is semantically meaningful.\n- Using `api_copy mode: \"modify\"` from inside the state diagram targeting its own ref — that re-triggers `api_callback` and can loop. Use `set_param` to update the current task in place instead.\n- Forgetting to update the driver process when you rename a state and the driver compares against its name (e.g. `{{conv[…].ref[…].status}} == \"Active\"`). The state name is `title`; the driver compares against a stored **value**, not the title — confirm with the user which they're checking.\n\n---\n\n## Step 4: Deploy the Changes\n\n**MANDATORY: Always push after any change — even if work is in-flight. Without push, the changes exist only on disk.**\n\nCall MCP tool **`push-process`** with `process_path: \"<PROCESS_PATH>\"`.\n\nIf push fails:\n- Re-read the file and confirm `\"conv_type\": \"state\"` is still at the root (a stray editor save or auto-format may have flipped it).\n- Lint with **`lint-process`** to localise the issue.\n- Confirm every state node still ends in `go → self_id`.\n- Confirm no forbidden logic types were introduced.\n\nAfter a successful push, notify the user:\n\n> \"State diagram updated. Refresh the Corezoid page to see the new states / transitions. Any tasks already parked in renamed states keep their `id` references intact, but tasks parked in **deleted** states are now stranded — check the workspace before deleting a populated state.\"\n\n> ⚠️ **Live data warning:** Unlike regular processes, a state diagram usually has **live tasks parked in its states**. Deleting or restructuring a state can strand those tasks. Before deleting a state, ask the user whether they want to migrate parked tasks first (e.g. by modifying their `ref` so they transition out of the doomed state).\n\n---\n\n## Step 5 (optional): Update Driver Processes\n\nIf your edit changed the **observable interface** of the state diagram — added a new field that drivers should now read, renamed a field drivers compare against, or removed a state drivers used to detect — hand off to `/corezoid-edit` for each driver process that needs updating.\n\nTo find driver processes affected by the edit, search the project:\n\n```\ngrep -rn \"conv\\[<sd_id>\\]\" .\ngrep -rn \"conv_id\\\": <sd_id>\" .\ngrep -rn \"conv\\[@<alias>\\]\" .\n```\n\n---\n\n## Reference Documents\n\n| Path | When to read |\n|---|---|\n| `${CLAUDE_PLUGIN_ROOT}/docs/state-diagrams/state-diagram-overview.md` | Concepts, allowed nodes, root structure |\n| `${CLAUDE_PLUGIN_ROOT}/docs/state-diagrams/state-diagram-node-structures.md` | Canonical JSON for every allowed node type |\n| `${CLAUDE_PLUGIN_ROOT}/docs/state-diagrams/state-diagram-process-interaction.md` | How driver processes read / create / modify state tasks |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/set-state-node.md` | Background and the `{{conv[...]}}` template |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/copy-task-node.md` | Error catalogue for `api_copy` |\n| `${CLAUDE_PLUGIN_ROOT}/docs/nodes/condition-node.md` | `go_if_const` reference |\n| `${CLAUDE_PLUGIN_ROOT}/docs/variables-guide.md` | Variables (`{{env_var[@…]}}`) |\n\n## Example Files\n\n| Path | Description |\n|---|---|\n| `${CLAUDE_PLUGIN_ROOT}/samples/state-diagrams/user-status-state-diagram.conv.json` | Minimal two-state diagram (`Active` ⇄ `Inactive`) |\n| `${CLAUDE_PLUGIN_ROOT}/samples/state-diagrams/user-status-driver-process.conv.json` | Companion driver process |\n"
}

SHA-256 of public snapshot: 4bec2b79e6e78eb21f80d5c7d7730e1ea8fd592711a0e410cbce76b48339c63c