$npx -y skills add decebals/claude-code-java --skill git-commitGenerate conventional commit messages for Java projects. Use when user says "commit", "create commit", "commit changes", or after completing code changes that need to be committed.
| 1 | # Git Commit Message Skill |
| 2 | |
| 3 | Generate conventional, informative commit messages for Java projects. |
| 4 | |
| 5 | ## When to Use |
| 6 | - After making code changes |
| 7 | - User says "commit this" / "commit changes" / "create commit" |
| 8 | - Before creating PRs |
| 9 | |
| 10 | ## Format Standard |
| 11 | |
| 12 | Use Conventional Commits format: |
| 13 | ``` |
| 14 | <type>(<scope>): <subject> |
| 15 | |
| 16 | <body> |
| 17 | |
| 18 | <footer> |
| 19 | ``` |
| 20 | |
| 21 | ### Types (Java context) |
| 22 | - **feat**: New feature (new API, new functionality) |
| 23 | - **fix**: Bug fix |
| 24 | - **refactor**: Code refactoring (no functional change) |
| 25 | - **test**: Add/update tests |
| 26 | - **docs**: Documentation only |
| 27 | - **perf**: Performance improvement |
| 28 | - **build**: Maven/Gradle changes |
| 29 | - **chore**: Maintenance (dependency updates, etc) |
| 30 | |
| 31 | ### Scope Examples (Java specific) |
| 32 | - Module name: `core`, `api`, `plugin-loader` |
| 33 | - Component: `PluginManager`, `ExtensionFactory` |
| 34 | - Area: `lifecycle`, `dependencies`, `security` |
| 35 | |
| 36 | ### Subject Rules |
| 37 | - Imperative mood: "Add support" not "Added support" |
| 38 | - No period at end |
| 39 | - Max 50 chars |
| 40 | - Lowercase after type |
| 41 | |
| 42 | ### Body (optional but recommended) |
| 43 | - Explain WHAT and WHY, not HOW |
| 44 | - Wrap at 72 chars |
| 45 | - Reference issues: "Fixes #123" / "Relates to #456" |
| 46 | |
| 47 | ## Examples |
| 48 | |
| 49 | ### Simple fix |
| 50 | ``` |
| 51 | fix(plugin-loader): prevent NPE when plugin directory is missing |
| 52 | |
| 53 | Check for null before accessing plugin directory to avoid |
| 54 | NullPointerException during initialization. |
| 55 | |
| 56 | Fixes #234 |
| 57 | ``` |
| 58 | |
| 59 | ### Feature with breaking change |
| 60 | ``` |
| 61 | feat(api): add support for plugin dependencies versioning |
| 62 | |
| 63 | BREAKING CHANGE: PluginDescriptor now requires semantic versioning |
| 64 | format (x.y.z) instead of free-form version strings. |
| 65 | |
| 66 | Closes #567 |
| 67 | ``` |
| 68 | |
| 69 | ### Refactoring |
| 70 | ``` |
| 71 | refactor(core): extract plugin validation logic |
| 72 | |
| 73 | Move validation logic from PluginManager to separate |
| 74 | PluginValidator class for better testability and separation |
| 75 | of concerns. |
| 76 | ``` |
| 77 | |
| 78 | ### Test addition |
| 79 | ``` |
| 80 | test(plugin-loader): add integration tests for plugin loading |
| 81 | |
| 82 | Add comprehensive integration tests covering: |
| 83 | - Loading from directory |
| 84 | - Loading from JAR |
| 85 | - Error handling for invalid plugins |
| 86 | ``` |
| 87 | |
| 88 | ### Build/dependency update |
| 89 | ``` |
| 90 | build(deps): upgrade Spring Boot to 3.2.1 |
| 91 | |
| 92 | Update Spring Boot from 3.1.0 to 3.2.1 for security patches |
| 93 | and performance improvements. |
| 94 | ``` |
| 95 | |
| 96 | ## Workflow |
| 97 | |
| 98 | 1. **Analyze changes** using `git diff --staged` |
| 99 | 2. **Identify scope** from modified files |
| 100 | 3. **Determine type** based on change nature |
| 101 | 4. **Generate message** following format |
| 102 | 5. **Execute commit**: `git commit -m "message"` |
| 103 | |
| 104 | ## Token Optimization |
| 105 | |
| 106 | - Read staged changes ONCE: `git diff --staged --stat` + targeted file diffs |
| 107 | - Don't read entire files unless necessary |
| 108 | - Use concise body - aim for 2-3 lines max |
| 109 | - Batch multiple small changes into logical commits |
| 110 | |
| 111 | ## Anti-patterns |
| 112 | |
| 113 | ❌ Avoid: |
| 114 | - "fix stuff" / "update code" / "changes" |
| 115 | - "WIP" commits (unless explicitly requested) |
| 116 | - Mixing unrelated changes (use separate commits) |
| 117 | - Over-detailed technical implementation in message |
| 118 | |
| 119 | ✅ Good commits: |
| 120 | - Single logical change |
| 121 | - Clear, searchable subject |
| 122 | - References issues when applicable |
| 123 | - Explains business value |
| 124 | |
| 125 | ## Integration with GitHub |
| 126 | |
| 127 | After commit, suggest next steps: |
| 128 | - "Push changes?" |
| 129 | - "Create PR for issue #X?" |
| 130 | - "Continue with next task?" |
| 131 | |
| 132 | ## Common Patterns for Java Projects |
| 133 | |
| 134 | ### Adding new functionality |
| 135 | ``` |
| 136 | feat(extension): add support for prioritized extensions |
| 137 | |
| 138 | Allow extensions to specify priority order for execution. |
| 139 | Extensions with higher priority run first. |
| 140 | |
| 141 | Closes #123 |
| 142 | ``` |
| 143 | |
| 144 | ### Fixing bugs |
| 145 | ``` |
| 146 | fix(classloader): resolve resource lookup in nested JARs |
| 147 | |
| 148 | ClassLoader.getResource() was failing for resources in |
| 149 | JARs loaded from plugin JARs (nested JARs). Fixed by |
| 150 | implementing proper resource resolution chain. |
| 151 | |
| 152 | Fixes #456 |
| 153 | ``` |
| 154 | |
| 155 | ### Dependency updates |
| 156 | ``` |
| 157 | build(deps): bump slf4j from 1.7.30 to 2.0.9 |
| 158 | |
| 159 | Updates SLF4J to latest stable version. No API changes |
| 160 | required as we use only stable APIs. |
| 161 | ``` |
| 162 | |
| 163 | ### Documentation improvements |
| 164 | ``` |
| 165 | docs(readme): add plugin development quickstart guide |
| 166 | |
| 167 | Add step-by-step guide for creating first plugin: |
| 168 | - Project setup |
| 169 | - Implementing Plugin interface |
| 170 | - Building and testing |
| 171 | ``` |
| 172 | |
| 173 | ### Performance optimizations |
| 174 | ``` |
| 175 | perf(plugin-loader): cache plugin descriptors |
| 176 | |
| 177 | Cache parsed plugin descriptors to avoid repeated I/O |
| 178 | and parsing. Reduces plugin loading time by ~40%. |
| 179 | |
| 180 | Related to #789 |
| 181 | ``` |
| 182 | |
| 183 | ## Multi-file Changes |
| 184 | |
| 185 | When changes span multiple components: |
| 186 | |
| 187 | ``` |
| 188 | refactor(core): reorganize plugin lifecycle management |
| 189 | |
| 190 | - Extract lifecycle state machine to separate class |
| 191 | - Move validation logic to validators package |
| 192 | - Update tests to reflect new structure |
| 193 | |
| 194 | This refactoring improves testability and separation |
| 195 | of concerns without changing external APIs. |
| 196 | |
| 197 | Related to #111, #222 |
| 198 | ``` |
| 199 | |
| 200 | ## Breaking Changes |
| 201 | |
| 202 | Always use BREAKING CHANGE footer: |
| 203 | |
| 204 | ``` |
| 205 | feat(api)!: replace Plugin.start() with Plugin.initialize() |
| 206 | |
| 207 | BREAKING CHANGE: The Plugin.start() method has been renam |