-
Notifications
You must be signed in to change notification settings - Fork 382
Minimal repro skill #10711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
timotheeguerin
merged 2 commits into
microsoft:main
from
timotheeguerin:minimal-repro-skill
Jun 1, 2026
Merged
Minimal repro skill #10711
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <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](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 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. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.