agentleFS
open-thoughtsopen-thoughts/OpenThoughts-Agent/.agents/skills/code-execute-staged-plan/SKILL.md

code-execute-staged-plan

Skill309 starsChanged 4 months agoApache-2.0View on GitHub

EXECUTE a staged codebase plan (from code-create-staged-plan or an existing notes/<codebase>/ plan) one stage at a time, gate-by-gate, while keeping the local clone ground truth and a dated agent_logs/ progress log. For each stage: re-read the scope + reconfirm the (drifting) code anchors, make the edit in the LOCAL clone on the feature branch, run the validation gate (flag-off byte-identical FIRST, then behavior-on / parity / GPU smoke on the right SIF/env), commit+push and sync to the cluster (vLLM = build from source, never rsync), update the plan status, and only THEN advance. Log every stage/debug session in agent_logs/YYYY-MM-DD_<topic>.md so long runs don't lose context. Use when the user says "execute/run the plan", "do stage N", or "continue the <X> port/fix".

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run a staged plan one stage, gate, and commit at a time.

    line 16
  2. Very specific:

    Record results: update the stage scope and parent status (Stage N ✅ DONE — commit <sha>, gate <result>).

    line 32
  3. Very specific:

    When the final stage is green, mark the parent plan DONE with the commit range and headline gate, ensure the canonical branch and clusters …

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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-staged-plan

Run a staged plan one stage, gate, and commit at a time. Keep the plan in notes/<codebase>/ and a dated progress log in agent_logs/.

Inputs

  • The plan: notes/<codebase>/{README.md | <change>_plan.md} + the per-stage stage<N>_<slug>_scope.md. Read the parent (goal + invariants + stage map) and the current stage's scope doc.
  • The progress log: a dated agent_logs/YYYY-MM-DD_<topic>.md — the running record for this change. If one exists for the change, append; else create it.

Per-stage loop

  1. Re-read the stage scope + RECONFIRM anchors. The borrow-map line/file anchors drift — grep/open the real files now; don't trust line numbers from the plan's authoring date.
  2. Edit the local feature branch. The clones are under ~/Documents/; never hand-edit or patch-by-rsync a cluster. Keep the diff minimal.
  3. Run the validation gate, in order:
    • Flag-off byte-identical first — prove the change is a no-op when its flag is off (torch.equal / golden test / the EP-CP no-op test pattern).
    • Behavior-on / parity — the stage's GO condition (e.g. dcp=N==dcp=1 greedy bit-identical + logprobs allclose at the bf16 floor tol — don't loosen tol to pass).
    • GPU smoke where needed via sbatch on the correct SIF/env (.agents/ops/<cluster>/ENVIRONMENT_MAP.md; torch selects the runtime).
    • Lint/syntax via mcp__ide__getDiagnostics, not py_compile.
  4. Commit, push, and sync. One descriptive commit per stage/logical unit. git pull the editable Python repos on the cluster; build vLLM from the committed source. Verify the cluster clone is at the pushed commit and clean.
  5. Record results: update the stage scope and parent status (Stage N ✅ DONE — commit <sha>, gate <result>); append what changed, commit, gate numbers, blocker, and next step to agent_logs/.
  6. Advance only on GREEN. A red/ambiguous gate stops the loop — diagnose (dispatch an investigative subagent if it's deep), log it, fix, re-gate. Don't paper over a failing parity gate.

Progress-log discipline (agent_logs/)

  • One dated file per change/debug thread (YYYY-MM-DD_<topic>.md); append across stages and sessions.
  • Capture: the hypothesis, what was tried, commit SHAs, gate results (with numbers), what was ruled out, and the current blocker + next action. Future-you (or a fresh subagent) should be able to resume from the log alone.
  • This log is ALSO the per-change failure/remediation record the cron sweep references for genuine FAILED jobs.

Subagents (for parallel stages / deep investigations)

Dispatch with: edit local → commit/push → sync; secrets via env vars only (source "$DC_AGENT_SECRET_ENV"); reconfirm anchors; run and report the gate. Verify the gate claim before marking a stage DONE.

On completion

When the final stage is green, mark the parent plan DONE with the commit range and headline gate, ensure the canonical branch and clusters are current, and write the closing agent_logs/ entry. Note concrete follow-ups.

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.