Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/images/help/copilot/copilot-cli-welcome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ children:
- /setting-up-the-codeql-cli
- /advanced-setup-of-the-codeql-cli
- /using-custom-queries-with-the-codeql-cli
- /testing-custom-queries
- /testing-query-help-files
- /specifying-command-options-in-a-codeql-configuration-file
- /creating-database-bundle-for-troubleshooting

redirect_from:
- /code-security/codeql-cli/using-the-codeql-cli
- /code-security/codeql-cli/getting-started-with-the-codeql-cli
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Testing custom queries
intro: You can set up tests for your {% data variables.product.prodname_codeql %} queries to ensure that they continue to return the expected results with new releases of the {% data variables.product.prodname_codeql_cli %}.
intro: Verify your custom {% data variables.product.prodname_codeql %} queries and catch breaking changes before they affect your {% data variables.product.prodname_code_scanning %} results following new releases of the {% data variables.product.prodname_codeql_cli %}.
shortTitle: Test custom queries
product: '{% data reusables.gated-features.codeql %}'
versions:
fpt: '*'
Expand All @@ -14,10 +15,11 @@ redirect_from:
- /code-security/codeql-cli/testing-custom-queries
- /code-security/codeql-cli/using-the-codeql-cli/testing-custom-queries
- /code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/testing-custom-queries
contentType: tutorials
- /code-security/tutorials/customize-code-scanning/testing-custom-queries
contentType: how-tos
---

## About testing custom queries
## Testing custom queries

{% data variables.product.prodname_codeql %} provides a simple test framework for automated regression testing
of queries. Test your queries to ensure that they behave as expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ children:
- /running-codeql-code-scanning-in-a-container
- /customizing-analysis-with-codeql-packs
- /creating-codeql-query-suites
- /testing-custom-queries
- /creating-and-working-with-codeql-packs
- /publishing-and-using-codeql-packs
---

75 changes: 11 additions & 64 deletions content/copilot/concepts/agents/about-agent-skills.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: About Agent Skills
shortTitle: Agent Skills
intro: 'Agent Skills enhance the ability of {% data variables.copilot.copilot_coding_agent %}, the {% data variables.copilot.copilot_cli %} and {% data variables.product.prodname_vscode %} Insiders to perform specialized tasks.'
title: About agent skills
shortTitle: Agent skills
intro: 'Skills allow {% data variables.product.prodname_copilot_short %} to perform specialized tasks.'
product: '{% data reusables.gated-features.copilot-coding-agent %}<br><br>{% data reusables.gated-features.copilot-cli %}<br><a href="https://github.com/features/copilot/plans?ref_product=copilot&ref_type=purchase&ref_style=button" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Sign up for {% data variables.product.prodname_copilot_short %}</span> {% octicon "link-external" height:16 %}</a>'
versions:
feature: copilot
Expand All @@ -11,11 +11,12 @@ category:
- Learn about Copilot
---

## About Agent Skills
> [!NOTE]
> Agent Skills work with {% data variables.copilot.copilot_coding_agent %}, the {% data variables.copilot.copilot_cli %} and agent mode in {% data variables.product.prodname_vscode %} Insiders. Support in the stable version of {% data variables.product.prodname_vscode_shortname %} is coming soon.

