minimal-repro

โดย microsoft

ช่วยสร้างการจำลองขั้นต่ำสำหรับบั๊กของคอมไพเลอร์หรืออีมิตเตอร์ TypeSpec ใช้เมื่อผู้ใช้ระบุซอร์ส TypeSpec (โค้ดที่วางหรือ URL GitHub) และอธิบาย…

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.

Skills เพิ่มเติมจาก microsoft

oss-growth
microsoft
บุคลิกภาพนักเติบโตโอเอสเอส
official
accessibility-aria-expert
microsoft
ตรวจจับและแก้ไขปัญหาการเข้าถึงใน React/Fluent UI webviews ใช้เมื่อตรวจสอบโค้ดเพื่อความเข้ากันได้กับโปรแกรมอ่านหน้าจอ แก้ไขป้ายกำกับ ARIA ทำให้มั่นใจว่า…
official
generate-canvas-app
microsoft
[เลิกใช้งานแล้ว — ใช้ canvas-app แทน] สร้างแอป Canvas ของ Power Apps ที่สมบูรณ์
official
django
microsoft
แนวทางปฏิบัติที่ดีที่สุดสำหรับการพัฒนาเว็บ Django รวมถึงโมเดล วิว เทมเพลต และการทดสอบ
official
github-issue-creator
microsoft
แปลงบันทึกดิบ บันทึกข้อผิดพลาด การเขียนตามคำบอก หรือภาพหน้าจอ ให้เป็นรายงานปัญหาที่ชัดเจนในรูปแบบ GitHub-flavored markdown ใช้เมื่อผู้ใช้วางข้อมูลบั๊ก ข้อผิดพลาด...
official
python-package-management
microsoft
ใช้ uv สำหรับการจัดการ dependencies และ poethepoet สำหรับการทำงานอัตโนมัติ
official
runtime-validation
microsoft
การตรวจสอบความถูกต้องขณะรันไทม์สำหรับแอปพลิเคชันที่ถูกย้าย — ครอบคลุมกลยุทธ์การทดสอบ (ระยะการวางแผน) และการดำเนินการทดสอบ (ระยะการตรวจสอบความถูกต้อง): การตรวจสอบการเริ่มต้นระบบ,…
official
azure-postgres-ts
microsoft
เชื่อมต่อกับ Azure Database for PostgreSQL Flexible Server โดยใช้แพ็กเกจ pg (node-postgres) ที่รองรับการยืนยันตัวตนด้วยรหัสผ่านและ Microsoft Entra ID (แบบไม่ใช้รหัสผ่าน)
official