agentleFS
GitHubKnown publishergithub/gh-aw/.github/skills/custom-agents/SKILL.md

custom-agents

Skill5.3k starsChanged 6 months agoMITView on GitHub

Define and validate GitHub custom agent files, prompts, and examples.

  • Reads credentials

Trending

Quiet since March.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 2 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the github/gh-aw repository that our weekly crawl found: only 3 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

The file

Show its rules and text

We split this skill into the rules it gives an agent

31 rules. About 0 are common, 17 are distinctive, and 14 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 14

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this reference for the GitHub custom agent file format.

    line 9
  2. Distinctive:

    Place custom agent files in these locations based on scope:

    line 17
  3. Distinctive:

    Important: Only one agent file is allowed per workflow

    line 41
  4. Very specific:

    Use YAML's | (literal) or > (folded) for multi-line content

    line 110
  5. Very specific:

    If both prompt and markdown body exist, they are typically combined

    line 111
  6. Very specific:

    If omitted or set to ["*"], agent has access to all available tools

    line 117
  7. Very specific:

    search: - Search codebase for keywords, references, or patterns

    line 127
  8. Very specific:

    pr: - Create, manage, or update pull requests

    line 128
  9. Very specific:

    issue: - Create, manage, or update issues

    line 129
  10. Distinctive:

    When using Model Context Protocol (MCP) servers, you can specify tools with server prefixes:

    line 145
  11. Very specific:

    All tools from a server: my-mcp-server/*

    line 147
  12. Very specific:

    Only used in .instructions.md files

    line 181
  13. Very specific:

    Use imports: for workflow prompt/context files (including local custom agent files), not as the primary skill installation path.

    line 405
  14. Very specific:

    Must be markdown files located under .github/agents/ directory

    line 446
  15. Distinctive:

    Only one agent file is allowed per workflow

    line 447
  16. Distinctive:

    Avoid mixing unrelated concerns in a single agent

    line 479
  17. Distinctive:

    Create multiple specialized agents rather than one general-purpose agent

    line 480
  18. Distinctive:

    Verify agent follows instructions correctly

    line 493
  19. Distinctive:

    Test with various input scenarios

    line 494
  20. Distinctive:

    Keep instructions current with codebase changes

    line 498
  21. Distinctive:

    Remove outdated or conflicting instructions

    line 500
  22. Distinctive:

    Use secrets for sensitive configuration

    line 505
  23. Distinctive:

    Ensure instructions don't conflict

    line 558
  24. Very specific:

    Verify tools are listed in tools array

    line 561
  25. Distinctive:

    Check agent has necessary permissions

    line 562
  26. Distinctive:

    Ensure tools are available in the environment

    line 563
  27. Distinctive:

    Verify glob patterns are correct

    line 566
  28. Distinctive:

    Check file paths match patterns

    line 567
  29. Very specific:

    Ensure applyTo is only used in .instructions.md files

    line 568
  30. Very specific:

    Verify agent file is imported in the imports field

    line 571
  31. Very specific:

    Ensure file exists and is committed under .github/agents/ directory

    line 572

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitHub Custom Agent File Format

Use this reference for the GitHub custom agent file format.

Overview

GitHub Copilot reads custom agent instructions from Markdown files with YAML frontmatter. Use them to define specialized behavior, tool access, and workflows for your repository.

File Locations

Place custom agent files in these locations based on scope:

1. Repository-wide Instructions

  • File: .github/copilot-instructions.md
  • Scope: Applies to all code generation in the repository
  • Use case: General coding standards, security requirements, testing practices

2. Path-specific Instructions

  • Directory: .github/instructions/
  • Pattern: *.instructions.md (e.g., frontend.instructions.md, backend.instructions.md)
  • Scope: Can target specific directories or file patterns using applyTo in frontmatter
  • Use case: Framework-specific guidelines, component-specific rules

3. Custom Agent Profiles

  • Directory: .github/agents/ or .github/copilot/instructions/
  • Pattern: AGENTS.md, *.md (e.g., readme-creator.md, test-writer.md)
  • Scope: Defines specialized agents with specific capabilities and instructions
  • Use case: Task-specific agents (documentation, testing, refactoring)

4. agentic workflow integration

  • Location: Imported via imports field in workflow frontmatter
  • Pattern: Any markdown files under .github/agents/ directory
  • Scope: Custom agent for specific agentic workflow execution
  • Use case: Workflow-specific agent configuration
  • Important: Only one agent file is allowed per workflow

File Format

Basic Structure

# YAML frontmatter (configuration)
name: agent-name
description: Brief description of agent's purpose

# Markdown body (instructions)

Your natural language instructions for the agent go here.

Complete YAML Frontmatter Schema

# Required fields
name: agent-identifier              # Unique identifier for the agent

# Optional descriptive fields
description: >                      # Multi-line description of agent's purpose
  Agent specializing in specific tasks

# Optional instruction fields
prompt: |                          # Freeform instructions (alternative to markdown body)
  Your instructions here

# Optional tool configuration
tools:                             # List of allowed tools for this agent
  - createFile
  - editFiles
  - codeSearch
  - search

# Optional path targeting (for .instructions.md files)
applyTo:                          # Glob patterns for targeted files/directories
  - "src/frontend/**"
  - "**/*.tsx"

