{
  "id": "create-claw-skill",
  "version": "1.0.0",
  "title": "create-claw-skill",
  "status": "process.active",
  "goal": {
    "text": "Convert a text skill or skill idea into a self-contained, template-backed claw skill."
  },
  "requirements": {
    "summary": "Preserve the source behavior across a concise claw entry, skill-local TEMPLATE.json, adjacent fallback document, and optional focused references.",
    "openQuestions": [],
    "acceptanceCriteria": [
      "The generated entry routes by whole-task, independent-stage, and mixed-stage ownership semantics without exposing storage scope.",
      "Independent-stage entries preserve the host-owned subplan handoff without duplicating adapter-owned Goal or progress effects.",
      "The generated template owns the structured workflow and contains choices only for real downstream branches; choice-aware guidance exposes valid ids once and one executable --choice command template.",
      "The template deliberately chooses whether a discussion delivery task adopts optional guidance.onPlanStart; executable templates start active without it by default.",
      "The adjacent fallback document preserves direct skill behavior for mixed-stage use and unavailable claw tooling.",
      "The generated TEMPLATE.json declares the independent template driver version and references this skill as its sole maintenance owner.",
      "The source template passes file-based validation and the converted package passes content coverage checks.",
      "The generated skill package is self-contained and its template id matches the entry."
    ]
  },
  "tasks": [
    {
      "id": 1,
      "title": "Confirm the user requirements and adapt the plan",
      "detail": "Confirm the user's requirements for the target skill and compare them with this generated plan before implementation. Adjust the plan to match the requested scope and workflow. Do not delete any sub-task or change any task id because template guidance depends on those ids. When a task is not applicable, keep it and change its description to mark it as removed from scope instead of deleting it.",
      "status": "pending",
      "guidance": {
        "onDone": {
          "default": {
            "mergeMode": "override",
            "summary": "The user requirements are confirmed and the plan reflects the requested scope without breaking template guidance.",
            "nextsteps": [
              "Inspect the source or skill idea using the adapted task descriptions.",
              "Preserve every sub-task id even when its description marks it as removed from scope."
            ],
            "nextTaskId": 2
          }
        }
      }
    },
    {
      "id": 2,
      "title": "Inspect the source and choose the conversion shape",
      "detail": "Read the source skill or distill the user idea. Identify its trigger, ordered workflow, tools, constraints, real control-flow branches, verification, lifecycle handoff, and companion files. For an existing TEMPLATE.json, keep driver maintenance internal to this skill: review and optimize the full package against the template-driver contract instead of only changing version metadata. Decide the conversion shape from evidence without asking the user to choose a template style. Treat claw plan start as optional global syntax sugar: adopt guidance.onPlanStart only for a genuine discussion-to-execution delivery point; otherwise start executable work in process.active.",
      "status": "pending",
      "guidance": {
        "onDone": {
          "default": {
            "mergeMode": "override",
            "summary": "The source behavior and conversion shape are clear; generate the package.",
            "nextsteps": [
              "Use choices only when the selected value changes the immediate downstream task or route.",
              "Use guidance.onPlanStart only when the current discussion task deliberately owns the transition into execution; do not add it as lifecycle boilerplate.",
              "For every choice task, verify completionChoices is the single valid-id source and guidance returns one claw task done --id <id> --choice <choice> command template.",
              "Keep long-form direct behavior in the adjacent fallback document."
            ],
            "nextTaskId": 3
          }
        }
      }
    },
    {
      "id": 3,
      "title": "Generate and complete the claw skill package",
      "detail": "Start with `node <create-claw-skill-dir>/scripts/create-claw-skill-stub.mjs --skill-name <skill-name> --out <target-skill-package>`. Add optional flags only when defaults do not fit. Replace generated TODOs, preserve companion files and links, and keep the entry focused on task-ownership routing while TEMPLATE.json owns execution. The stub writes the current template driver version. For an existing package, set its template version to the current template driver version only after the inspection and optimization pass is complete.",
      "status": "pending",
      "guidance": {
        "onDone": {
          "default": {
            "mergeMode": "override",
            "summary": "The converted package is ready for structural and coverage validation.",
            "nextsteps": [
              "Validate the development-source TEMPLATE.json by file path.",
              "Compare source behavior with its converted homes before closing out."
            ],
            "nextTaskId": 4
          }
        }
      }
    },
    {
      "id": 4,
      "title": "Validate structure and content coverage",
      "detail": "Use the host route in references/host-routing.md for validation and all workflow mutations; do not bypass a native adapter. Run the supported equivalent of `claw template validate --file <target-skill-package>/TEMPLATE.json` and confirm the returned version equals the current template driver version. Validate the skill package structure, and map important source behavior to entry, template tasks/guidance/rules/references, or the fallback document. For every task listed in choiceRequiredTasks, exercise its live workflow guidance and confirm completionChoices contains the valid ids while commandHints contains exactly one claw task done --id <id> --choice <choice> template and nextsteps does not repeat the ids. Use named `--template <id>` validation only after the skill is materialized in a supported runtime registry.",
      "status": "pending"
    }
  ],
  "references": [
    {
      "path": "references/host-routing.md",
      "why": "Maps workflow and validation operations to the actual native adapter or hostless route."
    },
    {
      "path": "FALLBACK.md",
      "why": "Plan-independent conversion workflow for mixed-stage use or unavailable claw tooling."
    },
    {
      "path": "references/template-authoring.md",
      "why": "Self-contained template, ownership routing, lifecycle, choice, and validation guidance."
    },
    {
      "path": "CONTENT-COVERAGE.md",
      "why": "Maps the create-claw-skill contract to its entry, template, fallback, references, and generator."
    },
    {
      "path": "references/template-upgrade.md",
      "why": "Review and maintain the independent template-driver contract without treating old stamps as runtime rejection."
    }
  ],
  "rules": [
    "Keep task ids numeric and workflow control in the template.",
    "Adapt the generated plan to confirmed user requirements without deleting sub-tasks or changing task ids; mark excluded work in the task description instead.",
    "Route by whether the skill owns the whole task, one independent stage, or only part of a mixed stage.",
    "Treat each batch item as a stage-level subplan when the skill owns that stage.",
    "For every subplan use references/host-routing.md and follow the owning host handoff; never manually duplicate adapter-owned Goal/progress effects.",
    "Let explicit template creation choose its runtime storage automatically.",
    "Preserve direct behavior in the adjacent fallback document and use focused references only when needed.",
    "Every TEMPLATE.json declares the independent template-driver version and names create-claw-skill as its only maintenance owner.",
    "Every guidance.onDone.choices task must expose valid ids once in completionChoices and one real --choice CLI command template without repeating ids in nextsteps.",
    "Treat claw plan start as optional global syntax sugar: templates opt into recommending it through the current task's guidance.onPlanStart, while ordinary plan and task mutations remain valid.",
    "Do not claim completion before file-based template validation and content coverage pass."
  ],
  "keyDecisions": [],
  "retrospective": {
    "summary": ""
  }
}
