agentleFS
d-o-hubd-o-hub/github-template-ai-agents/.agents/skills/git-github-workflow/SKILL.md

git-github-workflow

Skill2 starsChanged 9 days agoMITView on GitHub

Orchestrates the full git-to-merge lifecycle: validate → commit → check issues → create PR → monitor ALL GitHub Actions (including pre-existing failures) → fix via swarm/web research → merge with strategy selection → post-merge validate. Use this skill when the user asks to ship changes end-to-end, manage a PR through CI, or handle the complete commit-to-merge workflow — even if they just say "push it" or "ship it". Not for simple one-off git operations (revert, squash, cherry-pick), isolated tasks (just review, just test, just lint), or secret lifecycle work such as rotation and revocation (use secrets-management).

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 17 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 17

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run quality gate with zero warnings policy

    line 32
  2. Distinctive:

    Verify not on protected branch (main/master)

    line 34
  3. Distinctive:

    Check gh CLI authentication

    line 35
  4. Distinctive:

    Create atomic commit with conventional format

    line 41
  5. Distinctive:

    Check issue relevance to current changes

    line 48
  6. Distinctive:

    Create comprehensive PR with commit summary and context

    line 55
  7. Distinctive:

    CRITICAL: ALL GitHub Actions must pass, including pre-existing

    line 61
  8. Very specific:

    Check ALL repository workflows (gh run list)

    line 63
  9. Distinctive:

    Wait for ALL checks green or timeout

    line 66
  10. Distinctive:

    If ANY check fails:

    line 75
  11. Distinctive:

    Use available skills to fix issues

    line 77
  12. Distinctive:

    Verify ALL checks passing and merge state

    line 83
  13. Distinctive:

    Delete feature branch (optional)

    line 85
  14. Distinctive:

    Verify ALL files present

    line 91
  15. Distinctive:

    Run final quality gate

    line 93
  16. Distinctive:

    STRICT MODE (default): ALL checks must pass, including pre-existing.

    line 177
  17. Distinctive:

    If pre-existing failures found: document → web research → apply fix → re-run checks → merge only when ALL green.

    line 179
  18. Distinctive:

    After merge: checkout main, pull latest, verify all files present, validate docs, run quality gate, check repo integrity.

    line 189

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git-GitHub Workflow Skill

Unified atomic state-machine workflow: validate → commit → check issues → create PR → monitor ALL Actions → fix (swarm/web research) → merge (strategy selection) → post-merge validate

When to Use

  • User asks to commit code, create a PR, push changes, or merge
  • Need to manage the full git lifecycle from commit to merge
  • Even if they just say "push it" or "ship it"

Overview

Orchestrates complete code submission as a state machine with swarm agent coordination and 8 phases. See references/SWARM.md for agents and references/HANDOFF.md for coordination.

Workflow Phases

Phase 0: PRE_COMMIT (Validation)

  • Run quality gate with zero warnings policy
  • Scan for secrets in staged changes
  • Verify not on protected branch (main/master)
  • Check gh CLI authentication
  • Failure: Abort immediately, no changes made

Phase 1: ATOMIC COMMIT (Agent: commit-agent)

  • Stage ALL changes (git add -A)
  • Create atomic commit with conventional format
  • Auto-detect commit type from changed files
  • Generate meaningful commit message

Phase 2: CHECK GITHUB ISSUES (Agent: issue-agent)

  • List open issues in repository
  • Check issue relevance to current changes
  • Identify blocking issues (labeled "blocking"/"critical")
  • Determine if issues need fixing before merge

Phase 3: CREATE PR (Agent: pr-agent)

  • Push to new feature branch (auto-generated or custom name)
  • Create comprehensive PR with commit summary and context
  • Link related issues in PR body
  • Auto-detect existing PR for the branch

Phase 4: MONITOR ALL ACTIONS (Agent: monitor-agent)

CRITICAL: ALL GitHub Actions must pass, including pre-existing

  • Monitor PR checks continuously (gh pr checks)
  • Check ALL repository workflows (gh run list)
  • Distinguish pre-existing vs new issues
  • Detect warnings (configurable fail-on-warning)
  • Wait for ALL checks green or timeout
  • Branch protection awareness
  • Watch mode (absorbed from github-pr-sentinel): for long-running PRs, poll with scripts/gh_pr_watch.py --pr <n> --watch until merged, green, or blocked; loop back to Phase 5 on actionable review feedback before retrying flaky checks. Details: references/PR_WATCH_*.md.

Phase 5: ISSUE RESOLUTION (Agent: fix-agent) [Conditional]

If ANY check fails:

  • Trigger web research (web-search-researcher + doc-resolver)
  • Use available skills to fix issues
  • Re-run checks after fixes
  • Retry up to N times (configurable)

Phase 6: MERGE (Agent: merge-agent)

  • Verify ALL checks passing and merge state
  • Merge with configurable strategy (squash/merge/rebase)
  • Delete feature branch (optional)
  • Close related issues (optional)

Phase 7: POST-MERGE VALIDATION (Agent: validate-agent)

  • Checkout main branch
  • Verify ALL files present
  • Validate documentation complete
  • Run final quality gate
  • Check repository integrity

Quality Gates

PhaseCheckFailure Action
PRE_COMMITQuality gate zero warningsAbort
PRE_COMMITNo secrets in staged changesAbort
PRE_COMMITNot on protected branchAbort
COMMITValid conventional formatRollback
PRE_PUSHRemote accessibleRollback
PUSHSHA verificationRollback
PR_CREATEgh CLI authenticatedRollback
VERIFYAll CI checks green, zero warningsRollback

