一键导入
comet-build
Comet Phase 3: Plan and Build. Invoke with /comet-build. Create plans and select execution method (subagent or direct) for implementation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Comet Phase 3: Plan and Build. Invoke with /comet-build. Create plans and select execution method (subagent or direct) for implementation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use only when explicitly invoked as /comet-any or when the user explicitly wants to customize the /comet-classic five-phase workflow or create/upgrade a workflow Skill managed by Comet Creator. Do not use for general Skill authoring, cleanup, or review.
Use only when explicitly invoked as /comet-archive or routed by the root Comet skill/runtime to the archive phase; confirm archive, merge delta specs, and finish the branch.
Use only when explicitly invoked as /comet-build or routed by the root Comet skill/runtime to a full workflow build phase; create or recover the implementation plan and execute tasks.
Use when the user explicitly invokes /comet-classic, asks to start or resume the permanent Comet Classic workflow, or repository evidence identifies one unambiguous active Classic change; route through the intent runtime and .comet.yaml.
Use only when explicitly invoked as /comet-design or routed by the root Comet skill/runtime to a full workflow design phase; create or recover the deep technical Design Doc.
Use only when explicitly invoked as /comet-hotfix or routed by the root Comet skill/runtime to the hotfix preset; fix an existing behavior bug, not an ordinary unmanaged bugfix.
| name | comet-build |
| description | Comet Phase 3: Plan and Build. Invoke with /comet-build. Create plans and select execution method (subagent or direct) for implementation. |
Execute entry verification:
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
if [ -z "$COMET_ENV" ]; then
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
return 1
fi
. "$COMET_ENV"
"$COMET_BASH" "$COMET_STATE" check <name> build
Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
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.
Create 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.
Subagent instructions:
You are an implementation planning expert. Create an implementation plan based on the following inputs:
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 workflowdocs/superpowers/specs/)openspec/changes/<name>/tasks.md (task boundaries)Plan requirements:
docs/superpowers/plans/YYYY-MM-DD-<feature>.md---
change: <openspec-change-name>
design-doc: docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md
base-ref: <git rev-parse HEAD before implementation>
---
base-ref is used during verification to measure committed changes across the full implementation range. Record the current commit when creating the plan:
git rev-parse HEAD
Write the plan to file, then return the file path.
Execute subagent: Use the current platform's subagent dispatch mechanism to send the above task.
After the subagent completes:
writing-plans skill inline in the main session (degraded fallback)Record plan path:
"$COMET_BASH" "$COMET_STATE" set <name> plan docs/superpowers/plans/YYYY-MM-DD-feature.md
No manual phase update needed — guard auto-transitions when exit conditions are met.
After the plan is recorded, immediately provide a new user decision point:
| Option | Behavior | Description |
|---|---|---|
| A | Continue execution | Stay in the current model and proceed to Step 3 to choose workspace isolation and execution method |
| B | Pause to switch model | Record build_pause: plan-ready, stop this /comet-build invocation, and allow the user to resume later from /comet or /comet-build |
This is a user decision point. Must follow the comet/reference/decision-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.
When the user chooses to continue:
"$COMET_BASH" "$COMET_STATE" set <name> build_pause null
When the user chooses to pause:
"$COMET_BASH" "$COMET_STATE" set <name> build_pause plan-ready
After setting build_pause: plan-ready, stop the current invocation. Do not choose isolation or build_mode, and do not load an execution skill.
If 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:
"$COMET_BASH" "$COMET_STATE" set <name> build_pause null
Then continue this step to choose workspace isolation and execution method.
Plan 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:
Workspace Isolation:
| Option | Method | Description |
|---|---|---|
| A | Create branch | Create a new branch in the current repo, simple and fast |
| B | Create Worktree | Isolated workspace, fully independent, suitable for parallel development |
Recommendation rules:
Execution Method:
| Option | Skill | Applicable Scenario |
|---|---|---|
| A | Superpowers subagent-driven-development | Independent tasks, high complexity, requires two-phase review |
| B | Superpowers executing-plans | Simple tasks, no subagent environment, lightweight and fast |
Execution method recommendation rules:
This is a user decision point. Must follow the comet/reference/decision-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.
After user selection, update isolation, execution method, and TDD mode fields:
"$COMET_BASH" "$COMET_STATE" set <name> isolation <branch|worktree>
executing-plans: run "$COMET_BASH" "$COMET_STATE" set <name> subagent_dispatch null, then run "$COMET_BASH" "$COMET_STATE" set <name> build_mode executing-planssubagent-driven-development: first confirm the current platform has real background subagent / Task / multi-agent dispatch capability; after confirming, run "$COMET_BASH" "$COMET_STATE" set <name> subagent_dispatch confirmed, then run "$COMET_BASH" "$COMET_STATE" set <name> build_mode subagent-driven-developmentbuild_mode: subagent-driven-development; must pause and wait for the user to choose executing-plans insteadTDD Mode:
| Option | Meaning | Applicable Scenario |
|---|---|---|
tdd | Write a failing test first for each task, then implement | Recommended. Changes involving business logic, new features, APIs |
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/tweak presets default to direct |
Run "$COMET_BASH" "$COMET_STATE" set <name> tdd_mode <tdd|direct>
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.
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.
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.
build_mode defaults to direct only for hotfix/tweak 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:
"$COMET_BASH" "$COMET_STATE" set <name> direct_override true
"$COMET_BASH" "$COMET_STATE" set <name> build_mode direct
Without direct_override: true, build_mode=direct in full workflow is blocked by both guard and state transition.
Execute isolation:
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/confirmation 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.
Branch naming convention:
workflow field from .comet.yaml to determine the prefixworkflow: full → recommend feature/YYYYMMDD/<change-name>workflow: hotfix → recommend hotfix/YYYYMMDD/<change-name>workflow: tweak → recommend tweak/YYYYMMDD/<change-name>date +%Y%m%d at runtimeExample: if change name is fix-login-bug and today is 2026-06-09, recommend feature/20260609/fix-login-bug
After the user confirms or provides a custom branch name, run git checkout -b <branch-name>, subsequent work on the new branch.
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.
After 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:
git add docs/superpowers/plans/YYYY-MM-DD-feature.md
git commit -m "chore: add implementation plan"
Execute plan: Must handle execution according to the actual runtime of build_mode.
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.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/reference/subagent-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."$COMET_BASH" "$COMET_STATE" set <name> 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.TDD Mode Execution Constraints:
If tdd_mode: tdd:
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.build_mode: subagent-driven-development: The main session does not load the TDD skill. TDD constraints and evidence thresholds are defined in comet/reference/subagent-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.If tdd_mode: direct: Follow normal flow, no enforced TDD.
executing-plans review gate:
When 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.
Requirements:
requesting-code-review skill must be loaded before "$COMET_BASH" "$COMET_GUARD" <change-name> build --applyrequesting-code-review skill is unavailable, skip the review gate but must record <!-- review skipped: skill unavailable --> in tasks.md, then continue guard transitionDuring 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.
For specific investigation, minimal failing test, fix verification, and keeping the current change verification loop, follow comet/reference/debug-gate.md.
When the initial spec is found incomplete during implementation, handle by scale:
| Scale | Trigger Conditions | Approach |
|---|---|---|
| Small | Missing acceptance scenarios, edge cases | Directly edit delta spec + design.md, append tasks.md tasks |
| Medium | Interface changes, new components, data flow changes | Must use the current platform's available user input/confirmation 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 |
| Large | Brand-new capability requirements | Must use the current platform's available user input/confirmation mechanism to pause and wait for the user to explicitly confirm the split; after user confirms, create independent change through /comet-open |
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/reference/decision-point.md protocol to pause and wait for the user to decide whether to split into a new change.
When creating an independent change, must invoke /comet-open, not /opsx:new directly. /comet-open creates both OpenSpec artifacts and .comet.yaml, preventing the new change from leaving the Comet state machine.
User choices must include:
/comet-openPrinciples:
Build is the longest phase and may span many tasks. To support resume after context compaction:
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 filecomet/reference/context-recovery.md with phase set to build.comet/reference/dirty-worktree.md. That protocol defines checks, attribution, and prohibitions. Build-specific handling:
isolation has been written as branch or worktreebuild_mode has been written as subagent-driven-development, executing-plans, or direct with explicit override; if subagent-driven-development, subagent_dispatch must be confirmedtdd_mode has been written as tdd or directbuild_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"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply; after all PASS, state advances to phase: verifyGuard reads project command configuration first:
build_command: <build command>
verify_command: <verify command>
Configuration can live in the change .comet.yaml, or in repo-root .comet.yaml / comet.yaml / .comet.yml / comet.yml.
Only 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.
Before exit, run guard to auto-transition:
"$COMET_BASH" "$COMET_GUARD" <change-name> build --apply
State file is automatically updated to phase: verify, verify_result: pending.
Follow comet/reference/auto-transition.md. Key command:
"$COMET_BASH" "$COMET_STATE" next <change-name>
NEXT: auto → invoke the skill pointed to by SKILL to enter the next phaseNEXT: manual → do not invoke the next skill; prompt user to run /<SKILL> manuallyNEXT: done → workflow is complete, no further action needed