Git Commit Helper
Overview
This skill streamlines the git commit process by automating common pre-commit tasks, handling commit message generation, and providing clear instructions for subsequent git push and deployment monitoring. It aims to improve developer workflow efficiency and adherence to project standards.
Workflow
The git-commit-helper executes the following steps:
-
Identify and Fix Pre-commit Issues:
- Scans staged Python files for
print()statements and automatically replaces them withloggingcalls (logger.info,logger.error, etc.). - Ensures
import loggingandlogger = logging.getLogger(__name__)are present in affected files. - Note: This step specifically addresses the "no
print()statements" pre-commit hook often found in Python projects.
- Scans staged Python files for
-
Stage All Relevant Changes:
- Stages all modified tracked files (
git add -u). - Selectively stages untracked files that appear to be legitimate project components (e.g., Python scripts, documentation, new source files), while ignoring temporary or tool-specific files.
- Stages all modified tracked files (
-
Generate Commit Message:
- Creates a comprehensive commit message following Conventional Commits specification, summarizing the changes made during the session (e.g., fixes for pre-commit issues, new files, consolidated modifications).
-
Execute Commit:
- Performs the
git commitoperation. If pre-commit hooks are still failing despite automated fixes (due to false positives or misconfiguration), it may suggest bypassing them (--no-verify) as a last resort, with appropriate warnings.
- Performs the
-
Provide Deployment Instructions & Monitor (Enhanced Autonomy):
- After a successful commit, it will provide the necessary
git pushcommand. - Upon confirmation of
git push(or explicit user request), the skill will attempt to automatically monitor deployments. - It will check for installed Vercel and Fly.io CLIs.
- If found, it will stream real-time deployment logs from Vercel (for frontend
apps/mouth) and Fly.io (for backendapps/backend-rag) directly into the chat, providing autonomous monitoring. - Offers clear guidance on how to manually monitor deployments if automated monitoring is not possible.
- After a successful commit, it will provide the necessary
Resources
This skill will primarily utilize scripts/ for automated fixes and potentially references/ for commit message templates or deployment checklists.
scripts/
Executable Python scripts will be used to automate the detection and replacement of print() statements with logger calls, similar to the process just completed. New scripts will also be added for automated deployment monitoring (e.g., monitor_vercel.py, monitor_flyio.py).
references/
Might include templates for generating standardized commit messages or detailed deployment checklists specific to this project's environments (Vercel, Fly.io).
