Skip to main content
Settings
Search
Appearance
Theme Mode
About
Jekyll v3.10.0
Environment Production
Last Build
2026-05-22 20:16 UTC
Current Environment Production
Build Time May 22, 20:16
Jekyll v3.10.0
Build env (JEKYLL_ENV) production
Quick Links
Page Location
Page Info
Layout default
Collection notes
Path _notes/gh-600/copilot-coding-agent-cheatsheet.md
URL /notes/gh-600/copilot-coding-agent-cheatsheet/
Date 2026-05-17
Theme Skin
SVG Backgrounds
Layer Opacity
0.6
0.04
0.08

GitHub Copilot Coding Agent Cheatsheet

By IT-Journey Team

Quick reference for activating, configuring, and constraining the GitHub Copilot coding agent — including AGENTS.md structure, copilot-instructions.md, and permission scopes.

Estimated reading time: 2 minutes

GitHub Copilot Coding Agent Cheatsheet

Activating the Coding Agent

  1. Assign an issue to @copilot (or add the copilot label — check your organisation settings)
  2. Copilot creates a branch, opens a PR, and begins work
  3. Monitor in the “Copilot” tab of the issue/PR

AGENTS.md Structure

The AGENTS.md file in the repository root tells agents how to work in this repo.

# AGENTS.md

## Repository Context
[Brief description of the project purpose]

## Development Environment
[How to build and test locally]

## Conventions
[Code style, naming, commit format]

## Forbidden Actions
- Do not modify files in `infrastructure/`
- Do not push directly to `main`
- Do not delete any files without explicit instruction
- Do not store credentials in code

## Preferred Patterns
[Architecture patterns the agent should follow]

.github/copilot-instructions.md

Project-level instructions that Copilot reads for all interactions in this repository.

# Copilot Instructions

## Project Summary
[One paragraph describing the project]

## Coding Standards
- Language: [primary language]
- Style guide: [link]
- Testing: [framework and requirements]

## AI Collaboration Guidelines
- Prefer small, focused PRs
- Always include tests for new code
- Update documentation when changing interfaces

Workflow Permissions (Minimum for Coding Agent)

permissions:
  contents: write       # Create branches, commit files
  pull-requests: write  # Create and update PRs
  issues: write         # Comment on issues

Key GitHub Actions Contexts

Context Value
github.actor Who triggered the run
github.event_name Event type (push, issues, etc.)
github.sha Current commit SHA
github.ref Current branch/tag ref
github.run_id Unique ID for this workflow run

Environment Variables for Agent Context

GITHUB_REPOSITORY   # owner/repo
GITHUB_WORKFLOW     # workflow name
GITHUB_RUN_ID       # unique run ID (use as correlation ID)
GITHUB_ACTOR        # who triggered this run
GITHUB_EVENT_NAME   # trigger event type

Part of: [[GH-600 Agentic AI Quick-Reference Notes]] · Hub: [[The Agentic Codex: GH-600 Study Hub]]