{
  "id": "recipe.edit-with-wire-actions",
  "goal": "Edit an existing diagram with canonical WireAction batches.",
  "readFirst": [
    "/llm/mcp.shape.json",
    "/llm/schema/wire-diagram.json"
  ],
  "preferredPath": [
    "Load the current WireDiagram first.",
    "Group related edits into a single batch action or MCP apply_actions call.",
    "Use node.patch for field updates and node.add for new workflow steps.",
    "Use edge.connect only when adding a connection, and prefer target from refs unless edge metadata is required.",
    "Check changedNodeIds, changedEdgeIds, and validation from apply_actions.",
    "Repair validation issues before additional rendering."
  ],
  "actionBatch": [
    {
      "type": "node.add",
      "node": {
        "id": "review",
        "kind": "human",
        "title": "Review reply",
        "from": "draft"
      }
    },
    {
      "type": "node.patch",
      "id": "send",
      "patch": {
        "from": "review"
      }
    }
  ],
  "mcpPath": [
    "get_diagram_json({ diagramId })",
    "apply_actions({ diagramId, actions })",
    "validate({ diagramId })"
  ],
  "avoid": [
    "Do not rewrite the whole diagram for a small edit unless replacement is the intended operation.",
    "Do not create duplicate connections through both from and edges[].",
    "Do not introduce versioned action names."
  ]
}
