{
  "formula": "mol-polecat-work",
  "description": "Full polecat lifecycle from assignment to decommission.\n\nThis proto enables nondeterministic idempotence for polecat work. A polecat that crashes after any step can restart, read its molecule state, and continue from the last completed step. No work is lost.\n\n## Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| issue | Yes | The source issue ID being worked on |",
  "version": 1,
  "vars": {
    "issue": {
      "required": true,
      "description": "The source issue ID being worked on"
    }
  },
  "steps": [
    {
      "id": "load-context",
      "title": "Load context",
      "description": "Run gt prime and bd prime. Verify issue assignment.\nCheck inbox for any relevant messages.\n\nRead the assigned issue ({{issue}}) and understand the requirements.\nIdentify any blockers or missing information."
    },
    {
      "id": "implement",
      "title": "Implement",
      "needs": ["load-context"],
      "description": "Implement the solution for {{issue}}. Follow codebase conventions.\nFile discovered work as new issues with bd create.\n\nMake regular commits with clear messages.\nKeep changes focused on the assigned issue."
    },
    {
      "id": "self-review",
      "title": "Self-review",
      "needs": ["implement"],
      "description": "Review your own changes. Look for:\n- Bugs and edge cases\n- Style issues\n- Missing error handling\n- Security concerns\n\nFix any issues found before proceeding."
    },
    {
      "id": "request-shutdown",
      "title": "Request shutdown",
      "needs": ["self-review"],
      "description": "Send shutdown request to Witness.\nWait for termination.\n\nThe polecat is now ready to be cleaned up.\nDo not exit directly - wait for Witness to kill the session."
    }
  ]
}
