[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72W13G24R7ZBGEB68568S6Z":3,"skill-same:01M72W13G24R7ZBGEB68568S6Z":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M72W13G24R7ZBGEB68568S6Z","comet-build",null,"Comet Phase 3: Plan and Build. Invoke with \u002Fcomet-build. Create plans and select execution method (subagent or direct) for implementation.","rpamis\u002Fcomet","rpamis","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153429891?v=4","01M72VXBR7EQYMM7KN8C19244V","01M72VXBRYC06QG0ZH0JBGV09V",3298,"MIT","https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet\u002Fblob\u002Fmaster\u002Feval\u002Flocal\u002Fskills\u002Fbenchmarks\u002F039-release\u002Fcomet-classic-039-build\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: comet-build\ndescription: \"Comet Phase 3: Plan and Build. Invoke with \u002Fcomet-build. Create plans and select execution method (subagent or direct) for implementation.\"\n---\n\n# Comet Phase 3: Plan and Build (Build)\n\n## Prerequisites\n\n- Design Doc has been created (Phase 2 complete)\n- Active change exists\n\n## Steps\n\n### 0. Entry State Verification (Entry Check)\n\nExecute entry verification:\n\n```bash\nCOMET_ENV=\"${COMET_ENV:-$(find . \"$HOME\"\u002F.*\u002Fskills \"$HOME\u002F.config\" \"$HOME\u002F.gemini\" -path '*\u002Fcomet\u002Fscripts\u002Fcomet-env.sh' -type f -print -quit 2>\u002Fdev\u002Fnull)}\"\nif [ -z \"$COMET_ENV\" ]; then\n  echo \"ERROR: comet-env.sh not found. Ensure the comet skill is installed.\" >&2\n  return 1\nfi\n. \"$COMET_ENV\"\n\"$COMET_BASH\" \"$COMET_STATE\" check \u003Cname> build\n```\n\nProceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.\n\n**Idempotency**: All build phase operations can be safely re-executed. Read `.comet.yaml` `phase` field to confirm still in build, read plan header `base-ref`, then use `grep -n '\\- \\[ \\]' tasks.md | head -1` to find the first unchecked task. Already-committed tasks must not be re-committed.\n\n### 1. Create Plan (Subagent Offload)\n\nCreate the implementation plan through a subagent, avoiding planning skill occupying main session context. Plan files and execution feedback must use the language of the user request that triggered this workflow.\n\n**Subagent instructions**:\n\nYou are an implementation planning expert. Create an implementation plan based on the following inputs:\n\n1. **Immediately execute:** Use the Skill tool to load the Superpowers `writing-plans` skill. Skipping this step is prohibited. After the skill loads, ARGUMENTS must include: `Language: Use the language of the user request that triggered this workflow`\n2. Read the Design Doc (technical design document under `docs\u002Fsuperpowers\u002Fspecs\u002F`)\n3. Read `openspec\u002Fchanges\u002F\u003Cname>\u002Ftasks.md` (task boundaries)\n4. Follow the skill's guidance to create the plan\n\nPlan requirements:\n- Save to `docs\u002Fsuperpowers\u002Fplans\u002FYYYY-MM-DD-\u003Cfeature>.md`\n- Reference design document, break down into executable tasks\n- **Plan file header must contain associated metadata**:\n\n```yaml\n---\nchange: \u003Copenspec-change-name>\ndesign-doc: docs\u002Fsuperpowers\u002Fspecs\u002FYYYY-MM-DD-\u003Ctopic>-design.md\nbase-ref: \u003Cgit rev-parse HEAD before implementation>\n---\n```\n\n`base-ref` is used during verification to measure committed changes across the full implementation range. Record the current commit when creating the plan:\n\n```bash\ngit rev-parse HEAD\n```\n\nWrite the plan to file, then return the file path.\n\n**Execute subagent**: Use the current platform's subagent dispatch mechanism to send the above task.\n\nAfter the subagent completes:\n- If a valid file path is returned and the file exists, record it as the plan\n- If the subagent fails or returns an invalid path, fall back to loading the Superpowers `writing-plans` skill inline in the main session (degraded fallback)\n\n### 2. Update Plan Status and Provide Plan-Ready Pause Point\n\nRecord plan path:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> plan docs\u002Fsuperpowers\u002Fplans\u002FYYYY-MM-DD-feature.md\n```\n\nNo manual phase update needed — guard auto-transitions when exit conditions are met.\n\nAfter the plan is recorded, immediately provide a new user decision point:\n\n| Option | Behavior | Description |\n|--------|----------|-------------|\n| A | Continue execution | Stay in the current model and proceed to Step 3 to choose workspace isolation and execution method |\n| B | Pause to switch model | Record `build_pause: plan-ready`, stop this `\u002Fcomet-build` invocation, and allow the user to resume later from `\u002Fcomet` or `\u002Fcomet-build` |\n\nThis is a user decision point. **Must follow the `comet\u002Freference\u002Fdecision-point.md` protocol to pause and wait for the user to explicitly choose**. Must not auto-continue and must not write the pause into `build_mode`.\n\nWhen the user chooses to continue:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_pause null\n```\n\nWhen the user chooses to pause:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_pause plan-ready\n```\n\nAfter setting `build_pause: plan-ready`, stop the current invocation. Do not choose `isolation` or `build_mode`, and do not load an execution skill.\n\n### 3. Select Workflow Configuration\n\nIf resuming with `build_pause: plan-ready` and the `plan` file exists, do not rerun `writing-plans`. First tell the user the workflow is stopped at the plan-ready pause point; after the user confirms continuing, set:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_pause null\n```\n\nThen continue this step to choose workspace isolation and execution method.\n\nPlan has been written to the current branch. Before starting execution, **ask the user to choose both workspace isolation and execution method in a single interaction**:\n\n**Workspace Isolation**:\n\n| Option | Method | Description |\n|--------|--------|-------------|\n| A | Create branch | Create a new branch in the current repo, simple and fast |\n| B | Create Worktree | Isolated workspace, fully independent, suitable for parallel development |\n\n**Recommendation rules**:\n- Change involves ≤ 3 files → Recommend A\n- Need parallel development, current branch has uncommitted work → Recommend B\n\n**Execution Method**:\n\n| Option | Skill | Applicable Scenario |\n|------|------|-------------------|\n| A | Superpowers `subagent-driven-development` | Independent tasks, high complexity, requires two-phase review |\n| B | Superpowers `executing-plans` | Simple tasks, no subagent environment, lightweight and fast |\n\n**Execution method recommendation rules**:\n- Task count ≥ 3 → Recommend A\n- Task count ≤ 2 and no cross-module dependencies → Recommend B\n- From hotfix path → Recommend B\n\nThis is a user decision point. **Must follow the `comet\u002Freference\u002Fdecision-point.md` protocol to pause and wait for the user to explicitly choose isolation method, execution method, and TDD mode**. Must not choose `branch` or `worktree` based on recommendation rules, and must not choose the execution method or TDD mode based on recommendation rules. Recommendation rules are for suggestion only, not a substitute for user confirmation.\n\nAfter user selection, update `isolation`, execution method, and TDD mode fields:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> isolation \u003Cbranch|worktree>\n```\n\n- If the user chooses `executing-plans`: run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> subagent_dispatch null`, then run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_mode executing-plans`\n- If the user chooses `subagent-driven-development`: first confirm the current platform has real background subagent \u002F Task \u002F multi-agent dispatch capability; after confirming, run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> subagent_dispatch confirmed`, then run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_mode subagent-driven-development`\n- If real background dispatch capability cannot be confirmed, must not write `build_mode: subagent-driven-development`; must pause and wait for the user to choose `executing-plans` instead\n\n**TDD Mode**:\n\n| Option | Meaning | Applicable Scenario |\n|--------|---------|---------------------|\n| `tdd` | Write a failing test first for each task, then implement | Recommended. Changes involving business logic, new features, APIs |\n| `direct` | Implement directly, no enforced TDD flow | Changes that don't need test coverage, or user chooses to skip tests and write code directly. hotfix\u002Ftweak presets default to `direct` |\n\nRun `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> tdd_mode \u003Ctdd|direct>`\n\n`isolation` is a script-enforced hard constraint. Full workflow init may temporarily leave it as `null`, but only before this step. If it remains `null`, both the `build → verify` guard and `comet-state transition build-complete` will fail.\n\n`subagent_dispatch` is a script-enforced hard constraint. `build_mode: subagent-driven-development` requires `subagent_dispatch: confirmed` before leaving the build phase, otherwise both `comet-guard.sh build --apply` and `comet-state transition build-complete` will fail.\n\n`tdd_mode` is a script-enforced hard constraint. Full workflow must have `tdd_mode` selected as `tdd` or `direct` before leaving the build phase, otherwise both `comet-guard.sh build --apply` and `comet-state transition build-complete` will fail.\n\n`build_mode` defaults to `direct` only for hotfix\u002Ftweak presets. Full workflow must not default to `direct`. Use it only when the user explicitly asks to bypass the plan execution skills and you record an explicit override:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> direct_override true\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_mode direct\n```\n\nWithout `direct_override: true`, `build_mode=direct` in full workflow is blocked by both guard and state transition.\n\n**Execute isolation**:\n\n- **branch**: Recommend a branch name based on the workflow type and current date, then let the user confirm or input a custom name. This is a user decision point — **must use the current platform's available user input\u002Fconfirmation mechanism to pause and wait for the user to explicitly confirm or override the branch name**. Must not skip this step and create the branch directly.\n\n  Branch naming convention:\n  - Read the `workflow` field from `.comet.yaml` to determine the prefix\n  - `workflow: full` → recommend `feature\u002FYYYYMMDD\u002F\u003Cchange-name>`\n  - `workflow: hotfix` → recommend `hotfix\u002FYYYYMMDD\u002F\u003Cchange-name>`\n  - `workflow: tweak` → recommend `tweak\u002FYYYYMMDD\u002F\u003Cchange-name>`\n  - Date is derived from `date +%Y%m%d` at runtime\n\n  Example: if change name is `fix-login-bug` and today is 2026-06-09, recommend `feature\u002F20260609\u002Ffix-login-bug`\n\n  After the user confirms or provides a custom branch name, run `git checkout -b \u003Cbranch-name>`, subsequent work on the new branch.\n\n- **worktree**: Must use the Skill tool to load the Superpowers `using-git-worktrees` skill to create isolated workspace. Do not bypass this skill with plain shell commands or native tools; if the skill is unavailable, stop the process and prompt to install or enable Superpowers skills.\n\nAfter creating isolation, confirm plan file is accessible (naturally accessible with branch method; for worktree method, confirm plan has been committed). If the plan file has not been committed under worktree mode, commit it first before creating the worktree:\n\n```bash\ngit add docs\u002Fsuperpowers\u002Fplans\u002FYYYY-MM-DD-feature.md\ngit commit -m \"chore: add implementation plan\"\n```\n\n**Execute plan**: Must handle execution according to the actual runtime of `build_mode`.\n\n- `build_mode: executing-plans`: **Immediately execute:** Use the Skill tool to load the Superpowers `executing-plans` skill. Skipping this step is prohibited. If the skill is unavailable, stop the process and prompt to install or enable the corresponding skill; do not substitute with normal conversation. After the skill loads, ARGUMENTS must include the same Language constraint as Step 1: `Language: Use the language of the user request that triggered this workflow`. Execute according to plan.\n- `build_mode: subagent-driven-development`: The main session only coordinates and must not write implementation code directly. **Immediately execute:** Use the Skill tool to load the Superpowers `subagent-driven-development` skill. After the skill loads, read `comet\u002Freference\u002Fsubagent-dispatch.md` for Comet-specific extensions (real background dispatch, task isolation, checkoff verification, TDD constraints, continuous execution, context recovery) and apply them alongside the skill's workflow. If they conflict, the more specific Comet extensions take precedence.\n- If the current platform has no real background agent dispatch capability, must pause and wait for the user to choose main window execution instead. After the user chooses, must run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_mode executing-plans`, then follow the `build_mode: executing-plans` branch to load the Superpowers `executing-plans` skill. Must not continue executing tasks before the user explicitly chooses.\n\n**TDD Mode Execution Constraints**:\n\nIf `tdd_mode: tdd`:\n- `build_mode: executing-plans`: After loading the execution skill and before executing the first task, **Immediately execute:** Use the Skill tool to load the Superpowers `test-driven-development` skill once. Skipping this step is prohibited. After the skill loads, start from the first unchecked task and follow the loaded TDD Red-Green-Refactor cycle for each task. Must not skip the failing test verification phase. Do not reload this skill for subsequent tasks; follow the already-loaded flow. If resuming after context compaction, re-run this step to load the TDD skill once, then continue from the first unchecked task.\n- `build_mode: subagent-driven-development`: The main session does not load the TDD skill. TDD constraints and evidence thresholds are defined in `comet\u002Freference\u002Fsubagent-dispatch.md`; every background implementer and fix agent must use the Skill tool to load the Superpowers `test-driven-development` skill and follow the Comet-injected TDD hard constraint.\n\nIf `tdd_mode: direct`: Follow normal flow, no enforced TDD.\n\n**`executing-plans` review gate**:\n\nWhen `build_mode` is `executing-plans`, after all planned tasks are complete and before running the build → verify phase guard, must use the Skill tool to load the Superpowers `requesting-code-review` skill and request code review at least once.\n\nRequirements:\n- the `requesting-code-review` skill must be loaded before `\"$COMET_BASH\" \"$COMET_GUARD\" \u003Cchange-name> build --apply`\n- if `requesting-code-review` skill is unavailable, skip the review gate but must record `\u003C!-- review skipped: skill unavailable -->` in tasks.md, then continue guard transition\n- CRITICAL review findings (security vulnerabilities, data loss risk, build\u002Ftest failures) must be fixed first and must not be carried into verify\n- if non-CRITICAL review findings are accepted, record the acceptance reason and impact scope in tasks.md, the commit body, a verification report draft, or another durable artifact\n\n### 3b. In-Execution Debugging (Debug Gate)\n\nDuring task execution, whenever a crash, unexpected behavior, test failure, or build failure appears while running the program, tests, build, or manual verification, must use the Skill tool to load the Superpowers `systematic-debugging` skill. Before root-cause investigation is complete, must not propose or implement source-code fixes.\n\nFor specific investigation, minimal failing test, fix verification, and keeping the current change verification loop, follow `comet\u002Freference\u002Fdebug-gate.md`.\n\n### 4. Spec Incremental Updates\n\nWhen the initial spec is found incomplete during implementation, handle by scale:\n\n| Scale | Trigger Conditions | Approach |\n|------|-------------------|----------|\n| Small | Missing acceptance scenarios, edge cases | Directly edit delta spec + design.md, append tasks.md tasks |\n| Medium | Interface changes, new components, data flow changes | **Must use the current platform's available user input\u002Fconfirmation mechanism to pause and wait for the user to explicitly confirm**, then must use Skill tool to load the Superpowers `brainstorming` skill to update Design Doc + delta spec |\n| Large | Brand-new capability requirements | **Must use the current platform's available user input\u002Fconfirmation mechanism to pause and wait for the user to explicitly confirm the split**; after user confirms, create independent change through `\u002Fcomet-open` |\n\n**50% Threshold Determination**: Using initial task count in tasks.md as baseline, if new tasks exceed half of that total, it's considered outside original plan scope, **must follow the `comet\u002Freference\u002Fdecision-point.md` protocol to pause and wait for the user to decide whether to split into a new change**.\n\nWhen creating an independent change, must invoke `\u002Fcomet-open`, not `\u002Fopsx:new` directly. `\u002Fcomet-open` creates both OpenSpec artifacts and `.comet.yaml`, preventing the new change from leaving the Comet state machine.\n\n**User choices must include**:\n- \"Split into new change\" — create independent change via `\u002Fcomet-open`\n- \"Continue in current change\" — record scope-expansion decision, update tasks.md and delta spec, then continue\n\n**Principles**:\n- Delta spec is a living document, can be modified at any time during this phase\n- Each update should be committed with commit message explaining the change reason\n- Do not sync to main spec in advance, sync uniformly during archiving\n- For small-scale incremental direct delta spec edits, note in commit message to facilitate design doc drift assessment during archiving\n\n### 5. Context Management\n\nBuild is the longest phase and may span many tasks. To support resume after context compaction:\n\n- **After each task**: complete acceptance per the current execution branch before checking off and committing. `subagent-driven-development` must wait for both reviews to pass and perform targeted verification by unique task text. Use `grep -c '\\- \\[ \\]' tasks.md` to check remaining unchecked count; no need to re-read the entire file\n- **Context compression recovery**: Follow `comet\u002Freference\u002Fcontext-recovery.md` with phase set to `build`.\n- **User manual-change resume**: handle uncommitted changes through `comet\u002Freference\u002Fdirty-worktree.md`. That protocol defines checks, attribution, and prohibitions. Build-specific handling:\n  1. After attribution, if the diff implies plan or spec changes, handle it through Step 4 \"Spec Incremental Updates\"\n- **Long task split**: if a single task exceeds 200 lines of code changes, consider splitting it into multiple subtasks and commits\n\n## Exit Conditions\n\n- All tasks.md checked\n- Code committed\n- Project-specific build\u002Ftests explicitly run and pass; do not rely only on guard auto-detection\n- `isolation` has been written as `branch` or `worktree`\n- `build_mode` has been written as `subagent-driven-development`, `executing-plans`, or `direct` with explicit override; if `subagent-driven-development`, `subagent_dispatch` must be `confirmed`\n- `tdd_mode` has been written as `tdd` or `direct`\n- If `build_mode` is `executing-plans`, the Skill tool has been used to load the Superpowers `requesting-code-review` skill and request code review at least once, and CRITICAL review findings have been fixed or acceptance rationale for non-CRITICAL review findings has been recorded\n- **Phase guard**: Run `\"$COMET_BASH\" \"$COMET_GUARD\" \u003Cchange-name> build --apply`; after all PASS, state advances to `phase: verify`\n\nGuard reads project command configuration first:\n\n```yaml\nbuild_command: \u003Cbuild command>\nverify_command: \u003Cverify command>\n```\n\nConfiguration can live in the change `.comet.yaml`, or in repo-root `.comet.yaml` \u002F `comet.yaml` \u002F `.comet.yml` \u002F `comet.yml`.\nOnly when no command is configured does guard fall back to `npm run build`, Maven, or Cargo auto-detection. When a command fails, guard prints the command output as evidence for debugging.\n\nBefore exit, run guard to auto-transition:\n\n```bash\n\"$COMET_BASH\" \"$COMET_GUARD\" \u003Cchange-name> build --apply\n```\n\nState file is automatically updated to `phase: verify`, `verify_result: pending`.\n\n## Automatic Handoff to Next Phase\n\nFollow `comet\u002Freference\u002Fauto-transition.md`. Key command:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" next \u003Cchange-name>\n```\n\n- `NEXT: auto` → invoke the skill pointed to by `SKILL` to enter the next phase\n- `NEXT: manual` → do not invoke the next skill; prompt user to run `\u002F\u003CSKILL>` manually\n- `NEXT: done` → workflow is complete, no further action needed\n","# Comet Phase 3: Plan and Build (Build)\n\n## Prerequisites\n\n- Design Doc has been created (Phase 2 complete)\n- Active change exists\n\n## Steps\n\n### 0. Entry State Verification (Entry Check)\n\nExecute entry verification:\n\n```bash\nCOMET_ENV=\"${COMET_ENV:-$(find . \"$HOME\"\u002F.*\u002Fskills \"$HOME\u002F.config\" \"$HOME\u002F.gemini\" -path '*\u002Fcomet\u002Fscripts\u002Fcomet-env.sh' -type f -print -quit 2>\u002Fdev\u002Fnull)}\"\nif [ -z \"$COMET_ENV\" ]; then\n  echo \"ERROR: comet-env.sh not found. Ensure the comet skill is installed.\" >&2\n  return 1\nfi\n. \"$COMET_ENV\"\n\"$COMET_BASH\" \"$COMET_STATE\" check \u003Cname> build\n```\n\nProceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.\n\n**Idempotency**: All build phase operations can be safely re-executed. Read `.comet.yaml` `phase` field to confirm still in build, read plan header `base-ref`, then use `grep -n '\\- \\[ \\]' tasks.md | head -1` to find the first unchecked task. Already-committed tasks must not be re-committed.\n\n### 1. Create Plan (Subagent Offload)\n\nCreate the implementation plan through a subagent, avoiding planning skill occupying main session context. Plan files and execution feedback must use the language of the user request that triggered this workflow.\n\n**Subagent instructions**:\n\nYou are an implementation planning expert. Create an implementation plan based on the following inputs:\n\n1. **Immediately execute:** Use the Skill tool to load the Superpowers `writing-plans` skill. Skipping this step is prohibited. After the skill loads, ARGUMENTS must include: `Language: Use the language of the user request that triggered this workflow`\n2. Read the Design Doc (technical design document under `docs\u002Fsuperpowers\u002Fspecs\u002F`)\n3. Read `openspec\u002Fchanges\u002F\u003Cname>\u002Ftasks.md` (task boundaries)\n4. Follow the skill's guidance to create the plan\n\nPlan requirements:\n- Save to `docs\u002Fsuperpowers\u002Fplans\u002FYYYY-MM-DD-\u003Cfeature>.md`\n- Reference design document, break down into executable tasks\n- **Plan file header must contain associated metadata**:\n\n```yaml\n---\nchange: \u003Copenspec-change-name>\ndesign-doc: docs\u002Fsuperpowers\u002Fspecs\u002FYYYY-MM-DD-\u003Ctopic>-design.md\nbase-ref: \u003Cgit rev-parse HEAD before implementation>\n---\n```\n\n`base-ref` is used during verification to measure committed changes across the full implementation range. Record the current commit when creating the plan:\n\n```bash\ngit rev-parse HEAD\n```\n\nWrite the plan to file, then return the file path.\n\n**Execute subagent**: Use the current platform's subagent dispatch mechanism to send the above task.\n\nAfter the subagent completes:\n- If a valid file path is returned and the file exists, record it as the plan\n- If the subagent fails or returns an invalid path, fall back to loading the Superpowers `writing-plans` skill inline in the main session (degraded fallback)\n\n### 2. Update Plan Status and Provide Plan-Ready Pause Point\n\nRecord plan path:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> plan docs\u002Fsuperpowers\u002Fplans\u002FYYYY-MM-DD-feature.md\n```\n\nNo manual phase update needed — guard auto-transitions when exit conditions are met.\n\nAfter the plan is recorded, immediately provide a new user decision point:\n\n| Option | Behavior | Description |\n|--------|----------|-------------|\n| A | Continue execution | Stay in the current model and proceed to Step 3 to choose workspace isolation and execution method |\n| B | Pause to switch model | Record `build_pause: plan-ready`, stop this `\u002Fcomet-build` invocation, and allow the user to resume later from `\u002Fcomet` or `\u002Fcomet-build` |\n\nThis is a user decision point. **Must follow the `comet\u002Freference\u002Fdecision-point.md` protocol to pause and wait for the user to explicitly choose**. Must not auto-continue and must not write the pause into `build_mode`.\n\nWhen the user chooses to continue:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_pause null\n```\n\nWhen the user chooses to pause:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_pause plan-ready\n```\n\nAfter setting `build_pause: plan-ready`, stop the current invocation. Do not choose `isolation` or `build_mode`, and do not load an execution skill.\n\n### 3. Select Workflow Configuration\n\nIf resuming with `build_pause: plan-ready` and the `plan` file exists, do not rerun `writing-plans`. First tell the user the workflow is stopped at the plan-ready pause point; after the user confirms continuing, set:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_pause null\n```\n\nThen continue this step to choose workspace isolation and execution method.\n\nPlan has been written to the current branch. Before starting execution, **ask the user to choose both workspace isolation and execution method in a single interaction**:\n\n**Workspace Isolation**:\n\n| Option | Method | Description |\n|--------|--------|-------------|\n| A | Create branch | Create a new branch in the current repo, simple and fast |\n| B | Create Worktree | Isolated workspace, fully independent, suitable for parallel development |\n\n**Recommendation rules**:\n- Change involves ≤ 3 files → Recommend A\n- Need parallel development, current branch has uncommitted work → Recommend B\n\n**Execution Method**:\n\n| Option | Skill | Applicable Scenario |\n|------|------|-------------------|\n| A | Superpowers `subagent-driven-development` | Independent tasks, high complexity, requires two-phase review |\n| B | Superpowers `executing-plans` | Simple tasks, no subagent environment, lightweight and fast |\n\n**Execution method recommendation rules**:\n- Task count ≥ 3 → Recommend A\n- Task count ≤ 2 and no cross-module dependencies → Recommend B\n- From hotfix path → Recommend B\n\nThis is a user decision point. **Must follow the `comet\u002Freference\u002Fdecision-point.md` protocol to pause and wait for the user to explicitly choose isolation method, execution method, and TDD mode**. Must not choose `branch` or `worktree` based on recommendation rules, and must not choose the execution method or TDD mode based on recommendation rules. Recommendation rules are for suggestion only, not a substitute for user confirmation.\n\nAfter user selection, update `isolation`, execution method, and TDD mode fields:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> isolation \u003Cbranch|worktree>\n```\n\n- If the user chooses `executing-plans`: run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> subagent_dispatch null`, then run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_mode executing-plans`\n- If the user chooses `subagent-driven-development`: first confirm the current platform has real background subagent \u002F Task \u002F multi-agent dispatch capability; after confirming, run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> subagent_dispatch confirmed`, then run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_mode subagent-driven-development`\n- If real background dispatch capability cannot be confirmed, must not write `build_mode: subagent-driven-development`; must pause and wait for the user to choose `executing-plans` instead\n\n**TDD Mode**:\n\n| Option | Meaning | Applicable Scenario |\n|--------|---------|---------------------|\n| `tdd` | Write a failing test first for each task, then implement | Recommended. Changes involving business logic, new features, APIs |\n| `direct` | Implement directly, no enforced TDD flow | Changes that don't need test coverage, or user chooses to skip tests and write code directly. hotfix\u002Ftweak presets default to `direct` |\n\nRun `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> tdd_mode \u003Ctdd|direct>`\n\n`isolation` is a script-enforced hard constraint. Full workflow init may temporarily leave it as `null`, but only before this step. If it remains `null`, both the `build → verify` guard and `comet-state transition build-complete` will fail.\n\n`subagent_dispatch` is a script-enforced hard constraint. `build_mode: subagent-driven-development` requires `subagent_dispatch: confirmed` before leaving the build phase, otherwise both `comet-guard.sh build --apply` and `comet-state transition build-complete` will fail.\n\n`tdd_mode` is a script-enforced hard constraint. Full workflow must have `tdd_mode` selected as `tdd` or `direct` before leaving the build phase, otherwise both `comet-guard.sh build --apply` and `comet-state transition build-complete` will fail.\n\n`build_mode` defaults to `direct` only for hotfix\u002Ftweak presets. Full workflow must not default to `direct`. Use it only when the user explicitly asks to bypass the plan execution skills and you record an explicit override:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> direct_override true\n\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_mode direct\n```\n\nWithout `direct_override: true`, `build_mode=direct` in full workflow is blocked by both guard and state transition.\n\n**Execute isolation**:\n\n- **branch**: Recommend a branch name based on the workflow type and current date, then let the user confirm or input a custom name. This is a user decision point — **must use the current platform's available user input\u002Fconfirmation mechanism to pause and wait for the user to explicitly confirm or override the branch name**. Must not skip this step and create the branch directly.\n\n  Branch naming convention:\n  - Read the `workflow` field from `.comet.yaml` to determine the prefix\n  - `workflow: full` → recommend `feature\u002FYYYYMMDD\u002F\u003Cchange-name>`\n  - `workflow: hotfix` → recommend `hotfix\u002FYYYYMMDD\u002F\u003Cchange-name>`\n  - `workflow: tweak` → recommend `tweak\u002FYYYYMMDD\u002F\u003Cchange-name>`\n  - Date is derived from `date +%Y%m%d` at runtime\n\n  Example: if change name is `fix-login-bug` and today is 2026-06-09, recommend `feature\u002F20260609\u002Ffix-login-bug`\n\n  After the user confirms or provides a custom branch name, run `git checkout -b \u003Cbranch-name>`, subsequent work on the new branch.\n\n- **worktree**: Must use the Skill tool to load the Superpowers `using-git-worktrees` skill to create isolated workspace. Do not bypass this skill with plain shell commands or native tools; if the skill is unavailable, stop the process and prompt to install or enable Superpowers skills.\n\nAfter creating isolation, confirm plan file is accessible (naturally accessible with branch method; for worktree method, confirm plan has been committed). If the plan file has not been committed under worktree mode, commit it first before creating the worktree:\n\n```bash\ngit add docs\u002Fsuperpowers\u002Fplans\u002FYYYY-MM-DD-feature.md\ngit commit -m \"chore: add implementation plan\"\n```\n\n**Execute plan**: Must handle execution according to the actual runtime of `build_mode`.\n\n- `build_mode: executing-plans`: **Immediately execute:** Use the Skill tool to load the Superpowers `executing-plans` skill. Skipping this step is prohibited. If the skill is unavailable, stop the process and prompt to install or enable the corresponding skill; do not substitute with normal conversation. After the skill loads, ARGUMENTS must include the same Language constraint as Step 1: `Language: Use the language of the user request that triggered this workflow`. Execute according to plan.\n- `build_mode: subagent-driven-development`: The main session only coordinates and must not write implementation code directly. **Immediately execute:** Use the Skill tool to load the Superpowers `subagent-driven-development` skill. After the skill loads, read `comet\u002Freference\u002Fsubagent-dispatch.md` for Comet-specific extensions (real background dispatch, task isolation, checkoff verification, TDD constraints, continuous execution, context recovery) and apply them alongside the skill's workflow. If they conflict, the more specific Comet extensions take precedence.\n- If the current platform has no real background agent dispatch capability, must pause and wait for the user to choose main window execution instead. After the user chooses, must run `\"$COMET_BASH\" \"$COMET_STATE\" set \u003Cname> build_mode executing-plans`, then follow the `build_mode: executing-plans` branch to load the Superpowers `executing-plans` skill. Must not continue executing tasks before the user explicitly chooses.\n\n**TDD Mode Execution Constraints**:\n\nIf `tdd_mode: tdd`:\n- `build_mode: executing-plans`: After loading the execution skill and before executing the first task, **Immediately execute:** Use the Skill tool to load the Superpowers `test-driven-development` skill once. Skipping this step is prohibited. After the skill loads, start from the first unchecked task and follow the loaded TDD Red-Green-Refactor cycle for each task. Must not skip the failing test verification phase. Do not reload this skill for subsequent tasks; follow the already-loaded flow. If resuming after context compaction, re-run this step to load the TDD skill once, then continue from the first unchecked task.\n- `build_mode: subagent-driven-development`: The main session does not load the TDD skill. TDD constraints and evidence thresholds are defined in `comet\u002Freference\u002Fsubagent-dispatch.md`; every background implementer and fix agent must use the Skill tool to load the Superpowers `test-driven-development` skill and follow the Comet-injected TDD hard constraint.\n\nIf `tdd_mode: direct`: Follow normal flow, no enforced TDD.\n\n**`executing-plans` review gate**:\n\nWhen `build_mode` is `executing-plans`, after all planned tasks are complete and before running the build → verify phase guard, must use the Skill tool to load the Superpowers `requesting-code-review` skill and request code review at least once.\n\nRequirements:\n- the `requesting-code-review` skill must be loaded before `\"$COMET_BASH\" \"$COMET_GUARD\" \u003Cchange-name> build --apply`\n- if `requesting-code-review` skill is unavailable, skip the review gate but must record `\u003C!-- review skipped: skill unavailable -->` in tasks.md, then continue guard transition\n- CRITICAL review findings (security vulnerabilities, data loss risk, build\u002Ftest failures) must be fixed first and must not be carried into verify\n- if non-CRITICAL review findings are accepted, record the acceptance reason and impact scope in tasks.md, the commit body, a verification report draft, or another durable artifact\n\n### 3b. In-Execution Debugging (Debug Gate)\n\nDuring task execution, whenever a crash, unexpected behavior, test failure, or build failure appears while running the program, tests, build, or manual verification, must use the Skill tool to load the Superpowers `systematic-debugging` skill. Before root-cause investigation is complete, must not propose or implement source-code fixes.\n\nFor specific investigation, minimal failing test, fix verification, and keeping the current change verification loop, follow `comet\u002Freference\u002Fdebug-gate.md`.\n\n### 4. Spec Incremental Updates\n\nWhen the initial spec is found incomplete during implementation, handle by scale:\n\n| Scale | Trigger Conditions | Approach |\n|------|-------------------|----------|\n| Small | Missing acceptance scenarios, edge cases | Directly edit delta spec + design.md, append tasks.md tasks |\n| Medium | Interface changes, new components, data flow changes | **Must use the current platform's available user input\u002Fconfirmation mechanism to pause and wait for the user to explicitly confirm**, then must use Skill tool to load the Superpowers `brainstorming` skill to update Design Doc + delta spec |\n| Large | Brand-new capability requirements | **Must use the current platform's available user input\u002Fconfirmation mechanism to pause and wait for the user to explicitly confirm the split**; after user confirms, create independent change through `\u002Fcomet-open` |\n\n**50% Threshold Determination**: Using initial task count in tasks.md as baseline, if new tasks exceed half of that total, it's considered outside original plan scope, **must follow the `comet\u002Freference\u002Fdecision-point.md` protocol to pause and wait for the user to decide whether to split into a new change**.\n\nWhen creating an independent change, must invoke `\u002Fcomet-open`, not `\u002Fopsx:new` directly. `\u002Fcomet-open` creates both OpenSpec artifacts and `.comet.yaml`, preventing the new change from leaving the Comet state machine.\n\n**User choices must include**:\n- \"Split into new change\" — create independent change via `\u002Fcomet-open`\n- \"Continue in current change\" — record scope-expansion decision, update tasks.md and delta spec, then continue\n\n**Principles**:\n- Delta spec is a living document, can be modified at any time during this phase\n- Each update should be committed with commit message explaining the change reason\n- Do not sync to main spec in advance, sync uniformly during archiving\n- For small-scale incremental direct delta spec edits, note in commit message to facilitate design doc drift assessment during archiving\n\n### 5. Context Management\n\nBuild is the longest phase and may span many tasks. To support resume after context compaction:\n\n- **After each task**: complete acceptance per the current execution branch before checking off and committing. `subagent-driven-development` must wait for both reviews to pass and perform targeted verification by unique task text. Use `grep -c '\\- \\[ \\]' tasks.md` to check remaining unchecked count; no need to re-read the entire file\n- **Context compression recovery**: Follow `comet\u002Freference\u002Fcontext-recovery.md` with phase set to `build`.\n- **User manual-change resume**: handle uncommitted changes through `comet\u002Freference\u002Fdirty-worktree.md`. That protocol defines checks, attribution, and prohibitions. Build-specific handling:\n  1. After attribution, if the diff implies plan or spec changes, handle it through Step 4 \"Spec Incremental Updates\"\n- **Long task split**: if a single task exceeds 200 lines of code changes, consider splitting it into multiple subtasks and commits\n\n## Exit Conditions\n\n- All tasks.md checked\n- Code committed\n- Project-specific build\u002Ftests explicitly run and pass; do not rely only on guard auto-detection\n- `isolation` has been written as `branch` or `worktree`\n- `build_mode` has been written as `subagent-driven-development`, `executing-plans`, or `direct` with explicit override; if `subagent-driven-development`, `subagent_dispatch` must be `confirmed`\n- `tdd_mode` has been written as `tdd` or `direct`\n- If `build_mode` is `executing-plans`, the Skill tool has been used to load the Superpowers `requesting-code-review` skill and request code review at least once, and CRITICAL review findings have been fixed or acceptance rationale for non-CRITICAL review findings has been recorded\n- **Phase guard**: Run `\"$COMET_BASH\" \"$COMET_GUARD\" \u003Cchange-name> build --apply`; after all PASS, state advances to `phase: verify`\n\nGuard reads project command configuration first:\n\n```yaml\nbuild_command: \u003Cbuild command>\nverify_command: \u003Cverify command>\n```\n\nConfiguration can live in the change `.comet.yaml`, or in repo-root `.comet.yaml` \u002F `comet.yaml` \u002F `.comet.yml` \u002F `comet.yml`.\nOnly when no command is configured does guard fall back to `npm run build`, Maven, or Cargo auto-detection. When a command fails, guard prints the command output as evidence for debugging.\n\nBefore exit, run guard to auto-transition:\n\n```bash\n\"$COMET_BASH\" \"$COMET_GUARD\" \u003Cchange-name> build --apply\n```\n\nState file is automatically updated to `phase: verify`, `verify_result: pending`.\n\n## Automatic Handoff to Next Phase\n\nFollow `comet\u002Freference\u002Fauto-transition.md`. Key command:\n\n```bash\n\"$COMET_BASH\" \"$COMET_STATE\" next \u003Cchange-name>\n```\n\n- `NEXT: auto` → invoke the skill pointed to by `SKILL` to enter the next phase\n- `NEXT: manual` → do not invoke the next skill; prompt user to run `\u002F\u003CSKILL>` manually\n- `NEXT: done` → workflow is complete, no further action needed\n",{"name":5,"description":7},"master","a61a2e5b4766e1ad62377dec598e402560a259b6","eval\u002Flocal\u002Fskills\u002Fbenchmarks\u002F039-release\u002Fcomet-classic-039-build",314,"https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet","https:\u002F\u002Fdocs.comet.rpamis.com","https:\u002F\u002Fgithub.com\u002Frpamis","More Efficient, Easier to Use, and Less Annoying","2026-11-15 00:26:58",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add rpamis\u002Fcomet --skill comet-build",{"tool":38,"command":39},"bunx","bunx skills add rpamis\u002Fcomet --skill comet-build",{"tool":41,"command":42},"pnpm","pnpm dlx skills add rpamis\u002Fcomet --skill comet-build","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet\u002Fblob\u002Fmaster\u002Feval\u002Flocal\u002Fskills\u002Fbenchmarks\u002F039-release\u002Fcomet-classic-039-build\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":18},"01M72W3K6F0C2FKZ8DHABM49R7","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet\u002Fblob\u002Fmaster\u002Feval\u002Flocal\u002Fskills\u002Fbenchmarks\u002Fdependency\u002Fsuperpowers\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M72W3HCPQ3GVMACX61QJTD4B","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet\u002Fblob\u002Fmaster\u002Feval\u002Flocal\u002Fskills\u002Fbenchmarks\u002Fdependency\u002Fsuperpowers\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M72W3F8EVD3EK4NXJG40P84K","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet\u002Fblob\u002Fmaster\u002Feval\u002Flocal\u002Fskills\u002Fbenchmarks\u002Fdependency\u002Fsuperpowers\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M72W3CA9YM0Y6CSXXTNCV1CA","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet\u002Fblob\u002Fmaster\u002Feval\u002Flocal\u002Fskills\u002Fbenchmarks\u002Fdependency\u002Fsuperpowers\u002Fusing-git-worktrees\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M72W3AEH0F548GTPRNYRR3H3","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet\u002Fblob\u002Fmaster\u002Feval\u002Flocal\u002Fskills\u002Fbenchmarks\u002Fdependency\u002Fsuperpowers\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M72W38EN8NEKX1YN4W9G19Y2","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002Frpamis\u002Fcomet\u002Fblob\u002Fmaster\u002Feval\u002Flocal\u002Fskills\u002Fbenchmarks\u002Fdependency\u002Fsuperpowers\u002Fsystematic-debugging\u002FSKILL.md",[],[]]