Skip to content

Commit 46d3634

Browse files
authored
Move global-rules.md (#826)
* Move global-rules.md Related to #812. The plugin/skills/_shared/global-rules.md file includes instructions about how to handle destructive operations and the importance of confirming subscription IDs and regions with the user. The idea is that these instructions apply to multiple skills so they should be picked up from a single shared file. However, skills are not able to reference files outside of their directory and as such this file is never read by the LM. This makes sense from a security point of view--you wouldn't want a skill to be able to read in an arbitrary file from the file system. In YOLO/autopilot mode Copilot won't even ask for permission before reading the file. The instructions about destructive operations are especially important, so for the moment we solve this issue by copying the global-rules.md file to each of the three skills (`azure-prepare`, `azure-validate`, `azure-deploy`) that currently use it. * Fix references Fix references to pre-deploy-checklist.md. In a couple of cases this means removing the reference as it points to a file in a different skill, and that will never be loaded.
1 parent 4777c0e commit 46d3634

File tree

6 files changed

+84
-4
lines changed

6 files changed

+84
-4
lines changed

plugin/skills/azure-deploy/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Activate this skill when user wants to:
2424
1. Run after azure-prepare and azure-validate
2525
2. Manifest must exist with status `Validated`
2626
3. **Pre-deploy checklist required**[pre-deploy-checklist](references/pre-deploy-checklist.md)
27-
4.**Destructive actions require `ask_user`**[global-rules](../_shared/global-rules.md)
27+
4.**Destructive actions require `ask_user`**[global-rules](references/global-rules.md)
2828

2929
---
3030

plugin/skills/_shared/global-rules.md renamed to plugin/skills/azure-deploy/references/global-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ ask_user(
3939
- Azure subscription (show actual name and ID)
4040
- Azure region/location
4141

42-
See [pre-deploy-checklist](../azure-deploy/references/pre-deploy-checklist.md).
42+
See [pre-deploy-checklist](pre-deploy-checklist.md).

plugin/skills/azure-prepare/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Activate this skill when user wants to:
3131
4. Follow linked references for best practices and guidance
3232
5. Update `.azure/preparation-manifest.md` after each phase
3333
6. Invoke **azure-validate** before any deployment
34-
7.**Destructive actions require `ask_user`**[global-rules](../_shared/global-rules.md)
34+
7.**Destructive actions require `ask_user`**[global-rules](references/global-rules.md)
3535

3636
> **⛔ MANDATORY USER CONFIRMATION REQUIRED**
3737
>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Global Rules
2+
3+
> **MANDATORY** — These rules apply to ALL skills. Violations are unacceptable.
4+
5+
## Rule 1: Destructive Actions Require User Confirmation
6+
7+
**ALWAYS use `ask_user`** before ANY destructive action.
8+
9+
### What is Destructive?
10+
11+
| Category | Examples |
12+
|----------|----------|
13+
| **Delete** | `az group delete`, `azd down`, `rm -rf`, delete resource |
14+
| **Overwrite** | Replace existing files, overwrite config, reset settings |
15+
| **Irreversible** | Purge Key Vault, delete storage account, drop database |
16+
| **Cost Impact** | Provision expensive resources, scale up significantly |
17+
| **Security** | Expose secrets, change access policies, modify RBAC |
18+
19+
### How to Confirm
20+
21+
```
22+
ask_user(
23+
question: "This will permanently delete resource group 'rg-myapp'. Continue?",
24+
choices: ["Yes, delete it", "No, cancel"]
25+
)
26+
```
27+
28+
### No Exceptions
29+
30+
- Do NOT assume user wants to delete/overwrite
31+
- Do NOT proceed based on "the user asked to deploy" (deploy ≠ delete old)
32+
- Do NOT batch destructive actions without individual confirmation
33+
34+
---
35+
36+
## Rule 2: Never Assume Subscription or Location
37+
38+
**ALWAYS use `ask_user`** to confirm:
39+
- Azure subscription (show actual name and ID)
40+
- Azure region/location

plugin/skills/azure-validate/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ description: "**CRITICAL**: Run azure-validate before deploying Azure resources.
1818

1919
1. Run after azure-prepare, before azure-deploy
2020
2. All checks must pass—do not deploy with failures
21-
3.**Destructive actions require `ask_user`**[global-rules](../_shared/global-rules.md)
21+
3.**Destructive actions require `ask_user`**[global-rules](references/global-rules.md)
2222

2323
## Steps
2424

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Global Rules
2+
3+
> **MANDATORY** — These rules apply to ALL skills. Violations are unacceptable.
4+
5+
## Rule 1: Destructive Actions Require User Confirmation
6+
7+
**ALWAYS use `ask_user`** before ANY destructive action.
8+
9+
### What is Destructive?
10+
11+
| Category | Examples |
12+
|----------|----------|
13+
| **Delete** | `az group delete`, `azd down`, `rm -rf`, delete resource |
14+
| **Overwrite** | Replace existing files, overwrite config, reset settings |
15+
| **Irreversible** | Purge Key Vault, delete storage account, drop database |
16+
| **Cost Impact** | Provision expensive resources, scale up significantly |
17+
| **Security** | Expose secrets, change access policies, modify RBAC |
18+
19+
### How to Confirm
20+
21+
```
22+
ask_user(
23+
question: "This will permanently delete resource group 'rg-myapp'. Continue?",
24+
choices: ["Yes, delete it", "No, cancel"]
25+
)
26+
```
27+
28+
### No Exceptions
29+
30+
- Do NOT assume user wants to delete/overwrite
31+
- Do NOT proceed based on "the user asked to deploy" (deploy ≠ delete old)
32+
- Do NOT batch destructive actions without individual confirmation
33+
34+
---
35+
36+
## Rule 2: Never Assume Subscription or Location
37+
38+
**ALWAYS use `ask_user`** to confirm:
39+
- Azure subscription (show actual name and ID)
40+
- Azure region/location

0 commit comments

Comments
 (0)