# Optional MCP server configuration (enterprise/org only)
mcp-server:                       # External MCP server configuration
  url: https://my-mcp-server.com
  api-key: ${{ secrets.MCPSERVER_API_KEY }}

# Optional settings
settings:                         # Custom runtime or connection settings
  key: value

Field Descriptions

Core Fields

name (string, required for agent profiles)

  • Unique identifier for the custom agent
  • Used to reference the agent in workflows or assignments
  • Convention: lowercase with hyphens (e.g., readme-creator, test-writer)

description (string, optional)

  • Human-friendly description of the agent's focus and behavior
  • Helps users understand what the agent specializes in
  • Can be multi-line using YAML's > or | syntax

prompt (string, optional)

  • Alternative to using the markdown body for instructions
  • Contains freeform natural language instructions
  • Use YAML's | (literal) or > (folded) for multi-line content
  • If both prompt and markdown body exist, they are typically combined

Tool Configuration

tools (array of strings, optional)

  • List of tools the agent is allowed to use
  • If omitted or set to ["*"], agent has access to all available tools
  • Tool names are case-insensitive
  • Supports both GitHub's standard tool aliases and legacy naming conventions

GitHub Standard Tool Aliases:

GitHub Copilot defines a standardized set of tool aliases for custom agents:

  • read - Access and read contents of files or code
  • edit - Make changes in code files, apply edits or refactoring
  • search - Search codebase for keywords, references, or patterns
  • pr - Create, manage, or update pull requests
  • issue - Create, manage, or update issues

Legacy Tool Names:

For backward compatibility, these legacy tool names are still supported:

  • createFile - Create new files (use edit instead)
  • editFiles - Modify existing files (use edit instead)
  • deleteFiles - Remove files (use edit instead)
  • codeSearch - Semantic code search (use search instead)
  • runCommand - Execute shell commands
  • getFile - Read file contents (use read instead)
  • listFiles - List directory contents (use read instead)

MCP Server Tool Prefixes:

When using Model Context Protocol (MCP) servers, you can specify tools with server prefixes:

  • Single tool: my-mcp-server/tool-name
  • All tools from a server: my-mcp-server/*

Examples:

# Using standard tool aliases
tools:
  - read
  - edit
  - search

# Enable all tools with wildcard
tools: ["*"]

# Using legacy names (still supported)
tools:
  - editFiles
  - createFile
  - search

# Mixed standard and MCP server tools
tools:
  - read
  - edit
  - github-mcp/create_issue
  - custom-mcp/*

# Empty list disables all tools
tools: []

Path Targeting

applyTo (array of strings, optional)

  • Only used in .instructions.md files
  • Specifies glob patterns for files/directories these instructions apply to
  • Supports wildcards: * (any characters), ** (any directories)
  • Multiple patterns can be specified

Example:

applyTo:
  - "src/frontend/**/*.tsx"
  - "src/frontend/**/*.ts"
  - "components/**"

Enterprise Features

mcp-server (object, optional)

  • Configuration for external MCP (Model Context Protocol) servers
  • Typically used in enterprise or organization settings
  • Allows integration with custom tools and services

Fields:

  • url (string): MCP server endpoint
  • api-key (string): Authentication key (use GitHub secrets)

Example:

mcp-server:
  url: https://internal-tools.company.com/mcp
  api-key: ${{ secrets.INTERNAL_MCP_KEY }}

