Professional Commit Workflow
Overview
This skill automates the complete Git commit workflow with professional quality checks and conventional commit messages. It replaces the /git-workflow:commit command with a reusable, distributable skill.
Special Features:
- Automatic project detection (Java, Python, React, Documentation)
- Pre-commit validation with project-specific tools
- Emoji Conventional Commits (feat, fix, docs, etc.)
- Intelligent staging analysis with automatic add
- Atomic commit recommendations for multiple logical changes
- Performance-optimized through modular validator architecture
Prerequisites
Required:
- Git (version 2.0+)
- Python 3.8+
Optional (for specific validations):
- Java: Maven or Gradle
- Python: ruff, black, pytest, mypy
- React/Node.js: npm/pnpm/yarn/bun, ESLint, Prettier
- Docs: LaTeX, markdownlint, AsciiDoc
# Install Python dependencies
pip install -r requirements.txt --break-system-packages
Usage Workflow
User initiates commit: "Create a commit" or "Commit the changes"
Detect options:
--no-verify: Skips pre-commit checks
--skip-tests: Skips tests only
--force-push: Force push after commit (use with caution!)
Execute project detection:
python scripts/project_detector.py
Automatically detects:
- Java (Maven: pom.xml, Gradle: build.gradle)
- Python (pyproject.toml, requirements.txt, setup.py)
- React/Node.js (package.json with react/next/vite)
- Documentation (*.tex, *.md, *.adoc)
Pre-commit validation (unless --no-verify):
python scripts/main.py --validate-only
Executes project-specific checks:
- Java: Build, Tests, Checkstyle, SpotBugs
- Python: Ruff, Black, pytest, mypy
- React: ESLint, Prettier, TypeScript, Build
- Docs: LaTeX compile, markdownlint
Staging analysis:
python scripts/git_analyzer.py --analyze-staging
- Checks
git status for staged files
- Automatically adds changes if necessary
- Displays overview of files to be committed
Diff analysis:
python scripts/git_analyzer.py --analyze-diff
- Analyzes
git diff for logical changes
- Detects multiple features/fixes in a single commit
- Recommends splitting when appropriate
Generate commit message:
python scripts/commit_message.py --generate
- Detects commit type from changes
- Generates Emoji Conventional Commit
- German, imperative description
- Format:
<emoji> <type>: <description>
Create commit:
git commit -m "$(python scripts/commit_message.py --output)"
- IMPORTANT: No "Co-Authored-By" or "Generated with" suffixes
Optional: Offer push:
git push origin <branch>
Main Script Usage
# Standard commit workflow
python scripts/main.py
# Validation only (no commit)
python scripts/main.py --validate-only
# Skip checks
python scripts/main.py --no-verify
# Skip tests
python scripts/main.py --skip-tests
# With force push
python scripts/main.py --force-push
Output Structure
Successful workflow:
Project detected: React/TypeScript
Pre-commit checks passed (3/3)
ESLint: 0 errors
TypeScript: Compilation successful
Build: Successful
Staging analysis: 5 files ready
Commit type detected: feat
Commit created: feat: Add user dashboard with metrics
On validation failures:
Pre-commit checks failed (1/3)
ESLint: 0 errors
TypeScript: 2 errors found
- src/components/Dashboard.tsx:12 - Type 'string' is not assignable to type 'number'
Build: Successful
Commit aborted. Please fix errors or use --no-verify.
Configuration
commit_types.json
Defines emoji mappings for Conventional Commits:
{
"feat": {"emoji": "✨", "description": "New functionality"},
"fix": {"emoji": "🐛", "description": "Bug fix"},
"docs": {"emoji": "📚", "description": "Documentation"}
}
validation_rules.json
Project-specific validation rules:
{
"java": {
"build": true,
"tests": true,
"checkstyle": true
},
"python": {
"ruff": true,
"black": true,
"pytest": true,
"mypy": true
}
}
Error Handling
Validation errors:
- Display detailed error message
- Offer
--no-verify option
- Refer to docs/troubleshooting.md
Git errors:
- Check Git status (untracked, conflicts)
- Refer to Git troubleshooting
- Offer manual commands
Tool not found:
- Graceful degradation (skip)
- Warn user about missing validation
- Recommend tool installation
Best Practices
Atomic commits:
- Each commit = one logical unit
- Separate features, fixes, refactorings
- No "WIP" or "misc changes" commits
Meaningful messages:
- Describe "what" and "why", not "how"
- Imperative form: "Add", not "Added"
- First line 72 characters or fewer
- No automatic signatures
Code quality:
- All checks passed before commit
- Tests pass
- Build successful
- No debug output or commented-out code
Complete guidelines: docs/best-practices.md
References
- Pre-Commit Checks: Detailed check descriptions
- Commit Types: All emoji types with examples
- Best Practices: Comprehensive Git commit best practices
- Troubleshooting: Troubleshooting for common issues
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: professional-commit-workflow3description: Creates professional git commits with automated pre-commit checks for Java, Python, React, and documentation projects. Generates emoji conventional commit messages and analyzes staging status. Produces atomic commits following best practices.4---56# Professional Commit Workflow78## Overview910This skill automates the complete Git commit workflow with professional quality checks and conventional commit messages. It replaces the `/git-workflow:commit` command with a reusable, distributable skill.1112**Special Features:**13- Automatic project detection (Java, Python, React, Documentation)14- Pre-commit validation with project-specific tools15- Emoji Conventional Commits (feat, fix, docs, etc.)16- Intelligent staging analysis with automatic add17- Atomic commit recommendations for multiple logical changes18- Performance-optimized through modular validator architecture1920## Prerequisites2122**Required:**23- Git (version 2.0+)24- Python 3.8+2526**Optional (for specific validations):**27- **Java**: Maven or Gradle28- **Python**: ruff, black, pytest, mypy29- **React/Node.js**: npm/pnpm/yarn/bun, ESLint, Prettier30- **Docs**: LaTeX, markdownlint, AsciiDoc3132```bash33# Install Python dependencies34pip install -r requirements.txt --break-system-packages35```3637## Usage Workflow38391. **User initiates commit**: "Create a commit" or "Commit the changes"40412. **Detect options**:42 - `--no-verify`: Skips pre-commit checks43 - `--skip-tests`: Skips tests only44 - `--force-push`: Force push after commit (use with caution!)45463. **Execute project detection**:47 ```bash48 python scripts/project_detector.py49 ```50 Automatically detects:51 - Java (Maven: pom.xml, Gradle: build.gradle)52 - Python (pyproject.toml, requirements.txt, setup.py)53 - React/Node.js (package.json with react/next/vite)54 - Documentation (*.tex, *.md, *.adoc)55564. **Pre-commit validation** (unless `--no-verify`):57 ```bash58 python scripts/main.py --validate-only59 ```60 Executes project-specific checks:61 - **Java**: Build, Tests, Checkstyle, SpotBugs62 - **Python**: Ruff, Black, pytest, mypy63 - **React**: ESLint, Prettier, TypeScript, Build64 - **Docs**: LaTeX compile, markdownlint65665. **Staging analysis**:67 ```bash68 python scripts/git_analyzer.py --analyze-staging69 ```70 - Checks `git status` for staged files71 - Automatically adds changes if necessary72 - Displays overview of files to be committed73746. **Diff analysis**:75 ```bash76 python scripts/git_analyzer.py --analyze-diff77 ```78 - Analyzes `git diff` for logical changes79 - Detects multiple features/fixes in a single commit80 - Recommends splitting when appropriate81827. **Generate commit message**:83 ```bash84 python scripts/commit_message.py --generate85 ```86 - Detects commit type from changes87 - Generates Emoji Conventional Commit88 - German, imperative description89 - Format: `<emoji> <type>: <description>`90918. **Create commit**:92 ```bash93 git commit -m "$(python scripts/commit_message.py --output)"94 ```95 - **IMPORTANT:** No "Co-Authored-By" or "Generated with" suffixes96979. **Optional: Offer push**:98 ```bash99 git push origin <branch>100 ```101102## Main Script Usage103104```bash105# Standard commit workflow106python scripts/main.py107108# Validation only (no commit)109python scripts/main.py --validate-only110111# Skip checks112python scripts/main.py --no-verify113114# Skip tests115python scripts/main.py --skip-tests116117# With force push118python scripts/main.py --force-push119```120121## Output Structure122123**Successful workflow:**124```text125Project detected: React/TypeScript126Pre-commit checks passed (3/3)127 ESLint: 0 errors128 TypeScript: Compilation successful129 Build: Successful130Staging analysis: 5 files ready131Commit type detected: feat132Commit created: feat: Add user dashboard with metrics133```134135**On validation failures:**136```text137Pre-commit checks failed (1/3)138 ESLint: 0 errors139 TypeScript: 2 errors found140 - src/components/Dashboard.tsx:12 - Type 'string' is not assignable to type 'number'141 Build: Successful142143Commit aborted. Please fix errors or use --no-verify.144```145146## Configuration147148### commit_types.json149150Defines emoji mappings for Conventional Commits:151152```json153{154 "feat": {"emoji": "✨", "description": "New functionality"},155 "fix": {"emoji": "🐛", "description": "Bug fix"},156 "docs": {"emoji": "📚", "description": "Documentation"}157}158```159160### validation_rules.json161162Project-specific validation rules:163164```json165{166 "java": {167 "build": true,168 "tests": true,169 "checkstyle": true170 },171 "python": {172 "ruff": true,173 "black": true,174 "pytest": true,175 "mypy": true176 }177}178```179180## Error Handling181182**Validation errors:**183- Display detailed error message184- Offer `--no-verify` option185- Refer to [docs/troubleshooting.md](docs/troubleshooting.md)186187**Git errors:**188- Check Git status (untracked, conflicts)189- Refer to Git troubleshooting190- Offer manual commands191192**Tool not found:**193- Graceful degradation (skip)194- Warn user about missing validation195- Recommend tool installation196197## Best Practices198199**Atomic commits:**200- Each commit = one logical unit201- Separate features, fixes, refactorings202- No "WIP" or "misc changes" commits203204**Meaningful messages:**205- Describe "what" and "why", not "how"206- Imperative form: "Add", not "Added"207- First line 72 characters or fewer208- No automatic signatures209210**Code quality:**211- All checks passed before commit212- Tests pass213- Build successful214- No debug output or commented-out code215216**Complete guidelines:** [docs/best-practices.md](docs/best-practices.md)217218## References219220- **[Pre-Commit Checks](docs/pre-commit-checks.md)**: Detailed check descriptions221- **[Commit Types](docs/commit-types.md)**: All emoji types with examples222- **[Best Practices](docs/best-practices.md)**: Comprehensive Git commit best practices223- **[Troubleshooting](docs/troubleshooting.md)**: Troubleshooting for common issues224225---226> Converted and distributed by [TomeVault](https://tomevault.io/claim/talent-factory) — claim your Tome and manage your conversions.227<!-- tomevault:4.0:skill_md:2026-04-13 -->