Agent Skills are folders of instructions, scripts, and resources that {% data variables.product.prodname_copilot_short %} can load when relevant to improve its performance in specialized tasks. Agent Skills is an [open standard](https://github.com/agentskills/agentskills), used by a range of different agents.
## About agent skills

Agent Skills work with {% data variables.copilot.copilot_coding_agent %}, the {% data variables.copilot.copilot_cli %} and agent mode in {% data variables.product.prodname_vscode %} Insiders. Support in the stable version of {% data variables.product.prodname_vscode_shortname %} is coming soon.
Agent skills are folders of instructions, scripts, and resources that {% data variables.product.prodname_copilot_short %} can load when relevant to improve its performance in specialized tasks. The Agent Skills specification is an [open standard](https://github.com/agentskills/agentskills), used by a range of different AI systems.

You can create your own skills to teach {% data variables.product.prodname_copilot_short %} to perform tasks in a specific, repeatable way—or use skills shared online, for example in the [`anthropics/skills`](https://github.com/anthropics/skills) repository or {% data variables.product.company_short %}'s community created [`github/awesome-copilot`](https://github.com/github/awesome-copilot) collection.

Expand All @@ -26,63 +27,9 @@ You can create your own skills to teach {% data variables.product.prodname_copil

Support for organization-level and enterprise-level skills is coming soon.

> [!NOTE]
> {% data reusables.cli.preview-note-cli-body %}

## Creating and adding skills

1. Create a subdirectory for your new skill. Each skill should have its own directory (for example, `.github/skills/webapp-testing`). Skill directory names should be lowercase, use hyphens for spaces, and typically match the `name` in the `SKILL.md` frontmatter.

For project skills, specific to a single repository, store your skill under `.github/skills` or `.claude/skills`.

For personal skills, shared across projects, store your skill under `~/.copilot/skills` or `~/.claude/skills`.

1. Create a `SKILL.md` file with your skill's instructions.

> [!NOTE]
> Skill files must be named `SKILL.md`.

`SKILL.md` files are Markdown files with YAML frontmatter. In their simplest form, they include:

* YAML frontmatter
* **name** (required): A unique identifier for the skill. This must be lowercase, using hyphens for spaces.
* **description** (required): A description of what the skill does, and when {% data variables.product.prodname_copilot_short %} should use it.
* **license** (optional): A description of the license that applies to this skill.
* A Markdown body, with the instructions, examples and guidelines for {% data variables.product.prodname_copilot_short %} to follow.

1. Optionally, add scripts, examples or other resources to your skill's directory. For example, if you were writing a skill for converting images between different formats, you might include a script for converting SVG images to PNG.

### Example `SKILL.md` file

For a project skill, this file would be located in the `/path/to/repository/.github/skills/github-actions-failure-debugging` directory.

For a personal skill, this file would be located in the `~/.copilot/skills/github-actions-failure-debugging` directory.

```markdown copy
---
name: github-actions-failure-debugging
description: Guide for debugging failing GitHub Actions workflows. Use this when asked to debug failing GitHub Actions workflows.
---

To debug failing GitHub Actions workflows in a pull request, follow this process, using tools provided from the GitHub MCP Server:

1. Use the `list_workflow_runs` tool to look up recent workflow runs for the pull request and their status
2. Use the `summarize_job_log_failures` tool to get an AI summary of the logs for failed jobs, to understand what went wrong without filling your context windows with thousands of lines of logs
3. If you still need more information, use the `get_job_logs` or `get_workflow_run_logs` tool to get the full, detailed failure logs
4. Try to reproduce the failure yourself in your own environment.
5. Fix the failing build. If you were able to reproduce the failure yourself, make sure it is fixed before committing your changes.
```

## How {% data variables.product.prodname_copilot_short %} uses skills

When performing tasks, {% data variables.product.prodname_copilot_short %} will decide when to use your skills based on your prompt and the skill's description.

When {% data variables.product.prodname_copilot_short %} chooses to use a skill, the `SKILL.md` file will be injected in the agent's context, giving the agent access to your instructions. It can then follow those instructions, and use any scripts or examples you may have included in the skill's directory.

## Skills versus custom instructions

You can use both skills and custom instructions to teach {% data variables.product.prodname_copilot_short %} how to work in your repository and how to perform specific tasks.
## Next steps

We recommend using custom instructions for simple instructions relevant to almost every task (for example information about your repository's coding standards), and skills for more detailed instructions that {% data variables.product.prodname_copilot_short %} should access when relevant.
To create an agent skill, see:

To learn more about repository custom instructions, see [AUTOTITLE](/copilot/how-tos/configure-custom-instructions/add-repository-instructions).
* [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/create-skills)
* [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/create-skills)
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
title: About custom agents
shortTitle: Custom agents
intro: '{% data variables.copilot.custom_agents_caps_short %} enhance {% data variables.copilot.copilot_coding_agent %} with assistance tailored to your needs.'
product: '{% data reusables.gated-features.copilot-coding-agent %}<br><a href="https://github.com/features/copilot/plans?ref_product=copilot&ref_type=purchase&ref_style=button" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Sign up for {% data variables.product.prodname_copilot_short %}</span> {% octicon "link-external" height:16 %}</a>'
intro: '{% data variables.copilot.custom_agents_caps_short %} enhance {% data variables.product.prodname_copilot_short %} with assistance tailored to your needs.'
versions:
feature: copilot
topics:
Expand All @@ -13,7 +12,7 @@ category:

## About {% data variables.copilot.custom_agents_short %}

{% data variables.copilot.custom_agents_caps_short %} are specialized versions of {% data variables.copilot.copilot_coding_agent %} that you can tailor to your unique workflows, coding conventions, and use cases. They act like tailored teammates that follow your standards, use the right tools, and implement team-specific practices. You define these agents once instead of repeatedly providing the same instructions and context.
{% data variables.copilot.custom_agents_caps_short %} are specialized versions of the {% data variables.product.prodname_copilot_short %} agent that you can tailor to your unique workflows, coding conventions, and use cases. They act like tailored teammates that follow your standards, use the right tools, and implement team-specific practices. You define these agents once instead of repeatedly providing the same instructions and context.

You define {% data variables.copilot.custom_agents_short %} using Markdown files called {% data variables.copilot.agent_profiles %}. These files specify prompts, tools, and MCP servers. This allows you to encode your conventions, frameworks, and desired outcomes directly into {% data variables.product.prodname_copilot_short %}.

Expand Down Expand Up @@ -64,16 +63,19 @@ For more information, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage

{% data reusables.copilot.custom-agents-ide-preview %}

Once you create {% data variables.copilot.custom_agents_short %}, you can use them wherever {% data variables.copilot.copilot_coding_agent %} is available:
Once you create {% data variables.copilot.custom_agents_short %}, they become available to:

* {% data variables.product.prodname_dotcom_the_website %}: The agents tab and panel, issue assignment, and pull requests
* {% data variables.copilot.copilot_cli %}
* IDEs: {% data variables.product.prodname_vscode %}, JetBrains IDEs, Eclipse, and Xcode
* **{% data variables.copilot.copilot_coding_agent %} on {% data variables.product.prodname_dotcom_the_website %}**: The agents tab and panel, issue assignment, and pull requests
* **{% data variables.copilot.copilot_coding_agent %} in IDEs**: {% data variables.product.prodname_vscode %}, JetBrains IDEs, Eclipse, and Xcode
* **{% data variables.copilot.copilot_cli %}**

You can use {% data variables.copilot.agent_profiles %} directly in {% data variables.product.prodname_vscode %}, JetBrains IDEs, Eclipse, and Xcode. Some properties may function differently or be ignored between environments.
You can use {% data variables.copilot.agent_profiles %} directly in {% data variables.product.prodname_vscode %}, JetBrains IDEs, Eclipse, and Xcode. Some properties may function differently or be ignored between environments.

For more information on using {% data variables.copilot.custom_agents_short %} in {% data variables.product.prodname_vscode %}, see [{% data variables.copilot.custom_agents_caps_short %} in {% data variables.product.prodname_vscode_shortname %}](https://code.visualstudio.com/docs/copilot/customization/custom-agents).

## Next steps

To create your own {% data variables.copilot.custom_agents_short %}, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents).
To create your own {% data variables.copilot.custom_agents_short %}, see:

* [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents)
* [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli)
15 changes: 8 additions & 7 deletions content/copilot/concepts/agents/coding-agent/about-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ versions:
topics:
- Copilot
contentType: concepts
category:
category:
- Configure Copilot
---

## About hooks

Hooks enable you to execute custom shell commands at strategic points in an agent's workflow, such as when an agent session starts or ends, or before and after a prompt is entered or a tool is called.
Hooks enable you to execute custom shell commands at strategic points in an agent's workflow, such as when an agent session starts or ends, or before and after a prompt is entered or a tool is called.

Hooks receive detailed information about agent actions via JSON input, enabling context-aware automation. For example, you can use hooks to:

* Programmatically approve or deny tool executions.
* Programmatically approve or deny tool executions.
* Utilize built-in security features like secret scanning to prevent credential leaks.
* Implement custom validation rules and audit logging for compliance.

Expand All @@ -27,17 +27,19 @@ Hooks receive detailed information about agent actions via JSON input, enabling
Hooks are available for use with:

* {% data variables.copilot.copilot_coding_agent %} on {% data variables.product.github %}
* {% data variables.copilot.copilot_cli %} in the terminal
* {% data variables.copilot.copilot_cli %} in the terminal

## Types of hooks

The following types of hooks are available:

* **sessionStart**: Executed when a new agent session begins or when resuming an existing session. Can be used to initialize environments, log session starts for auditing, validate project state, and set up temporary resources.
* **sessionEnd**: Executed when the agent session completes or is terminated. Can be used to cleanup temporary resources, generate and archive session reports and logs, or send notifications about session completion.
* **userPromptSubmitted**: Executed when the user submits a prompt to the agent. Can be used to log user requests for auditing and usage analysis.
* **userPromptSubmitted**: Executed when the user submits a prompt to the agent. Can be used to log user requests for auditing and usage analysis.
* **preToolUse**: Executed before the agent uses any tool (such as `bash`, `edit`, `view`). This is the most powerful hook as it can **approve or deny tool executions**. Use this hook to block dangerous commands, enforce security policies and coding standards, require approval for sensitive operations, or log tool usage for compliance.
* **postToolUse**: Executed after a tool completes execution (whether successful or failed). Can be used to log execution results, track usage statistics, generate audit trails, monitor performance metrics, and send failure alerts.
* **agentStop**: Executed when the main agent has finished responding to your prompt.
* **subagentStop**: Executed when a subagent completes, before returning results to the parent agent.
* **errorOccurred**: Executed when an error occurs during agent execution. Can be used to log errors for debugging, send notifications, track error patterns, and generate reports.

To see a complete reference of hook types with example use cases, best practices, and advanced patterns, see [AUTOTITLE](/copilot/reference/hooks-configuration).
Expand Down Expand Up @@ -154,11 +156,10 @@ To ensure security is maintained when using hooks, keep the following considerat
* **Always validate and sanitize the input processed by hooks**. Untrusted input could lead to unexpected behavior.
* **Use proper shell escaping when constructing commands**. This prevents command injection vulnerabilities.
* **Never log sensitive data, such as tokens or passwords**.
* **Ensure hook scripts and logs have the appropriate permissions**.
* **Ensure hook scripts and logs have the appropriate permissions**.
* **Be cautious with hooks that make external network calls**. These can introduce latency, failures, or expose data to third parties.
* **Set appropriate timeouts to prevent resource exhaustion**. Long-running hooks can block agent execution and degrade performance.

## Next steps

To start creating hooks, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks).

Loading