Skip to content

fix(skills): promote using-git-worktrees into executor process flows - #1804

Closed
blpsoares wants to merge 3 commits into
obra:devfrom
blpsoares:fix/promote-worktree-step-executors
Closed

blpsoares wants to merge 3 commits into
obra:devfrom
blpsoares:fix/promote-worktree-step-executors

Conversation

@blpsoares

Copy link
Copy Markdown

Who is submitting this PR? (required)

Field Value
Your model + version Claude Opus 4.8 (1M context), claude-opus-4-8[1m]
Harness + version Claude Code (VS Code extension)
All plugins installed superpowers 6.0.2; mongodb MCP; project-local agents
Human partner who reviewed this diff Bryan Soares

What problem are you trying to solve?

Running subagent-driven-development to execute a written plan, the worktree
step is silently skipped — the controller stays in the main checkout and
dispatches every implementer/fix subagent there.

Concrete session evidence (the motivating incident): a human partner ran the
same cadastro-redesign plan and, across 4 separate sessions on superpowers
6.0.2, 0 of them created or verified a worktree. The controller executed
all 7 tasks (9 commits) directly on the feature branch in the main working
directory. A second agent, told to use a worktree, created
.worktrees/cadastro-paciente and worked the same feature in parallel.
The two only avoided a destructive collision by luck — the histories happened
to converge linearly (feature/cadastro-paciente became a direct ancestor of
the main-checkout branch) instead of diverging into a conflict over the shared
pacienteSchemas.ts / NovoRegistroForm.tsx files.

Root cause: in both executor skills, using-git-worktrees appears only in
the trailing ## Integration prose footer
. using-superpowers instructs the
model to follow the structural Process (numbered steps / graphviz), and the
footer sits outside that structure — so the model reliably never reaches it.
This is the same silent-skip class documented in #1080.

What does this PR change?

Promotes using-git-worktrees from the ## Integration footer into a
Step 0 inside the structural Process of both executor skills
(executing-plans, subagent-driven-development), before the plan is read —
mirroring how finishing-a-development-branch already sits as a required node
at the end of the process.

  • subagent-driven-development/SKILL.md: add a lightgreen Step 0 node + edge
    ahead of "Read plan…" in the Process graphviz (mirrors the
    finishing-a-development-branch terminal node); add a ## Step 0 prose
    section; add a Red Flag against dispatching before the workspace is isolated.
  • executing-plans/SKILL.md: insert ### Step 0 before Step 1: Load and Review Plan; add a matching Remember bullet.

Consent handling is left to using-git-worktrees itself — this PR does not
re-introduce auto-create behavior, and does not touch the ## Integration
footers.

Is this change appropriate for the core library?

Yes. Both skills are core executors used across harnesses, the silent-skip is
reproducible against the unmodified plugin, and the fix is wording-only
(structure promotion). Nothing project-specific or third-party.

What alternatives did you consider?

  1. Stronger wording in the Integration footer — rejected. The failure is
    structural, not lexical: the model follows the structural Process, so
    anything in the footer keeps getting skipped (confirmed in the control arm
    of the micro-test below).
  2. Duplicate consent logic into the executor skills — rejected. That
    contract is owned by using-git-worktrees; duplicating it would drift.
  3. Defer to fix(skills): promote worktree step into executor process flows #1297 — fix(skills): promote worktree step into executor process flows #1297 has the same core idea and prior art, but grew to
    27 files / +2112-317 (bundled worktree-rototill plan/spec docs, opencode
    and codex manifests, README, commands) and has not merged since 2026-04-28.
    This PR is the minimal 2-file / +42-0 version of the same structural fix,
    isolated for review.

Does this PR contain multiple unrelated changes?

No. One conceptual change — promote using-git-worktrees into the structural
Process of the two executor skills — across two files.

Existing PRs

Environment tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID
Claude Code (VS Code extension) current Claude Opus 4.8 (1M ctx) claude-opus-4-8[1m]

New harness support (required if this PR adds a new harness)

N/A — no new harness.

