SDLC.ai VIRIM Agent Navigator

Find the right agent for your VIRIM project phase, role, or deliverable

github-interactions

Skill detail with category, linked agents, and source metadata.

github-interactions

Governs how agents interact with GitHub — Pull Requests, reviews, resolving PR comments, issues, repository operations, branches, and API calls. Use whenever you need to create, read, or review a PR, query issues, commits, check CI status, push branches, or call any GitHub REST/GraphQL endpoint. Provides the Windows Credential Manager token pattern for VIRIM developer machines.

Category: code-generation Used by 3 agents

Source: .github/skills/code-generation/github-interactions/SKILL.md

Used By Agents

Preview

View source preview (first 3000 chars)

# GitHub Interactions

> **Copilot CLI Mode**: `git` and `gh` commands run directly via the shell tool — no special skill invocation needed. The Windows Credential Manager + `Invoke-RestMethod` pattern below still applies for GitHub REST API calls when needed.
>
> **VS Code Chat / IDE Mode**: This skill's full workflow applies — use `run_in_terminal` for git commands, and the token extraction + REST API patterns documented below for GitHub API operations.

All GitHub and local git operations **must** use standard `git` commands, the `gh` CLI, or direct calls to the GitHub REST API. Refrain from using third-party unapproved tools for git or GitHub operations. Only use Microsoft, GitHub, and other highly reputable first-party tools. Third-party MCP tools, extensions, or proxies that intercept git/GitHub traffic are not compliant with corporate policy.

## Mandatory User Confirmation for Commits, Pushes, and PRs

**Never auto-commit, auto-push, or auto-create a PR without explicit user approval.** Unless the user has explicitly instructed upfront to "go ahead and commit" or "commit without asking", you **must** confirm interactively before every commit, push, and PR creation.

### Before committing

Present the user with:
1. The list of files to be committed
2. The proposed commit message
3. Ask explicitly: "Should I commit these files with this message? (Yes / No / Edit message)"

Wait for the user's response before running `git commit`.

### Before pushing

After committing, ask: "Should I push this to the remote? (Yes / No)"

### Before creating a PR

Present:
1. PR title and description
2. Target branch (e.g., `develop`)
3. Ask explicitly: "Should I create this Draft PR? (Yes / No / Edit)"

### Exception

If the user has already given blanket permission (e.g., "go ahead and commit everything", "commit and push without asking"), you may proceed without per-action confirmation for that session.

---

## Preferred Tools (in order)

| Priority | Tool | When to use |
|---|---|---|
| 1 | `gh` CLI | Primary for GitHub operations: create PR, list PRs, check CI status, view issues — if installed and authenticated (`gh auth status` passes) |
| 2 | Windows Credential Manager + `Invoke-RestMethod` | Fallback for GitHub API operations: use when `gh` CLI is not installed or not authenticated — uses the token git already has stored, zero extra auth steps |
| 3 | `run_in_terminal` / shell with `git` | All local git ops: add, commit, push, log, diff, stash, status, branch, checkout, reset |

---

## `gh` CLI — Preferred for GitHub Operations

**Try `gh` first** for all GitHub API interactions. Check if available:

```bash
gh auth status
# On Windows if not in PATH:
& "C:\Program Files\GitHub CLI\gh.exe" auth status
```

If authenticated, use `gh` commands:

```bash
# Create a draft PR (preferred method)
gh pr create --draft --base develop --title "feat: your PR title" --body "## Summary\n\nDescription..."

# List open PRs
gh pr list --state open

# View a spec