agentleFS
dmlguq456dmlguq456/hearting/skills/code-execute/SKILL.md

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.

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
  1. Distinctive:

    Before source changes, establish a recoverable working state.

    line 35
  2. Distinctive:

    Run the git working-state preflight before the safety checkpoint and again before every success commit.

    line 37
  3. Very specific:

    Run git fetch && git pull when the active workflow authorizes remote synchronization.

    line 41
  4. Distinctive:

    If the pull creates conflicts, follow OPERATIONS §5.9 before further edits.

    line 42
  5. Distinctive:

    Run git status and inspect all uncommitted changes.

    line 43
  6. Very specific:

    If changes exist, first check git rev-parse -q --verify MERGE_HEAD and $(git rev-parse --git-dir)/rebase-merge or rebase-apply.

    line 44
  7. Distinctive:

    If any merge or rebase is active, apply OPERATIONS §5.9.

    line 45
  8. Very specific:

    Run git rev-parse HEAD, save it as $SAFETY_COMMIT, and persist it in the checklist header.

    line 47
  9. Very specific:

    Read the resolved plan at $ARG.

    line 51
  10. Very specific:

    If {log_dir}/checklist.md contains [x], [FAIL], or [SKIP-DEP], update its Safety commit: line, skip completed steps, and continue at the …

    line 55
  11. Very specific:

    Run mkdir -p {log_dir}/dev_logs {log_dir}/_internal/dev_reviews and write {log_dir}/checklist.md directly from the canonical plan:

    line 57
  12. Very specific:

    Use the checklist as the sole orchestration tracker.

    line 69
  13. Distinctive:

    Read the checklist before every step and execute steps in dependency order.

    line 73
  14. Distinctive:

    Run independent steps in parallel when the active workflow supports in-session parallel delegation.

    line 76
  15. Very specific:

    After a successful step, mark it [x].

    line 77
  16. Distinctive:

    Before selecting Adversarial, use the active adapter's external-adversary availability check.

    line 94
  17. Distinctive:

    Read the review files and act:

    line 108
  18. Very specific:

    If rollback fails, read $SAFETY_COMMIT, run git checkout ., mark all steps [FAIL] with Reverted by git checkout due to rollback failure in …

    line 113
  19. Very specific:

    If rollback succeeds, mark the phase steps [FAIL] with the reason.

    line 114
  20. Very specific:

    If every step ends as [FAIL] or [SKIP-DEP], roll source changes back to the safety commit without touching the artifact root:

    line 119
  21. Very specific:

    If a step causes cascading errors beyond plan scope, mark it [FAIL], roll it back from the step log, and continue only with independent …

    line 130
  22. Distinctive:

    Do not change code outside plan scope except where a required contract change makes a caller update unavoidable.

    line 131
  23. Very specific:

    All steps [x] → set plan frontmatter status: done.

    line 135

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 the autopilot-code conductor. Resolve the plan path from arguments, read plan.md from 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-frontmatter status. 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's dev/* 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 $ARG to 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 is feat, fix, refactor, or chore

Git Safety Checkpoint

Before source changes, establish a recoverable working state.

  1. 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 if HEAD changed unexpectedly or a new MERGE_HEAD appeared.
  2. Run git fetch && git pull when the active workflow authorizes remote synchronization.
    • If the pull creates conflicts, follow OPERATIONS §5.9 before further edits; do not abort automatically.
  3. Run git status and inspect all uncommitted changes.
  4. If changes exist, first check git rev-parse -q --verify MERGE_HEAD and $(git rev-parse --git-dir)/rebase-merge or rebase-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 commit only when every included change is understood and in scope. Stop instead of sweeping unrelated user changes into the checkpoint.
  5. Run git rev-parse HEAD, save it as $SAFETY_COMMIT, and persist it in the checklist header.

Initialization

  1. Read the resolved plan at $ARG.
  2. Set {log_dir} to the task root two levels above plan.md.
    • Example: $AGENT_ARTIFACT_OUTPUT_DIR/plans/2026-03-18_refactor_engine/plan.md → $AGENT_ARTIFACT_OUTPUT_DIR/plans/2026-03-18_refactor_engine/
  3. Detect resume state.
    • If {log_dir}/checklist.md contains [x], [FAIL], or [SKIP-DEP], update its Safety commit: line, skip completed steps, and continue at the first [ ] step.
    • Otherwise create a fresh checklist.
  4. Run mkdir -p {log_dir}/dev_logs {log_dir}/_internal/dev_reviews and write {log_dir}/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].

Execution Rules

  • Read the checklist before every step and execute steps in dependency order.
  • Implement each step as the node's dev/* unit (default dev/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 as dev_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.

LevelAuto-detect conditionReview action
QuickInherited --intensity quick direct invocationOne fast reviewer, one pass; log major findings without rollback retry and propagate them to pipeline_summary.md Decision Points
LightAt most 3 mechanical units in one variantOne fast reviewer
Standard4–10 units or logic changes in one moduleOne deep reviewer
ThoroughMore than 10 units, cross-module or cross-variant work, or architectural changeTwo or three reviewers in parallel: correctness/deep, consistency/fast, and safety/deep when more than 20 files are involved
AdversarialCross-variant or shared-module architectural work and an external adversary is availableThorough 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:

  1. Select the review level from plan override or phase scope.
  2. Record the phase's step-log paths, {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.
    • 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.
  3. 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}.md as a closure check that names the round and the prior review path — never a fresh full audit, and never a full execute redispatch. 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 (frontmatter verdict: closed-by-owner, node: impl-review; body naming every blocking attempt id, its review artifact, and each finding's disposition) and completes impl-review with that record as --evidence.
    • Major critical finding: roll back the phase automatically and continue under the family autonomy policy.
      1. Restore every old_string recorded in the phase logs.
      2. If rollback fails, read $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.
      3. If rollback succeeds, mark the phase steps [FAIL] with the reason.
      4. Continue to the next independent phase; mark dependent steps [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

Critical 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 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.
  • 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 frontmatter status: done.
  • Some [x] and some [FAIL]/[SKIP-DEP] → set status: partial and list step numbers in failed_steps.
  • No [x] → set status: failed and list every step number in failed_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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.