Get the FREE Ultimate OpenClaw Setup Guide →

copilot-exec

npx machina-cli add skill dceoy/ai-coding-agent-skills/copilot-exec --openclaw
Files (1)
SKILL.md
3.2 KB

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/file to focus Copilot on a file.

  • Use /agent to pick a custom agent, or run:

    copilot --agent=refactor-agent --prompt "Refactor src/auth/*"
    
  • Use /add-dir or --add-dir to add extra directories.

  • Use --add-dir to allow additional directories in the workspace.

  • Use /model to pick another model if needed.

Use Custom Instructions

Copilot CLI automatically loads repository instructions if present:

  • .github/copilot-instructions.md
  • .github/copilot-instructions/**/*.instructions.md
  • AGENTS.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 /login and follow prompts.
  • If results are off, refine the prompt and include file paths.

Related Skills

  • copilot-ask for read-only questions
  • copilot-review for code reviews

Limitations

  • Interactive mode by default
  • Requires explicit approvals for file edits and commands
  • Limited by current codebase context

Source

git clone https://github.com/dceoy/ai-coding-agent-skills/blob/main/skills/copilot-exec/SKILL.mdView on GitHub

Overview

Copilot Exec uses GitHub Copilot CLI to perform code modifications, including creating features, refactoring, bug fixes, and test generation. It streamlines development requests by running guided prompts against your codebase and requires the Copilot CLI to be installed.

How This Skill Works

Clarify the task and gather repository context, then launch Copilot CLI in the project directory. Provide a clear, structured prompt with project metadata; Copilot suggests edits which you review and approve before applying. After changes, verify with git status/diff and run lint or tests if available.

When to Use It

  • 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

Quick Start

  1. Step 1: Understand Task — clarify what to create/modify, affected files, desired outcome, and constraints
  2. Step 2: Launch Copilot CLI — cd /path/to/project and run copilot
  3. Step 3: Review & Verify — examine changes, approve correct edits, then run lint/tests and git diff

Best Practices

  • Follow existing code patterns and conventions in the project
  • Add appropriate error handling and include necessary imports
  • Maintain readability, style, and use proper types where applicable
  • Include comments to explain complex logic
  • Preview all changes before applying them and provide clear task prompts with project context

Example Use Cases

  • Add a new REST API endpoint in a TypeScript/Node.js service using Copilot CLI
  • Refactor a Python function for clarity and performance with automated edits
  • Fix a UI bug in a React component and update related tests
  • Generate unit tests for a module with edge-case coverage
  • Update build/config files to accommodate a new dependency or tool

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers