|
1 | | -## Script Language Choice |
2 | | - |
3 | | -Hooks can execute scripts in many languages: shell, PowerShell, Python, C#, and more. However, not all script types are available on every platform, and some require extra dependencies: |
4 | | - |
5 | | -- **Shell scripts** (`bash`, `sh`) are not available on Windows by default. |
6 | | -- **PowerShell** is Windows-native but available cross-platform if installed. |
7 | | -- **Python** is widely used for hooks due to its cross-platform nature, but requires Python to be installed on the system. |
8 | | -- **C#** scripts (with `dotnet-script` or file-based C#) are a good fit for .NET projects, but require the .NET SDK. |
9 | | -- **Node.js**, **Go**, and others are possible if the runtime is present. |
10 | | - |
11 | | -**Best practice:** Always ask the user which language/tool to use for hook scripts, and confirm that the required runtime is available in the target environment. If unsure, suggest a default based on the project stack. |
12 | | - |
13 | | -**Example prompt:** |
14 | | -> "What language/tool do you want to use for this hook script? (C#, Python, shell, etc.)" |
15 | | -
|
16 | | -If you use Python, check that it is installed before relying on it. For C#, prefer file-based scripts for portability. |
17 | | - |
18 | 1 | --- |
19 | 2 | name: copilot-hooks |
20 | 3 | description: > |
@@ -71,3 +54,21 @@ When creating or editing hooks, produce: |
71 | 54 | - Do not assume one runtime payload shape; support documented and observed variants. |
72 | 55 | - For deny decisions, always include a human-readable reason. |
73 | 56 | - Avoid project-specific naming unless the user explicitly requests it. |
| 57 | + |
| 58 | +## Script Language Choice |
| 59 | + |
| 60 | +Hooks can execute scripts in many languages: shell, PowerShell, Python, C#, and more. However, not all script types are available on every platform, and some require extra dependencies: |
| 61 | + |
| 62 | +- **Shell scripts** (`bash`, `sh`) are not available on Windows by default. |
| 63 | +- **PowerShell** is Windows-native but available cross-platform if installed. |
| 64 | +- **Python** is widely used for hooks due to its cross-platform nature, but requires Python to be installed on the system. |
| 65 | +- **C#** scripts (with `dotnet-script` or file-based C#) are a good fit for .NET projects, but require the .NET SDK. |
| 66 | +- **Node.js**, **Go**, and others are possible if the runtime is present. |
| 67 | + |
| 68 | +**Best practice:** Always ask the user which language/tool to use for hook scripts, and confirm that the required runtime is available in the target environment. If unsure, suggest a default based on the project stack. |
| 69 | + |
| 70 | +**Example prompt:** |
| 71 | +> "What language/tool do you want to use for this hook script? (C#, Python, shell, etc.)" |
| 72 | +
|
| 73 | +If you use Python, check that it is installed before relying on it. For C#, prefer file-based scripts for portability. |
| 74 | + |
0 commit comments