Cross-platform one-command install + hook fixes, tests, CI#1
Open
denfry wants to merge 4 commits into
Open
Conversation
fable-trigger.py read the playbook from a hardcoded /Users/ak path, so the on-demand injection silently failed for every user but the original author — resolve it under ~/.claude instead. test-after-edit.py invoked npm/pnpm/yarn/make directly, which raises FileNotFoundError for the .cmd shims on Windows and made the hook a silent no-op there; resolve the runner via shutil.which and run through cmd.exe on Windows. Also drop a duplicate .lockb entry and refresh the settings fragment comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the per-OS shell logic with a single install.py (Python is already a hard dependency, so it is the one runtime guaranteed present). install.sh and install.ps1 become thin wrappers that locate Python and exec install.py; shell/fable.ps1 adds a PowerShell launcher alongside the zsh one. merge_settings.py is now an importable helper that writes the absolute interpreter (sys.executable) and absolute hook paths into settings.json, so the hooks fire without relying on $HOME expansion or a python3 alias at hook-run time. README documents the one-command install for all three OSes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- tests/: pytest coverage for both hooks (injection, effort trigger, debounce, skip/disable) and the installer (copy, absolute paths, idempotency, both launcher branches), runnable hermetically with the host interpreter. - .github/workflows/ci.yml: matrix CI across ubuntu/macos/windows x py3.9/3.12. - uninstall.py (+ .sh/.ps1 wrappers): surgical reversal of install.py — removes bundled files, strips the launcher line, drops only the Fable hooks from settings.json; leaves user skills, unrelated hooks, and ~/.claude intact. - .gitattributes: force LF on shell/Python and CRLF on PowerShell so install.sh stays runnable on a Windows checkout (a CRLF shebang breaks Git Bash). - Unify the owner identity to HalalifyMusic in LICENSE/README; remove a dead CONNECTORS.md link in the explore-data skill; ignore .pytest_cache. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- SECURITY.md: document the local-execution model (the test-after-edit hook runs a project's test command), how to disable it, the vendored third-party content, and private vulnerability reporting. - CONTRIBUTING.md: dev setup, layout, cross-platform + stdlib-only + test rules. - CHANGELOG.md: Keep a Changelog history (Unreleased + initial 0.1.0). - .editorconfig: mirror .gitattributes (LF default, CRLF for PowerShell). - README: link the three docs. - Mark install.py / uninstall.py / uninstall.sh executable for direct ./ runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Makes fable-mode install with one command on Windows, macOS, and Linux, fixes two bugs that broke the core feature for every user, and adds the missing repo scaffolding (tests, CI, uninstaller, docs).
Motivation: install required manual steps and had no Windows support. Two show-stoppers surfaced during an audit.
What's in it (4 commits)
1. Fix hooks
fable-trigger.pyread the playbook from a hardcoded/Users/ak/...path -> on-demand injection silently failed for everyone but the original author. Now resolves~/.claude/FABLE_PLAYBOOK.md.test-after-edit.pywas a silent no-op on Windows (npm/pnpm/yarn/makeshims raiseFileNotFoundError). Now resolves the runner viashutil.whichand runs throughcmd.exeon Windows.2. Cross-platform one-command installer
install.pyis the single source of truth (Python is already required by the hooks).install.sh/install.ps1become thin wrappers that locate Python and exec it. Addsshell/fable.ps1PowerShell launcher.scripts/merge_settings.pywrites the absolute interpreter (sys.executable) + hook paths intosettings.json, so hooks fire without$HOME/python3resolution at run time.3. Repo scaffolding
tests/— pytest for both hooks + the installer (hermetic, host interpreter)..github/workflows/ci.yml— matrix CI: ubuntu/macos/windows x py3.9/3.12.uninstall.py(+.sh/.ps1) — surgical reversal; leaves user skills, unrelated hooks, and~/.claudeintact..gitattributes— LF for shell/Python, CRLF for PowerShell (a CRLF shebang breaksinstall.shunder Git Bash).CONNECTORS.mdlink.4. Community-health docs
SECURITY.md(local-execution model + private reporting),CONTRIBUTING.md,CHANGELOG.md,.editorconfig; mark entrypoints executable.Testing
python -m pytest -q-> 14 passed locally..py/.sh/.ps1parse-checked; PowerShell via the language parser.🤖 Generated with Claude Code