Skip to content
Open
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
1 change: 1 addition & 0 deletions plugin/skills/azure-prepare/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Activate this skill when user wants to:
5. **Validate before deploy** — Invoke azure-validate before azure-deploy
6. **Confirm Azure context** — Use `ask_user` for subscription and location per [Azure Context](references/azure-context.md)
7. ⛔ **Destructive actions require `ask_user`** — [Global Rules](references/global-rules.md)
8. ⛔ **NEVER delete user project directories** — When adding features to an existing project, MODIFY existing files. Templates and `azd init` are for NEW projects only. NEVER run `rm -rf` on user workspace directories.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule #8 states templates/azd init are for new projects only, while global-rules.md currently allows azd init on existing workspaces with explicit confirmation. Align the wording across these documents so the agent doesn’t get conflicting guidance about whether in-place initialization is ever acceptable.

Suggested change
8.**NEVER delete user project directories** — When adding features to an existing project, MODIFY existing files. Templates and `azd init` are for NEW projects only. NEVER run `rm -rf` on user workspace directories.
8.**NEVER delete user project directories** — When adding features to an existing project, MODIFY existing files. Templates and `azd init` are primarily for NEW projects; in existing workspaces, only run `azd init` after explicit user confirmation and in compliance with [Global Rules](references/global-rules.md). NEVER run `rm -rf` on user workspace directories.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an agent follows this instruction exactly it will lose the ability to delete directories for other valid reasons.


---

Expand Down
2 changes: 2 additions & 0 deletions plugin/skills/azure-prepare/references/global-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ ask_user(
- Do NOT assume user wants to delete/overwrite
- Do NOT proceed based on "the user asked to deploy" (deploy ≠ delete old)
- Do NOT batch destructive actions without individual confirmation
- ⛔ Do NOT delete user project directories (`rm -rf <project>`) even when adding features, converting, or migrating — use MODIFY mode to edit existing files instead
- ⛔ `azd init` and template commands are for NEW projects only — NEVER run on an existing workspace without explicit user confirmation
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bullet is internally inconsistent: it says "template commands are for NEW projects only" but then suggests they can be run on an existing workspace with confirmation. To avoid agents treating this as a sanctioned in-place reinit, make the rule explicit (e.g., only run templates in an empty/new directory; if the user explicitly wants a re-init, do it in a separate directory after confirmation).

Suggested change
-`azd init` and template commands are for NEW projects only — NEVER run on an existing workspace without explicit user confirmation
-`azd init` and template commands are for NEW projects only — run them **only** in an empty/new directory. If the user explicitly requests re-initialization of an existing project, create a separate new directory, run the template there, and then migrate changes into the existing project with user-confirmed edits. Never run these commands directly in a non-empty existing workspace.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to say azd init commands with a template in the arguments? You can azd init without a template in an existing workspace.


---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ Templates for hosting MCP (Model Context Protocol) servers on Azure Functions.

**Indicators**: `mcp_tool_trigger`, `MCPTrigger`, `@app.mcp_tool`, project name contains "mcp"

## Standard MCP Templates
> ⚠️ **Warning: Templates are for NEW projects only.**
> If the user has an existing Azure Functions project, do NOT use `azd init` — this will overwrite their workspace.
> For existing projects, use the **recipe approach** instead: [recipes/mcp/](recipes/mcp/README.md).
> ⛔ **NEVER run `rm -rf` or delete the user's project directory.** Destructive actions require `ask_user` confirmation — see [global-rules.md](../../../global-rules.md).
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning mixes an absolute prohibition ("NEVER run rm -rf") with a more permissive statement ("Destructive actions require ask_user confirmation"), which can be read as implying deletion becomes OK after confirmation. Consider rephrasing to keep the policy unambiguous: deleting user workspace directories is prohibited, and refer to global-rules.md only for other destructive actions that may require ask_user.

Suggested change
> **NEVER run `rm -rf` or delete the user's project directory.** Destructive actions require `ask_user` confirmation — see [global-rules.md](../../../global-rules.md).
> **NEVER run `rm -rf` or delete the user's project/workspace directory under any circumstances.** For all other destructive actions (excluding deletion of user workspaces), follow `ask_user` confirmation rules as described in [global-rules.md](../../../global-rules.md).

Copilot uses AI. Check for mistakes.

## When to Use Templates vs. Recipes

| Scenario | Action |
|----------|--------|
| **New project** — no existing code | Use `azd init -t` template below |
| **Existing project** — add MCP support | Use [recipes/mcp/](recipes/mcp/README.md) — modify existing files, do NOT reinitialize |

## Standard MCP Templates (NEW projects only)

| Language | Template |
|----------|----------|
Expand All @@ -13,13 +25,13 @@ Templates for hosting MCP (Model Context Protocol) servers on Azure Functions.
| C# (.NET) | `azd init -t remote-mcp-functions-dotnet` |
| Java | `azd init -t remote-mcp-functions-java` |

## MCP + API Management (OAuth)
## MCP + API Management (OAuth) (NEW projects only)

| Language | Template |
|----------|----------|
| Python | `azd init -t remote-mcp-apim-functions-python` |

## Self-Hosted MCP SDK
## Self-Hosted MCP SDK (NEW projects only)

| Language | Template |
|----------|----------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ This recipe creates functions that respond to blob creation/deletion events via
| **Auth** | Managed Identity (UAMI) |
| **IaC** | ✅ Full template available |

## AZD Templates (Recommended)
## AZD Templates (NEW projects only)

> ⚠️ **Warning:** Use these templates only for **new projects**. If the user has an existing Azure Functions project, use the **Composition Steps** below to modify existing files instead.

Use these templates directly instead of composing from HTTP base:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ This recipe creates functions that respond to row changes in Azure SQL Database
| **Auth** | Entra ID (Managed Identity) |
| **IaC** | ✅ Full template available |

## AZD Templates (Recommended)
## AZD Templates (NEW projects only)

> ⚠️ **Warning:** Use these templates only for **new projects**. If the user has an existing Azure Functions project, use the **Composition Steps** below to modify existing files instead.

Use these templates directly instead of composing from HTTP base:

Expand Down
Loading