openapi-diff
Copilot instructions290 starsChanged 9 months agoMITView on GitHub
This repository contains the source code for openapi-diff (aka oad, aka @azure/oad), a breaking-change detector tool for OpenAPI specifications. It is published as an npm package and is used internally by the azure-rest-api-specs and azure-rest-api-specs-pr repos to validate PRs. The core diff logic is written in C#/.NET and the CLI/validation layer is written in TypeScript. TypeScript tests live in src/test/ and follow the naming pattern *[tT]est.ts. CI runs on both Ubuntu and Windows via GitHub Actions (.github/workflows/ci.yml). It runs: npm…
The file
We split this copilot-instructions.md into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 64
Prefer const over let where possible
- Very specific: line 90
Run npm run lint and npm run prettier before submitting changes.
- Very specific: line 91
Add or update tests in src/test/ for any TypeScript code changes.
- Very specific: line 92
Do not modify CI/CD pipeline files (.github/workflows/, azure-pipelines.yml) unless specifically required.
- Very specific: line 93
When working only on TypeScript, use npm run ts.test to run just the TypeScript tests.
≈ “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
Copilot Instructions
Project Overview
This repository contains the source code for openapi-diff (aka oad, aka @azure/oad), a breaking-change
detector tool for OpenAPI specifications. It is published as an npm package and is used internally by the
azure-rest-api-specs and
azure-rest-api-specs-pr repos to validate PRs.
The core diff logic is written in C#/.NET and the CLI/validation layer is written in TypeScript.
Tech Stack
- TypeScript (ES2017 target, CommonJS modules) — CLI, validation, and test code in
src/ - C#/.NET 6 — core diff engine in
openapi-diff/ - Node.js 20+
- Jest with
ts-jestfor TypeScript tests - ESLint (
typescript-eslint) for linting - Prettier for formatting
- markdownlint for Markdown style
Setup
npm ci # Install Node.js dependencies
npm run dn.restore # Restore .NET dependencies (if working on C# code)Build
npm run tsc # Build TypeScript code (outputs to dist/)
npm run dn.build # Build C# codeLint and Format
npm run lint # Run ESLint (zero warnings allowed)
npm run lint:fix # Auto-fix ESLint issues
npm run prettier # Check formatting with Prettier
npm run prettier:write # Auto-fix formattingTest
npm run ts.test # Run TypeScript tests (Jest)
npm run dn.test # Run C# tests (dotnet test)
npm test # Run both C# and TypeScript testsTypeScript tests live in src/test/ and follow the naming pattern *[tT]est.ts.
Code Conventions
- No semicolons — Prettier is configured with
"semi": false - Print width is 140 characters
- Trailing commas are not used (
"trailingComma": "none") - Arrow function parentheses are avoided when possible (
"arrowParens": "avoid") - Strict TypeScript —
tsconfig.jsonhas"strict": true - ESLint config is in
eslint.config.js(CommonJS format, not ESM) - Markdown line length limit is 120 characters (tables and headings are exempt)
- Prefer
constoverletwhere possible
Repository Structure
src/
cli.ts # CLI entry point
index.ts # Package entry point
lib/
commands/ # Command implementations
util/ # Utility modules
validate.ts # Validation logic
validators/ # Validator implementations
test/ # TypeScript tests (Jest)
specs/ # Test fixture OpenAPI spec files
openapi-diff/ # C#/.NET solution (core diff engine)
docs/ # DocumentationCI
CI runs on both Ubuntu and Windows via GitHub Actions (.github/workflows/ci.yml). It runs:
npm run lint, npm run prettier, and npm test (which includes both C# and TypeScript tests).
Guidelines
- Run
npm run lintandnpm run prettierbefore submitting changes. - Add or update tests in
src/test/for any TypeScript code changes. - Do not modify CI/CD pipeline files (
.github/workflows/,azure-pipelines.yml) unless specifically required. - When working only on TypeScript, use
npm run ts.testto run just the TypeScript tests.
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.

