name: QGIT - Git Release Management description: Run quality gates (lint, typecheck, test), stage changes, generate Conventional Commit message, commit, and push to remote version: 1.0.0 agents: [release-manager] tools: [quality-gate-checker.py] references: [conventional-commits.md, quality-gates.md] claude_tools: Read, Grep, Glob, Bash trigger: QGIT
QGIT Skill
Purpose
Automated git release management with quality gate enforcement:
- Run pre-commit quality gates (lint, typecheck, test)
- Stage changes
- Generate Conventional Commit message
- Commit with co-author attribution
- Push to remote repository
Use QGIT when:
- Ready to commit and push changes
- Want to ensure quality gates pass before commit
- Need a well-formatted Conventional Commit message
Do NOT use QGIT for:
- Destructive git operations (force push, hard reset)
- Skipping quality gates (use manual git commands if necessary)
Workflow
Phase 1: Quality Gate Checks
Agent: release-manager
Actions:
- Run
npm run lint(ESLint, Prettier) - Run
npm run typecheck(TypeScript) - Run
npm run test(All tests) - Run edge function dependency checks (if applicable)
- Run custom quality gates from
.qgit.json(if configured)
Tools: Bash, quality-gate-checker.py
Blockers: Any failing gate blocks the commit
Output: Quality gate report
Phase 2: Change Analysis
Agent: release-manager
Actions:
- Run
git statusto see untracked and modified files - Run
git diffto see staged and unstaged changes - Run
git log -5to see recent commit style - Analyze changes to determine commit type (feat, fix, refactor, etc.)
Tools: Bash (git commands)
Output: Change summary
Phase 3: Commit Message Generation
Agent: release-manager
Actions:
- Determine commit type based on changes
- Extract scope from changed files (e.g., "auth", "api", "ui")
- Write concise description (<50 chars)
- Add body if needed (explain "why", not "what")
- Add footer with REQ IDs (if applicable)
- Add co-author attribution
Format: Conventional Commits (https://www.conventionalcommits.org)
Output: Commit message
Phase 4: Stage and Commit
Agent: release-manager
Actions:
- Stage relevant files (
git add <files>) - Commit with generated message
- Verify commit succeeded
Tools: Bash (git commands)
Safety: Never stage .env, credentials.json, or other secrets
Output: Commit hash
Phase 5: Push
Agent: release-manager
Actions:
- Push to remote repository (
git push) - Verify push succeeded
Tools: Bash (git commands)
Safety: Never force push to main/master unless explicitly requested
Output: Push confirmation
Input
From User:
- Basic:
QGIT - With custom message:
QGIT --message="fix(auth): resolve token expiry bug" - Skip specific gate:
QGIT --skip-lint(use sparingly) - Dry run:
QGIT --dry-run(show what would happen, don't commit)
From Environment:
- Git status and diff
- Package.json scripts (lint, typecheck, test)
.qgit.jsonconfiguration (if exists)requirements/requirements.lock.md(for REQ IDs)
Output
Quality Gate Report
Quality Gate Report
===================
✅ Lint: PASSED (0 errors, 0 warnings)
✅ Typecheck: PASSED (0 errors)
✅ Test: PASSED (42 tests, 0 failures)
✅ Edge Functions: PASSED (all dependencies @2.50.2)
All gates passed. Proceeding with commit.
Commit Message
feat(auth): add OAuth provider support
Implement Google and GitHub OAuth providers with PKCE flow.
Includes token refresh logic and session management.
REQ-42, REQ-43
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Commit and Push Confirmation
Staged files:
src/auth/oauth.ts
src/auth/providers/google.ts
src/auth/providers/github.ts
src/auth/__tests__/oauth.spec.ts
Commit: a3f8c2e feat(auth): add OAuth provider support
Push: origin/main (success)
Quality Gates
Default Gates (MUST PASS)
Lint (
npm run lint)- ESLint rules
- Prettier formatting
- No errors or warnings
Typecheck (
npm run typecheck)- TypeScript compilation
- No type errors
Test (
npm run test)- All tests pass
- No failing test suites
Edge Functions (if applicable)
- Dependency version consistency
- Function exists in
supabase/functions/ - Smoke test passes
Custom Gates
Add custom gates in .qgit.json:
{
"quality_gates": [
{
"name": "Security Scan",
"command": "npm audit --production",
"required": true
},
{
"name": "Bundle Size",
"command": "npm run build && du -sh dist",
"required": false
}
]
}
Conventional Commits Format
Based on: https://www.conventionalcommits.org
Structure
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Types
- feat: New feature
- fix: Bug fix
- refactor: Code refactoring (no behavior change)
- perf: Performance improvement
- test: Add or update tests
- docs: Documentation changes
- style: Code style changes (formatting, no logic change)
- chore: Build process, dependencies, tooling
- ci: CI/CD configuration changes
- revert: Revert previous commit
Scope
Scope is optional but recommended. Use the primary domain affected:
auth- Authentication/authorizationapi- API endpointsui- UI componentscore- Core domain logicdb- Database/migrations
Description
- Max 50 characters
- Lowercase, no period at end
- Imperative mood ("add", not "added" or "adds")
Body
- Explain "why", not "what" (code shows "what")
- Wrap at 72 characters
- Separate from description with blank line
Footer
- Reference REQ IDs:
REQ-42, REQ-43 - Breaking changes:
BREAKING CHANGE: <description> - Close issues:
Closes #123
Examples
Simple Feature:
feat(auth): add password reset flow
REQ-43
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Bug Fix with Context:
fix(api): resolve race condition in token refresh
Token refresh logic was not thread-safe, causing intermittent
401 errors under high concurrency. Added mutex lock.
REQ-45
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Breaking Change:
feat(auth): migrate from sessions to JWT tokens
BREAKING CHANGE: Session storage is no longer supported.
Existing sessions will be invalidated on upgrade.
Migration guide: See docs/migration/v2.0.0.md
REQ-46
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Configuration
Default Settings
- Quality Gates: lint, typecheck, test
- Auto-stage: Modified and new files (excludes .env, credentials.json)
- Auto-push: true
- Commit Format: Conventional Commits
- Co-author: Claude Opus 4.5
Custom Configuration
Create .qgit.json in project root:
{
"quality_gates": [
{
"name": "Lint",
"command": "npm run lint",
"required": true
},
{
"name": "Typecheck",
"command": "npm run typecheck",
"required": true
},
{
"name": "Test",
"command": "npm run test",
"required": true
}
],
"auto_stage": true,
"auto_push": true,
"commit_format": "conventional",
"exclude_patterns": [".env", "*.key", "credentials.json"],
"require_req_ids": false,
"max_description_length": 50,
"max_body_line_length": 72
}
Examples
Example 1: Simple Feature Commit
Scenario: Implemented OAuth authentication
Command:
QGIT
Actions:
- Run quality gates ✅ All pass
- Analyze changes: Added files in
src/auth/ - Generate commit message:
feat(auth): add OAuth provider support - Stage files:
src/auth/oauth.ts,src/auth/providers/*.ts,src/auth/__tests__/*.spec.ts - Commit:
a3f8c2e - Push:
origin/main
Estimated Effort: 0.05 SP (automated)
Example 2: Bug Fix with Custom Message
Scenario: Fixed token refresh bug, want custom description
Command:
QGIT --message="fix(api): resolve token refresh race condition"
Actions:
- Run quality gates ✅ All pass
- Use provided message (validate Conventional Commits format)
- Add body and footer automatically
- Stage files
- Commit
- Push
Estimated Effort: 0.05 SP (automated)
Example 3: Quality Gate Failure
Scenario: Tests are failing
Command:
QGIT
Actions:
- Run quality gates ❌ Test fails
- Display failing test output
- Block commit
- Recommend: Fix tests, then retry
Output:
Quality Gate Report
===================
✅ Lint: PASSED
✅ Typecheck: PASSED
❌ Test: FAILED (2 tests failed)
Failing tests:
- src/auth/__tests__/oauth.spec.ts:42 REQ-42 — OAuth flow
- src/auth/__tests__/oauth.spec.ts:58 REQ-43 — Token refresh
Fix failing tests before committing.
Estimated Effort: N/A (blocked)
Example 4: Dry Run
Scenario: Want to see what QGIT would do without committing
Command:
QGIT --dry-run
Actions:
- Run quality gates ✅ All pass
- Analyze changes
- Generate commit message
- Display what would be staged
- Skip commit and push
Output:
Dry Run Mode
============
Quality gates: ✅ All passed
Would stage:
src/auth/oauth.ts
src/auth/providers/google.ts
src/auth/__tests__/oauth.spec.ts
Would commit with message:
feat(auth): add OAuth provider support
REQ-42, REQ-43
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Would push to: origin/main
(No changes made - dry run only)
Estimated Effort: 0.05 SP (automated)
Integration with Other QShortcuts
With QCODE (Implementation)
# 1. Implement feature
QCODE
# 2. Verify implementation
npm run test
# 3. Commit and push
QGIT
With QDOC (Documentation)
# 1. Implement feature
QCODE
# 2. Update docs
QDOC
# 3. Commit all changes (code + docs)
QGIT
With QCHECK (Code Review)
# 1. Implement feature
QCODE
# 2. Code review
QCHECK
# 3. Fix issues from review
QCODE
# 4. Commit and push
QGIT
Safety Features
Git Safety Protocol
NEVER:
- Update git config
- Run destructive commands (force push, hard reset, clean -f, checkout .)
- Skip hooks (--no-verify, --no-gpg-sign)
- Force push to main/master
- Commit secrets (.env, credentials.json)
ALWAYS:
- Run quality gates before commit
- Generate Conventional Commit messages
- Add co-author attribution
- Verify push success
Secret Detection
QGIT automatically excludes files matching these patterns:
.env,.env.**.key,*.pem,*.p12credentials.jsonsecrets.yaml
To customize, add to .qgit.json:
{
"exclude_patterns": [".env", "*.key", "api-keys.json"]
}
Troubleshooting
Issue: Quality Gate Failing
Problem: npm run test fails
Solution: Fix failing tests
npm run test # See specific failures
# Fix issues
npm run test # Verify green
QGIT # Retry commit
Issue: Commit Message Too Long
Problem: Generated commit description >50 chars
Solution: Shorten description manually
QGIT --message="feat(auth): add OAuth support"
Issue: Want to Skip Quality Gate
Problem: Need to commit despite failing lint (edge case)
Solution: Use manual git commands (QGIT is opinionated about quality)
git add .
git commit -m "wip: work in progress"
git push
Note: Only do this for WIP branches, never main/master.
Issue: Push Rejected (Non-Fast-Forward)
Problem: Remote has changes not in local
Solution: Pull and rebase, then retry
git pull --rebase
npm run test # Verify tests still pass
QGIT # Retry push
Story Point Estimation
| Action | Effort (SP) |
|---|---|
| QGIT (all gates pass) | 0.05 |
| QGIT (gates fail, fix issues) | 0.1-0.5 (depends on fixes) |
| QGIT --dry-run | 0.05 |
Baseline: QGIT is automated and should take ~30 seconds when gates pass.
Tools
quality-gate-checker.py
Python script that runs quality gates and reports results.
Usage:
python tools/quality-gate-checker.py
Output: JSON with gate results
{
"lint": {"status": "pass", "errors": 0},
"typecheck": {"status": "pass", "errors": 0},
"test": {"status": "fail", "errors": 2, "details": "..."}
}
References
See references/ directory:
conventional-commits.md- Conventional Commits specification and examplesquality-gates.md- Quality gate configuration and troubleshooting
Best Practices
1. Commit Frequently
❌ Don't: Commit once per day with 500 lines changed ✅ Do: Commit after each logical unit of work (1-3 REQs)
2. Write Descriptive Messages
❌ Don't: fix: bug fix
✅ Do: fix(auth): resolve race condition in token refresh
3. Keep Commits Focused
❌ Don't: Mix features and bug fixes in one commit ✅ Do: Separate commits for different change types
4. Reference REQs
❌ Don't: feat: add feature
✅ Do: feat(auth): add OAuth support\n\nREQ-42, REQ-43
Contributing
For issues or enhancements to QGIT skill:
- Email: skills@sparkry.ai
- License: MIT