minimal-repro

Hilf dabei, eine minimale Reproduktion für einen TypeSpec-Compiler- oder Emitter-Bug zu erstellen. Verwende dies, wenn ein Benutzer TypeSpec-Quellcode (eingefügten Code oder eine GitHub-URL) bereitstellt und beschreibt…

npx skills add https://github.com/microsoft/typespec --skill minimal-repro

Minimal Reproduction

Reduce a user-reported TypeSpec bug to the smallest single .tsp file that still triggers the issue.

Inputs

  • TypeSpec source (pasted or GitHub URL)
  • Error description (diagnostic code, message, or incorrect emitter output)

Environment

Use packages/samples/scratch/ as the working directory — it's gitignored and the packages/samples package already depends on compiler, http, rest, openapi3, versioning, json-schema, etc.

If the repro needs packages NOT in the workspace (e.g., @azure-tools/*), use a temp folder with npm install instead.

Steps

  1. Reproduce — Write the user's code to packages/samples/scratch/main.tsp, compile with npx tsp compile main.tsp (add --emit <emitter> if relevant), and confirm the same error occurs.

  2. Minimize — Iteratively remove code (unused imports, models, properties, decorators, operations, namespaces) and re-compile after each removal. Keep only what's needed to trigger the same error. Undo any removal that makes the error disappear.

  3. Present — Show the final minimal .tsp, the compile command, and the error output. Suggest pasting into a GitHub issue or the TypeSpec Playground.

  4. Cleanup — Remove scratch files (rm -f packages/samples/scratch/*.tsp packages/samples/scratch/tspconfig.yaml && rm -rf packages/samples/scratch/tsp-output).

Tips

  • Most reproductions reduce to a single file with no namespaces needed.
  • Remove @service, @server, @doc, @info early — they're rarely relevant.
  • Combine multi-file code into one file by inlining.
  • If the error doesn't reproduce, check for missing import/using statements.

Mehr Skills von microsoft

python-kwargs-setattr-security
microsoft
Beim Überprüfen oder Beheben von Python-Code, der setattr() mit benutzergesteuerten kwargs verwendet, um C++-Erweiterungsobjekte (SessionOptions, RunOptions usw.) zu konfigurieren…
oss-growth
microsoft
OSS-Wachstums-Hacker-Persona
infopath-to-canvas
microsoft
Migrieren Sie ein Microsoft InfoPath-Formular (.xsn) in eine Power Apps Canvas-App. VERWENDEN SIE DIES, wenn der Benutzer ein InfoPath-Formular/eine InfoPath-Vorlage nach Canvas konvertieren, portieren oder migrieren möchte…
winui-code-review
microsoft
Codequalitätsüberprüfung für WinUI 3-Apps — MVVM-Konformität, x:Bind-Korrektheit, Barrierefreiheit, Theming, Sicherheit und Leistung. Vor dem Commit verwenden, um … zu erkennen.
accessibility-aria-expert
microsoft
Erkennt und behebt Barrierefreiheitsprobleme in React/Fluent UI-Webansichten. Verwenden Sie dies bei der Überprüfung von Code auf Bildschirmleser-Kompatibilität, beim Korrigieren von ARIA-Labels, beim Sicherstellen…
generate-canvas-app
microsoft
[VERALTET — stattdessen canvas-app verwenden] Erstellt eine vollständige Power Apps Canvas-App.
review-staged
microsoft
Generate structured code review for staged files AND all branch commits since main, using Claude Code agents. Provides full PR-equivalent coverage before…
python-development
microsoft
Codierungsstandards, Konventionen und Muster für die Entwicklung von Python-Code im Agent-Framework-Repository. Verwenden Sie dies beim Schreiben oder Ändern von Python-Quellcode…