settings (object, optional)

  • Custom runtime or connection settings
  • Key-value pairs for agent-specific configuration
  • Format and available keys depend on the agent implementation

Usage Patterns

Pattern 1: Repository-wide Standards

File: .github/copilot-instructions.md

description: Repository-wide coding standards

# Coding Standards

## Style Guide
- Use single quotes in JavaScript/TypeScript
- Follow ESLint configuration in `.eslintrc.json`
- Maximum line length: 100 characters

## Security
- Always set `httpOnly` and `secure` flags for cookies
- Validate all user input
- Use parameterized queries for database access

## Testing
- All new code must include Jest tests
- Aim for >80% code coverage
- Test edge cases and error conditions

Pattern 2: Path-specific Instructions

File: .github/instructions/frontend.instructions.md

description: Frontend development guidelines
applyTo:
  - "src/frontend/**"
  - "components/**"

# Frontend Development Guidelines

## Component Structure
- Use React functional components with hooks
- Prefer composition over inheritance
- Keep components small and focused (< 150 lines)

## Styling
- Use CSS Modules for component styles
- Follow BEM naming convention
- Use Tailwind utility classes where appropriate

## State Management
- Use React Context for global state
- Keep local state in components when possible
- Use reducers for complex state logic

Pattern 3: Custom Agent Profile

File: .github/agents/readme-creator.md

name: readme-creator
description: Agent specializing in creating and improving README files
tools:
  - read
  - edit
  - search

# README Creator Agent

You are a documentation specialist focused on creating clear, comprehensive README files.

## Responsibilities
- Create well-structured README.md files for projects
- Include all standard sections: Overview, Installation, Usage, Contributing
- Generate accurate code examples
- Ensure documentation is up-to-date with codebase

## Style Guidelines
- Use clear, concise language
- Include code examples with syntax highlighting
- Add badges for build status, coverage, version
- Organize with logical heading hierarchy
- Include a table of contents for long READMEs

## Quality Standards
- Verify all code examples are accurate
- Test installation instructions
- Ensure links are valid and working
- Check for proper Markdown formatting

Pattern 4: Test Writer Agent

File: .github/agents/test-writer.md

name: test-writer
description: Specialized agent for writing comprehensive test suites
tools:
  - read
  - edit
  - search

# Test Writer Agent

You specialize in creating comprehensive, well-structured test suites.

## Testing Framework
- Use Jest for JavaScript/TypeScript
- Follow AAA pattern: Arrange, Act, Assert
- Use descriptive test names: "should [expected behavior] when [condition]"

## Test Coverage
- Write unit tests for all public functions
- Create integration tests for API endpoints
- Add edge case tests (null, undefined, empty, boundary values)
- Test error conditions and exception handling

## Test Organization
- Group related tests with `describe` blocks
- Use `beforeEach` and `afterEach` for setup/teardown
- Keep tests independent and isolated
- Mock external dependencies

## Best Practices
- One assertion per test when possible
- Use test data builders for complex objects
- Avoid test interdependence
- Keep tests fast (< 1 second each)

Pattern 5: Agentic Workflow Integration

File: .github/workflows/code-review.md

on:
  pull_request:
    types: [opened, synchronize]
permissions:
  contents: read
  pull-requests: write
engine:
  id: copilot
  custom-agent: .github/agents/code-reviewer.md

# Automated Code Review

Review the pull request changes and provide constructive feedback.

File: .github/agents/code-reviewer.md

name: code-reviewer
description: Agent specialized in performing code reviews
tools:
  - read
  - search

# Code Review Agent

You are an experienced code reviewer focused on code quality, security, and best practices.

## Review Checklist
- Code follows repository style guidelines
- Proper error handling is implemented
- Security best practices are followed
- Tests are included for new functionality
- Documentation is updated where needed
- No unnecessary complexity

## Feedback Style
- Be constructive and specific
- Explain the reasoning behind suggestions
- Prioritize issues (critical, important, minor)
- Acknowledge good patterns and improvements
- Provide code examples for suggestions

Integration with gh-aw

The gh-aw (GitHub Agentic Workflows) tool supports custom agent files through the imports field in workflow frontmatter. Any markdown files under the .github/agents/ directory are treated as custom agent files when imported.

Preferred way to install skills in workflows

