copilot-ask
npx machina-cli add skill dceoy/ai-coding-agent-skills/copilot-ask --openclawCopilot Ask Skill
Use GitHub Copilot CLI to answer questions about code without making modifications. This is a read-only analysis skill.
When to Use
- User asks "how does X work?"
- User wants to find where something is implemented
- User needs to understand architecture or patterns
- User is debugging and needs to understand code flow
- User asks "what does this code do?"
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: Parse the Question
Extract what the user wants to know and the scope (files, feature, component).
Step 2: Launch Copilot CLI
cd /path/to/project
copilot
Step 3: Ask the Question
Provide a clear prompt:
Explain how [FEATURE/COMPONENT] works in this codebase.
Please provide:
1. Direct answer to the question
2. Specific file paths and line numbers
3. Code examples from the actual codebase
4. Related concepts or dependencies
Do NOT make any changes - this is read-only analysis.
Step 4: Present the Answer
Format with:
- Summary (1-2 sentences)
- Details (explanation)
- File references (paths + line numbers)
- Code examples
- Related info (dependencies, gotchas)
Tips
- Use
@path/to/fileto include a specific file in the prompt. - Use
/usageto view session usage details. - Use
/modelto pick another model if needed. - Use
?orcopilot helpto see available commands.
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 the answer is unclear, narrow the question and include file paths.
Related Skills
copilot-execfor code modificationscopilot-reviewfor code reviews
Limitations
- Read-only analysis
- Interactive mode only
- Limited by current codebase context
Source
git clone https://github.com/dceoy/ai-coding-agent-skills/blob/main/skills/copilot-ask/SKILL.mdView on GitHub Overview
Copilot-Ask is a read-only analysis skill that uses GitHub Copilot CLI to explain how code works, where things are implemented, and which patterns are used. It helps you understand architecture, debugging flows, and code behavior without making any changes. Prerequisites include having Copilot CLI installed and accessible in PATH.
How This Skill Works
User's question is parsed to define scope (files, feature, component). The agent launches Copilot CLI in the project directory and submits a carefully crafted prompt. Copilot returns a structured answer with a direct explanation, file references, and code examples from the actual codebase, all in read-only mode.
When to Use It
- User asks "how does X work?"
- User wants to find where something is implemented
- User needs to understand architecture or patterns
- User is debugging and needs to understand code flow
- User asks "what does this code do?"
Quick Start
- Step 1: Parse the user's question and define the scope (files, feature, component)
- Step 2: In your project directory, launch the Copilot CLI session (copilot)
- Step 3: Ask a clear prompt and review the read-only answer with summary, details, and file references
Best Practices
- Keep prompts scoped to a specific feature or component to avoid broad, unfocused results
- Include precise file paths and line numbers when relevant
- Request a direct answer plus file references and code examples from the codebase
- Ask for related concepts or dependencies to provide context
- Do NOT request code changes; this is strictly read-only analysis
Example Use Cases
- Explain how the user authentication flow works in the login module
- Find where the payment success path is implemented in the checkout service
- Describe the event-driven pattern used in the order processing pipeline
- Trace the data flow during debugging of a null reference in utils
- Describe what the helper function does and where it is used in the codebase