Programmatic mode (copilot -p "<your prompt>") for quick, one-off questions
@ symbol references files and directories in your prompts
Summarize @README.md
@samples/book-app-project/books.py Review this file for potential bugs
@**/test_*.py Recursive wildcard: find all test files anywhere
Best Practices for Large Codebases
Be specific: @samples/book-app-project/books.py instead of @samples/book-app-project/
Clear between topics: Use /clear when switching focus
Use /compact: Summarize conversation to free up context
Use multiple sessions: One session per feature or topic
Tests
copilot
> @samples/book-app-project/utils.py Generate comprehensive pytest tests for get_book_details covering:
> - Valid input
> - Empty strings
> - Invalid year formats
> - Very long titles
> - Special characters in author names
planning : /research bedore /plan
https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-best-practices
/agent or --agent to change agent
/init Generates project configuration files (instructions, agents)
Agent files are markdown files with a .agent.md extension.
Put agent files under .github/agents/ (Project-specific ) or ~/.copilot/agents/ (Global (all projects))
---
name: my-reviewer
description: Code reviewer focused on bugs and security issues
---
# Code Reviewer
You are a code reviewer focused on finding bugs and security issues.
When reviewing code, always check for:
- SQL injection vulnerabilities
- Missing error handling
- Hardcoded secrets
Launch an agent
copilot --agent python-reviewer
> Review @samples/book-app-project/books.py
.github/
└── instructions/
├── python-standards.instructions.md
├── security-checklist.instructions.md
└── api-design.instructions.md
Another example agent ~/.copilot/agents/python-reviewer.agent.md:
---
name: python-reviewer
description: Python code quality specialist for reviewing Python projects
tools: ["read", "edit", "search", "execute"]
---
# Python Code Reviewer
You are a Python specialist focused on code quality and best practices.
**Your focus areas:**
- Code quality (PEP 8, type hints, docstrings)
- Performance optimization (list comprehensions, generators)
- Error handling (proper exception handling)
- Maintainability (DRY principles, clear naming)
**Code style requirements:**
- Use Python 3.10+ features (dataclasses, type hints, pattern matching)
- Follow PEP 8 naming conventions
- Use context managers for file I/O
- All functions must have type hints and docstrings
**When reviewing code, always check:**
- Missing type hints on function signatures
- Mutable default arguments
- Proper error handling (no bare except)
- Input validation completeness
Documentation agent
cat > .github/agents/documentor.agent.md << 'EOF'
---
name: documentor
description: Technical writer for clear and complete documentation
---
# Documentation Agent
You are a technical writer who creates clear documentation.
**Documentation standards:**
- Start with a one-sentence summary
- Include usage examples
- Document parameters and return values
- Note any gotchas or limitations
EOF
A skill: Provide capabilities or actions Copilot can execute
An agent: Define a role/persona for Copilot
You want Copilot to behave differently Agent
You want Copilot to execute tasks Skill
You want multiple AI roles in repo Agents
You want automation capability Skills
Agent Skills are folders containing instructions, scripts, and resources that Copilot automatically loads when relevant to your task. Copilot reads your prompt, checks if any skills match, and applies the relevant instructions automatically.