typespec / http-client-js
Copilot instructions5.9k starsChanged 4 months agoMITView on GitHub
Scope: These instructions apply only to the packages/http-client-js sub-project in this monorepo. Use them whenever Copilot generates code, tests, commit messages, or pull request descriptions for the emitter. If Copilot is used in other sub-projects, these rules do not apply unless stated otherwise. - Project Purpose We are building a TypeSpec Emitter that generates JavaScript (TypeScript) HTTP clients.
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
- .github/copilot-instructions.mdCopilot instructions
- packages/http-client-java/.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
24 rules. About 0 are common, 17 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Always generate TypeScript using ES Modules.
- Very specific: line 12
Do not use require or __dirname.
- Distinctive: line 13
Do not introduce new dependencies or frameworks without explicit approval.
- Distinctive: line 40
Follow SOLID and KISS principles.
- Distinctive: line 41
Use TypeScript best practices.
- Distinctive: line 42
Write JSDoc for public/exported functions or classes.
- Distinctive: line 43
Add inline comments for non-obvious logic or design decisions.
- Very specific: line 51
Use literate tests in Markdown files under test/scenarios//*.md.
- Very specific: line 82
Use the @typespec/emitter-framework test harness to process these .md files and validate generated outputs.
- Distinctive: line 83
Do not add extra test libraries (e.g., Jest, Mocha).
- Distinctive: line 96
Check that code remains SOLID and not over-engineered.
- Distinctive: line 97
Ensure public functions are documented with JSDoc.
- Very specific: line 98
Verify usage of the correct TypeSpec or Alloy-JS APIs (e.g., $onEmit, <ef.InterfaceDeclaration>, etc.).
- Distinctive: line 99
If logic is complex, suggest more inline comments or a concise doc block.
- Distinctive: line 125
Keep commit messages self-contained (no external links).
- Very specific: line 150
Write or append these summaries to .github/context/[timestamp]-context-summary.md.
- Very specific: line 159
When investigating issues, understand that TypeSpec has a complex type system with these key concepts:
- Very specific: line 162
Typekits: Use $ from @typespec/compiler/experimental/typekit to check type kinds (e.g., $.modelProperty.is())
- Distinctive: line 166
Check for a declared transform reference
- Distinctive: line 173
Transform Chain: Follow the transformation chain from root component to leaf components
- Distinctive: line 175
Edge Cases: Look for special cases like nullable types, union types, and type references
- Distinctive: line 178
Duplicated Properties: Check property reference resolution in transforms
- Distinctive: line 179
Missing Properties: Verify type unpacking is complete at all points
- Distinctive: line 180
Type Mismatches: Ensure the right transform is being selected for each type kind
≈ “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
Scope: These instructions apply only to the
packages/http-client-jssub-project in this monorepo. Use them whenever Copilot generates code, tests, commit messages, or pull request descriptions for the emitter. If Copilot is used in other sub-projects, these rules do not apply unless stated otherwise.
1. Code Generation Instructions
- Project Purpose
We are building a TypeSpec Emitter that generates JavaScript (TypeScript) HTTP clients. - Language & Modules
- Always generate TypeScript using ES Modules.
- Do not use
requireor__dirname. - Do not introduce new dependencies or frameworks without explicit approval.
- Core Stack
- TypeSpec Compiler & Libraries
@typespec/compiler,@typespec/http,@typespec/emitter-framework,@typespec/http-client- Activate typekits by importing:
import { $ } from "@typespec/compiler/experimental/typekit"; import "@typespec/http/experimental/typekit";
- Alloy-JS
@alloy-js/core+@alloy-js/typescriptfor templating code with JSX-like syntax.@typespec/emitter-framework/typescriptoffers higher-level React-like components (e.g.,<ef.InterfaceDeclaration type={model} />) for converting TypeSpec types to TypeScript code.
- No React
- Alloy-JS syntax resembles React but is implemented independently. Don’t import React libraries.
- TypeSpec Compiler & Libraries
- Emitter Implementation
- Implement
$onEmitto hook into TypeSpec’s compiler. For example:export async function $onEmit(program: Program, emitterOptions: MyEmitterOptions) { // Query the type graph using program.checker, typekits, etc. // Generate TypeScript code using Alloy-JS. } - Parse TypeSpec’s type graph to gather HTTP metadata (e.g., operations, models) and emit TypeScript code using Alloy-JS components.
- Implement
- Coding Style
- Follow SOLID and KISS principles.
- Use TypeScript best practices; keep your code readable and reusable.
- Write JSDoc for public/exported functions or classes.
- Add inline comments for non-obvious logic or design decisions.
- Favor clarity over cleverness, particularly for new developer onboarding.
2. Test Generation Instructions
- Test Format
- Use literate tests in Markdown files under
test/scenarios/**/*.md. - Each test file typically has:
# [TestTitle]: High-level description of the scenario being tested.## Spec: Contains a TypeSpec snippet as input for the emitter.## [Test Expectation]: Contains code blocks showing the expected generated code.
- Use literate tests in Markdown files under
Example
# [MyTest] Tests generating a client for a simple model. ## Spec \`\`\`tsp namespace Test; model Foo { name: string; } @get op getFoo(): Foo; \`\`\` ## [Test Expectation] \`\`\`ts path/to/generated.ts function jsonFooToTransportTransform export function jsonFooToTransportTransform(input: Foo) { // This is the expected code snippet } \`\`\`- Implementation
- Use the
@typespec/emitter-frameworktest harness to process these.mdfiles and validate generated outputs. - Do not add extra test libraries (e.g., Jest, Mocha). The built-in harness is sufficient.
- Use the
- There should only be a single tsp code block per h1 (#) heading.
- H1 Headings translate to describe blocks in vitest
- ts codeblocks translate to it blocks in vitest.
- !NEVER modify existing ts or tsp code blocks
3. Code Review Instructions
- Review Criteria
- Confirm ES Module usage (no
require). - Check that code remains SOLID and not over-engineered.
- Ensure public functions are documented with JSDoc.
- Verify usage of the correct TypeSpec or Alloy-JS APIs (e.g.,
$onEmit,<ef.InterfaceDeclaration>, etc.). - If logic is complex, suggest more inline comments or a concise doc block.
- Confirm ES Module usage (no
- No Unauthorized Dependencies
- Code reviewers should flag any added libraries or frameworks without explicit approval.
4. Commit Message Generation
Format
<type>(<scope>): <description>Examples:
feat(emitter): add support for generating query parametersfix(api): handle empty model in TypeSpec
- Scopes
emitterfor changes in emitter codecompilerfor changes in TypeSpec compiler logictestfor changes to the literate tests
- Automation & Strictness
- Copilot may suggest commit messages, but they must follow this conventional format.
- Keep commit messages self-contained (no external links).
5. Pull Request Title & Description
- Title
- Same format as commits:
<type>(<scope>): <description>.
- Same format as commits:
- Body
- Why this change is needed
- What has changed
- How to test or verify (if relevant)
- Implications on emitter output or user-facing APIs
- Keep it Brief
- Provide enough context for the reviewer without unnecessary details.
6. Context Management
- Random Emoji
- Prepend a random emoji at the beginning of every generated response.
- Summaries
- Periodically generate concise summaries of progress or changes.
- Write or append these summaries to
.github/context/[timestamp]-context-summary.md.
No Additional Dependencies
- Implement emoji generation or summary logic with built-in JS features only.
7. Debugging and Troubleshooting
- TypeSpec Type System
- When investigating issues, understand that TypeSpec has a complex type system with these key concepts:
- Type References: Types can reference other types (e.g.,
ModelPropertycan reference anotherModelProperty) - Type Unpacking: Many types need to be "unpacked" to get their underlying type (e.g.,
HttpPart,ModelProperty, etc.) - Typekits: Use
$from@typespec/compiler/experimental/typekitto check type kinds (e.g.,$.modelProperty.is())
- Type References: Types can reference other types (e.g.,
- When investigating issues, understand that TypeSpec has a complex type system with these key concepts:
- Common Transformation Patterns
- Transforms like
JsonTransformhave this general flow:- Check for a declared transform reference
- Switch on the type kind (Model, Union, ModelProperty, etc.)
- Route to the appropriate specialized transform
- Generate code with property accessors
- Transforms like
- Debugging Strategies
- Type Inspection: For type-related bugs, check what the actual TypeSpec type is at each step
- Transform Chain: Follow the transformation chain from root component to leaf components
- Recursive Handling: Pay special attention to places where types are handled recursively
- Edge Cases: Look for special cases like nullable types, union types, and type references
- Common Issues
- Duplicated Properties: Check property reference resolution in transforms
- Missing Properties: Verify type unpacking is complete at all points
- Type Mismatches: Ensure the right transform is being selected for each type kind
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.