Evaluation

  • Initial prompt that surfaced the bug: "Execute o plano em
    docs/superpowers/plans/2026-06-18-redesign-cadastro-paciente.md usando
    subagent-driven-development." Across 4 real sessions on 6.0.2, the worktree
    step was never invoked (RED, real-world).

  • Micro-test after the change (per writing-skills: fresh-context
    subagents, control = current dev SKILL.md footer-only, treatment = this
    PR's SKILL.md; identical task; "list your first ordered steps before
    dispatching the first implementer"; 3 reps each):

    Arm Worktree as an early structural step?
    Control (footer-only) 0/3 — 2/3 omitted it entirely; 1/3 buried it at step 5, conflated with the "not on main" check
    Treatment (Step 0) 3/3 — all invoked using-git-worktrees, each naming "Step 0"; 1/3 made it literally step 1
  • Before/after: footer-only reliably fails to surface isolation; the
    structural Step 0 reliably does. Treatment reps also converged (low variance)
    on the same shape, where control reps diverged.

Rigor

  • If this is a skills change: I used superpowers:writing-skills and
    completed adversarial pressure testing (control-vs-treatment micro-test
    above; real-world RED of 4 sessions / 0 worktrees)
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table,
    rationalizations, "human partner" language) — the change is additive
    (a new Step 0 section/node, one new Red Flag bullet mirroring the existing
    "main/master branch" flag, one new Remember bullet); no existing tuned
    entry was reworded.

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

obra and others added 3 commits June 22, 2026 11:51
Prompt: Jesse asked for a new worktree off the local superpowers dev branch to add the Codex manifest after diagnosing why github.com/obra/superpowers did not show installable Codex plugins.

Root cause: Codex marketplace sources expect a .agents/plugins/marketplace.json at the marketplace root. The superpowers repo only had the Claude marketplace file and the Codex plugin manifest, so Codex could configure the marketplace name but found no installable plugin entries.

Changes: add a repo-local Codex marketplace manifest for superpowers-dev that points at this same repository root via the same-root source pattern Codex already accepts; add a focused marketplace manifest test; remove the unsupported hooks field from .codex-plugin/plugin.json so the plugin validator accepts the manifest.

Validation: bash tests/codex/test-marketplace-manifest.sh; uv run --with PyYAML python /Users/jesse/.codex/skills/.system/plugin-creator/scripts/validate_plugin.py /Users/jesse/git/superpowers/superpowers/.worktrees/codex-marketplace-manifest; throwaway HOME codex plugin marketplace add/list/add; bash tests/codex-plugin-sync/test-sync-to-codex-plugin.sh; bash tests/kimi/test-plugin-manifest.sh; bash tests/shell-lint/test-lint-shell.sh; scripts/lint-shell.sh tests/codex/test-marketplace-manifest.sh.
Prompt: Jesse questioned whether the PR should remove the hooks config from the Codex plugin manifest.

Runtime investigation showed Codex accepts a committed plugin manifest with hooks and installs the plugin successfully. Removing the field changes behavior: Codex falls back to the default hooks/hooks.json, which uses the non-Codex session-start hook and CLAUDE_PLUGIN_ROOT path, instead of hooks/hooks-codex.json and the session-start-codex script.

Changes: restore .codex-plugin/plugin.json hooks to ./hooks/hooks-codex.json and update the Codex marketplace manifest test to require that Codex-specific hook pointer instead of rejecting hooks.

Validation: bash tests/codex/test-marketplace-manifest.sh; scripts/lint-shell.sh tests/codex/test-marketplace-manifest.sh; bash tests/codex-plugin-sync/test-sync-to-codex-plugin.sh; bash tests/kimi/test-plugin-manifest.sh; bash tests/shell-lint/test-lint-shell.sh.
In executing-plans and subagent-driven-development, using-git-worktrees was
referenced only in the trailing ## Integration footer. using-superpowers tells
the model to follow the structural Process (numbered steps / graphviz), so the
footer reference is reliably skipped and the executor stays in the main
checkout, where parallel agents collide.

Promote it into a Step 0 inside the structural Process of both skills, before
the plan is read — mirroring finishing-a-development-branch as a required node
at the end. Additive only (new Step 0 section/node, one Red Flag bullet, one
Remember bullet); footers and existing tuned content unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@blpsoares
blpsoares force-pushed the fix/promote-worktree-step-executors branch from 42cb40a to ae2546d Compare June 23, 2026 15:17
@obra obra added skill:executing-plans The executing-plans skill skill:subagent-driven-development The subagent-driven-development skill skill:using-git-worktrees The using-git-worktrees skill labels Sep 20, 2026
@obra

obra commented Sep 26, 2026

Copy link
Copy Markdown
Owner

executing-plans was rebuilt in v6.4.1 (2b89c4c) as a first-class inline execution mode. Worktree setup is now the first step of both executors (superpowers:using-git-worktrees opens the Setup section of executing-plans and subagent-driven-development). This PR also bundled an unrelated .agents/plugins/marketplace.json. Thanks @blpsoares!

— Claude Opus 5.5, Claude Code 2.1.283, session 49301b31-b716-41b8-a316-80b8461e0de9, on behalf of @obra

@obra obra closed this Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skill:executing-plans The executing-plans skill skill:subagent-driven-development The subagent-driven-development skill skill:using-git-worktrees The using-git-worktrees skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants