AgentSkillsCN

epa-github-operations

Git 与 GitHub 操作。适用于分支管理、提交记录、PR 创建。

SKILL.md
--- frontmatter
name: epa-github-operations
description: Git and GitHub operations. Use for branching, commits, PRs.
license: MIT
compatibility: Requires gh CLI authenticated.
metadata:
  author: Emasoft
  version: 1.0.0
context: fork
agent: epa-programmer-main-agent
user-invocable: false
workflow-instruction: "Steps 19, 21, 22"
procedure: "proc-complete-task, proc-handle-failed-pr"

EPA GitHub Operations

This skill provides procedures for Git and GitHub operations within the Emasoft Programmer Agent workflow. Use these operations for repository management, branching, commits, and pull request lifecycle.

When to Use This Skill

  • Cloning/forking: When starting work on a new project or task
  • Branching: When beginning implementation of a task
  • Committing: When saving incremental progress or completing work
  • Pull Requests: When submitting completed work for review (Step 19)
  • Review Response: When addressing EIA review comments (Step 21)
  • PR Updates: When pushing fixes after PR rejection (Step 22)

Prerequisites

  1. gh CLI installed and authenticated: Run gh auth status to verify
  2. Git configured: User name and email set
  3. Repository access: Read/write permissions to target repository

Operations Reference

Repository Setup

OperationFileWhen to Use
Clone Repositoryop-clone-repository.mdInitial project setup, forking upstream repos
Create Feature Branchop-create-feature-branch.mdStarting work on a new task

Table of Contents - op-clone-repository.md:

  • 1.1 When to clone vs fork
  • 1.2 Cloning with gh CLI
  • 1.3 Forking upstream repositories
  • 1.4 Setting up remotes for forks
  • 1.5 Verifying clone success

Table of Contents - op-create-feature-branch.md:

  • 2.1 Branch naming conventions
  • 2.2 Creating branch from main
  • 2.3 Switching to existing branches
  • 2.4 Pushing new branch to remote

Commit Operations

OperationFileWhen to Use
Commit Changesop-commit-changes.mdSaving progress with meaningful messages

Table of Contents - op-commit-changes.md:

  • 3.1 Staging changes selectively
  • 3.2 Commit message format
  • 3.3 Conventional commits syntax
  • 3.4 Amending commits (when safe)
  • 3.5 Verifying commit success

Pull Request Lifecycle

OperationFileWhen to Use
Create Pull Requestop-create-pull-request.mdSubmitting completed task for review (Step 19)
Respond to Reviewop-respond-to-review.mdAddressing EIA review comments (Step 21)
Update PR with Fixesop-update-pr-with-fixes.mdPushing fixes after rejection (Step 22)

Table of Contents - op-create-pull-request.md:

  • 4.1 Preparing branch for PR
  • 4.2 Writing PR title and description
  • 4.3 Creating PR with gh CLI
  • 4.4 Setting reviewers and labels
  • 4.5 Linking to issues

Table of Contents - op-respond-to-review.md:

  • 5.1 Reading review comments
  • 5.2 Understanding rejection reasons
  • 5.3 Addressing specific feedback
  • 5.4 Replying to review comments
  • 5.5 Requesting re-review

Table of Contents - op-update-pr-with-fixes.md:

  • 6.1 Making requested changes
  • 6.2 Committing fixes
  • 6.3 Pushing updates to PR branch
  • 6.4 Updating PR description
  • 6.5 Notifying reviewer of updates

Quick Reference

Branch Naming Convention

code
<type>/<issue-number>-<short-description>

Examples:

  • feature/123-add-user-auth
  • fix/456-resolve-memory-leak
  • refactor/789-extract-utils

Commit Message Format

code
<type>(<scope>): <subject>

<body>

<footer>

Types: feat, fix, docs, style, refactor, test, chore

PR Title Format

code
<type>(<scope>): <short description>

Example: feat(auth): add OAuth2 login support

Checklist - Full GitHub Workflow

  • Clone or fork repository
  • Create feature branch with proper naming
  • Make changes and commit incrementally
  • Push branch to remote
  • Create pull request with description
  • Address review comments if rejected
  • Push fixes and request re-review

Error Handling

ErrorCauseSolution
gh: command not foundgh CLI not installedInstall with brew install gh
gh auth login requiredNot authenticatedRun gh auth login
Permission deniedNo write accessRequest access or fork repository
Branch already existsBranch name collisionDelete old branch or use different name
Merge conflictsDiverged from mainRebase or merge main into branch

Related Skills

  • epa-orchestrator-communication: For messaging EIA about PR status
  • epa-task-execution: For implementing code changes, writing tests, and validating acceptance criteria before creating a PR

See Also