github-commander

Structured workflows for triaging GitHub issues, reviewing PRs, sprinting through milestones, and running security/quality/performance audits — with configurable validation gates, auto-detected security scanning, journal audit trails, and human-in-the-loop checkpoints. Use this skill whenever you are working on a GitHub issue, reviewing or submitting a PR, running any kind of code audit, updating dependencies, or working through a milestone. Also use when the user mentions issue numbers, PR numbers, milestone names, or asks you to "fix", "triage", "audit", "review", or "update deps".

GitHub Commander

Structured, configurable workflows that teach AI agents to triage GitHub issues, review PRs, and sprint through milestones. Every action is journaled for full audit trails, and human-in-the-loop checkpoints keep you in control.

The reason every step journals its results is that it creates a searchable audit trail — future sessions can find exactly what was tried, what passed, and what failed, without the human needing to remember or repeat context.

When to Load

Load this skill when any of these apply:

  • You are assigned or asked to fix a GitHub issue
  • You need to review or submit a pull request
  • You need to work through issues in a milestone
  • You want to run dependency updates, security audits, or code quality audits
  • The user mentions an issue number (e.g., "fix #42") or PR number
  • The user says "triage", "audit", "review", "update deps", or similar
  • You are about to push code and want a structured validation pipeline

Quick Reference

WorkflowFilePurpose
Issue Triageworkflows/issue-triage.mdFix a single GitHub issue end-to-end
PR Reviewworkflows/pr-review.mdReview a PR with validation pipeline
Copilot Auditworkflows/copilot-audit.mdAdversarial Copilot CLI repo/PR review
Milestone Sprintworkflows/milestone-sprint.mdWork through milestone issues sequentially
Roadmap Kickoffworkflows/roadmap-kickoff.mdTranslate planning epics into Kanban issues
Update Dependenciesworkflows/update-deps.mdDependency update with audit trail
Security Auditworkflows/security-audit.mdAuto-detected security scanning
Code Quality Auditworkflows/code-quality-audit.mdStatic code quality analysis
Performance Auditworkflows/perf-audit.mdBuild, bundle, runtime, test speed analysis

Prerequisites

  • gh CLI authenticated (gh auth status)
  • GITHUB_TOKEN set for API access
  • PROJECT_REGISTRY configured for repo auto-detection
  • Project repo cloned locally

Configuration

All commands are configurable via environment variables. Defaults assume a Node.js project. Override for other ecosystems (Python, Rust, Go, etc.).

VariableDefaultDescription
PROJECT_LINT_CMDnpm run lintLint command
PROJECT_TYPECHECK_CMDnpm run typecheckType-check command (empty = skip)
PROJECT_BUILD_CMDnpm run buildBuild command (empty = skip)
PROJECT_TEST_CMDnpm run testUnit/integration test command
PROJECT_E2E_CMD(empty = skip)E2E test command
PROJECT_PACKAGE_MANAGER(auto-detect)npm, yarn, pnpm, or bun
PROJECT_HAS_DOCKERFILE(auto-detect)true to enable Docker audit steps
COMMANDER_HITL_FILE_THRESHOLD10HITL if changes touch > N files
COMMANDER_SECURITY_TOOLS(auto-detect)Comma-separated override list
COMMANDER_BRANCH_PREFIXfixBranch naming prefix

Package Manager Auto-Detection

If PROJECT_PACKAGE_MANAGER is not set, detect by lockfile:

  1. bun.lockb or bun.lockbun
  2. pnpm-lock.yamlpnpm
  3. yarn.lockyarn
  4. package-lock.jsonnpm
  5. Fallback → npm

Security Tool Auto-Detection

When COMMANDER_SECURITY_TOOLS is not set, each tool is detected independently:

ToolDetectionWhat It Scans
npm-auditAlways (Node.js project)Dependency vulnerabilities
codeqlcodeql CLI or gh codeqlStatic analysis (SAST)
trivytrivy --version succeedsContainer images, filesystems
docker-scoutdocker scout version succeedsDocker image CVEs
gitleaksgitleaks version succeedsSecrets in git history
trufflehogtrufflehog --version succeedsSecrets (verified only)

Missing tools are skipped with a journal note — never a failure.

Core Concepts

Validation Gates

Every workflow uses sequential validation gates. Each gate must pass before the next runs. On failure, the agent attempts to auto-fix (lint/type errors). If auto-fix fails after 2 attempts, the agent requests human input.

Gate 1: Lint + Typecheck  →  Gate 2: Build  →  Gate 3: Tests  →  Gate 4: E2E  →  Gate 5: Security

Gates configured with empty commands are skipped automatically.

Journal Audit Trail

Every significant action creates a journal entry with structured tags:

  • commander — all entries from this skill
  • triage / review / milestone — workflow type
  • gate-pass / gate-fail — validation results
  • security — security scan findings

Entries link to issues/PRs via issue_number and pr_number fields, connecting to the knowledge graph automatically.

Human-in-the-Loop Checkpoints

The agent pauses and requests human approval when:

  1. Before git push — present diff summary, files changed
  2. Critical security findings — any critical/high severity scan result
  3. Unfixable test failures — after 2 auto-fix attempts
  4. Large changesets — changes touch more files than COMMANDER_HITL_FILE_THRESHOLD
  5. Between milestone issues — in milestone-sprint workflow

Shipped Entry Types

These entry types are used by Commander workflows for structured audit trails:

TypeUsed ByPurpose
triageissue-triageIssue context gathered, analysis complete
implementationissue-triageFix implemented
gate_passallValidation gate passed
gate_failallValidation gate failed (with error details)
security_findingsecurity-auditSecurity scan finding
pr_submittedissue-triagePR created and pushed
review_startpr-reviewPR review initiated
review_completepr-reviewPR review completed
milestone_sprint_startmilestone-sprintSprint started
deps_updateupdate-depsDependency update completed
audit_findingall auditsCode quality or perf finding