Agent skill
copilot-exec
Execute development tasks using GitHub Copilot CLI for code generation, refactoring, feature implementation, and bug fixes. Use when the user asks to create code, add features, refactor, fix bugs, or generate tests. Requires Copilot CLI installed.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/copilot-exec
SKILL.md
Copilot Exec Skill
Use GitHub Copilot CLI to execute development tasks that involve code modifications. This skill modifies code.
When to Use
- User asks to add, create, implement, or generate code
- User wants to refactor existing code
- User needs to fix a bug
- User wants to create tests
- User asks to update or modify code
Prerequisites
Verify GitHub Copilot CLI is available:
copilot --version
Note: Copilot will ask you to trust the files in the current folder before it can read them.
Basic Usage
Step 1: Understand the Task
Clarify:
- What to create/modify?
- Which files are affected?
- Expected outcome?
- Constraints or requirements?
Step 2: Gather Context
Review current state:
git status
git diff
Read relevant files to understand patterns.
Step 3: Launch Copilot CLI
cd /path/to/project
copilot
Step 4: Execute the Task
Provide clear instructions:
[TASK DESCRIPTION]
Follow these guidelines:
- Follow existing code patterns and conventions
- Add appropriate error handling
- Include necessary imports
- Maintain readability and style
- Use proper types if applicable
- Add comments for complex logic
Project context:
- Language: [e.g., TypeScript + React]
- Build tool: [e.g., Vite, webpack]
- Package manager: [e.g., npm, pnpm, yarn]
- Coding style: [e.g., see eslint config]
Preview all changes before applying them.
Step 5: Review and Approve
Copilot CLI will ask for approvals before it changes files or runs commands. Review each action and approve only what is correct.
Step 6: Verify Changes
git status
git diff
Run lint/tests if available.
Step 7: Report Results
Provide:
- Files modified/created
- Summary of changes
- Verification results
- Issues or follow-ups
Tips
-
Use
@path/to/fileto focus Copilot on a file. -
Use
/agentto pick a custom agent, or run:bashcopilot --agent=refactor-agent --prompt "Refactor src/auth/*" -
Use
/add-diror--add-dirto add extra directories. -
Use
/cwdor--cwdto set the working directory. -
Use
/modelto pick another model if needed.
Use Custom Instructions
Copilot CLI automatically loads repository instructions if present:
.github/copilot-instructions.md.github/copilot-instructions/**/*.instructions.mdAGENTS.md(agent instructions)
Error Handling
- If Copilot is not found, ensure it is installed per the prerequisites in README.md and available in PATH.
- If authentication fails, run
/loginand follow prompts. - If results are off, refine the prompt and include file paths.
Related Skills
copilot-askfor read-only questionscopilot-reviewfor code reviews
Limitations
- Interactive mode by default
- Requires explicit approvals for file edits and commands
- Limited by current codebase context
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?