setup-toolchain
Setup Toolchain Enforcement
What This Sets Up
- PreToolUse hooks blocking banned CLI commands with actionable suggestions
- Destructive command guards preventing
rm -rf(except safe targets like node_modules/.next/dist/build),git push --force,git reset --hard, andgit checkout ./git restore . - SessionStart hook setting environment variables for LLM-friendly defaults
- All hooks written to
.claude/settings.json(project-level, committed to git)
Steps
1. Create hook scripts
Copy scripts/enforce-toolchain.sh and scripts/session-env.sh into .claude/hooks/. Make both executable: chmod +x .claude/hooks/*.sh
2. Configure hooks in .claude/settings.json
Add to hooks config (merge with existing):
- PreToolUse (matcher:
Bash):.claude/hooks/enforce-toolchain.sh - SessionStart:
.claude/hooks/session-env.sh
3. Verify
-
.claude/hooks/enforce-toolchain.shexists and is executable -
.claude/hooks/session-env.shexists and is executable -
.claude/settings.jsoncontains both hook entries - Test: run
npm installin Claude — should be blocked - Test: run
bun add lodashin Claude — should be blocked (missing --yarn)
4. Commit
Stage .claude/hooks/ and .claude/settings.json. Commit with: Add toolchain enforcement hooks (bun + tsgo)
More from malinskibeniamin/skills
setup-react-rules
Enforce React/TS/security rules via PostToolUse hooks — bans raw HTML, TS escape hatches, XSS vectors, barrel imports, missing passive listeners. Use when enforcing React patterns or component library standards.
9setup-react-compiler
Install React Compiler with rsbuild and enforce compiler-friendly patterns via PostToolUse hooks. Flags manual memoization, derived state, useRef cache. Use when setting up React Compiler or post-compiler patterns.
9setup-biome
Install Biome linter with Ultracite preset, create biome.jsonc config, and configure Claude Code Stop hook for auto-fix before finishing. Use when setting up linting, formatting, Biome, Ultracite, or code quality enforcement.
9setup-quality-gate
Add quality:gate package.json script for fast local/CI quality checks (biome + tsgo + related tests), GitHub Actions workflow, and Stop hook for type checking. Use when setting up quality gates, CI pipelines, or pre-push validation.
9setup-connect-query
Enforce ConnectRPC + Connect Query + Protobuf v2 patterns via PostToolUse hooks. Bans raw useQuery, empty invalidateQueries, $typeName literals. Use when setting up ConnectRPC, protobuf type safety, or data fetching enforcement.
8work-automation-kit
Install planning and project management skills — PRD creation, implementation planning, issue breakdown, bug triage, code review. Use when setting up project planning workflows or creating PRDs.
8