minimal-repro

bởi microsoft

Giúp tạo một bản tái hiện tối thiểu cho lỗi trình biên dịch hoặc bộ phát TypeSpec. Sử dụng khi người dùng cung cấp mã nguồn TypeSpec (mã được dán hoặc URL GitHub) và mô tả…

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.

Thêm skills từ microsoft

oss-growth
microsoft
Cá tính tăng trưởng OSS
official
accessibility-aria-expert
microsoft
Phát hiện và sửa các vấn đề về khả năng tiếp cận trong giao diện web React/Fluent UI. Sử dụng khi xem xét mã để đảm bảo tương thích với trình đọc màn hình, sửa nhãn ARIA, đảm bảo…
official
generate-canvas-app
microsoft
[DEPRECATED — sử dụng canvas-app thay thế] Tạo một ứng dụng canvas Power Apps hoàn chỉnh.
official
django
microsoft
Các phương pháp tốt nhất cho phát triển web Django bao gồm models, views, templates và testing.
official
github-issue-creator
microsoft
Chuyển đổi ghi chú thô, nhật ký lỗi, ghi âm giọng nói hoặc ảnh chụp màn hình thành báo cáo vấn đề markdown sắc nét theo phong cách GitHub. Sử dụng khi người dùng dán thông tin lỗi, lỗi…
official
python-package-management
microsoft
Sử dụng uv để quản lý phụ thuộc và poethepoet để tự động hóa tác vụ.
official
runtime-validation
microsoft
Xác thực thời gian chạy cho các ứng dụng đã di chuyển — bao gồm chiến lược kiểm thử (giai đoạn lập kế hoạch) và thực thi kiểm thử (giai đoạn xác thực): xác minh khởi động,…
official
azure-postgres-ts
microsoft
Kết nối đến Azure Database for PostgreSQL Flexible Server bằng gói pg (node-postgres) với hỗ trợ xác thực mật khẩu và Microsoft Entra ID (không mật khẩu).
official