Skip to content

fix(superpowers-bridge): add bridge-new skill, move worktree creation before any artifact - #9

Open
LuSrackhall wants to merge 1 commit into
JiangWay:mainfrom
LuSrackhall:worktree-fix+untracked-artifacts-worktree-timing
Open

fix(superpowers-bridge): add bridge-new skill, move worktree creation before any artifact#9
LuSrackhall wants to merge 1 commit into
JiangWay:mainfrom
LuSrackhall:worktree-fix+untracked-artifacts-worktree-timing

Conversation

@LuSrackhall

Copy link
Copy Markdown

Problem

/opsx:new --schema superpowers-bridge creates the change directory on the main working tree as untracked files. All subsequent artifacts (brainstorm.md, proposal.md, design.md, specs/, tasks.md, plan.md) are also written as untracked files. When /opsx:apply later creates a git worktree for implementation, untracked files are not carried over — causing a gap where apply lacks necessary planning artifacts.

Root Cause

README line 373 noted that v0's auto-commit was removed per PR #970, calling it "the worktree skill's responsibility" — but using-git-worktrees SKILL.md never handled untracked files. OpenSpec schemas have no before_create hook, so the earliest execution point is artifact.instruction (at /opsx:continue), by which time /opsx:new has already written files on main.

Solution (Plan C+)

Ship a bundled bridge-new skill that reverses the order:

  1. Create the worktree first
  2. Run openspec new change inside it
  3. All artifacts land directly in the isolated branch — zero main-tree pollution

Add worktree detection to every artifact instruction — each /opsx:continue checks git worktree list and STOPS if the worktree is missing.

Changes

File Change
templates/skills/bridge-new.md NEW — entry skill, canonical replacement for /opsx:new
schema.yaml +7 worktree checks (6 artifact instructions + apply step 1); description notes /bridge-new
README.md Updated: Quick flow, Step-by-step, CLI cheat sheet, lifecycle diagram, timing notes, touchpoints table, apply walkthrough, Design touch #6, new design decision section
README.zh-TW.md Synced all changes to Traditional Chinese

Verification

  • YAML syntax valid
  • 7 worktree check blocks in schema.yaml
  • bridge-new.md skill file present in templates/skills/
  • All bridge-new references consistent across README.md and README.zh-TW.md

Closes #6

… before any artifact

Root cause: /opsx:new writes change scaffolding on main working tree as
untracked files. Subsequent artifacts are also untracked. When /opsx:apply
creates a worktree, untracked files are not synced — causing a gap where
apply lacks necessary planning artifacts.

Solution: Ship a bundled bridge-new skill that creates the worktree FIRST,
then runs openspec new change inside it. All artifacts land directly in the
isolated branch with zero main-tree pollution. Every artifact instruction
now checks for the worktree and STOPS if missing.

Changes:
- NEW: templates/skills/bridge-new.md — entry skill for the schema
- schema.yaml: add worktree check to all 6 artifact instructions + apply
- README.md: update lifecycle diagram, timing notes, touchpoints, walkthrough
- README.zh-TW.md: sync all changes to Traditional Chinese
- README.md & .zh-TW.md: add design decision documenting why a skill was necessary

Closes JiangWay#6
@LuSrackhall

Copy link
Copy Markdown
Author

此 pr 由 ai 生成, 我并没有做任何形式测试, 仅供作者参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Untracked change artifacts lost when worktree is created during apply

1 participant