From c6852891ddd69e206af547b2bad1db20c18daf46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=B0=BD=28piknow=29?= Date: Sat, 11 Oct 2025 19:39:32 +0900 Subject: [PATCH] feat: add make-commit command and update commit conventions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Requirement: Provide a standardized slash command for creating well-structured commits following the project's conventions. Update commit type documentation to include the complete set of conventions (feat, fix, doc, config, refactor, format, test, perf) with clear guidance on using Requirement vs Goal in commit messages. Implementation: - Created make-commit.md slash command with comprehensive commit workflow - Added all 8 commit type conventions (feat, fix, doc, config, refactor, format, test, perf) - Defined Requirement vs Goal usage: Requirement as default, Goal for proactive improvements - Added format type for code formatting changes (replacement for style) - Updated make-branch.md to include format type - Structured command to analyze changes, group by purpose, and propose commits - Included commit message template with Requirement/Goal and Implementation sections 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .claude/commands/make-branch.md | 1 + .claude/commands/make-commit.md | 64 +++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .claude/commands/make-commit.md 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