{
  "schemaVersion": 10,
  "extends": "yadflow-default@2",
  "phases": [
    { "id": "foundation", "name": "Foundation", "level": "product", "runs": "once", "built": true,
      "description": "The Product level, written once: what the product is for and how it will be built. Optional, but every epic reads it when it exists." },
    { "id": "discover", "name": "Discover", "part": "Shape", "level": "feature", "runs": "once", "built": true,
      "description": "Say what the change is and why: the optional analysis, then the epic." },
    { "id": "design", "name": "Design", "part": "Shape", "level": "feature", "runs": "once", "built": true,
      "description": "Decide how it is built: the architecture and its locked contract, and the user interface when there is one." },
    { "id": "plan", "name": "Plan", "part": "Shape", "level": "feature", "runs": "once", "built": true,
      "description": "Split the work into stories, and write the test cases that prove them." },
    { "id": "build", "name": "Build", "part": "Build", "level": "feature", "runs": "loop", "over": ["story", "repo"], "built": true,
      "description": "Each story is built in each repo it names, one lane at a time: spec, tasks, implement and checks by the agent, then a person's engineer review and merge." },
    { "id": "release", "name": "Release", "part": "Run", "level": "feature", "runs": "loop", "over": ["release"], "built": false,
      "description": "Not built yet." },
    { "id": "operate", "name": "Operate", "part": "Run", "level": "feature", "runs": "once", "built": false,
      "description": "Not built yet." }
  ],
  "steps": [
    { "id": "foundation", "name": "Foundation", "phase": "foundation", "kind": "author",
      "description": "Write the Product's foundation once: its purpose, scope, first release (MVP), roadmap, stack and repos, plus its market and risks if wanted. Every epic builds on it.", "driver": "pair",
      "artifact": { "type": "set", "path": "foundation/",
        "files": ["purpose.md", "market.md", "scope.md", "mvp.md", "roadmap.md", "stack.md", "repos.md", "risks.md"],
        "optional": ["market.md", "risks.md"] },
      "optional": false, "gate": { "riskTags": [], "advance": "human",
        "description": "A person reviews the foundation and approves it: on its review PR/MR, then merges it, when the Product has a platform; with `yad gate approve` and `yad gate advance` when it has none (in solo mode no approval is counted, so only `yad gate advance`). The step never moves on by itself." }, "skills": ["yad-discovery"], "behaviours": ["product-level"],
      "extraPaths": [], "inputs": [], "replaces": "discovery",
      "provider": { "id": "yadflow", "version": 1, "origin": "foundation" } },
    { "id": "discovery", "name": "Discovery", "phase": "foundation", "kind": "author",
      "description": "The old Product-level step, replaced by Foundation. Kept so a Product that still uses it can be read.", "driver": "pair",
      "artifact": { "type": "set", "path": "discovery/",
        "files": ["market-research.md", "competitor-analysis.md", "current-state.md", "feasibility.md", "requirements.md", "roadmap.md"],
        "optional": [] },
      "optional": false, "gate": { "riskTags": [], "advance": "human",
        "description": "A person reviews the discovery and approves it: on its review PR/MR, then merges it, when the Product has a platform; with `yad gate approve` and `yad gate advance` when it has none (in solo mode no approval is counted, so only `yad gate advance`). The step never moves on by itself." }, "skills": ["yad-discovery"], "behaviours": ["product-level"],
      "extraPaths": [], "inputs": [], "retired": true,
      "provider": { "id": "yadflow", "version": 1, "origin": "discovery" } },
    { "id": "analysis", "name": "Analysis", "phase": "discover", "kind": "author",
      "description": "Study the problem before the epic: who it is for, the options, and the evidence. The analysis-first and spike routes start here.", "driver": "pair",
      "artifact": { "type": "file", "path": "analysis.md" },
      "optional": false, "gate": { "riskTags": [], "advance": "human",
        "description": "A person reviews the analysis and approves it: on its review PR/MR, then merges it, when the Product has a platform; with `yad gate approve` and `yad gate advance` when it has none (in solo mode no approval is counted, so only `yad gate advance`). The step never moves on by itself." }, "skills": ["yad-analysis"], "behaviours": [],
      "extraPaths": [], "inputs": [],
      "provider": { "id": "yadflow", "version": 1, "origin": "analysis" } },
    { "id": "epic", "name": "Epic", "phase": "discover", "kind": "author",
      "description": "Describe the change: the problem, the goal, what is in and out of scope, and how success is measured. It sets the work-item type the rest of the chain follows.", "driver": "pair",
      "artifact": { "type": "file", "path": "epic.md" },
      "optional": false, "gate": { "riskTags": [], "advance": "human",
        "description": "A person reviews the epic and approves it: on its review PR/MR, then merges it, when the Product has a platform; with `yad gate approve` and `yad gate advance` when it has none (in solo mode no approval is counted, so only `yad gate advance`). The step never moves on by itself." }, "skills": ["yad-epic"], "behaviours": ["work-item-source"],
      "extraPaths": [], "inputs": ["analysis"],
      "provider": { "id": "yadflow", "version": 1, "origin": "epic" } },
    { "id": "architecture", "name": "Architecture", "phase": "design", "kind": "author",
      "description": "Decide how the change is built across the repos, and lock the contract between them. A later change to the locked contract needs its own review.", "driver": "pair",
      "artifact": { "type": "file", "path": "architecture.md" },
      "optional": false, "gate": { "riskTags": ["contract"], "advance": "human",
        "description": "A person reviews the architecture and approves it: on its review PR/MR, then merges it, when the Product has a platform; with `yad gate approve` and `yad gate advance` when it has none (in solo mode no approval is counted, so only `yad gate advance`). The step never moves on by itself." }, "skills": ["yad-architecture"], "behaviours": ["locks-contract"],
      "extraPaths": ["contract.md", ".sdlc/contract-lock.json"], "inputs": ["epic"],
      "provider": { "id": "yadflow", "version": 1, "origin": "architecture" } },
    { "id": "ui-design", "name": "UI design", "phase": "design", "kind": "author",
      "description": "Design the screens and flows, and link the design files. Optional on the routes that offer it: skip it when the change has no user interface.", "driver": "pair",
      "artifact": { "type": "file", "path": "ui-design.md" },
      "optional": false, "gate": { "riskTags": [], "advance": "human",
        "description": "A person reviews the UI design and approves it: on its review PR/MR, then merges it, when the Product has a platform; with `yad gate approve` and `yad gate advance` when it has none (in solo mode no approval is counted, so only `yad gate advance`). The step never moves on by itself." }, "skills": ["yad-ui"], "behaviours": [],
      "extraPaths": ["DESIGN.md", ".sdlc/design-links.json"], "inputs": ["epic", "architecture"],
      "provider": { "id": "yadflow", "version": 1, "origin": "ui-design" } },
    { "id": "stories", "name": "Stories", "phase": "plan", "kind": "author",
      "description": "Split the epic into stories, each tagged with the repos it touches. Its approval ends Shape, so Build can start.", "driver": "pair",
      "artifact": { "type": "folder", "path": "stories/", "unit": "story" },
      "optional": false, "gate": { "riskTags": [], "advance": "human",
        "description": "A person reviews the stories and approves them: on their review PR/MR, then merges it, when the Product has a platform; with `yad gate approve` and `yad gate advance` when it has none (in solo mode no approval is counted, so only `yad gate advance`). The step never moves on by itself." }, "skills": ["yad-stories"], "behaviours": ["ends-shape"],
      "extraPaths": [], "inputs": ["epic", "architecture", "ui-design"],
      "provider": { "id": "yadflow", "version": 1, "origin": "stories" } },
    { "id": "test-cases", "name": "Test cases", "phase": "plan", "kind": "author",
      "description": "Write the test cases that prove the stories work. It runs beside Build, not before it.", "driver": "pair",
      "artifact": { "type": "file", "path": "test-cases.md" },
      "optional": false, "gate": { "riskTags": [], "advance": "human",
        "description": "A person reviews the test cases and approves them: on their review PR/MR, then merges it, when the Product has a platform; with `yad gate approve` and `yad gate advance` when it has none (in solo mode no approval is counted, so only `yad gate advance`). The step never moves on by itself." }, "skills": ["yad-test-cases"], "behaviours": ["parallel-with-build"],
      "extraPaths": [".sdlc/test-links.json"], "inputs": ["stories"],
      "provider": { "id": "yadflow", "version": 1, "origin": "test-cases" } },
    { "id": "spec", "name": "Spec", "phase": "build", "kind": "author",
      "description": "For one story in one repo, write the detailed spec the code is built from.", "driver": "agent",
      "artifact": null,
      "optional": false, "gate": null, "skills": ["yad-spec"], "behaviours": ["spec-source"],
      "extraPaths": [], "inputs": ["stories"],
      "provider": { "id": "yadflow", "version": 1, "origin": "spec" } },
    { "id": "tasks", "name": "Tasks", "phase": "build", "kind": "author",
      "description": "Break the spec into small, ordered tasks, each naming the files it may touch (aim for 3 or fewer).", "driver": "agent",
      "artifact": null,
      "optional": false, "gate": null, "skills": ["yad-spec"], "behaviours": [],
      "extraPaths": [], "inputs": ["spec"],
      "provider": { "id": "yadflow", "version": 1, "origin": "tasks" } },
    { "id": "implement", "name": "Implement", "phase": "build", "kind": "author",
      "description": "Write the code and its tests for one task, on the task's branch.", "driver": "agent",
      "artifact": null,
      "optional": false, "gate": null, "skills": ["yad-implement"], "behaviours": ["code-change"],
      "extraPaths": [], "inputs": ["tasks"],
      "provider": { "id": "yadflow", "version": 1, "origin": "implement" } },
    { "id": "checks", "name": "Checks", "phase": "build", "kind": "author",
      "description": "Run the CI gates on this machine (`yad run checks`). Then the task's PR/MR is opened, so CI runs them too; `yad dial open-pr` says whether the agent asks first.", "driver": "agent",
      "artifact": null,
      "optional": false, "gate": null, "skills": ["yad-checks"], "behaviours": ["ci-gates"],
      "extraPaths": [], "inputs": ["implement"],
      "provider": { "id": "yadflow", "version": 1, "origin": "checks" } },
    { "id": "engineer-review", "name": "Engineer review", "phase": "build", "kind": "review",
      "description": "A person reviews the PR/MR, approves it and merges it. An AI first pass may help, but the merge is always a person's.", "driver": "human",
      "artifact": null,
      "optional": false, "gate": null, "skills": ["yad-engineer-review"], "behaviours": ["merge-gate"],
      "extraPaths": [], "inputs": ["checks"],
      "provider": { "id": "yadflow", "version": 1, "origin": "engineer-review" } }
  ],
  "routes": [
    { "id": "classic", "name": "the 10-step chain",
      "steps": ["epic", "architecture", { "id": "ui-design", "optional": true }, "stories", "test-cases"] },
    { "id": "analysis-first", "name": "the 12-step chain",
      "steps": ["analysis", "epic", "architecture", { "id": "ui-design", "optional": true }, "stories", "test-cases"] },
    { "id": "chore", "name": "the upkeep lane", "steps": ["epic", "stories"] },
    { "id": "spike", "name": "the investigation lane", "steps": ["analysis", "epic", "stories"] },
    { "id": "discovery", "name": "the product front-zero", "steps": ["discovery"], "retired": true },
    { "id": "foundation", "name": "the Product Foundation", "steps": ["foundation"] },
    { "id": "lane", "name": "the Build lane", "steps": ["spec", "tasks", "implement", "checks", "engineer-review"] }
  ],
  "plugins": []
}
