{
  "schema_version": 1,
  "diagram_type": "architecture",
  "meta": {
    "title": "交付流程工具版圖",
    "locale": "zh-TW",
    "quality_profile": "showcase",
    "output": "docs/workflow/diagrams/01-tooling.html"
  },
  "components": [
    { "id": "operator", "type": "external", "label": "Operator（人）", "sublabel": "需求、釐清、git push", "pos": [40, 200], "size": [150, 64] },
    { "id": "claude", "type": "backend", "label": "Claude Code", "sublabel": "agent 本體", "pos": [270, 200], "size": [150, 64], "tag": "auto mode" },
    { "id": "skills", "type": "backend", "label": "Skills", "sublabel": "~/.claude/skills（ron-skills）", "pos": [270, 60], "size": [150, 64] },
    { "id": "memory", "type": "database", "label": "Memory／AGENTS.md", "sublabel": "規則與教訓", "pos": [270, 340], "size": [150, 64] },
    { "id": "scripts", "type": "backend", "label": "scripts/*.mjs", "sublabel": "流程的唯一入口", "pos": [500, 200], "size": [150, 64], "tag": "規則變腳本" },
    { "id": "orca", "type": "cloud", "label": "Orca CLI", "sublabel": "只負責建／刪 worktree", "pos": [500, 60], "size": [150, 64] },
    { "id": "docker", "type": "messagebus", "label": "Docker Desktop", "sublabel": "testcontainers MySQL", "pos": [500, 340], "size": [150, 64] },
    { "id": "gitlab", "type": "cloud", "label": "GitLab", "sublabel": "Issues／labels／board", "pos": [730, 200], "size": [150, 64], "tag": "唯一看板" },
    { "id": "worktree", "type": "database", "label": "Issue worktree", "sublabel": "~/orca/workspaces/spay2", "pos": [730, 60], "size": [150, 64] },
    { "id": "integ", "type": "database", "label": "整合分支", "sublabel": "主 checkout", "pos": [960, 60], "size": [150, 64] },
    { "id": "hooks", "type": "security", "label": "git hooks", "sublabel": "pre-push／reference-transaction", "pos": [960, 200], "size": [150, 64] }
  ],
  "connections": [
    { "id": "op-claude", "from": "operator", "to": "claude", "label": "指令", "variant": "emphasis" },
    { "id": "claude-skills", "from": "claude", "to": "skills", "label": "載入", "fromSide": "top", "toSide": "bottom" },
    { "id": "claude-memory", "from": "claude", "to": "memory", "label": "讀寫", "variant": "dashed", "fromSide": "bottom", "toSide": "top" },
    { "id": "claude-scripts", "from": "claude", "to": "scripts", "label": "執行", "variant": "emphasis" },
    { "id": "scripts-gitlab", "from": "scripts", "to": "gitlab", "label": "API 讀寫", "variant": "emphasis" },
    { "id": "scripts-orca", "from": "scripts", "to": "orca", "label": "create／rm", "fromSide": "top", "toSide": "bottom" },
    { "id": "scripts-docker", "from": "scripts", "to": "docker", "label": "測試", "variant": "dashed", "fromSide": "bottom", "toSide": "top" },
    { "id": "orca-worktree", "from": "orca", "to": "worktree", "label": "建立" },
    { "id": "worktree-integ", "from": "worktree", "to": "integ", "label": "合入" },
    { "id": "hooks-integ", "from": "hooks", "to": "integ", "label": "守護", "variant": "security", "fromSide": "top", "toSide": "bottom" }
  ],
  "cards": [
    { "dot": "cyan", "title": "Claude Code 這一側", "items": ["skills 定義「怎麼做」，memory 與 AGENTS.md 記「不要再犯」", "所有流程動作都收斂成 scripts/ 內的腳本，agent 不直接呼叫 glab 或 git merge"] },
    { "dot": "emerald", "title": "外部系統", "items": ["GitLab：Issue、狀態 label、Development board、整合分支 remote", "Orca：建立與移除 worktree，worktree 都在 ~/orca/workspaces/spay2", "Docker Desktop：testcontainers 跑 Docker-backed 測試"] },
    { "dot": "rose", "title": "守門", "items": ["pre-push 跑 check-before-push.sh；reference-transaction 擋掉繞過腳本的合併", "git push 由 Operator 在主 checkout 執行，不在 agent 權限內"] }
  ]
}
