Validate Git Hygiene
Validates git repository hygiene including commit messages, branch names, and best practices.
Usage
This skill validates git practices and returns structured results.
Checks Performed
Commit Message Format
- Conventional Commits format:
type(scope): description
- Valid types: feat, fix, docs, style, refactor, test, chore
- Character limits (72 chars for title)
Branch Naming
- Pattern validation (feat/, fix/, chore/*, etc.)
- No invalid characters
- Descriptive naming
Repository Hygiene
- No uncommitted changes in working directory
- No untracked sensitive files (.env, credentials)
- Branch up to date with remote
Output Format
Success (All Checks Pass)
{
"status": "success",
"git": {
"commits": {
"valid": 5,
"invalid": 0,
"issues": []
},
"branch": {
"name": "feat/add-character-system",
"valid": true,
"pattern": "feat/*"
},
"hygiene": {
"workingDirectory": "clean",
"untrackedSensitive": []
}
},
"canProceed": true
}
Issues Found
{
"status": "warning",
"git": {
"commits": {
"valid": 3,
"invalid": 2,
"issues": [
{
"commit": "abc123",
"message": "fixed bug",
"problem": "Missing type prefix (feat/fix/etc)"
}
]
},
"branch": {
"name": "my-feature",
"valid": false,
"pattern": null,
"problem": "Should follow pattern: feat/fix/chore/etc"
},
"hygiene": {
"workingDirectory": "dirty",
"untrackedSensitive": [".env.local"]
}
},
"canProceed": false,
"details": "2 commit message issues and 1 sensitive file found"
}
When to Use
- Pre-commit validation
- Branch creation workflows
- Conductor Phase 2/4 (Implementation/PR creation)
- Git workflow enforcement
- Code review preparation
Requirements
- Git repository initialized
- Git command-line tools available
- Commits exist on current branch (for commit validation)
1---2name: validate-git-hygiene-23description: Validate git commit messages, branch naming conventions, and repository hygiene. Returns structured output with validation results for commit format (conventional commits), branch naming, and best practices. Used for quality gates and git workflow validation.4---5
6# Validate Git Hygiene
7
8Validates git repository hygiene including commit messages, branch names, and best practices.
9
10## Usage
11
12This skill validates git practices and returns structured results.
13
14## Checks Performed
15
161. **Commit Message Format**
17 - Conventional Commits format: `type(scope): description`
18 - Valid types: feat, fix, docs, style, refactor, test, chore
19 - Character limits (72 chars for title)
20
212. **Branch Naming**
22 - Pattern validation (feat/*, fix/*, chore/*, etc.)
23 - No invalid characters
24 - Descriptive naming
25
263. **Repository Hygiene**
27 - No uncommitted changes in working directory
28 - No untracked sensitive files (.env, credentials)
29 - Branch up to date with remote
30
31## Output Format
32
33### Success (All Checks Pass)
34
35```json
36{
37 "status": "success",
38 "git": {
39 "commits": {
40 "valid": 5,
41 "invalid": 0,
42 "issues": []
43 },
44 "branch": {
45 "name": "feat/add-character-system",
46 "valid": true,
47 "pattern": "feat/*"
48 },
49 "hygiene": {
50 "workingDirectory": "clean",
51 "untrackedSensitive": []
52 }
53 },
54 "canProceed": true
55}
56```
57
58### Issues Found
59
60```json
61{
62 "status": "warning",
63 "git": {
64 "commits": {
65 "valid": 3,
66 "invalid": 2,
67 "issues": [
68 {
69 "commit": "abc123",
70 "message": "fixed bug",
71 "problem": "Missing type prefix (feat/fix/etc)"
72 }
73 ]
74 },
75 "branch": {
76 "name": "my-feature",
77 "valid": false,
78 "pattern": null,
79 "problem": "Should follow pattern: feat/fix/chore/etc"
80 },
81 "hygiene": {
82 "workingDirectory": "dirty",
83 "untrackedSensitive": [".env.local"]
84 }
85 },
86 "canProceed": false,
87 "details": "2 commit message issues and 1 sensitive file found"
88}
89```
90
91## When to Use
92
93- Pre-commit validation
94- Branch creation workflows
95- Conductor Phase 2/4 (Implementation/PR creation)
96- Git workflow enforcement
97- Code review preparation
98
99## Requirements
100
101- Git repository initialized
102- Git command-line tools available
103- Commits exist on current branch (for commit validation)