fix-worktree-opsx-skills-not-created
SkillAI & modelsDiagnose/fix worktrees missing the generated openspec-* (opsx) skills after worktreeInit. Root cause: bare `npx openspec` can resolve a squatted registry stub instead of the real CLI.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the fix-worktree-opsx-skills-not-created skill
What this skill tells your AI
The instructions your AI receives, as published by blackbelttechnology/pi-agent-dashboard in packages/openspec-workflow/.pi/skills/fix-worktree-opsx-skills-not-created/SKILL.md and read by ahel’s review.
When to Use
Use when a git worktree lacks the OpenSpec lifecycle skills (.pi/skills/openspec-explore, openspec-propose, and related directories), /opsx: commands are missing, openspec-apply-change stalls, or .pi/settings.json#worktreeInit needs an audit.
Procedure
- Confirm the skills are generated, not committed.
.pi/.gitignorecontainsskills/openspec-*/**; each fresh worktree must runopenspec init. - Confirm the repository declares
@fission-ai/openspecand identify its package-manager install command. The unscoped npm packageopenspecis a0.0.0stub. - Require a clean
git status --porcelain=v1, then install repository dependencies. For this repository, runpnpm install --frozen-lockfile. - Use the repository-pinned binary when it exists:
pnpm exec openspec init --tools pi --forcepnpm execuses the declared local dependency and fails when the binary is absent. In a repository that does not declare the CLI, use the version-pinned scoped package explicitly:npx @fission-ai/openspec@1.6.0 init --tools pi --force. - Verify the CLI reports setup success. Check the lifecycle skills this repository requires by name:
openspec-explore,openspec-propose,openspec-apply-change,openspec-update-change, andopenspec-archive-change. - Check
git status --short. Generatedopenspec-*skill directories should remain ignored. Review any tracked context-file rewrite before continuing.
Why the old path fails
Bare npx openspec init ... can fetch openspec@0.0.0 when node_modules/.bin/openspec is absent. The stub exits without generating lifecycle skills. Installing dependencies first and using pnpm exec openspec preserves the lockfile-selected CLI and fails visibly when setup is incomplete.
Pitfalls
- Run the dependency install first.
pnpm exec openspeccannot recover a missing local binary. - Do not hard-code the number of generated skills or commands. OpenSpec releases generate different sets; validate the required lifecycle names.
- The worktree-init gate
test ! -d .pi/skills/openspec-explorecorrectly re-triggers initialization when generated skills are absent. openspec init --forcecan rewrite trackedAGENTS.mdorCLAUDE.md. Generated skill directories are safe; tracked context changes require review.
Verification
set -euo pipefail
before_status="$(git status --porcelain=v1)"
if [ -n "$before_status" ]; then
printf '%s\n' "Refusing recovery in a dirty worktree" >&2
exit 1
fi
pnpm install --frozen-lockfile
pnpm exec openspec --version
pnpm exec openspec init --tools pi --force
for skill in openspec-explore openspec-propose openspec-apply-change openspec-update-change openspec-archive-change; do
test -d ".pi/skills/$skill" || exit 1
done
after_status="$(git status --porcelain=v1)"
test -z "$after_status"
Completion requires setup success, every named directory, and empty Git status before and after recovery.
Signals
- GitHub stars
- 283
- Forks
- 41
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
fix-worktree-opsx-skills-not-created- Source
- github.com/blackbelttechnology/pi-agent-dashboard