{
  "name": "spec-clarify-plan-oracle",
  "version": "1.0.0",
  "description": "Read-only product workflow with a clarification gate before planning.",
  "readOnly": true,
  "defaultExecution": "plan_only",
  "steps": [
    {
      "id": "spec",
      "agent": "specifier",
      "task": "Convert goal into a testable spec for: {goal}. Preserve original ask: {original_user_ask}.",
      "expectedOutcome": "spec.v1 with acceptance criteria and open questions",
      "requiredTools": ["read", "grep", "find", "ls"],
      "outputContract": "spec.v1",
      "mustDo": ["Stay read-only", "Make acceptance criteria observable", "State assumptions and open questions", "Cite evidence consulted"],
      "mustNotDo": ["No edits", "No writes", "No bash", "No secrets or .env reads", "No commits", "No live child execution"],
      "context": "Chain {chain}, step {step_id}; original ask: {original_user_ask}; previous steps: {previous_step_ids}"
    },
    {
      "id": "clarify",
      "agent": "clarifier",
      "task": "Review the prior spec for goal: {goal}. Score clarity and decide if planning is allowed. If clarity_score < 70 or BLOCKED, return allow_plan=no.",
      "expectedOutcome": "clarification.v1 with clarity_score, verdict, allow_plan, questions, assumptions, and minimum_to_plan",
      "requiredTools": ["read", "grep", "find", "ls"],
      "outputContract": "clarification.v1",
      "mustDo": ["Stay read-only", "Score clarity 0-100", "Ask guided questions", "Block planning when acceptance criteria are not testable"],
      "mustNotDo": ["No edits", "No writes", "No bash", "No secrets or .env reads", "No commits", "No live child execution"],
      "context": "Chain {chain}, step {step_id}; original ask: {original_user_ask}; previous steps: {previous_step_ids}"
    },
    {
      "id": "plan",
      "agent": "planner",
      "task": "Plan only if clarification allows planning for goal: {goal}. Use prior spec/clarification evidence from: {previous_step_ids}. State assumptions and stop if allow_plan=no.",
      "expectedOutcome": "Bounded plan or explicit stop decision if clarification blocks planning",
      "requiredTools": ["read", "grep", "find", "ls"],
      "outputContract": "plan.v1",
      "mustDo": ["Stay plan-only and read-only", "Consume prior spec and clarification", "Respect allow_plan gate", "Name validation commands"],
      "mustNotDo": ["No edits", "No writes", "No bash", "No secrets or .env reads", "No commits", "No live child execution"],
      "context": "Chain {chain}, step {step_id}; original ask: {original_user_ask}; previous steps: {previous_step_ids}"
    },
    {
      "id": "oracle",
      "agent": "oracle",
      "task": "Review the clarification-gated plan for goal: {goal}. Return PASS/FAIL/WARN and no_ship without editing.",
      "expectedOutcome": "Oracle verdict on whether the clarified plan is safe",
      "requiredTools": ["read", "grep", "find", "ls"],
      "outputContract": "oracle.v1",
      "mustDo": ["Stay read-only", "Check plan against spec and clarification", "Flag missing validation or unsafe scope", "Return clear PASS/FAIL/WARN"],
      "mustNotDo": ["No edits", "No writes", "No bash", "No secrets or .env reads", "No commits", "No live child execution"],
      "context": "Chain {chain}, step {step_id}; original ask: {original_user_ask}; previous steps: {previous_step_ids}"
    }
  ]
}
