code-execute
Skill8 starsChanged 2 months agoMITView on GitHub
Use only when autopilot-code dispatches the implementation stage for an approved plan. Not for top-level user requests or primary capability routing.
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codex_setting/AGENTS.mdAGENTS.md
- opencode_setting/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- claude_setting/CLAUDE.mdCLAUDE.md
- analyze-projectSkill
- analyze-userSkill
- artifact-projection-readSkill
- auditSkill
- autopilot-applySkill
- autopilot-codeSkill
- autopilot-designSkill
- autopilot-draftSkill
- autopilot-labSkill
- autopilot-refineSkill
- autopilot-researchSkill
- autopilot-shipSkill
- autopilot-specSkill
- code-planSkill
- code-refineSkill
- code-reportSkill
- code-testSkill
- design-componentsSkill
- design-handoffSkill
- design-initSkill
- design-refsSkill
- design-reviewSkill
- design-tokensSkill
- draft-refineSkill
- draft-strategySkill
- post-itSkill
- session-tidySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 10 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
Before source changes, establish a recoverable working state.
- Distinctive: line 37
Run the git working-state preflight before the safety checkpoint and again before every success commit.
- Very specific: line 41
Run git fetch && git pull when the active workflow authorizes remote synchronization.
- Distinctive: line 42
If the pull creates conflicts, follow OPERATIONS §5.9 before further edits.
- Distinctive: line 43
Run git status and inspect all uncommitted changes.
- Very specific: line 44
If changes exist, first check git rev-parse -q --verify MERGE_HEAD and $(git rev-parse --git-dir)/rebase-merge or rebase-apply.
- Distinctive: line 45
If any merge or rebase is active, apply OPERATIONS §5.9.
- Very specific: line 47
Run git rev-parse HEAD, save it as $SAFETY_COMMIT, and persist it in the checklist header.
- Very specific: line 51
Read the resolved plan at $ARG.
- Very specific: line 55
If {log_dir}/checklist.md contains [x], [FAIL], or [SKIP-DEP], update its Safety commit: line, skip completed steps, and continue at the …
- Very specific: line 57
Run mkdir -p {log_dir}/dev_logs {log_dir}/_internal/dev_reviews and write {log_dir}/checklist.md directly from the canonical plan:
- Very specific: line 69
Use the checklist as the sole orchestration tracker.
- Distinctive: line 73
Read the checklist before every step and execute steps in dependency order.
- Distinctive: line 76
Run independent steps in parallel when the active workflow supports in-session parallel delegation.
- Very specific: line 77
After a successful step, mark it [x].
- Distinctive: line 94
Before selecting Adversarial, use the active adapter's external-adversary availability check.
- Distinctive: line 108
Read the review files and act:
- Very specific: line 113
If rollback fails, read $SAFETY_COMMIT, run git checkout ., mark all steps [FAIL] with Reverted by git checkout due to rollback failure in …
- Very specific: line 114
If rollback succeeds, mark the phase steps [FAIL] with the reason.
- Very specific: line 119
If every step ends as [FAIL] or [SKIP-DEP], roll source changes back to the safety commit without touching the artifact root:
- Very specific: line 130
If a step causes cascading errors beyond plan scope, mark it [FAIL], roll it back from the step log, and continue only with independent …
- Distinctive: line 131
Do not change code outside plan scope except where a required contract change makes a caller update unavoidable.
- Very specific: line 135
All steps [x] → set plan frontmatter status: done.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
code-execute
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.mdfrom disk, and never depend on prior-stage conversation. This is the only source-mutating stage. Its write class is assigned source files (including tracked docs/configuration examples),checklist.md,dev_logs/,_internal/dev_reviews/, and plan-frontmatterstatus. Source ownership is defined by scope and tracked content, not filename extension. A commit-expected single session commits all validated owned source paths; artifact shadows, runtime state, and unrelated dirty files are excluded. 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.
Slice Mode
If the assignment is a parallel sub-session slice (a phase brief, fixed files, stage_authority=0), this is all you do: edit only the fixed files, run only the slice's verify command, and report the changed files and the verify result. Skip the Git Safety Checkpoint, phase commits and rollback below — a slice makes no git writes (no add, commit, checkout, restore, stash, reset), reads git state with GIT_OPTIONAL_LOCKS=0, and leaves checklist.md and the dev log to the owner. If a file outside the list is needed, stop and hand off.
Commit Messages
- Safety checkpoint:
chore: Safety checkpoint before {plan-name} execution - Success:
{type}: {description}\n\n{bullet list of key changes}, where type isfeat,fix,refactor, orchore
Git Safety Checkpoint
Before source changes, establish a recoverable working state.
- Run the git working-state preflight before the safety checkpoint and again before every success commit.
- Apply OPERATIONS §5.9 for active operations, conflict-resolution authority, and detached HEAD handling.
- Warn about a dirty entry state, an upstream-ahead branch, or the same branch checked out in another worktree.
- Record entry
HEAD. Before committing, stop ifHEADchanged unexpectedly or a newMERGE_HEADappeared.
- Run
git fetch && git pullwhen the active workflow authorizes remote synchronization.- If the pull creates conflicts, follow OPERATIONS §5.9 before further edits; do not abort automatically.
- Run
git statusand inspect all uncommitted changes. - If changes exist, first check
git rev-parse -q --verify MERGE_HEADand$(git rev-parse --git-dir)/rebase-mergeorrebase-apply.- If any merge or rebase is active, apply OPERATIONS §5.9; a safety checkpoint never completes the operation implicitly.
- Otherwise, create an accurately described checkpoint with
git add -A && git commitonly when every included change is understood and in scope. Stop instead of sweeping unrelated user changes into the checkpoint.
- Run
git rev-parse HEAD, save it as$SAFETY_COMMIT, and persist it in the checklist header.
Initialization
- Read the resolved plan at
$ARG. - Set
{log_dir}to the task root two levels aboveplan.md.- Example:
$AGENT_ARTIFACT_OUTPUT_DIR/plans/2026-03-18_refactor_engine/plan.md→$AGENT_ARTIFACT_OUTPUT_DIR/plans/2026-03-18_refactor_engine/
- Example:
- Detect resume state.
- If
{log_dir}/checklist.mdcontains[x],[FAIL], or[SKIP-DEP], update itsSafety commit:line, skip completed steps, and continue at the first[ ]step. - Otherwise create a fresh checklist.
- If
Run
mkdir -p {log_dir}/dev_logs {log_dir}/_internal/dev_reviewsand write{log_dir}/checklist.mddirectly 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].
Execution Rules
- Read the checklist before every step and execute steps in dependency order.
- Implement each step as the node's
dev/*unit (defaultdev/backend; the compiled route seals the member) with concrete file and change instructions. - Give each worker
{log_dir}/dev_logs/and require a step log such asdev_logs/step_01_model_py.md. - Run independent steps in parallel when the active workflow supports in-session parallel delegation.
- After a successful step, mark it
[x]. The phase review owns syntax and import verification. - Continue until every processable step has a terminal checklist mark.
QA Scaling
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.
Change Logs and Phase Review
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:
- Select the review level from plan override or phase scope.
- Record the phase's step-log paths,
{log_dir}, changed source files, focus, and output path in the stage artifact; the conductor dispatches theimpl-reviewsibling node (unitqa/code-review) against them per the compiled route.- Light/Standard: one reviewer.
- Thorough: parallel correctness, consistency, and optional safety reviewers using the portable fast/deep profiles above.
- Adversarial: the Thorough batch plus one external adversary.
- Require every reviewer to write its report and return only the path and a one-line verdict.
- Read the review files and act:
- Advisory-only findings: record them in the checklist and continue.
- Critical findings that do not require rollback: re-enter the execute boundary once and fix every 🔴 of the review together (plus the follow-on gaps it named); then re-review to
phase_{NN}_fix{M}.mdas a closure check that names the round and the prior review path — never a fresh full audit, and never a fullexecuteredispatch. Treat a critical finding still open after that single batched fix as major. If the impl-review budget is spent while the last round still reports blocking findings, the conductor records{log_dir}/_internal/dev_reviews/phase_{NN}.owner-closure.md(frontmatterverdict: closed-by-owner,node: impl-review; body naming every blocking attempt id, its review artifact, and each finding's disposition) and completesimpl-reviewwith that record as--evidence. - Major critical finding: roll back the phase automatically and continue under the family autonomy policy.
- Restore every
old_stringrecorded in the phase logs. - If rollback fails, read
$SAFETY_COMMIT, rungit checkout ., mark all steps[FAIL]withReverted by git checkout due to rollback failure in Phase N, and stop at Final Report. - If rollback succeeds, mark the phase steps
[FAIL]with the reason. - Continue to the next independent phase; mark dependent steps
[SKIP-DEP].
- Restore every
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 statusCritical Safety Rules
- Signature-change safety (find every call site, update every caller, inspect implicit contracts) is owned by the dev unit contract — the
dev/*unit common rules androles/units/dev/refactor.md— and byplan/plan-authorcall-site coverage; hold workers to it through phase review instead of restating it per step. - If a step causes cascading errors beyond plan scope, mark it
[FAIL], roll it back from the step log, and continue only with independent steps. - Do not change code outside plan scope except where a required contract change makes a caller update unavoidable.
Plan Status
- All steps
[x]→ set plan frontmatterstatus: done. - Some
[x]and some[FAIL]/[SKIP-DEP]→ setstatus: partialand list step numbers infailed_steps. - No
[x]→ setstatus: failedand list every step number infailed_steps.
Final Report
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.
Task
Execute the plan at: $ARG
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

