PM-Friendly Hooks: Your Technical Autopilot
The Big Picture
These hooks handle all the boring technical stuff automatically, so you can focus on what you want built, not how to build it.
π Auto Git Workflow
What it does: Creates feature branches automatically when you start building something new
When you say: "Add a login button" What happens:
- β Detects this is a new feature
- πΏ Creates branch:
feature/add-login-button - π‘ Tells you: "Working on a feature branch, will PR when done"
Why you care: No more working on main branch. Everything stays organized. Easy to review changes before going live.
π¦ Auto Commit
What it does: Saves progress automatically at smart milestones
What happens:
- After ~5 files change β Claude stages and commits with a clear message
- Example: "feat: Add user authentication flow with email validation"
Why you care:
- Can roll back to any point if something breaks
- Clear history of what was built when
- No more "save my work" stress
π Auto Documentation
What it does: Creates plain-English docs explaining what was built
What happens:
Claude builds: LoginButton.tsx
Hook triggers: "New component detected"
Claude writes: "Login Button - Handles user authentication.
Displays loading state. Shows errors clearly."
Why you care:
- Understand what exists without reading code
- Onboard new team members faster
- Remember what things do months later
βΏ Accessibility Check
What it does: Makes sure everything works for everyone (screen readers, keyboards, etc.)
Checks for:
- β Buttons have descriptive labels
- β Images have alt text
- β Forms are keyboard-navigable
- β Color contrast is readable
Why you care:
- Reach more users (20% of people have disabilities)
- Avoid lawsuits (ADA compliance)
- Better SEO (Google loves accessible sites)
β‘ Performance Alert
What it does: Warns about slow code patterns
Catches:
- π Inline functions causing re-renders
- π Large lists without pagination
- π Missing optimization opportunities
Why you care:
- Faster app = happier users
- Better mobile experience
- Lower bounce rates
π Deployment Check
What it does: Verifies everything works before going live
Before creating PR, checks:
- β Production build succeeds
- β Environment variables configured
- β Vercel/deployment ready
Why you care:
- Catch deployment issues before users do
- No "works on my machine" surprises
- Confident deploys every time
π Progress Report
What it does: Shows real-time updates as Claude works
Shows you:
π Progress Update:
- Files modified: 7
- Latest: components/LoginForm.tsx
- Tests: β
Passing
Why you care:
- Know work is actually happening
- See what's being changed
- Track complexity of the feature
π― How These Work Together
Example: "Add user profiles with avatars"
1. You ask β Hook creates feature branch
2. Claude codes β Progress reports show updates
3. Files saved β Auto-commit at milestones
4. UI built β Accessibility check ensures usability
5. Component done β Auto-docs explain what it does
6. Ready to ship β Deployment check verifies build
7. PR created β You review plain-English summary
ποΈ Customization Guide
Making Hooks More/Less Strict
More alerts (perfectionist mode):
# Edit ~/.claude/hooks/accessibility-check.sh
# Change: exit 0 β exit 1
# Now accessibility issues block progress
Fewer interruptions (speed mode):
# Edit ~/.claude/hooks/performance-alert.sh
# Comment out checks you don't care about
Adjusting Auto-Commit Frequency
# Edit ~/.claude/hooks/auto-commit.sh
# Line: if [ "$CHANGES" -ge 5 ]; then
# More frequent: Change 5 β 3
# Less frequent: Change 5 β 10
Custom Checks for Your Stack
Example: Add Tailwind class checking
# Create ~/.claude/hooks/tailwind-check.sh
if grep -q "className=" "$FILE_PATH"; then
if grep -qE "(style=|css=)" "$FILE_PATH"; then
echo "β οΈ Mix of Tailwind + inline styles detected"
fi
fi
π§ Troubleshooting
"Hooks seem slow"
# Check which hook is taking time
time ~/.claude/hooks/verify-after-write.sh path/to/file.tsx
"Too many alerts"
# Temporarily disable specific hooks
mv ~/.claude/hooks/performance-alert.sh ~/.claude/hooks/performance-alert.sh.disabled
"Hook failed but not sure why"
# Run hook manually to see full output
~/.claude/hooks/accessibility-check.sh components/Button.tsx
π‘ Pro Tips
1. Reading Hook Feedback
- β = Passed check, all good
- β οΈ = Suggestion, not blocking
- β = Failed, Claude will fix
- π‘ = Helpful tip
2. When to Disable Hooks
- Quick experiments: Disable auto-commit
- Prototyping: Disable accessibility checks
- Emergency fixes: Disable deployment checks
- Never disable: Verification hooks (ensure code works)
3. Best Workflow
- Start feature: Let auto-branch work
- During build: Monitor progress reports
- Before review: Check auto-docs were created
- Before merge: Verify deployment check passed
π¬ Real Example
You: "Build a comment system with replies"
Behind the scenes:
πΏ Auto-branch: feature/build-comment-system-with-replies
π Progress: Creating Comment.tsx (1/5 files)
βΏ Accessibility: Adding keyboard navigation
π¦ Auto-commit: "feat: Add comment component structure"
π Progress: Creating Reply.tsx (2/5 files)
β‘ Performance: Optimizing render with React.memo
π¦ Auto-commit: "feat: Add reply threading logic"
π Auto-docs: Creating component documentation
β
All checks passed!
π Ready for PR
What you see: "Comment system complete! β Keyboard accessible, optimized performance, documented. Ready to review PR."
π Next Level Hooks (Future Ideas)
- Auto Testing: Generate test cases from your description
- Cost Estimation: Warn about expensive API calls
- SEO Check: Verify meta tags and structure
- Mobile Preview: Auto-screenshot on device sizes
- Changelog: Auto-update release notes
Want any of these? Just ask! π