{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "Distilly: tạo và tiến hoá Person Profile",
    "quality_profile": "showcase",
    "views": [
      {
        "id": "create",
        "label": "Tạo mới",
        "focus": [
          "family",
          "intake",
          "sources",
          "analyze",
          "preview",
          "writer",
          "host"
        ],
        "note": "Chọn nhóm, trả lời intake, nạp tư liệu, phân tích 2 tuyến, xác nhận rồi mới ghi Skill."
      },
      {
        "id": "evolve",
        "label": "Tiến hoá",
        "focus": [
          "evolve",
          "writer",
          "host"
        ],
        "note": "Thêm file hoặc sửa bằng lời: backup phiên bản rồi cập nhật qua skill_writer, không ghi đè kết luận cũ."
      }
    ],
    "legend": {
      "mode": "hidden"
    }
  },
  "lanes": [
    {
      "id": "user",
      "label": "Người dùng"
    },
    {
      "id": "distilly",
      "label": "Distilly"
    },
    {
      "id": "out",
      "label": "Kết quả + tiến hoá"
    }
  ],
  "phases": [
    {
      "id": "intake-phase",
      "label": "Intake",
      "fromCol": 0,
      "toCol": 1
    },
    {
      "id": "analysis-phase",
      "label": "Tư liệu + phân tích",
      "fromCol": 2,
      "toCol": 3,
      "variant": "emphasis"
    },
    {
      "id": "write-phase",
      "label": "Xác nhận + ghi",
      "fromCol": 4,
      "toCol": 5,
      "variant": "dashed"
    }
  ],
  "mainPath": [
    "family",
    "intake",
    "sources",
    "analyze",
    "preview",
    "writer",
    "host"
  ],
  "nodes": [
    {
      "id": "family",
      "lane": "user",
      "col": 0,
      "type": "frontend",
      "label": "Chọn nhóm",
      "sublabel": "colleague / relationship / celebrity",
      "width": 150
    },
    {
      "id": "intake",
      "lane": "user",
      "col": 1,
      "type": "frontend",
      "label": "Intake",
      "sublabel": "3–4 câu hỏi",
      "width": 132
    },
    {
      "id": "sources",
      "lane": "distilly",
      "col": 2,
      "type": "database",
      "label": "Tư liệu",
      "sublabel": "Lark, DingTalk, file…",
      "width": 132
    },
    {
      "id": "analyze",
      "lane": "distilly",
      "col": 3,
      "type": "backend",
      "label": "Phân tích",
      "sublabel": "Work + Persona",
      "width": 132
    },
    {
      "id": "preview",
      "lane": "user",
      "col": 4,
      "type": "security",
      "label": "Xác nhận",
      "sublabel": "tóm tắt 5–8 dòng",
      "width": 132
    },
    {
      "id": "writer",
      "lane": "distilly",
      "col": 5,
      "type": "backend",
      "label": "skill_writer",
      "sublabel": "SKILL.md + manifest",
      "width": 132
    },
    {
      "id": "host",
      "lane": "out",
      "col": 5,
      "type": "cloud",
      "label": "Agent host",
      "sublabel": "8 host được hỗ trợ",
      "width": 132
    },
    {
      "id": "evolve",
      "lane": "out",
      "col": 3,
      "type": "messagebus",
      "label": "Tiến hoá",
      "sublabel": "người dùng thêm file / sửa",
      "width": 132
    }
  ],
  "edges": [
    {
      "id": "family-intake",
      "from": "family",
      "to": "intake"
    },
    {
      "id": "intake-sources",
      "from": "intake",
      "to": "sources",
      "variant": "emphasis"
    },
    {
      "id": "sources-analyze",
      "from": "sources",
      "to": "analyze"
    },
    {
      "id": "analyze-preview",
      "from": "analyze",
      "to": "preview",
      "variant": "emphasis"
    },
    {
      "id": "preview-writer",
      "from": "preview",
      "to": "writer",
      "label": "đồng ý",
      "variant": "emphasis"
    },
    {
      "id": "writer-host",
      "from": "writer",
      "to": "host",
      "label": "cài"
    },
    {
      "id": "evolve-writer",
      "from": "evolve",
      "to": "writer",
      "label": "backup + update",
      "variant": "dashed",
      "role": "branch"
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "Đầu ra",
      "items": [
        "Persona: giọng, cách quyết định, ứng xử",
        "Work Skill (colleague): phạm vi, quy trình, kinh nghiệm"
      ]
    },
    {
      "dot": "rose",
      "title": "Cần cân nhắc",
      "items": [
        "Có thể thu tin nhắn riêng nếu được cấp quyền",
        "Xin đồng ý của người được mô phỏng"
      ]
    }
  ]
}
