fix(playbook_loader): load generated playbooks from styles/custom/ - #487
Open
hubooy wants to merge 1 commit into
Open
fix(playbook_loader): load generated playbooks from styles/custom/#487hubooy wants to merge 1 commit into
hubooy wants to merge 1 commit into
Conversation
lib/playbook_generator.save_playbook() writes generated playbooks to styles/custom/, and the skills tell agents to save them there (skills/meta/capability-extension.md, the animation and explainer proposal directors). But this loader globs only the styles/ root, and it is the loader tools/video/video_compose.py imports — so every generated playbook was invisible at render time. The only way to make one work was to hand-copy it up one directory, which is why custom playbooks end up duplicated in both places. Search styles/custom/ as a fallback in load_playbook() and merge it into list_playbooks(), matching the semantics lib/playbook_generator.py already uses: a preset wins when both exist, and the listing is deduped. The not-found error now names both directories it searched instead of just the last path it tried. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GYThSL15CujvBwD1wuUmr9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generated playbooks are invisible at render time.
lib/playbook_generator.save_playbook()writes them tostyles/custom/(:219-220), and the skills instruct agents to save them there —skills/meta/capability-extension.md:62, plus the animation and explainer proposal directors. Butstyles/playbook_loader.pyglobs only thestyles/root, and it is the loadertools/video/video_compose.pyimports (:1234,:1728). So a playbook created through the documented path can never be loaded by the tool that needs it.The two modules also disagree with each other:
playbook_generatorhas its ownload_playbook/list_playbooksthat do searchcustom/, but nothing in the Python codebase imports that module — only the three skill docs point at it.The practical result is that every custom playbook has to be hand-copied up one directory, leaving duplicated pairs in
styles/andstyles/custom/.Related issue
None — filing the fix directly.
Changes
load_playbook()falls back to<styles_dir>/custom/when the name is not found in the root.list_playbooks()merges both directories and dedupes.lib/playbook_generator.py:32-49already implements: a preset wins when both exist.styles_diroverride parameter still works — the custom subdirectory is resolved relative to it, not hardcoded.FileNotFoundErrornow names both directories searched, instead of only the last path tried.Testing
python -m pytest tests/contracts/ -q— 630 passed, 7 skipped (includes the 14 playbook cases intest_phase3_contracts.pyandtest_taste_governance_contracts.py).python tests/qa/test_07_playbook_intelligence.py— 56 passed, 0 failed.styles_diroverride: a playbook present only incustom/now loads; with the same name in both places the root preset wins;list_playbooks()dedupes the overlap; and a missing name reports both directories searched.Checklist
make test-contracts/make test) where applicable.capability-extension.md:62and the proposal directors) true.🤖 Generated with Claude Code
https://claude.ai/code/session_01GYThSL15CujvBwD1wuUmr9