agentleFS
metalogicametalogica/substrate/skills/execute/SKILL.md

execute

Skill0 starsChanged 2 months agoMITView on GitHub

The ATTENDED single-window execution mode: run a multi-phase SDD spec (produced by /substrate:architect-spec) with one implementing agent while a human co-pilots, pausing at each step/phase gate for approval. Invoke with a spec path (docs/tasks/ongoing/<feature>/<feature>-spec.md). Walks Phase N → Step N.M → Verify → Gate per docs/protocol/sdd/execution-format.md. This is the single-window (K=1, human-in-the-loop) alternative to the primary door /substrate:orchestrate, which runs K context-budget windows as an unattended parallel worktree fleet. Choose execute when you want to watch/adapt one window, or the spec fits one window and you prefer HIL. Best run in a fresh Claude session for a clean context window.

  • Commits and pushes

57 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use context-optimize, ralplan and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ibahgatSkill

    context-optimize

    Improve context efficiency and cache stability for long or complex sessions.

    Also in 3 projects that use this

  • ibahgatSkill

    ralplan

    Create a strict, quality-first execution plan with explicit gates and rollback-ready sequencing.

    Also in 5 projects that use this

  • Yeachan-HeoSkill

    ultragoal

    Create and execute durable repo-native multi-goal plans over Codex goal mode artifacts.

    Also in 4 projects that use this

  • buddyhSkill

    deep-dive

    Deep dive on any topic. Decomposes into subtopics, researches each in parallel with thorough source gathering, then synthesizes into a comprehensive report (4,000-10,000+ words, 40-100+ sources). Scales depth dynamically based on topic complexity. Use when asked for a deep dive, deep research, comprehensive analysis, or thorough investigation of a topic.

    Also in 4 projects that use this

  • mukcoSkill

    principles

    General software engineering principles — DRY, SOLID, YAGNI, KISS, naming, code smells, and refactoring. Language-agnostic. Use alongside language-specific skills.

    Also in 3 projects that use this

  • team-attentionSkill

    compound

    This skill should be used when the user says "/compound", "compound this", "document learnings", "save what we learned", or after completing a PR. Extracts knowledge from PR context and saves to docs/learnings/.

    Also in 3 projects that use this

  • +1 more from ibahgat

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. 0 are common, 15 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 55 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a spec phase-by-phase with gated verification, one window, with a human co-piloting.

    line 8
  2. Very specific:

    If a tracker (tbd) is configured, read the DAG: bash docs/scripts/bead-graph.sh --epic <slug>.

    line 50
  3. Very specific:

    No tracker, or no epic:<slug> beads → the spec has no partition to fan out.

    line 51
  4. Distinctive:

    Offer the default, then honor the choice: If orchestrated would clearly win, surface it — "this spec partitions into a parallel fleet.

    line 58
  5. Distinctive:

    Read the full spec at the provided path.

    line 73
  6. Very specific:

    Every step has a ##### Verify block.

    line 77
  7. Distinctive:

    If any structural check fails, stop and report which section is broken so the user can fix the spec before re-running.

    line 80
  8. Distinctive:

    All commands exit 0 → step passes, continue to next step.

    line 122
  9. Distinctive:

    If still failing, STOP and ask the user what to do.

    line 127
  10. Distinctive:

    After the last step of the phase:

    line 129
  11. Very specific:

    3e. Run phase gate: If a #### Gate block exists, run its commands via Bash.

    line 131
  12. Very specific:

    Wait for explicit approval.

    line 145
  13. Distinctive:

    Read the full integrated diff (this feature's changes vs.

    line 151
  14. Distinctive:

    Do NOT push. The user decides when to push.

    line 178
  15. Distinctive:

    MUST parse the spec before executing anything.

    line 197
  16. Distinctive:

    MUST stop execution at any failed verify/gate — do NOT skip over failures.

    line 198
  17. Distinctive:

    MUST pause for user approval between phases (after each gate).

    line 199
  18. Very specific:

    MUST run the Doctrine Reconciliation phase — never skip the final phase — and apply any earned ratify-only doctrine change to …

    line 200
  19. Distinctive:

    MUST commit after successful execution (step 6).

    line 201
  20. Very specific:

    MUST NOT push to GitHub or deploy — that's for the user or /substrate:deploy.

    line 202
  21. Very specific:

    MUST NOT invent steps beyond what the spec contains.

    line 203
  22. Distinctive:

    SHOULD narrate each phase + step + verify result so the user sees liveness on long executions.

    line 204
  23. Distinctive:

    SHOULD attempt one obvious fix when a verify fails (missing import, trivial type error).

    line 205

“Common” is measured: kept by at least 6 in 10 of the 55 edited versions of this file we could read. “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

/substrate:execute

Run a spec phase-by-phase with gated verification, one window, with a human co-piloting. This is the attended execution mode — the single-window (K=1) case of substrate's context-budget partition (agents-parallel-execution-doctrine.md §Grouping & windows), where one implementing agent walks the whole spec and pauses at each gate for you.

Orchestrated is the default; attended is the deliberate choice. The primary execution door is /substrate:orchestrate, which partitions the graphed DAG into K windows and runs them as an unattended parallel worktree fleet. Reach for attended execute when you want to watch and adapt one window as it runs, or the spec is small enough to be one window and you prefer human-in-the-loop over a fleet. Same partition, K collapsed to 1, human in the loop.

/substrate:architect-spec produces the spec; this skill executes it as the attended half of the SDD pipeline.

Arguments

<spec-path> — path to a spec at docs/tasks/ongoing/<feature>/<feature>-spec.md.

When to run

  • A spec exists and follows the grammar in docs/protocol/sdd/execution-format.md.
  • You want attended, human-in-the-loop execution of a single window — to watch/adapt as it runs, or because the spec fits one window and a parallel fleet isn't worth the worktree overhead. For the unattended parallel default, use /substrate:orchestrate instead.
  • You're in a FRESH Claude session (not the same session that drafted the spec). Clean context is the entire point.

When to REFUSE

SignalRedirect
Spec path missing or emptyAsk for the path.
Spec does not contain a ## N. Prompt Execution Strategy sectionNot executable — it's a design doc. Run /substrate:architect-spec to produce an executable version.
Same session already contains the brief + Q&A + architect outputsOpen a new terminal and re-invoke. A cluttered context window degrades step quality on long specs.

Workflow

Step 0. Confirm attended is the right mode (orchestrated is the default)

You were invoked as the attended door, but orchestrated is substrate's primary strategy — so before walking phases, confirm this spec actually wants a single attended window rather than the parallel fleet. This is a routing check only; it never changes the attended steps below.

  1. Detect a graphed epic. Derive <slug> from the spec directory (docs/tasks/ongoing/<slug>/). If a tracker (tbd) is configured, read the DAG: bash docs/scripts/bead-graph.sh --epic <slug>. No tracker, or no epic:<slug> beads → the spec has no partition to fan out; stay attended (Step 1 onward).
  2. Assess whether orchestrated would clearly win. The parallel fleet earns its worktree overhead only when all hold:
    • a graphed epic:<slug> exists, AND
    • some wave has ≥3 file-disjoint windows/beads, AND
    • a tracker is configured.
  3. Offer the default, then honor the choice. If orchestrated would clearly win, surface it — "this spec partitions into a parallel fleet; /substrate:orchestrate <slug> is the primary door — run that instead, or stay attended here?" On explicit confirm to switch, hand off to /substrate:orchestrate <slug> (optionally --auto). Otherwise — no epic, fewer than 3 file-disjoint windows, no tracker, or the user prefers to stay attended — run the attended phase-by-phase path (Step 1 onward). Choosing attended is always valid: it's the deliberate single-window mode, not a fallback.

Never silently fan out. Spawning a parallel fleet is heavy and mutating (it cuts branches and worktrees), so switching to orchestrated is always an explicit opt-in. Staying attended never spawns a worktree. See /substrate:orchestrate and agents-parallel-execution-doctrine.md §Grouping & windows for the fleet semantics.

Step 1. Load the spec

Read the full spec at the provided path. Verify it contains:

  • ## N. Prompt Execution Strategy section (required per execution-format.md).
  • At least one ### Phase N: subsection.
  • Every step has a ##### Verify block.
  • The final phase is "Doctrine Reconciliation" (mandatory, terminal per spec-template.md §N).

If any structural check fails, stop and report which section is broken so the user can fix the spec before re-running.

Step 2. Parse the execution plan

Walk the spec's Prompt Execution Strategy section. For each phase, capture:

  • Phase number + name
  • Steps, each with: title, prompt content, verify commands, optional timeout
  • Optional phase gate commands

Print a one-line summary per phase, then wait for approval before starting:

Execution Plan — <feature>

  Phase 1: Domain Layer           (3 steps, gate: pnpm app:compile && pnpm app:test)
  Phase 2: Schema + Backend       (4 steps, gate: pnpm app:compile && pnpm app:test)
  Phase 3: Frontend               (5 steps, gate: pnpm app:compile && pnpm app:test)
  Phase 4: Integration + E2E      (2 steps, gate: pnpm app:test:e2e)
  Phase 5: Doctrine Reconciliation (1 step, gate: re-run epic gate on integrated tip)

Start Phase 1? (y / n)

Step 3. Walk each phase

For each phase, in order:

For each step within the phase:

3a. Announce.

--- Phase <N>, Step <N.M>: <Title> ---

3b. Execute. Carry out the step's prompt content using the appropriate tools (Write, Edit, Bash). Respect any "Tools to use" / "Tools to NOT use" hints in the step body.

3c. Run verify commands. Each ##### Verify list item is a shell command in backticks. Run them sequentially via Bash, in order. Apply the step's ##### Timeout if specified (default 180000ms).

3d. Interpret results.

  • All commands exit 0 → step passes, continue to next step.
  • Any command exits non-zero → step FAILS:
    1. Show the failing command and its output.
    2. Attempt one fix based on the error if it's obvious (missing import, type mismatch, missing dir).
    3. Re-run verify.
    4. If still failing, STOP and ask the user what to do.

After the last step of the phase:

3e. Run phase gate. If a #### Gate block exists, run its commands via Bash. Same semantics as verify.

3f. Pause for user approval. Print:

✔ Phase <N> complete.
  Steps: <N> passed
  Gate: <gate commands> → green

Summary: <one-paragraph of what changed in this phase>

Continue to Phase <N+1>? (y / n / pause)

Wait for explicit approval. n or pause stops execution cleanly so the user can inspect before resuming.

Step 4. Final phase: Doctrine Reconciliation

The last phase is always Phase N: Doctrine Reconciliation per spec-template.md. It runs against the fully integrated feature and applies the doctrine change the code earned — it does not detect-and-queue. /substrate:execute is depth-0 and attended, so apply the mutation directly:

  1. Read the full integrated diff (this feature's changes vs. the pre-execution base) and the doctrines the spec loaded.
  2. Edit docs/doctrine/** directly to codify what the landed code demonstrates — under the ratify-only rule: you may only relax an outdated rule, promote a pattern the code demonstrates, or add coverage the code exemplifies. You may never introduce a MUST / MUST-NOT the just-landed code violates. If reconciliation would require a stricter rule that invalidates shipped code, do not apply it here — leave it for /substrate:synthesize-session.
  3. Re-run the gate on the integrated tip (pnpm app:compile && pnpm app:lint && pnpm app:test). Green ⟹ the mutation was ratify-only and lands with the feature in the same commit. Red ⟹ not ratify-only; revert the doctrine edit and defer.

There is no doctrine-amendments.md, no type: doctrine-amendment bead, no handoff queue — behavior is identical regardless of bead-tracker. If no doctrine change is earned, this phase is a no-op.

Step 5. Archive the task

Once the Doctrine Reconciliation phase passes, archive the feature directory:

mkdir -p docs/tasks/completed
mv "docs/tasks/ongoing/<feature>" "docs/tasks/completed/<feature>"

Step 6. Commit the execution

git add -A
git commit -m "feat(<feature>): execute spec

Spec: docs/tasks/completed/<feature>/<feature>-spec.md
Phases: <N>
Doctrine reconciled in-epic: <yes (docs/doctrine/… touched) | no change earned>
"

Do NOT push. The user decides when to push.

Step 7. Handoff

✔ Spec execution complete.

Feature: <feature>
Phases completed: <N>
Archive: docs/tasks/completed/<feature>/
Doctrine reconciled in-epic: <docs/doctrine/… touched | no change earned>

Next:
  - git push when you're ready
  - Or continue iterating with /substrate:quick-spec, /substrate:architect-spec, or /substrate:deploy

Constraints

  • MUST parse the spec before executing anything. A malformed spec must fail fast, not halfway through.
  • MUST stop execution at any failed verify/gate — do NOT skip over failures.
  • MUST pause for user approval between phases (after each gate). Non-negotiable — gated execution is the whole point of this skill.
  • MUST run the Doctrine Reconciliation phase — never skip the final phase — and apply any earned ratify-only doctrine change to docs/doctrine/** in-epic, then re-gate. Never queue it as a doctrine-amendment or write a doctrine-amendments.md.
  • MUST commit after successful execution (step 6). One commit per spec = one revertable unit.
  • MUST NOT push to GitHub or deploy — that's for the user or /substrate:deploy.
  • MUST NOT invent steps beyond what the spec contains. The spec is binding during execution (per _SPEC-STANDARD.md §3).
  • SHOULD narrate each phase + step + verify result so the user sees liveness on long executions.
  • SHOULD attempt one obvious fix when a verify fails (missing import, trivial type error); escalate to the user if the first fix doesn't resolve.

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.