🤖 AI Summary
Claude Code’s Slash Commands let you encode your git workflow as reusable commands so the AI performs repetitive tasks for you. The author replaced manual branch names, commit messages and PR descriptions with commands like /commit, /branch "add dark mode", and /pr that auto-generate conventional commits, create feature branches, and assemble full PR descriptions. Commands are Markdown files stored in .claude/commands/ (project) or ~/.claude/commands/ (personal); the filename becomes the slash command. Prereqs: Git and the GitHub CLI (gh + gh auth login) so commands that touch GitHub (e.g., /pr, /fix-pipeline) can run.
Key technical details: command frontmatter controls description, allowed-tools (which Bash commands the command may run), model (sonnet for heavier reasoning, haiku for fast/cheap responses), and argument-hint. Commands can execute Bash inline with !git diff or !git status; Claude captures and injects the command output into the prompt, giving real-time context for smarter responses. Arguments use $ARGUMENTS or $1/$2; file contents can be referenced with @path. The author’s workflow chains /branch, /lint, /vitest, /commit, /push, /fix-pipeline, /pr, /review-coderabbit, /merge-to-main and can be run non-interactively with claude -p and shell aliases. Implications: this makes developer workflows reproducible and deterministic, reduces cognitive overhead, and demonstrates how sandboxed shell execution plus model selection enables practical, automated developer tooling — with security and tool-permission considerations.
Loading comments...
login to comment
loading comments...
no comments yet