Use the skills: frontmatter field as the preferred way to install external skills for workflow runs. This installs skills during activation and persists them correctly between jobs. Use the top-level plugins: field the same way for agent plugins. Never add on-the-fly installation steps or ask the agent to install a skill or plugin from the prompt.

Use imports: for workflow prompt/context files (including local custom agent files), not as the primary skill installation path.

on: pull_request
engine:
  id: copilot
skills:
  - mattpocock/skills/tdd@801dca688564c529fa84f247f64472520d9ebe28
plugins:
  - octo-org/agent-plugin@v1
imports:
  - .github/agents/code-reviewer.md

# Workflow prompt

Configuration

on: issues
engine:
  id: copilot
imports:
  - .github/agents/my-agent.md

# My Workflow

Instructions for the workflow...

Supported Engines

Custom agent files are supported by the following engines:

  1. Copilot - Uses --agent <path> flag to load custom agent file
  2. Claude - Prepends agent file content to the workflow prompt
  3. Codex - Prepends agent file content to the workflow prompt

File Path Resolution

  • Agent files are imported via the imports field
  • Must be markdown files located under .github/agents/ directory
  • Only one agent file is allowed per workflow
  • File is validated during workflow compilation
  • Checkout step is automatically added if agent file is imported

Example Workflow with Custom Agent

on:
  issues:
    types: [opened]
permissions:
  contents: read
  issues: write
engine:
  id: copilot
imports:
  - .github/agents/issue-triager.md
tools:
  github:
    allowed:
      - add_labels_to_issue
      - create_issue_comment

# Issue Triage Workflow

Analyze the issue and categorize it appropriately.

Best Practices

1. Keep Instructions Focused

  • Each agent should have a clear, specific purpose
  • Avoid mixing unrelated concerns in a single agent
  • Create multiple specialized agents rather than one general-purpose agent

2. Be Explicit and Specific

  • Provide concrete examples of expected behavior
  • Define clear success criteria
  • Specify edge cases and error handling

3. Use Appropriate Scoping

  • Repository-wide instructions for universal standards
  • Path-specific instructions for framework or directory-specific rules
  • Custom agents for task-specific workflows

4. Test Agent Behavior

  • Verify agent follows instructions correctly
  • Test with various input scenarios
  • Iterate based on actual agent performance

5. Maintain and Update

  • Keep instructions current with codebase changes
  • Review and refine based on agent performance
  • Remove outdated or conflicting instructions

6. Security Considerations

  • Limit tool access to what's necessary
  • Be cautious with file deletion permissions
  • Use secrets for sensitive configuration
  • Review agent actions regularly

Common Patterns

Documentation Agent

name: documentation-specialist
description: Creates and maintains technical documentation
tools: [read, edit, search]

Refactoring Agent

name: code-refactorer
description: Improves code quality and structure
tools: [read, edit, search]

Security Auditor

name: security-auditor
description: Reviews code for security vulnerabilities
tools: [read, search]

Migration Assistant

name: migration-helper
description: Assists with framework or library migrations
tools: [read, edit, search]

Issue Management Agent

name: issue-manager
description: Manages GitHub issues and project tracking
tools: [read, issue]

Pull Request Assistant

name: pr-assistant
description: Assists with pull request creation and management
tools: [read, edit, pr]

Troubleshooting

Agent Not Following Instructions

  • Make instructions more explicit and specific
  • Provide concrete examples
  • Break down complex instructions into steps
  • Ensure instructions don't conflict

Tool Access Issues

  • Verify tools are listed in tools array
  • Check agent has necessary permissions
  • Ensure tools are available in the environment

Path Targeting Not Working

  • Verify glob patterns are correct
  • Check file paths match patterns
  • Ensure applyTo is only used in .instructions.md files

Custom Agent File Not Found

  • Verify agent file is imported in the imports field
  • Ensure file exists and is committed under .github/agents/ directory
  • Confirm agent file path is correct in imports list
  • Remember: only one agent file is allowed per workflow

References

Examples in This Repository

The gh-aw repository uses custom agent files for performance engineering guides:

  • .github/copilot/instructions/ci-performance.md - CI/CD optimization
  • .github/copilot/instructions/workflow-performance.md - Workflow efficiency
  • .github/copilot/instructions/build-performance.md - Build optimization
  • .github/copilot/instructions/cli-performance.md - CLI performance

These files provide specialized guidance for performance engineering tasks and demonstrate the custom agent file format in practice.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.