microsoft/typespec/diff-upstream
Claude Code and agent skill by microsoft/typespec
- vendor
Checking that the SKILL.md file is still in the repository.
Regenerate the local emitter and diff the generated code against the upstream baseline checked into autorest.python. Use this skill when the user wants to see how their emitter changes affect generated code compared to what's currently in production, says things like "diff upstream", "compare to baseline", "what changed vs production", "show me the diff", "how does this affect generated code", or wants to validate their changes produce the expected output differences.
Install
npx vskill@latest install microsoft/typespec/diff-upstreamSKILL.md
The same SKILL.md was published earlier as microsoft/typespec/diff-upstream.
Diff Upstream Skill
Regenerates local emitter output and compares it against the baseline generated code checked into the autorest.python repository. Shows exactly what would change if the current emitter changes were shipped.
Optimized for local development with cached baseline and editor integration.
Paths
All paths are relative to the http-client-python package root.
| Item | Path | |
|---|---|---|
| Package root | ~/Desktop/github/typespec/packages/http-client-python | |
| Local generated (unbranded) | generator/test/unbranded/generated | |
| Local generated (azure) | generator/test/azure/generated | |
| Baseline cache (unbranded) | generator/test/unbranded/.baseline (gitignored) | |
| Baseline cache (azure) | generator/test/azure/.baseline (gitignored) | |
| Diff summary output | generator/test/.diff-summary.md (gitignored) | |
| Regenerate marker | .last-regenerate | |
| Upstream repo | https://github.com/Azure/autorest.python |
Workflow
Step 1: Build and regenerate
Always regenerate to see current changes:
If build or regenerate fails, report errors and stop.
Step 2: Fetch or update baseline
Fetch baseline files directly into the test folders using sparse checkout:
Step 3: Generate diff summary
Create a markdown summary file with package-level comparison:
Step 4: Open in editor
Open the summary file in the user's preferred editor:
Step 5: Report to user
Tell the user:
- Summary file is open at
generator/test/.diff-summary.md - Baseline is cached alongside generated code in
generator/test/*/.baseline/ - How to view detailed diffs (commands are in the summary file)
- How to refresh baseline:
rm -rf generator/test/*/.baseline
Viewing Detailed File Diffs
After showing the summary, if the user wants to see specific file changes:
Find changed files in a package:
Show inline diff for a file:
VS Code side-by-side (if user has VS Code):
Integration with test-unbranded-emitter
After running diff-upstream, you can immediately run tests:
- The
.last-regeneratemarker is updated test-unbranded-emitterwill skip regeneration since it's fresh
Cleanup
The baseline is cached for fast subsequent runs. To refresh:
Gitignore
These patterns should be in .gitignore:
Interpreting Diffs
After generating the diff, analyze what changed and report to the user whether the diffs are expected.
Step 1: Check what code changes were made on the branch
First, understand what emitter changes were made:
Step 2: Correlate code changes with expected generated output changes
Based on the emitter changes, determine what generated code SHOULD change:
| Emitter change type | Expected generated code impact | |
|---|---|---|
| Namespace logic refactor (behavior-preserving) | No generated code changes | |
| New decorator support | Changes in files using that decorator | |
| Serialization changes | Changes in _serialization.py, model files | |
| Client initialization changes | Changes in _client.py, _configuration.py | |
| Operation changes | Changes in _operations/*.py |
Step 3: Compare expected vs actual diffs
- If actual diffs match expected: Tell user "The diffs are expected based on your emitter changes to [describe changes]. The generated code correctly reflects your modifications."
- If no diffs but expected some: Tell user "No generated code changes detected. If you expected changes, verify your emitter modifications are being triggered by the test specs, or there may be more development needed. Should I investigate further?"
- If unexpected diffs appear: Tell user "Found unexpected changes in [files]. These don't appear to match your emitter modifications. There may be unintended side effects - would you like me to investigate?"
Pre-existing repo differences (always present, not caused by your changes)
These diffs exist between typespec and autorest.python repos regardless of emitter changes. They should be ignored when evaluating your changes:
| File type | Typical diff | Cause | |
|---|---|---|---|
_patch.py | List[str] → list[str] | Type hint modernization (Python 3.9+ style) | |
CHANGELOG.md | Formatting differences | Template differences | |
README.md | Service display names | Template/config differences | |
pyproject.toml / setup.py | Different packaging | Tooling preferences |
If only these files differ: "The only diffs are pre-existing repo differences (type hints, config files), not caused by your emitter changes. Your changes are behavior-preserving."
Unexpected diffs (actual code changes)
If you see differences in these files, the emitter changes ARE affecting generated code:
_client.py- Client class definitions_operations/*.py- Operation implementationsmodels/*.py- Model definitions (excluding_patch.py)_serialization.py- Serialization logicaio/*.py- Async client code
If these files differ: First check if the changes match what the emitter modifications should produce. If they match, say "The generated code changes are expected based on your emitter changes." If they don't match or are unexpected, say "Found changes that don't appear to match your emitter modifications. There may be more development needed - would you like me to investigate?"
Quick diff analysis command
To check if there are actual code changes (excluding expected differences):
If this returns nothing, only expected diffs exist.
Notes
Diff direction
The diff shows changes from upstream (baseline) to local (your changes):
-lines: removed from upstream (or changed)+lines: added in your local version
Why packages might be missing locally
Some upstream packages may not generate locally due to:
- TypeSpec version incompatibilities in the monorepo
- Specs that require specific dependencies not installed
- Test configurations that differ between repos
This is expected for ARM/azure-resource-manager specs if there are version conflicts.
Performance
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 30 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/http-client-python/.github/skills/diff-upstream/SKILL.md
Popularity
- Repository stars
- 5,906
- Repository forks
- 416
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/typespec/diff-upstream)