You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-the-command-line/testing-custom-queries.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
---
2
2
title: Testing custom queries
3
-
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 %}.
3
+
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 %}.
4
+
shortTitle: Test custom queries
4
5
product: '{% data reusables.gated-features.codeql %}'
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.'
2
+
title: About agent skills
3
+
shortTitle: Agent skills
4
+
intro: 'Skills allow {% data variables.product.prodname_copilot_short %} to perform specialized tasks.'
5
5
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>'
6
6
versions:
7
7
feature: copilot
@@ -11,11 +11,12 @@ category:
11
11
- Learn about Copilot
12
12
---
13
13
14
-
## About Agent Skills
14
+
> [!NOTE]
15
+
> 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.
15
16
16
-
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.
17
+
## About agent skills
17
18
18
-
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.
19
+
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.
19
20
20
21
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.
21
22
@@ -26,63 +27,9 @@ You can create your own skills to teach {% data variables.product.prodname_copil
26
27
27
28
Support for organization-level and enterprise-level skills is coming soon.
28
29
29
-
> [!NOTE]
30
-
> {% data reusables.cli.preview-note-cli-body %}
31
-
32
-
## Creating and adding skills
33
-
34
-
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.
35
-
36
-
For project skills, specific to a single repository, store your skill under `.github/skills` or `.claude/skills`.
37
-
38
-
For personal skills, shared across projects, store your skill under `~/.copilot/skills` or `~/.claude/skills`.
39
-
40
-
1. Create a `SKILL.md` file with your skill's instructions.
41
-
42
-
> [!NOTE]
43
-
> Skill files must be named `SKILL.md`.
44
-
45
-
`SKILL.md` files are Markdown files with YAML frontmatter. In their simplest form, they include:
46
-
47
-
* YAML frontmatter
48
-
***name** (required): A unique identifier for the skill. This must be lowercase, using hyphens for spaces.
49
-
***description** (required): A description of what the skill does, and when {% data variables.product.prodname_copilot_short %} should use it.
50
-
***license** (optional): A description of the license that applies to this skill.
51
-
* A Markdown body, with the instructions, examples and guidelines for {% data variables.product.prodname_copilot_short %} to follow.
52
-
53
-
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.
54
-
55
-
### Example `SKILL.md` file
56
-
57
-
For a project skill, this file would be located in the `/path/to/repository/.github/skills/github-actions-failure-debugging` directory.
58
-
59
-
For a personal skill, this file would be located in the `~/.copilot/skills/github-actions-failure-debugging` directory.
60
-
61
-
```markdown copy
62
-
---
63
-
name: github-actions-failure-debugging
64
-
description: Guide for debugging failing GitHub Actions workflows. Use this when asked to debug failing GitHub Actions workflows.
65
-
---
66
-
67
-
To debug failing GitHub Actions workflows in a pull request, follow this process, using tools provided from the GitHub MCP Server:
68
-
69
-
1. Use the `list_workflow_runs` tool to look up recent workflow runs for the pull request and their status
70
-
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
71
-
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
72
-
4. Try to reproduce the failure yourself in your own environment.
73
-
5. Fix the failing build. If you were able to reproduce the failure yourself, make sure it is fixed before committing your changes.
74
-
```
75
-
76
-
## How {% data variables.product.prodname_copilot_short %} uses skills
77
-
78
-
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.
79
-
80
-
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.
81
-
82
-
## Skills versus custom instructions
83
-
84
-
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.
30
+
## Next steps
85
31
86
-
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.
32
+
To create an agent skill, see:
87
33
88
-
To learn more about repository custom instructions, see [AUTOTITLE](/copilot/how-tos/configure-custom-instructions/add-repository-instructions).
Copy file name to clipboardExpand all lines: content/copilot/concepts/agents/coding-agent/about-custom-agents.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
---
2
2
title: About custom agents
3
3
shortTitle: Custom agents
4
-
intro: '{% data variables.copilot.custom_agents_caps_short %} enhance {% data variables.copilot.copilot_coding_agent %} with assistance tailored to your needs.'
5
-
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>'
4
+
intro: '{% data variables.copilot.custom_agents_caps_short %} enhance {% data variables.product.prodname_copilot_short %} with assistance tailored to your needs.'
6
5
versions:
7
6
feature: copilot
8
7
topics:
@@ -13,7 +12,7 @@ category:
13
12
14
13
## About {% data variables.copilot.custom_agents_short %}
15
14
16
-
{% 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.
15
+
{% 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.
17
16
18
17
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 %}.
19
18
@@ -64,16 +63,19 @@ For more information, see [AUTOTITLE](/copilot/how-tos/administer-copilot/manage
64
63
65
64
{% data reusables.copilot.custom-agents-ide-preview %}
66
65
67
-
Once you create {% data variables.copilot.custom_agents_short %}, you can use them wherever {% data variables.copilot.copilot_coding_agent %} is available:
66
+
Once you create {% data variables.copilot.custom_agents_short %}, they become available to:
68
67
69
-
* {% data variables.product.prodname_dotcom_the_website %}: The agents tab and panel, issue assignment, and pull requests
70
-
* {% data variables.copilot.copilot_cli %}
71
-
*IDEs: {% data variables.product.prodname_vscode %}, JetBrains IDEs, Eclipse, and Xcode
68
+
***{% data variables.copilot.copilot_coding_agent %} on {% data variables.product.prodname_dotcom_the_website %}**: The agents tab and panel, issue assignment, and pull requests
69
+
***{% data variables.copilot.copilot_coding_agent %} in IDEs**: {% data variables.product.prodname_vscode %}, JetBrains IDEs, Eclipse, and Xcode
70
+
***{% data variables.copilot.copilot_cli %}**
72
71
73
-
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.
72
+
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.
74
73
75
74
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).
76
75
77
76
## Next steps
78
77
79
-
To create your own {% data variables.copilot.custom_agents_short %}, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents).
78
+
To create your own {% data variables.copilot.custom_agents_short %}, see:
Copy file name to clipboardExpand all lines: content/copilot/concepts/agents/coding-agent/about-hooks.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,17 +8,17 @@ versions:
8
8
topics:
9
9
- Copilot
10
10
contentType: concepts
11
-
category:
11
+
category:
12
12
- Configure Copilot
13
13
---
14
14
15
15
## About hooks
16
16
17
-
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.
17
+
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.
18
18
19
19
Hooks receive detailed information about agent actions via JSON input, enabling context-aware automation. For example, you can use hooks to:
20
20
21
-
* Programmatically approve or deny tool executions.
21
+
* Programmatically approve or deny tool executions.
22
22
* Utilize built-in security features like secret scanning to prevent credential leaks.
23
23
* Implement custom validation rules and audit logging for compliance.
24
24
@@ -27,17 +27,19 @@ Hooks receive detailed information about agent actions via JSON input, enabling
27
27
Hooks are available for use with:
28
28
29
29
* {% data variables.copilot.copilot_coding_agent %} on {% data variables.product.github %}
30
-
* {% data variables.copilot.copilot_cli %} in the terminal
30
+
* {% data variables.copilot.copilot_cli %} in the terminal
31
31
32
32
## Types of hooks
33
33
34
34
The following types of hooks are available:
35
35
36
36
***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.
37
37
***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.
38
-
***userPromptSubmitted**: Executed when the user submits a prompt to the agent. Can be used to log user requests for auditing and usage analysis.
38
+
***userPromptSubmitted**: Executed when the user submits a prompt to the agent. Can be used to log user requests for auditing and usage analysis.
39
39
***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.
40
40
***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.
41
+
***agentStop**: Executed when the main agent has finished responding to your prompt.
42
+
***subagentStop**: Executed when a subagent completes, before returning results to the parent agent.
41
43
***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.
42
44
43
45
To see a complete reference of hook types with example use cases, best practices, and advanced patterns, see [AUTOTITLE](/copilot/reference/hooks-configuration).
@@ -154,11 +156,10 @@ To ensure security is maintained when using hooks, keep the following considerat
154
156
***Always validate and sanitize the input processed by hooks**. Untrusted input could lead to unexpected behavior.
155
157
***Use proper shell escaping when constructing commands**. This prevents command injection vulnerabilities.
156
158
***Never log sensitive data, such as tokens or passwords**.
157
-
***Ensure hook scripts and logs have the appropriate permissions**.
159
+
***Ensure hook scripts and logs have the appropriate permissions**.
158
160
***Be cautious with hooks that make external network calls**. These can introduce latency, failures, or expose data to third parties.
159
161
***Set appropriate timeouts to prevent resource exhaustion**. Long-running hooks can block agent execution and degrade performance.
160
162
161
163
## Next steps
162
164
163
165
To start creating hooks, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/use-hooks).
0 commit comments