一键导入
code-execute
Use only when autopilot-code dispatches the implementation stage for an approved plan. Not for top-level user requests or primary capability routing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use only when autopilot-code dispatches the implementation stage for an approved plan. Not for top-level user requests or primary capability routing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when source code must be implemented, debugged, refactored, or code-audited through a plan, execution, test, and report loop. Not for requirements-only changes, new empirical experiments, or document-only editing.
Use when persistent analysis of code, a paper, or a document must be created or refreshed because it is absent, stale, or explicitly requested. Not for read-only project orientation, context recovery, or status reporting.
Use when durable cross-project user preferences must be inferred from coding, writing, or analysis evidence and stored as a profile. Not for one-project context recovery, casual preference acknowledgment, or ordinary task execution.
Use when a visual product surface needs references, design tokens, components or mockups, review, and development handoff. Not for implementing an already-approved design in code or for document prose work.
Use when a new paper, presentation, report, proposal, or other user-facing document must be produced from evidence. Not for correcting only an existing document or for source-code implementation.
Use only when autopilot-draft dispatches document strategy and evidence-plan creation. Not for top-level user requests or primary capability routing.
| name | code-execute |
| description | Use only when autopilot-code dispatches the implementation stage for an approved plan. Not for top-level user requests or primary capability routing. |
| argument-hint | <plan name or path> |
| metadata | {"group":"sub","fam":"sub","invocation_class":"parent-invoked","modes":[],"blurb":"Execute a plan step by step, delegate implementation to the development role, and record an execution log.","use_when":"Use only when autopilot-code dispatches the implementation stage for an approved plan.","not_for":"Not for top-level user requests or primary capability routing."} |
Stage-session entry (
standard+dispatch, spec/stage-dispatch SD-2): Run in-session or as an isolated dispatch-depth-2 stage worker dispatched by theautopilot-codeconductor. Resolve the plan path from arguments, readplan/plan.mdfrom disk, and never depend on prior-stage conversation. This is the only source-mutating stage. Its write class is source code,plan/checklist.md,dev_logs/,_internal/dev_reviews/, and plan-frontmatterstatus. The stage runs as the compiled route'sdev/*unit (sealed at compile); it never dispatches units itself, and any unforeseen narrow scaffolding uses an ephemeral native helper without unit semantics.
Plan resolution: Treat arguments-and-decisions.md#plan-resolution as the single authority for resolving
$ARGto a plan path.
Language rule: Follow the audience and artifact language contract in arguments-and-decisions.md#language-rule. Do not infer a fixed execution-log or report language from this skill file.
chore: Safety checkpoint before {plan-name} execution{type}: {description}\n\n{bullet list of key changes}, where type is feat, fix, refactor, or choreBefore source changes, establish a recoverable working state.
HEAD. Before committing, stop if HEAD changed unexpectedly or a new MERGE_HEAD appeared.git fetch && git pull when the active workflow authorizes remote synchronization.
git merge --abort, report the conflict, and stop execution.git status and inspect all uncommitted changes.git rev-parse -q --verify MERGE_HEAD and $(git rev-parse --git-dir)/rebase-merge or rebase-apply.
git add -A && git commit; stop and report the state.git add -A && git commit only when every included change is understood and in scope. Stop instead of sweeping unrelated user changes into the checkpoint.git rev-parse HEAD, save it as $SAFETY_COMMIT, and persist it in the checklist header.Read the resolved plan at $ARG.
Set {log_dir} to the task root two levels above plan/plan.md.
<artifact-root>/plans/2026-03-18_refactor_engine/plan/plan.md → <artifact-root>/plans/2026-03-18_refactor_engine/Detect resume state.
{log_dir}/plan/checklist.md contains [x], [FAIL], or [SKIP-DEP], update its Safety commit: line, skip completed steps, and continue at the first [ ] step.Run mkdir -p {log_dir}/dev_logs {log_dir}/_internal/dev_reviews and write {log_dir}/plan/checklist.md directly from the canonical plan:
Safety commit: {$SAFETY_COMMIT}
Phase A: [description]
[ ] Step 1: [file] — [what to change]
[ ] Step 2: [file] — [what to change]
Phase B: [description]
[ ] Step 3: [file] — [what to change]
Use the checklist as the sole orchestration tracker. Keep plan files immutable during execution. Mark each step [x], [FAIL], or [SKIP-DEP].
dev/* unit (default dev/backend; the compiled route seals the member) with concrete file and change instructions.{log_dir}/dev_logs/ and require a step log such as dev_logs/step_01_model_py.md.[x]. The phase review owns syntax and import verification.Plan-frontmatter qa_level overrides automatic selection for every phase. Otherwise classify each phase by scope.
| Level | Auto-detect condition | Review action |
|---|---|---|
| Quick | Inherited --intensity quick direct invocation | One fast reviewer, one pass; log major findings without rollback retry and propagate them to pipeline_summary.md Decision Points |
| Light | At most 3 mechanical units in one variant | One fast reviewer |
| Standard | 4–10 units or logic changes in one module | One deep reviewer |
| Thorough | More than 10 units, cross-module or cross-variant work, or architectural change | Two or three reviewers in parallel: correctness/deep, consistency/fast, and safety/deep when more than 20 files are involved |
| Adversarial | Cross-variant or shared-module architectural work and an external adversary is available | Thorough review plus one external adversary in parallel |
For Thorough review, cover bugs, logic, and signature mismatches; naming, conventions, and dead code; and tensor-shape or None edge cases when relevant. Write each result to _internal/dev_reviews/phase_{NN}_{focus}.md and address every critical finding.
Before selecting Adversarial, use the active adapter's external-adversary availability check. An explicitly requested unavailable adversarial run fails loudly; automatic escalation falls back to Thorough and records the fallback.
Each implementation step writes its own step log under {log_dir}/dev_logs/. Record exact old/new edits and a Decision: field explaining the rationale.
At the end of each phase:
{log_dir}, changed source files, focus, and output path in the stage artifact; the conductor dispatches the impl-review sibling node (unit qa/code-review) against them per the compiled route.
phase_{NN}_fix.md; treat a remaining critical finding as major.old_string recorded in the phase logs.$SAFETY_COMMIT, run git checkout ., mark all steps [FAIL] with Reverted by git checkout due to rollback failure in Phase N, and stop at Final Report.[FAIL] with the reason.[SKIP-DEP].Record every rollback as a Decision Point for the pipeline summary. For plans with at most three steps, skip phase grouping and review once after all steps.
If every step ends as [FAIL] or [SKIP-DEP], roll source changes back to the safety commit without touching the artifact root:
git diff --name-only $SAFETY_COMMIT HEAD -- ':!<artifact-root>'
git checkout $SAFETY_COMMIT -- <changed files>
git status
dev/* unit common rules and roles/units/dev/refactor.md — and by plan/plan-author call-site coverage; hold workers to it through phase review instead of restating it per step.[FAIL], roll it back from the step log, and continue only with independent steps.[x] → set plan frontmatter status: done.[x] and some [FAIL]/[SKIP-DEP] → set status: partial and list step numbers in failed_steps.[x] → set status: failed and list every step number in failed_steps.Read the checklist and report the overall verdict in the selected audience language. List only [FAIL] and [SKIP-DEP] steps with reasons; when all steps succeeded, a concise success verdict is sufficient. End by recommending code-test <plan file path> for functional verification. In a standalone invocation, this is the only user-facing progress report.
Execute the plan at: $ARG