java/src/main/resources/targets/claude/skills/core/git/x-git-push/SKILL.md
Git operations: branch creation, atomic commits (Conventional Commits), push, and PR creation. Use for any git workflow task including branching, committing, pushing, creating PRs, or managing version control.
npx skillsauth add edercnj/ia-dev-environment x-git-pushInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Standardizes the Git workflow for {{PROJECT_NAME}}. Every feature starts with a branch and ends with a clean commit history following Conventional Commits.
/x-git-push — commit and push current changes/x-git-push branch-name — create branch, commit, and push/x-git-push "commit message" — commit with message and push1. BRANCH -> Create or verify feature branch
2. COMMIT -> Stage and commit with Conventional Commits format
3. PUSH -> Push to remote with tracking
4. PR -> Create pull request (if applicable)
main (production, tagged releases only)
+-- hotfix/short-description
develop (integration, always green)
+-- feat/story-XXXX-YYYY-short-description (parent/story branch)
| +-- feat/task-XXXX-YYYY-NNN-short-desc (task branch)
+-- release/vX.Y.Z
Pattern: feat/task-XXXX-YYYY-NNN-short-desc
| Component | Format | Example |
|-----------|--------|---------|
| XXXX | 4-digit epic ID | 0029 |
| YYYY | 4-digit story ID | 0015 |
| NNN | 3-digit task sequence (001-999) | 001 |
| short-desc | lowercase-hyphenated description | implement-phase2 |
Rules:
[a-z0-9/-] (lowercase, digits, hyphens, forward slashes)feat/ (or fix/, refactor/ as appropriate)Examples:
feat/task-0029-0015-001-implement-phase2 (41 chars)fix/task-0029-0015-002-null-check-guard (40 chars)Pattern: feat/story-XXXX-YYYY-short-desc
Rules:
develop; task branches are created from this parent--auto-approve-pr is active in x-story-implementExample: feat/story-0029-0015-lifecycle (30 chars)
Pattern: feat/story-XXXX-YYYY-short-kebab-description
Rules:
feat/ (or fix/, refactor/ as appropriate)| Rule | Validation | Error |
|------|------------|-------|
| Epic ID (XXXX) | 4 numeric digits | "Invalid epic ID: must be 4 digits" |
| Story ID (YYYY) | 4 numeric digits | "Invalid story ID: must be 4 digits" |
| Task seq (NNN) | 3 numeric digits (001-999) | "Invalid task sequence: must be 3 digits" |
| Description | lowercase, hyphens only | "Invalid description: use lowercase-hyphenated" |
| Task branch length | <= 60 chars total | "Branch name exceeds 60 chars: truncating description" |
| Characters | [a-z0-9/-] only | "Invalid characters in branch name" |
Task branch (from parent or develop):
git checkout feat/story-XXXX-YYYY-description # or develop
git pull
git checkout -b feat/task-XXXX-YYYY-NNN-short-desc
Story/parent branch (from develop):
git checkout develop
git pull origin develop
git checkout -b feat/story-XXXX-YYYY-description
<type>(<scope>): <subject>
<optional body>
<optional footer>
| Type | When to use |
|------|-------------|
| feat | New feature |
| test | Adding or modifying tests only |
| fix | Bug fix |
| refactor | Restructuring without behavior change |
| docs | Documentation changes |
| build | Build system changes |
| chore | Maintenance tasks |
| infra | Infrastructure and deployment changes |
Task-centric scope (preferred for task branches):
Use TASK-XXXX-YYYY-NNN as the scope when working on a task branch:
feat(TASK-0029-0015-001): implement task execution loop [TDD:GREEN]
Module-based scope (for non-task work):
Use the module, package, or component name as scope. Define project-specific scopes based on the architecture (e.g., domain, rest, persistence, config).
git checkout develop
git pull origin develop
git checkout -b feat/story-XXXX-YYYY-description
git status
Make frequent, atomic commits:
git add src/main/path/to/Feature.{{LANGUAGE}}
git add src/test/path/to/FeatureTest.{{LANGUAGE}}
git commit -m "feat(TASK-XXXX-YYYY-NNN): add feature description [TDD]"
For non-task branches, use module-based scopes:
git commit -m "feat(scope): add feature description"
# 1. Run full build
{{BUILD_COMMAND}}
# 2. Review changes
git log --oneline develop..HEAD
git diff develop...HEAD --stat
# 3. Push
git push -u origin feat/story-XXXX-YYYY-description
Hotfixes branch from main and merge back to both main and develop.
git checkout main
git pull origin main
git checkout -b hotfix/short-description
git add src/main/path/to/Fix.{{LANGUAGE}}
git add src/test/path/to/FixTest.{{LANGUAGE}}
git commit -m "fix(scope): description of critical fix"
git push -u origin hotfix/short-description
gh pr create \
--base main \
--title "fix(scope): description of critical fix" \
--body "$(cat <<'EOF'
## Summary
<Description of the critical fix>
## Test plan
- [ ] Build passes (`{{BUILD_COMMAND}}`)
- [ ] Fix verified in production-like environment
EOF
)"
After the hotfix is merged to main, propagate the fix to develop:
git checkout main
git pull origin main
gh pr create \
--base develop \
--title "chore: back-merge hotfix to develop" \
--body "Propagates hotfix from main to develop."
When creating a PR for a task branch:
gh pr create \
--base feat/story-XXXX-YYYY-description \
--title "feat(TASK-XXXX-YYYY-NNN): description" \
--body "$(cat <<'EOF'
## Summary
<1-3 bullet points describing what was built>
Story: story-XXXX-YYYY
Epic: epic-XXXX
Task Plan: plans/epic-XXXX/plans/task-plan-XXXX-YYYY-NNN.md
## Changed Files
| File | Layer | Change |
|------|-------|--------|
| `src/domain/model/Entity.{{LANGUAGE}}` | domain | Added |
| `src/adapter/outbound/EntityRepo.{{LANGUAGE}}` | adapter | Modified |
## TDD Summary
- RED-GREEN-REFACTOR cycles: N
- Test count: N unit, N integration
## Checklist
- [ ] Build passes (`{{BUILD_COMMAND}}`)
- [ ] Coverage thresholds met
- [ ] All acceptance criteria covered
EOF
)"
When creating a PR for a story or non-task branch:
gh pr create \
--base develop \
--title "feat(scope): implement story-XXXX-YYYY -- title" \
--body "$(cat <<'EOF'
## Summary
<1-3 bullet points describing what was built>
## Test plan
- [ ] Build passes (`{{BUILD_COMMAND}}`)
- [ ] Coverage thresholds met
- [ ] All acceptance criteria covered
EOF
)"
Task PR format:
<type>(TASK-XXXX-YYYY-NNN): descriptionfeat(TASK-0029-0015-001): implement Phase 2 task loopStory PR format (legacy):
feat(scope): implement story-XXXX-YYYY -- short title| Section | Content | Required |
|---------|---------|----------|
| Story reference | Story: story-XXXX-YYYY | Yes |
| Epic reference | Epic: epic-XXXX | Yes |
| Task plan link | Task Plan: plans/epic-XXXX/plans/task-plan-XXXX-YYYY-NNN.md | Optional |
| Changed files | Table with file path, layer, and change type | Yes |
| TDD summary | Number of RED/GREEN/REFACTOR cycles | Yes |
| Checklist | DoD items from the task | Yes |
gh pr list
gh pr view <number>
gh pr checks <number>
gh pr merge <number> --squash --delete-branch
git tag -a v0.1.0 -m "Milestone description"
git push origin v0.1.0
When following TDD, use these commit format variants:
| Format | When to use |
|--------|-------------|
| feat(scope): implement [behavior] [TDD] | Recommended default. Complete Red-Green(-Refactor) cycle in one commit: test + implementation (+ trivial refactor) |
| test(scope): add test for [behavior] [TDD:RED] | Optional, fine-grained. Test-only Red phase; must be paired with a [TDD:GREEN] commit before push |
| feat(scope): implement [behavior] [TDD:GREEN] | Optional, fine-grained. Implementation-only Green phase; must immediately follow a paired [TDD:RED] commit |
| refactor(scope): [improvement] [TDD:REFACTOR] | Optional. Non-trivial refactor-only commit (no new behavior), immediately after the corresponding Green commit |
The combined format [TDD] is the recommended default for most work: one green commit per complete Red-Green(-Refactor) cycle. Use the separate [TDD:RED], [TDD:GREEN], [TDD:REFACTOR] tags only when finer granularity in the git history is needed, and always keep RED/GREEN commits paired (no orphaned test-only commits on shared branches).
TDD tags are additive suffixes — they do not replace the Conventional Commits type. All existing types (feat, test, fix, refactor, docs, build, chore, infra) remain valid.
[TDD] suffix for a complete cycle in a single commit[TDD:RED] commits are allowed locally for fine-grained work, but must be paired with a corresponding [TDD:GREEN] commit before push (no orphaned test-only commits on shared branches)[TDD:REFACTOR] immediately after the Green commit, adding no new behaviorThe sequence of commits should tell the story of TDD progression from simple to complex:
The git log should read as a progression from the simplest case to the most complex, making the development process transparent and reviewable.
| Scenario | Action | |----------|--------| | Uncommitted changes when creating branch | Stash or commit before switching | | Push rejected (remote ahead) | Pull with rebase, then push again | | Merge conflict during rebase | Report conflict files, suggest resolution | | PR creation fails (no remote branch) | Push branch first, then retry PR creation | | Build fails before push | Abort push, report build errors |
| Skill | Relationship | Context |
|-------|-------------|---------|
| x-story-implement | called-by | Phase 0 (branch from develop) and Phase 5 (push + PR to develop) |
| x-task-implement | called-by | Atomic TDD commits during implementation |
| x-release | called-by | Release commit and tag creation |
| x-git-commit | delegates-to | Commit creation with task ID scope and TDD tags |
| x-pr-create | delegates-to | PR creation with task references and body template |
main and creates PRs targeting main, then back-merges to developTASK-XXXX-YYYY-NNN formatdeveloptesting
Scaffolds a Helidon SE/MP service with routing, health, config, Dockerfile, and tests.
tools
Generates a Picocli @Command with subcommands, options, converters, and unit tests.
testing
Scaffolds a Micronaut service with @Controller, DI, health, Dockerfile, and tests.
testing
Scaffolds a Helidon SE/MP service with routing, health, config, Dockerfile, and tests.