Developers increasingly rely on terminals for speed, automation, and direct system access. Tools like GitHub Copilot CLI already help by generating commands, debugging code, and accelerating workflows without leaving the command line.
Yet even with these tools, friction persists: commands get re-run, context must be re-explained, and logs often need translation before others can act on them. Over time, these small hurdles accumulate—especially when teams use different stacks and standards.
What if your terminal not only ran commands but truly understood your stack, tools, and team norms? That’s the promise of custom agents in GitHub Copilot CLI.
Instead of crafting one-off prompts each time, teams can encode their context into reusable workflows. These agents handle repetitive patterns consistently, produce reviewable outputs, and integrate seamlessly with your existing tools—extending GitHub Copilot’s capabilities for specific development needs.
What custom agents are and how they differ
Custom agents are specialized Copilot agents configured via Markdown files stored in your repository. Unlike generic assistants, they follow defined roles, access tools, enforce standards, and produce consistent outputs wherever they run.
For example, a general coding agent might suggest code cleanup. But a custom agent can enforce your team’s formatting rules, accessibility standards, security policies, and review requirements every single time.
Agent profiles—written as .agent.md files in the .github/agents directory—define key attributes:
- The agent’s purpose and domain expertise
- The tools it can use (e.g. codebase access, terminal commands, test runners)
- Guardrails to ensure safe, predictable behavior
Below is a simplified excerpt from an accessibility-focused agent profile:
---
description: Expert assistant for web accessibility (WCAG 2.1/2.2), inclusive UX, and a11y testing
name: Accessibility Expert
model: GPT-4.1
tools:
- changes
- codebase
- edit/editFiles
- extensions
- web/fetch
- findTestFiles
- githubRepo
- new
- openSimpleBrowser
- problems
- runCommands
- runTasks
- runTests
- search
- searchResults
- terminalLastCommand
- terminalSelection
- testFailure
- usages
- vscodeAPI
---
# Accessibility Expert
You are a world-class expert in web accessibility who translates standards into practical guidance for designers, developers, and QA. You ensure products are inclusive, usable, and aligned with WCAG 2.1/2.2 across A/AA/AAA levels.
## Your Expertise
- Standards & Policy: WCAG 2.1/2.2 conformance, A/AA/AAA mapping, privacy/security aspects, regional policiesBecause agent profiles live in your repo, teams can review, version, and share them. This ensures the same expectations follow the work from CLI commands to IDE edits and GitHub pull requests.
How custom agents operate within GitHub Copilot CLI
GitHub Copilot CLI excels at running scripts, calling APIs, and interacting directly with repositories. Adding custom agents lets you encode complex, execution-heavy workflows once—then invoke them from the terminal with consistent results every time.
To create and use a custom agent:
- Use the
/agentslash command in Copilot CLI to select your custom agent. - Store the agent profile as a
.agent.mdfile in the.github/agentsdirectory of your target repository. This file includes YAML frontmatter and instructions that define the agent’s capabilities and constraints.
Since agent profiles are version-controlled files, they support team collaboration, auditing, and continuous improvement.
Practical workflows you can automate today
Start with tasks your team repeats often—especially those that begin in the terminal and flow into the IDE or GitHub.
Here are three common scenarios where custom agents add immediate value:
Security audit workflows
A security audit agent runs your team’s standard checks across repositories, groups findings by severity, and outputs a pull request–ready checklist with owners and action items. It leverages existing security tooling like Semgrep, Trivy, and Gitleaks, and surfaces gaps or misconfigurations as actionable issues.
Example agent profile structure:
---
name: Security audit
description: Run our standard security checks across repositories and produce a PR-ready checklist grouped by severity.
tools:
- gh
- git
- semgrep
- trivy
- gitleaks
- jq
---
## Instructions
You are the Security audit agent for this organization.
### Goal
For the repositories provided by the user:
- Run the team’s standard security checks
- Summarize findings by severity (Critical, High, Medium, Low)
- Output a PR-ready checklist with owners and next steps
### Operating rules
- Prefer existing security tooling and config files (e.g. `.semgrep.yml`, `.trivyignore`, `.gitleaks.toml`)
- If a tool is missing, flag it as a High severity “coverage gap”
- Never expose secrets or full payloads; redact sensitive data
- Use inclusive language (e.g., allowlist/denylist)
- Format dates as “March 23, 2026”Testing and validation pipelines
A test automation agent can run your suite of unit, integration, and end-to-end tests, interpret failures, and draft a summary report with links to related logs or documentation. It can even suggest fixes based on common patterns.
Code quality and style enforcement
Agents focused on code quality can analyze new changes, enforce your team’s style guide, and open draft pull requests with suggested fixes—all triggered from the terminal.
By shifting repetitive, context-rich tasks into defined agents, development teams reduce cognitive load, eliminate manual rework, and maintain consistency across projects.
Looking ahead, custom agents could evolve to support multi-repository workflows, tighter IDE integration, and real-time collaboration features—further closing the gap between terminal automation and human oversight.
AI summary
Terminal kullanımında verimlilik herkesin aradığı şey. GitHub Copilot CLI'deki yeni 'özel ajan' özelliğiyle, tekrar eden komutları ve ekip standartlarını otomatikleştirerek iş akışlarınızı nasıl optimize edebileceğinizi keşfedin.