azure-webpubsub
Copilot instructions144 starsChanged 2 months agoMITView on GitHub
Repository-wide guidance for AI agents. Everything here has been verified against this repository; if you find a statement is no longer true, fix it in the same pull request that proves it wrong. - Push topic branches to your own fork, then open the pull request from the fork. Do not push working branches to Azure/azure-webpubsub. Keep the upstream remote for fetching and for the pull request target only. - main is protected. Merges are squash-only and require one approving…
The file
We split this copilot-instructions.md into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
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 10
Do not push working branches to Azure/azure-webpubsub.
- Distinctive: line 14
Every other check is advisory and does not block merge — but do not merge past a red check until you understand it.
- Distinctive: line 26
Ask a human to push the branch, or point them at the GitHub web editor.
- Distinctive: line 27
Keep workflow-only changes in their own commit so they are easy to hand off.
- Distinctive: line 40
All dependency installation must go through the approved proxy.
- Distinctive: line 50
The proxy lags public advisories: Before choosing a target version for a security bump, confirm the feed actually carries it:
- Very specific: line 82
Read the test source before trusting a green test job.
- Very specific: line 104
Always verify with a real install (yarn install --frozen-lockfile or npm ci), not by inspection.
≈ “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 for azure-webpubsub
Repository-wide guidance for AI agents. Everything here has been verified against this repository; if you find a statement is no longer true, fix it in the same pull request that proves it wrong.
Contributing workflow
- Push topic branches to your own fork, then open the pull request from the fork.
Do not push working branches to
Azure/azure-webpubsub. Keep the upstream remote for fetching and for the pull request target only. mainis protected. Merges are squash-only and require one approving review.- The only required status checks are
license/claandGitGuardian Security Checks. Every other check is advisory and does not block merge — but do not merge past a red check until you understand it. Say plainly in the pull request why it is unrelated. - Branch protection is not
strict, so a branch does not need to be up to date withmainto merge. Stale bases are still a common source of misleading CI (see below).
Files under .github/workflows/
GitHub rejects any push touching .github/workflows/** unless the credential carries the
workflow OAuth scope, and the rejection fails the entire push, not just that file.
Agent sessions usually do not have that scope. When a change is needed there:
- Make the edit and commit it locally.
- Ask a human to push the branch, or point them at the GitHub web editor.
- Keep workflow-only changes in their own commit so they are easy to hand off.
This restriction is enforced per credential, not per repository, so pushing to a fork
does not avoid it. It also reaches further than it first appears: pushing any branch
whose history contains a workflow commit the target does not already have will be
rejected, even when your own commits touch nothing under .github/. A fork that has
fallen behind an upstream main containing workflow changes therefore cannot receive any
branch at all — and POST /repos/{owner}/{repo}/merge-upstream is gated by the same
scope, so the fork cannot be resynced without the scope either. Until a human syncs the
fork, push the branch to the upstream repository instead.
Package feeds
All dependency installation must go through the approved proxy. Public registries are reachable from CI but blocked from developer machines, so a plain install that works in CI may fail locally.
| Ecosystem | Feed |
| npm / yarn / pnpm | https://packagefeedproxy.microsoft.io/npm/ |
| pip / uv / Poetry | https://packagefeedproxy.microsoft.io/pypi/simple |
| NuGet / dotnet | https://packagefeedproxy.microsoft.io/nuget/v3/index.json |
The proxy lags public advisories. Before choosing a target version for a security bump, confirm the feed actually carries it:
npm view <package> versions --jsonDependabot resolves against the public registry and will happily propose a version the proxy has never mirrored. Prefer the advisory's first patched version, which is both sufficient to close the alert and far more likely to be available.
To reproduce a CI install locally, copy the project to a scratch directory and rewrite
registry.npmjs.org to the proxy in the copy only. Never commit proxy URLs into a
lockfile; resolved URLs in committed lockfiles should stay canonical.
Read which CI jobs actually ran
build.yml starts with a Detect affected components job, and every build job is gated
on a path filter. A job that did not match its filter is reported as skipped, and the
pull request still looks green. Before trusting a green run:
- Cross-check the files you changed against which checks ran versus were skipped.
- Known gap: the
csharpjob's filter issamples/csharp/**only, so that job compiles no C# outsidesamples/csharp/. Much of the rest is picked up by dedicated workflows that do run on pull requests —tools/emulator/**byemulator-tests.yml,sdk/clients/protobuf-client/csharp/**byprotobuf-client-tests.yml, andtests/integration-tests/csharp/**byintegration-tests-csharp.yml. Check for one of those before assuming a directory is uncovered. What is genuinely left over issdk/webpubsub-socketio-extension/examples/*/extensions.csproj:socketio_e2e.ymlbuilds Node packages and checks the credential-free test harness on pull requests, with live service tests restricted to pushes tomain. It does not build the C# examples. Build those locally before merging. - Read the test source before trusting a green test job. For example,
samples/ai/chat-demo/tests/test_chat_model_client.pymonkeypatches theOpenAIclass away entirely, so it passes regardless of whichopenaiversion is installed.
For Dependabot pull requests specifically, also check the base commit. A batch of
Dependabot pull requests is often cut from the same stale base, which makes every result
in the batch — green and red alike — describe old code. Comment @dependabot rebase and
re-read the run before drawing a conclusion.
Editing lockfiles
- The repository has no
.gitattributesand developers commonly run withcore.autocrlf=true. Any script that rewrites a lockfile must match\r?\n, not\n, or it will silently match nothing inyarn.lock. package-lock.jsonatlockfileVersion: 2stores every entry twice — once underpackages("node_modules/foo") and once under the legacydependencies("foo"). Both copies must be updated.lockfileVersion: 3has onlypackages.- Patch lockfile text in place. Round-tripping through
JSON.parse/JSON.stringifyreformats the whole file and buries the real change in noise. integrityhashes are content-addressed and therefore mirror-independent: a hash computed from a tarball fetched via the proxy is valid alongside a canonicalregistry.npmjs.orgURL.- Always verify with a real install (
yarn install --frozen-lockfileornpm ci), not by inspection.
Things CI does not cover
website/is built only bydeploy-demo-website.yml, not by pull request CI. Runyarn buildthere yourself when you change its dependencies.- C# outside
samples/csharp/,tools/emulator/,sdk/clients/protobuf-client/csharp/andtests/integration-tests/csharp/— in practicesdk/webpubsub-socketio-extension/examples/*/extensions.csproj. See the path-filter note above; do not generalise this to all ofsdk/**, which does contain covered projects.
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.

