Context
Part of the epic #59658 — Auto-repair custom-code build failures in generated SDK PRs using the Generator Agent. Refines/amends #59653, which currently says to make the existing dpg-migration / mpg-migration skills available to the cloud agent.
Problem
The dpg-migration / mpg-migration skills are built for a full Swagger→TypeSpec migration, not for repairing an already-generated SDK PR. Reusing them in the cloud-agent repair flow is a poor fit and partly a failure mode:
- Requires a spec repo and prompts the user for it —
dpg-migration states localSpecsPath is "always required" and instructs the agent to ask the user for it. The cloud agent runs non-interactively in an ephemeral env with no spec checkout; this is an immediate blocker.
- Generation-mode + spec-edit logic (remote/local mode,
client.tsp/tspconfig.yaml edits, commit_iteration) — irrelevant; the repair flow never edits the spec or regenerates from it.
- Migration-only phases —
pregen_cleanup, migrate_test_samples, finalize_migration (runs Export-API.ps1 + Update-Snippets.ps1), generator-bug diagnosis. None belong in a bounded build-repair, and some would produce unwanted diffs.
Pointing the agent at all of this bloats context and invites wrong actions.
Proposal
Author a thin, purpose-built auto-build-repair skill scoped to exactly:
The SDK PR already exists; the build failed because of custom (non-generated) code; patch only custom code until the package builds; never modify Generated/; stop when bounded.
It reuses the same generator-agent MCP tools, but only the build-fix-loop subset:
build_and_classify → classify_errors → batch_fix (+ targeted fixers: add_using_directive, nullable_annotation_fix, add_codegen_suppress, rename_codegen_type, fetch_to_fromlro) → rebuild → verify_generated_unchanged.
Plus:
Structural options
- Standalone thin skill (recommended for MVP) — small duplication of the build-fix-loop section.
- Factor out a shared
generator-agent-build-fix core skill that dpg-migration, mpg-migration, and this repair skill all compose (DRY, since both migration skills already embed this loop). Cleaner long-term; treat as Phase 2 hardening.
Sequencing
Author after the feasibility spike #59650 confirms the cloud-agent loop, tool subset, and bounds — so the skill reflects the validated flow rather than assumptions.
Acceptance criteria
--generated by Copilot
Context
Part of the epic #59658 — Auto-repair custom-code build failures in generated SDK PRs using the Generator Agent. Refines/amends #59653, which currently says to make the existing
dpg-migration/mpg-migrationskills available to the cloud agent.Problem
The
dpg-migration/mpg-migrationskills are built for a full Swagger→TypeSpec migration, not for repairing an already-generated SDK PR. Reusing them in the cloud-agent repair flow is a poor fit and partly a failure mode:dpg-migrationstateslocalSpecsPathis "always required" and instructs the agent to ask the user for it. The cloud agent runs non-interactively in an ephemeral env with no spec checkout; this is an immediate blocker.client.tsp/tspconfig.yamledits,commit_iteration) — irrelevant; the repair flow never edits the spec or regenerates from it.pregen_cleanup,migrate_test_samples,finalize_migration(runsExport-API.ps1+Update-Snippets.ps1), generator-bug diagnosis. None belong in a bounded build-repair, and some would produce unwanted diffs.Pointing the agent at all of this bloats context and invites wrong actions.
Proposal
Author a thin, purpose-built
auto-build-repairskill scoped to exactly:It reuses the same
generator-agentMCP tools, but only the build-fix-loop subset:build_and_classify→classify_errors→batch_fix(+ targeted fixers:add_using_directive,nullable_annotation_fix,add_codegen_suppress,rename_codegen_type,fetch_to_fromlro) → rebuild →verify_generated_unchanged.Plus:
Structural options
generator-agent-build-fixcore skill thatdpg-migration,mpg-migration, and this repair skill all compose (DRY, since both migration skills already embed this loop). Cleaner long-term; treat as Phase 2 hardening.Sequencing
Author after the feasibility spike #59650 confirms the cloud-agent loop, tool subset, and bounds — so the skill reflects the validated flow rather than assumptions.
Acceptance criteria
auto-build-repairskill exists, self-contained, no interactive prompts, no migration-only phases.Generated/immutability.--generated by Copilot