Coding task · Vibe coding with Claude Code course · Module 15: Advanced Claude Code
Practice: Smart commit generator
Capture Claude's answer in a variable: MESSAGE=$(... | claude -p "..."). Commit only when the sailor answers y: the automation proposes, the sailor decides. Lines starting with # are comments.
Task
In commands.sh write the smart-commit.sh script: take the staged diff (git diff --cached), ask claude -p for a message in Conventional Commits format, show it, ask for approval (read) and run git commit -m.