diff --git a/plugin/skills/azure-prepare/SKILL.md b/plugin/skills/azure-prepare/SKILL.md index c30ea173..559ceaf3 100644 --- a/plugin/skills/azure-prepare/SKILL.md +++ b/plugin/skills/azure-prepare/SKILL.md @@ -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. --- diff --git a/plugin/skills/azure-prepare/references/global-rules.md b/plugin/skills/azure-prepare/references/global-rules.md index 9cb6c200..3b070b28 100644 --- a/plugin/skills/azure-prepare/references/global-rules.md +++ b/plugin/skills/azure-prepare/references/global-rules.md @@ -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 `) 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 --- diff --git a/plugin/skills/azure-prepare/references/services/functions/templates/mcp.md b/plugin/skills/azure-prepare/references/services/functions/templates/mcp.md index 669f2d6b..5e3036d0 100644 --- a/plugin/skills/azure-prepare/references/services/functions/templates/mcp.md +++ b/plugin/skills/azure-prepare/references/services/functions/templates/mcp.md @@ -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). + +## 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 | |----------|----------| @@ -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 | |----------|----------| diff --git a/plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/README.md b/plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/README.md index f28d3353..61e5dde8 100644 --- a/plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/README.md +++ b/plugin/skills/azure-prepare/references/services/functions/templates/recipes/blob-eventgrid/README.md @@ -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: diff --git a/plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/README.md b/plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/README.md index f24f3ab3..d1318b3b 100644 --- a/plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/README.md +++ b/plugin/skills/azure-prepare/references/services/functions/templates/recipes/sql/README.md @@ -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: