fix-worktree-opsx-skills-not-created
Diagnose/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.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 348
- Forks
- 56
01 前言 Front Matter
- name
- fix-worktree-opsx-skills-not-created
- created
- 2026-07-13
- updated
- 2026-08-20
- version
- 1
- description
- Diagnose/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.
03 SKILL.md 正文
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.14.3 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.
04 同仓库更多 Skills
youtube-srt
Download YouTube subtitles (SRT + timestamped TXT) for a channel, playlist or video via yt-dlp, no media download; optionally mine them into a categorized catalog (e.g. AI models by function, open weights, local runnability, hardware tier). Use on "download the srt of this video", "transcripts of channel X for the last N months", "catalog the models AI Search talked about", "update docs/models".
video-transcription
Transcribe video and audio files to SRT subtitles with speaker diarization using the Soniox (default) or AssemblyAI API. Use when the user wants to transcribe meetings, videos, or audio files. Supports MKV, MP4, MOV, M4A, MP3. Triggers on "/transcribe", "transcribe my meetings", "transcribe videos in ~/Movies", or any request to convert audio/video to text.
speaker-id
Name anonymous diarized SRT speakers from a persistent local voiceprint library and repair speaker drift; local, CPU-only, no API key. Triggers "who is speaker 2", "put names on the transcript", "label the meeting SRT", "the diarization split one person into three", "enroll my voice". Backed by the pi-voiceid CLI.
veo-showreel-production-kit
Turn a video timeline + voiceover into a reproducible, sliceable Veo 3.1 prompt package with a consistency anchor and AI storyboard sketches.
veo-generator
Render a scripted video project into mp4 clips with the Google Veo 3.1 API. Reads a project's shot package (shots/*.md), one clip per camera cut, reusing each shot's prompt and sketch — world anchor only with `--with-reference`, seed unless `--no-seed`. Use on "render the Veo video for <project>", "generate the videos from the shot scripts", "make the clips with Veo".
hyperframes-showreel
Turn real screen and site footage into a rhythmic showreel rendered with HyperFrames: sampling, edit script, redacted clips, a generated composition, Veo only as additive FX, music edit + camera punches, delivery render and export QA. Use on "make a showreel from these recordings", "build the HyperFrames video", "assemble the footage edit", "render and QA the showreel".