Skip to content

Commit dfd0361

Browse files
samvaityCopilot
andcommitted
Add guardrails against manual fallback in azure-typespec-author skill
When azsdk_typespec_generate_authoring_plan fails (e.g. auth errors or timeouts), the agent proceeds to make manual TypeSpec edits instead of stopping. Add explicit constraints and troubleshooting guidance to stop and report the error to the user. Fixes #15458 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 706ef19 commit dfd0361

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

  • .github/skills/azure-typespec-author
  • plugins/azure-sdk-tools/skills/azure-typespec-author

.github/skills/azure-typespec-author/SKILL.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ The `azure-typespec-author` skill **must** be invoked immediately in all modes (
3636
- **Always validate** — run every steps in [validation](references/validation.md) after every edit.
3737
- **Always cite references** — provide links that justify the approach.
3838
- **Follow the authoring plan exactly** — code changes in Step 4 MUST follow the authoring plan generated in Step 3. Do not deviate by referring to existing code patterns in the TypeSpec project; the authoring plan is the single source of truth for what to change.
39+
- **NEVER proceed with manual edits if an MCP tool call fails.** If `azsdk_typespec_generate_authoring_plan` or `azsdk_run_typespec_validation` fails (due to authentication errors, timeouts, or other issues), **stop and report the error to the user**. Do not attempt to author or validate TypeSpec changes without the tool — the authoring plan provides grounded guidance that cannot be reliably replicated manually.
3940

4041
## Workflow
4142

@@ -88,3 +89,8 @@ Output all referenced document URLs from Step 3. This gives the user direct link
8889
- "Add a new preview API version 2026-01-01-preview for widget resource manager"
8990
- "Add an ARM resource named Asset with CRUD operations"
9091
- "Add a new property to the Widget model"
92+
93+
## Troubleshooting
94+
95+
- If `azsdk_typespec_generate_authoring_plan` fails with an authentication error, stop and ask the user to authenticate. Do not proceed with manual TypeSpec edits.
96+
- If a tool call times out, report the error and suggest retrying. Do not attempt to replicate the tool's behavior manually.

plugins/azure-sdk-tools/skills/azure-typespec-author/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ compatibility: "azure-sdk-mcp server with azsdk_typespec_generate_authoring_plan
2626
- **Always validate** — run every steps in [validation](references/validation.md) after every edit.
2727
- **Always cite references** — provide links that justify the approach.
2828
- **Follow the authoring plan exactly** — code changes in Step 4 MUST follow the authoring plan generated in Step 3. Do not deviate by referring to existing code patterns in the TypeSpec project; the authoring plan is the single source of truth for what to change.
29+
- **NEVER proceed with manual edits if an MCP tool call fails.** If `azsdk_typespec_generate_authoring_plan` or `azsdk_run_typespec_validation` fails (due to authentication errors, timeouts, or other issues), **stop and report the error to the user**. Do not attempt to author or validate TypeSpec changes without the tool — the authoring plan provides grounded guidance that cannot be reliably replicated manually.
2930

3031
---
3132

@@ -120,3 +121,5 @@ See [validation guide](references/validation.md) for sub-steps. You must run Typ
120121

121122
- **TypeSpec validation fails** — display all errors, provide fix suggestions, re-run validation.
122123
- **API Version Evolution** — use the versioning guide URLs in the [version evolution reference](references/api-version-evolution.md); do not call the authoring plan tool.
124+
- If `azsdk_typespec_generate_authoring_plan` fails with an authentication error, stop and ask the user to authenticate. Do not proceed with manual TypeSpec edits.
125+
- If a tool call times out, report the error and suggest retrying. Do not attempt to replicate the tool's behavior manually.

0 commit comments

Comments
 (0)