Commit Format

type(scope): Brief description (72 chars max)

  • Why not what - user perspective
  • Reference issues: Fixes #123
  • Types: feat, fix, docs, style, refactor, perf, test, ci, chore
  • Auto-detection: CI→ci | Test→test | Docs→docs | New→feat | Mod→fix

Auto-Merge Strategies

MethodCommandDescription
squashgh pr merge --squashCombine into single commit (default)
mergegh pr merge --mergeCreate merge commit
rebasegh pr merge --rebaseFast-forward after rebase

Error Codes

CodeMeaningPhase
0Success-
1General error-
2Quality gate failedPRE_COMMIT
3Commit failedCOMMIT
4GitHub issues blockingISSUES
5PR creation failedPR
6Actions checks failedMONITOR
7Max retries / timeoutFIX
8Merge failedMERGE
9Post-merge validation failedVALIDATE

Usage

# Full workflow
bash .agents/skills/git-github-workflow/run.sh --message "feat: implement feature"

# Partial modes
bash .agents/skills/git-github-workflow/run.sh --check-issues-only
bash .agents/skills/git-github-workflow/run.sh --validate-main-only

Arguments

ArgumentDescriptionDefault
--message, -mCommit messageauto-generated
--merge-methodmerge/squash/rebasesquash
--branch-nameCustom branch nameauto-generated
--rebase / --no-rebaseAuto-rebase if behindtrue
--check-all-actionsMonitor repo-wide Actionstrue
--fail-on-warningTreat warnings as errorstrue
--cleanup-branchDelete branch after mergefalse
--fix-issuesAuto-fix issuesfalse
--close-issuesClose related issues on mergefalse
--strict-validationALL checks must passtrue
--skip-issue-checkSkip GitHub issues checkfalse
--skip-ciSkip CI verification (emergency)false
--post-merge-validateValidate after mergetrue
--auto-researchWeb research on failurestrue
--dry-runSimulate without executingfalse
--max-retriesMax fix attempts3
--timeoutActions timeout (seconds)3600
--base-branchTarget branch for PRmain

Pre-existing Issue Handling

STRICT MODE (default): ALL checks must pass, including pre-existing. No exceptions.

If pre-existing failures found: document → web research → apply fix → re-run checks → merge only when ALL green.

NON-STRICT (--no-strict-validation): Distinguishes pre-existing vs new issues. New failures block merge; only pre-existing can merge. Reports all issues clearly.

Web Research Integration

On ANY failure: launch web-search-researcher → query failure → do-web-doc-resolver → get official docs → apply fix → re-run checks → retry (default max 3).

Post-Merge Validation

After merge: checkout main, pull latest, verify all files present, validate docs, run quality gate, check repo integrity.

Configuration

GIT_GITHUB_WORKFLOW_TIMEOUT=3600
GIT_GITHUB_WORKFLOW_MAX_RETRIES=3
GIT_GITHUB_WORKFLOW_STRICT_VALIDATION=1
GIT_GITHUB_WORKFLOW_AUTO_RESEARCH=1
GIT_GITHUB_WORKFLOW_POST_MERGE_VALIDATE=1
GIT_GITHUB_WORKFLOW_CLOSE_ISSUES=0
GIT_GITHUB_WORKFLOW_MERGE_METHOD=squash
GIT_GITHUB_WORKFLOW_REBASE=1
GIT_GITHUB_WORKFLOW_FAIL_ON_WARNING=1
GIT_GITHUB_WORKFLOW_CHECK_ALL_ACTIONS=1
GIT_GITHUB_WORKFLOW_CLEANUP_BRANCH=0

Success Criteria

Workflow succeeds when:

  1. ✓ Quality gate passed (zero warnings)
  2. ✓ Atomic commit with valid conventional format
  3. ✓ GitHub issues checked (none blocking or resolved)
  4. ✓ PR created and pushed to feature branch
  5. ✓ ALL GitHub Actions passing (pre-existing fixed)
  6. ✓ Issues resolved via web research (if needed)
  7. ✓ Merged to main with configured strategy
  8. ✓ Post-merge validation passes

Rationalizations

RationalizationReality
"I'll skip the quality gate, it's a tiny change"Small changes cause most production incidents.
"Rollback is too complex, I'll fix forward"Fix-forward creates tangled history.
"Post-merge validation is redundant"Ensures merge didn't introduce integration issues.
"Pre-existing failures aren't my problem"They still block your PR's merge status.
"I'll merge now and fix CI later"Broken CI contaminates main for all contributors.

Red Flags

  • Bypassing the quality gate for "trivial" changes
  • Merging on a green gh pr checks rollup without listing workflow runs; failed runs can be absent from it
  • Ignoring pre-existing CI failures as "not my problem"
  • Disabling rollback on failure
  • Skipping post-merge validation on main

See Also

  • references/SWARM.md - Agent definitions and coordination
  • references/HANDOFF.md - Handoff protocol
  • references/IMPLEMENTATION_ATOMIC_COMMIT.md - State machine, rollback matrix, secret patterns (migrated)
  • references/IMPLEMENTATION_GITHUB_WORKFLOW.md - GitHub API, merge strategies, troubleshooting (migrated)
  • run.sh - Workflow implementation script
  • evals/README.md - Consolidated test scenarios

Voice & Context

  • Default: professional + blog
  • Reference: voice-profiles skill for definitions and auto-detection.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.