From 35e859634e0765ec3e2842e901d9bd8a297ec4e6 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Sat, 16 May 2026 15:21:48 -0700 Subject: [PATCH 1/2] Minimal repro skill --- .github/skills/minimal-repro/SKILL.md | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/skills/minimal-repro/SKILL.md diff --git a/.github/skills/minimal-repro/SKILL.md b/.github/skills/minimal-repro/SKILL.md new file mode 100644 index 00000000000..406efd192da --- /dev/null +++ b/.github/skills/minimal-repro/SKILL.md @@ -0,0 +1,39 @@ +--- +name: minimal-repro +description: > + Help create a minimal reproduction for a TypeSpec compiler or emitter bug. + Use when a user provides TypeSpec source (pasted code or a GitHub URL) and + describes an issue. Reproduces locally and reduces to a single-file 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 ` 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](https://typespec.io/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 repros 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. From 7ad1d69bc6f2feb83bc35df191a544cdba209161 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 18 May 2026 06:30:45 -0700 Subject: [PATCH 2/2] fix spell check --- .github/skills/minimal-repro/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/skills/minimal-repro/SKILL.md b/.github/skills/minimal-repro/SKILL.md index 406efd192da..8af10b3bebf 100644 --- a/.github/skills/minimal-repro/SKILL.md +++ b/.github/skills/minimal-repro/SKILL.md @@ -33,7 +33,7 @@ If the repro needs packages NOT in the workspace (e.g., `@azure-tools/*`), use a ## Tips -- Most repros reduce to a single file with no namespaces needed. +- 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.