microsoft/test-unbranded-emitter
> Build and test the @typespec/http-client-python emitter. Use this skill whenever the user wants to test their local changes to the emitter, run the generator test suite, check if their http-client-python changes are passing, or validate a fix. Triggers on phrases like "test the emitter", "run tests", "check if my changes in the emitter package.
npx skills add https://github.com/microsoft/typespec --skill test-unbranded-emitter
Builds and tests @typespec/http-client-python to validate local changes.
Automatically regenerates if the generated code is stale.
All paths are relative to the http-client-python package root:
~/Desktop/github/typespec/packages/http-client-python
| Item | Path |
| --------------------- | ------------------------------------------------------- |
| Package root | ~/Desktop/github/typespec/packages/http-client-python |
| Emitter source | emitter/src |
| Generated (unbranded) | generator/test/unbranded/generated |
| Generated (azure) | generator/test/azure/generated |
| Regenerate marker | .last-regenerate |
cd ~/Desktop/github/typespec/packages/http-client-python
npm run build
Check for TypeScript compilation errors. If the build fails, report the errors
to the user and stop — do not proceed to testing.
Regeneration is needed if ANY of these conditions are true:
cd ~/Desktop/github/typespec/packages/http-client-python
if [ ! -d "generator/test/unbranded/generated" ] \
|| [ -z "$(ls -A generator/test/unbranded/generated 2> /dev/null)" ]; then
echo "Unbranded generated folder is empty - regeneration needed"
fi
if [ ! -d "generator/test/azure/generated" ] \
|| [ -z "$(ls -A generator/test/azure/generated 2> /dev/null)" ]; then
echo "Azure generated folder is empty - regeneration needed"
fi
if [ ! -f ".last-regenerate" ]; then
echo "No regenerate marker - regeneration needed"
fi
if [ -n "$(find emitter/src -newer .last-regenerate -type f 2> /dev/null | head -1)" ]; then
echo "Emitter source changed since last regenerate - regeneration needed"
fi
If any condition from Step 2 is true:
cd ~/Desktop/github/typespec/packages/http-client-python
echo "Regenerating test clients..."
npm run regenerate
After successful regeneration, update the marker:
touch .last-regenerate
If regeneration fails, report the error and stop.
If regeneration is NOT needed, inform the user:
> "Generated code is up to date (source unchanged since last regeneration). Skipping regenerate."
cd ~/Desktop/github/typespec/packages/http-client-python
npm run ci
This runs:
test:emitter - vitest unit tests for the emitterci:generator - pytest tests against generated codeThe full CI can take several minutes. Keep the user informed that it's running.
Offer to help debug or investigate specific failures.
Both skills share the regeneration marker system:
diff-upstream always regenerates and updates .last-regeneratetest-unbranded-emitter checks this marker and skips regeneration if freshEfficient workflow:
diff-upstream → test-unbranded-emitter
The second command will skip regeneration since diff-upstream just did it.
Standalone workflow:
test-unbranded-emitter
Will regenerate only if source changed since last run.
npm run regenerate can take 2-3 minutes. The staleness check avoids this delay
when the user is iterating on test fixes (not emitter changes).
| Command | What it runs | Duration |
| ------------------------ | ------------------------- | ------------ |
| npm run test:emitter | vitest unit tests only | ~5 seconds |
| npm run test:generator | pytest only (no vitest) | ~2 minutes |
| npm run ci | vitest + pytest (full CI) | ~2-3 minutes |
This skill runs npm run ci (full CI). If the user wants just unit tests or
just pytest, they can ask specifically.
The test server teardown sometimes fails with ProcessLookupError - this is a
pre-existing infrastructure issue, not a test failure. All actual tests may pass
even if you see this error at the end.
If the user suspects stale generated code despite the marker, they can force
regeneration:
rm ~/Desktop/github/typespec/packages/http-client-python/.last-regenerate
Then run the skill again.
Ensure this entry is in the package's .gitignore:
.last-regenerate
Take microsoft/test-unbranded-emitter from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.