diff --git a/.claude/commands/make-branch.md b/.claude/commands/make-branch.md index 89fe6d6..f84aa3c 100644 --- a/.claude/commands/make-branch.md +++ b/.claude/commands/make-branch.md @@ -22,6 +22,7 @@ i{issue-index}-{type}/{action-description_with_underscores} - `doc` - Documentation changes - `config` - Configuration updates - `refactor` - Code refactoring +- `format` - Code formatting changes (whitespace, indentation, semicolons, etc.) - `test` - Test additions or improvements - `perf` - Performance improvements diff --git a/.claude/commands/make-commit.md b/.claude/commands/make-commit.md new file mode 100644 index 0000000..94aa30c --- /dev/null +++ b/.claude/commands/make-commit.md @@ -0,0 +1,64 @@ +--- +description: "Analyze changes and create meaningful commits with requirement and implementation details" +allowed-tools: + - Bash +--- + +# Smart Commit Command + +Analyze git changes (staged and unstaged) and create well-structured commits. + +## Instructions + +1. **Analyze all changes**: + - Check both staged (`git diff --cached`) and unstaged (`git diff`) changes + - Get the list of modified files (`git status`) + +2. **Group files by intent and purpose**: + - Identify distinct concerns that should be separate commits + - Group files that share the same purpose/intent + - Consider: feature additions, config changes, refactoring, bug fixes, tests + +3. **For each commit group, determine**: + - **Type prefix** (choose one): + * `feat`: New features, updates, output-changing code + * `fix`: Bug fixes, correcting mistakes + * `doc`: Documentation changes + * `config`: prettier, eslint, ci/cd, dependency installs/bumps, docker, vscode settings + * `refactor`: Lint fixes, prettier fixes, output-unchanged code improvements + * `format`: Code formatting changes (whitespace, indentation, semicolons, etc.) + * `test`: Test additions or improvements, storybook, .test file additions + * `perf`: Performance improvements + + - **Requirement (or Goal)**: Why this change is needed (1-2 sentences) + * Default: Use `Requirement:` for most commits + * Exception: Use `Goal:` only when describing proactive improvements without specific requirements (e.g., voluntary refactoring, performance optimization) + - **Implementation**: What was changed and how (concise bullet points) + +4. **Format each commit message** as: + ``` + : + + Requirement: (or Goal: if applicable) + + + Implementation: + + ``` + +5. **Present proposed commits**: + - Show each commit group with: + * Files included + * Proposed commit message + - Ask for user confirmation before executing + +6. **Execute approved commits**: + - Stage the appropriate files for each commit + - Create the commit with the approved message + - Show confirmation after each commit + +## Key Requirements +- Each commit must be independently meaningful for PR creation later +- Keep commit messages concise but informative +- No unnecessary details - focus on requirement and implementation only +- Ensure logical separation of concerns \ No newline at end of file