typespec
Copilot instructions5.9k starsChanged 4 months agoMITView on GitHub
ALWAYS follow these instructions first and only fall back to additional search and context gathering if the information here is incomplete or found to be in error. TypeSpec is a language for defining cloud service APIs and shapes. This monorepo contains the TypeSpec compiler, standard library packages, tools, documentation, and various language client emitters. [!IMPORTANT] These instructions do NOT apply to the language emitter packages (http-client-csharp, http-client-java, http-client-python). Those packages are excluded from the pnpm workspace and do not require…
- Installs packages
Trending
Quiet since September.about the whole repository
Who's talking about microsoft/typespec
- neovim/nvim-lspconfig“Support for typespec”GitHub · Jan 23, 2024 · 11 reactions
- github-linguist/linguist“Add TypeSpec”GitHub · Mar 27, 2024 · 9 reactions
- orval-labs/orval“Support unevaluatedProperties OpenAPI 3.1”GitHub · Jun 11, 2025 · 5 reactions
- Azure/autorest.typescript“Emitters should not crash on purpose”GitHub · Feb 20, 2025 · 2 reactions
- Azure/azure-sdk-for-java“Finalize removing JUnit, Reactor Test, and SLF4J Simple test dependencies”GitHub · Sep 25, 2024 · 2 reactions
The biggest 5 of 37 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 37
Talked about on GitHub, Bluesky and Hacker News (37 times).
On GitHub · 32
- Jan 23, 2024Support for typespec — neovim/nvim-lspconfig11 reactions · 3 comments
- Mar 27, 2024Add TypeSpec — github-linguist/linguist9 reactions · 10 comments
- Jun 11, 2025Support unevaluatedProperties OpenAPI 3.1 — orval-labs/orval5 reactions · 1 comment
- Feb 20, 2025Emitters should not crash on purpose — Azure/autorest.typescript2 reactions
- Sep 25, 2024Finalize removing JUnit, Reactor Test, and SLF4J Simple test dependencies — Azure/azure-sdk-for-java2 reactions · 1 comment
27 more on GitHub
- Sep 20, 2026deps(deps-dev): bump the lockfile-updates group in /tools/schema-sync with 4 updates — Imagine-That-Ai/BurnBar1 reaction · 5 comments
- Sep 10, 2026Design required: asynchronous messaging contracts and AsyncAPI emission — cataggar/typespec1 reaction · 1 comment
- Sep 9, 2026deps(deps-dev): bump @typespec/compiler from 1.15.0 to 1.16.0 in /tools/schema-sync — Imagine-That-Ai/BurnBar1 reaction · 5 comments
- Aug 20, 2026deps(deps-dev): bump the lockfile-updates group across 1 directory with 4 updates — Imagine-That-Ai/BurnBar1 reaction · 3 comments
- Aug 6, 2026Fix Experimental Visitor Gaps — Azure/azure-sdk-for-net1 reaction
- Jul 25, 2026deps(deps-dev): bump the lockfile-updates group across 1 directory with 4 updates — Imagine-That-Ai/BurnBar1 reaction · 9 comments
- Jul 25, 2026deps(deps-dev): bump the lockfile-updates group in /tools/schema-sync with 4 updates — Imagine-That-Ai/BurnBar1 reaction · 2 comments
- Jul 13, 2026Add AZC0002 Suppression & ForwardsClientCalls attribute for Mgmt Back Compat Methods — Azure/azure-sdk-for-net1 reaction
- May 28, 2026[Bug]: tcgc mismatched enum type names for /specs/type/file/main.tsp — Azure/typespec-azure1 reaction · 1 comment
- Apr 22, 2026Adopt Additional XML Spector Tests in Azure Generator — Azure/azure-sdk-for-net1 reaction · 1 comment
- Apr 21, 2026Adopt Spector Header Encoding Scenarios — Azure/azure-sdk-for-net1 reaction
- Mar 30, 2026Bump @typespec/http-specs in Azure Generator & Adopt New XML Spector Tests — Azure/azure-sdk-for-net1 reaction
- Mar 2, 2026Emit multiple api-versions in our metadata file for multiple services — Azure/azure-sdk-for-net1 reaction
- Mar 2, 2026[python] add test case for https://github.com/Azure/typespec-azure/pull/3923 — msyyc/typespec1 reaction
- Mar 2, 2026[python] add test case for https://github.com/Azure/typespec-azure/pull/3922 — msyyc/typespec1 reaction
- Mar 2, 2026[python] add test case for https://github.com/Azure/typespec-azure/pull/3729 — msyyc/typespec1 reaction
- Feb 26, 2026Update XML Visitor to Use XmlRequestContent for FromEnumerable helper method — Azure/azure-sdk-for-net1 reaction · 1 comment
- Feb 26, 2026[python] add test case for https://github.com/microsoft/typespec/pull/9660 — msyyc/typespec1 reaction
- Feb 17, 2026Adopt New XML Pageable Spector Scenarios — Azure/azure-sdk-for-net1 reaction
- Jan 5, 2026[spector] Add a POST long running API whose response type is `bytes` — Azure/typespec-azure1 reaction · 2 comments
- Jul 3, 2025Automation is not updating the mgmt package.json version to reference new Azure generator version — Azure/azure-sdk-for-net1 reaction
- Jul 2, 2025Add integration test cases Response.StatusCodeRange — Azure/autorest.typescript1 reaction
- May 8, 2026[http-client-csharp-mgmt] Mgmt SDK regen broken by upstream BaseModelProvider resolution change (microsoft/typespec#10600) — Azure/azure-sdk-for-net0 reactions
- Mar 27, 2026Incorrect XML ETag Deserialization in Model Properties — Azure/azure-sdk-for-net0 reactions
- Mar 11, 2026[Bug]: Error: Unimplemented: transformJsonExprForType: Enum — timotheeguerin/typespec0 reactions · 1 comment
- Mar 11, 2026[Bug]: Error: Unimplemented: transformJsonExprForType: Enum — timotheeguerin/typespec0 reactions · 1 comment
- May 13, 2024Microsoft Typespec — PrismJS/prism0 reactions · 1 comment
On Bluesky · 4
- Jan 30, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / typespec ⭐ 1,776 (+120) 🗒 TypeScript — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- May 31, 2024📦 microsoft / typespec ⭐ 3,427 (+76) 🗒 TypeScript — @github-trending-js.bsky.social1 likes and repost
- Apr 30, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / typespec ⭐ 2,578 (+177) 🗒 TypeScript — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Jan 26, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / typespec ⭐ 1,311 (+151) 🗒 TypeScript — @github-trending-js.bsky.social1 likes and repost · 1 reply
On Hacker News · 1
- Sep 20, 2024TypeSpec1 point · 1 comment
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- packages/http-client-java/.github/copilot-instructions.mdCopilot instructions
- packages/http-client-js/.github/copilot-instructions.mdCopilot instructions
- code-reviewSkill
- csharp-spector-coverage-gapsSkill
- emitter-prep-for-prSkill
- http-client-python-bump-and-releaseSkill
- minimal-reproSkill
- pnpm-formatSkill
- writing-python-sdk-spector-mock-api-testsSkill
- diff-upstreamSkill
- generate-from-typespecSkill
- test-unbranded-emitterSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
23 rules. About 0 are common, 1 is distinctive, and 22 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
22
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 28
CRITICAL: Run all tests: pnpm test (takes ~5 minutes, NEVER CANCEL - set timeout to 10+ minutes)
- Very specific: line 29
Run E2E tests: pnpm test:e2e and node e2e/e2e-tests.ts (~1 minute)
- Very specific: line 30
Run tests with coverage: pnpm test:ci
- Very specific: line 31
Run tests in watch mode (in specific package): pnpm test:watch
- Very specific: line 35
Check formatting: pnpm format:check (~1 minute)
- Very specific: line 37
Run linting: pnpm lint (~1 minute)
- Very specific: line 42
ALWAYS: run the full build process after repository clone: pnpm install && pnpm build
- Very specific: line 43
Start watch mode: pnpm watch
- Very specific: line 44
Test TypeSpec compilation works:
- Very specific: line 57
Always format and lint before completing changes: pnpm format && pnpm lint:fix
- Very specific: line 84
Basic functionality test: Create and compile a simple TypeSpec file as shown above
- Very specific: line 85
Build validation: Run full build to ensure no build breaks: pnpm build
- Very specific: line 86
Test validation: Run relevant tests: pnpm test
- Very specific: line 87
Code quality: Ensure formatting and linting pass: pnpm format:check && pnpm lint
- Very specific: line 92
Start development server: pnpm start (runs on port 4321)
- Very specific: line 108
Add change description: pnpm change add
- Very specific: line 112
Check catalog usage: pnpm check-catalog
- Very specific: line 116
If builds fail with watch mode conflicts, run: pnpm clean && pnpm build
- Very specific: line 118
If TypeScript compilation fails, check that compiler built first: pnpm -r --filter "@typespec/compiler" build
- Very specific: line 123
Always run the linting and the formatting commands before any commit.
- Very specific: line 125
Avoid committing pnpm-lock.yaml unless absolutely necessary.
- Very specific: line 131
When the work is done, run pnpm chronus add to add a changelog entry.
- Distinctive: line 159
When pushing changes and creating pull requests, push to your personal fork and open PRs against the main Microsoft fork's main branch.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TypeSpec Copilot Instructions
ALWAYS follow these instructions first and only fall back to additional search and context gathering if the information here is incomplete or found to be in error.
TypeSpec is a language for defining cloud service APIs and shapes. This monorepo contains the TypeSpec compiler, standard library packages, tools, documentation, and various language client emitters.
[!IMPORTANT] These instructions do NOT apply to the language emitter packages (
http-client-csharp,http-client-java,http-client-python). Those packages are excluded from the pnpm workspace and do not require using pnpm.
Essential Setup and Build Commands
Prerequisites and Installation
- Install Node.js LTS:
- Install pnpm globally:
npm install -g pnpm - Install dependencies:
pnpm install(takes ~1.5 minutes) - Install Playwright browsers (optional for UI testing):
npx playwright install
Building the Project
- CRITICAL: Build the entire project:
pnpm build(takes ~7 minutes, NEVER CANCEL - set timeout to 15+ minutes) - Build in watch mode for development:
pnpm watch - Build specific package:
pnpm -r --filter "<package-name>..." build - Clean build artifacts:
pnpm clean
Testing and Validation
- CRITICAL: Run all tests:
pnpm test(takes ~5 minutes, NEVER CANCEL - set timeout to 10+ minutes) - Run E2E tests:
pnpm test:e2eandnode e2e/e2e-tests.ts(~1 minute) - Run tests with coverage:
pnpm test:ci - Run tests in watch mode (in specific package):
pnpm test:watch
Code Quality
- Check formatting:
pnpm format:check(~1 minute) - Format code:
pnpm format - Run linting:
pnpm lint(~1 minute) - Fix lint issues:
pnpm lint:fix
Essential TypeSpec Development Workflow
- ALWAYS run the full build process after repository clone:
pnpm install && pnpm build - Start watch mode:
pnpm watch Test TypeSpec compilation works:
# Create test project mkdir test-tsp && cd test-tsp echo 'import "@typespec/rest"; import "@typespec/openapi3"; op ping(): void;' > main.tsp echo '{"dependencies": {"@typespec/compiler": "latest", "@typespec/rest": "latest", "@typespec/openapi3": "latest"}}' > package.json # Install and compile /path/to/typespec/packages/compiler/cmd/tsp.js install /path/to/typespec/packages/compiler/cmd/tsp.js compile main.tsp --emit @typespec/openapi3- Always format and lint before completing changes:
pnpm format && pnpm lint:fix
Repository Structure
Key Packages (packages/)
- compiler: Core TypeSpec compiler and CLI tool
- http, rest, openapi3: Standard HTTP/REST API libraries
- versioning: API versioning support
- json-schema: JSON Schema emitter
- prettier-plugin-typespec: Code formatting support
- typespec-vscode, typespec-vs: Editor extensions
- playground: Interactive TypeSpec playground
- website: Documentation website (typespec.io)
Important Directories
/packages/: All TypeSpec packages and libraries/e2e/: End-to-end integration tests/website/: Documentation website source/eng/: Build engineering and automation scripts/.github/workflows/: CI/CD pipeline definitions
Manual Validation After Changes
ALWAYS perform these validation steps after making changes:
- Basic functionality test: Create and compile a simple TypeSpec file as shown above
- Build validation: Run full build to ensure no build breaks:
pnpm build - Test validation: Run relevant tests:
pnpm test - Code quality: Ensure formatting and linting pass:
pnpm format:check && pnpm lint
Website Development
- Navigate to website:
cd website - Start development server:
pnpm start(runs on port 4321) - Build website:
pnpm build - The website includes documentation, API references, and the playground
Critical Timing and Performance Notes
- NEVER CANCEL long-running commands - builds can take 7+ minutes, tests 5+ minutes
- Set explicit timeouts: Build commands need 15+ minutes, test commands need 10+ minutes
- Package installation: ~1.5 minutes
- Full rebuild from clean state: ~7 minutes
- Full test suite: ~5 minutes
- Lint check: ~1 minute
- E2E tests: ~1 minute
Common Development Tasks
- Add change description:
pnpm change add - Generate external signatures:
pnpm gen-compiler-extern-signature - Regenerate samples:
pnpm regen-samples - Regenerate docs:
pnpm regen-docs - Check catalog usage:
pnpm check-catalog
Troubleshooting
- If builds fail with watch mode conflicts, run:
pnpm clean && pnpm build - For installation issues, try:
pnpm install-conflict - If TypeScript compilation fails, check that compiler built first:
pnpm -r --filter "@typespec/compiler" build - For VS Code extension development, ensure you have the workspace open at the repository root
Commit instructions
- Always run the linting and the formatting commands before any commit. In particular, always run
pnpm formatbefore committing. - Follow conventional commits.
- Avoid committing
pnpm-lock.yamlunless absolutely necessary.
Pull Request instructions
Changelog entries
When the work is done, run pnpm chronus add to add a changelog entry. The valid change kinds are defined in .chronus/config.yaml. Do NOT use feat, docs, patch, minor, or major — these are not valid change kinds.
If a PR affects multiple packages with different types of changes, create a separate changelog entry for each. For example, if the PR adds a feature to @typespec/http and fixes a bug in @typespec/openapi3, run pnpm chronus add twice to create two separate changelog entries — one with feature for @typespec/http and one with fix for @typespec/openapi3. Do NOT bundle different change types into a single entry.
Changelog message guidelines
- Provide a clear description based on the initial issue description.
- Only add an area tag when the package has multiple areas and the change targets a secondary area; use bracket format like
[converter]or[formatter](for example, a secondary openapi3 converter change should start with[converter]). Avoid generic area prefixes likecore -and do not add any area tag for single-area packages. - For new features, include a short code block in the changelog entry that showcases the new functionality; skip code blocks for simple bug fixes.
TDD approach
- Always start by defining additional unit tests/updating existing unit tests to fulfill the requirements first. Then make changes to the code accordingly. If you are following the TDD (Test Driven Development) approach, make sure to run the tests and see them fail before implementing the code changes.
Branch Naming Conventions
Out-of-sync / hotfix releases
Out-of-sync releases and hotfix releases follow the same flow using a publish/ branch:
- Pattern:
publish/<package>-release-<MM-DD>(e.g.,publish/python-release-03-26) - These branches skip certain CI checks (consistency, external-integration) and auto-publish on merge
- For out-of-sync releases, the PR targets
main - For hotfix releases, the PR targets the corresponding
release/*branch (e.g.,release/v0.60) instead ofmain
Branch and PR Workflow
- When creating new branches or worktrees, base them off the main Microsoft fork's
mainbranch (Microsoft/typespec). This remote might be calledupstreamororigindepending on your local git setup — the key point is to always branch from the main Microsoft fork, not a personal fork. - When pushing changes and creating pull requests, push to your personal fork and open PRs against the main Microsoft fork's
mainbranch.
Available Task Instructions
- Testserver Generation: Instructions for generating TypeSpec HTTP spec test servers
- http-client-csharp Development: Instructions for developing the C# HTTP client
- http-client-java Development: Instructions for developing the TypeSpec library for Java client.
- TCGC Upgrade: Instructions for TCGC version on emitters. Activate with:
tcgc upgrade <emitter-name> <new-version>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

