Github workflows

From AtlasOmnia/hermes-custom-pack · View interactive version

Github workflows is an AI agent skill from the GitHub repository AtlasOmnia/hermes-custom-pack. github-workflows — Consolidate GitHub auth, repository management, PR lifecycle, issues, and code review workflows.

How to use this skill

Skill file

GitHub Workflows

Use this skill for the full GitHub operating loop:

1) authenticate, 2) manage repos and remotes, 3) open and review PRs, 4) work on issues, and 5) monitor CI.

Why this umbrella exists

The old project-specific skills (github-auth, github-repo-management, github-pr-workflow, github-issues, github-code-review) all target the same operational domain: repository setup, PR lifecycles, issue triage, and review. Consolidating them avoids fragmented workflows and makes the sequence from local repo state to merged code explicit.

Core entrypoints

  1. Authentication first
  1. Repository foundation
  1. Issue workflow
  1. PR execution
  1. Code review loop

Recommended practical sequence

PR + issue operating matrix

When a task spans both code and tracking, prefer this order:

  1. Ensure repo auth is valid.
  2. Confirm branch and remote are current.
  3. If needed, create/clone the repo and verify contributor permissions.
  4. For new work, open or update an issue first, then PR.
  5. Run or track CI before requesting final merge.
  6. Post review and close loop with state updates.

Curated staging and PR-body safety

Before the first commit in a public repository, verify git config user.name and git config user.email. If either is empty or would fall back to a machine-local identity such as user@hostname.local, set the repository-local identity to the authenticated GitHub account and its noreply address before committing. If caught after a local commit but before push, amend with git commit --amend --no-edit --reset-author, then verify both author and committer fields.

For large working trees, do not default to git add .. Stage an explicit path list, then:

  1. Run git status --short and investigate every MM entry. If a generator ran after staging, restage the final generated output so the committed file is the one that was actually tested.
  2. Run git diff --cached --check and scan the staged diff for secrets.
  3. Compare git diff --cached --name-only against a forbidden list covering credentials, result bundles, agent-session directories, build output, and known duplicate files.
  4. After push, verify local HEAD equals the remote branch SHA.

For multiline PR descriptions—especially Markdown containing backticks, $(), or shell metacharacters—write the body with the file tool and call gh pr create --body-file <path> or gh pr edit --body-file <path>. Do not pass rich Markdown inside a double-quoted --body shell argument: command substitution can execute text inside backticks and silently corrupt the PR description. Read the PR back with gh pr view --json body,url,state before reporting success.

If gh pr checks reports that no checks exist, say so explicitly; a successful push is not CI verification.

Public GitHub profile setup

Treat a GitHub profile as two separate deliverables:

  1. Account metadata — display name, bio, website, and optional location, updated through PATCH /user.
  2. Profile README — README.md in a public repository whose owner and repository names exactly match the authenticated username.

Preflight with gh auth status and gh api user; do not assume repository scopes permit profile edits. The REST profile endpoint requires the OAuth user scope. If PATCH /user returns HTTP 404 with a scope hint, request only that scope using gh auth refresh -h github.com -s user -c. GitHub's device authorization must be approved by the user; do not enter credentials or approve permission dialogs on their behalf. Resume only after the refresh exits successfully and gh auth status confirms the scope.

For the profile README, use the established public/noreply Git identity, scan the staged content for secrets and PII, push it, then verify the rendered public profile rather than only the repository API response. Keep community-facing profiles credibility-first: concise project summaries, verified links, and an affiliation disclaimer when independent community work could be mistaken for an official vendor account.

Quick fallbacks when `gh` is unavailable

Multi-repository sync and reconciliation

When asked to scan “all repos,” treat it as an inventory and classification task rather than repeating git pull blindly:

When the user asks to continue into reconciliation:

Destructive cleanup and archive retirement

Treat synchronization and archival cleanup as separate phases. A canonical repository can be fully reconciled even while duplicate snapshots, campaign worktrees, backup branches, or stashes remain intentionally preserved.

  1. Prove the canonical clone is clean and equal to its remote before touching any duplicate.
  2. Preserve unique branch tips with a verified git bundle, and preserve dirty work with an external patch/tar archive.
  3. Execute destructive operations serially, never in a parallel batch. Approval systems may allow one deletion and deny another, leaving partial state that must be re-read before continuing.
  4. After every approved deletion, verify the path/ref is absent and the canonical clone is unchanged.
  5. If an approval is denied, do not rephrase or route around it. Stop that cleanup item, leave the archive classified as noncanonical, and continue only with read-only verification.
  6. A directory containing .git files may be an unregistered review copy even when git worktree list shows only the canonical checkout. Classify it from both views before removal.

Staged privacy-scan precision

Do not scan staged diffs with an unbounded grep 'sk-': ordinary package-lock names such as task-* can match and create false alarms. Use token boundaries and realistic minimum lengths (for example (?<![A-Za-z])sk-[A-Za-z0-9_-]{20,}), scan without printing matched secret values, and keep local-path/PII checks separate from credential checks.

For explicitly authorized deletion of whole remote GitHub repositories, including complete git bundle backups, dirty-work sidecars, the delete_repo OAuth device flow, serial DELETE calls, and absence verification, follow the deletion steps in this skill.

Investigating “branched but not on main” reports

Treat this as a provenance question, not merely a branch-name search:

  1. Resolve the exact repository first. If the name is uncertain, search session history or the authenticated account’s repository list; once an exact owner/repo is known, query it directly with gh repo view owner/repo. Broad repository-enumeration filters can omit private, transferred, archived, or otherwise unexpectedly classified repositories.
  2. Inspect all three surfaces:
  1. Inspect repository events and main history when the expected branch is absent:

A local-only topic branch may have been fast-forwarded or pushed directly to main, leaving no remote branch and no PR. A deleted branch may still appear in repository events or refs/pull/*.

  1. Prove ancestry before concluding anything: record the old base, current main SHA, commit parents, and compare range. Distinguish “merged through a PR,” “fast-forward/direct push to main,” “branch exists but is unmerged,” and “local-only work not present on GitHub.”
  2. If the change is already on main, say plainly that nothing needs merging. Separately flag process concerns such as bypassing PR review; do not manufacture a merge task merely because the work began on a branch.

Self-hosted runner deployment

Use self-hosted runners to preserve GitHub PR/check workflows without consuming GitHub-hosted minutes.

Verification checklist

Support-file equivalents from merged skills

Legacy skill assets now live in the archived originals under:

When not to use this skill

(e.g., local code review logic, testing, or architecture workflows).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.