code-review
Skill1.9k starsChanged 8 months agoMITView on GitHub
Use when reviewing any pull request in the Azure SDK for Go repository, including Go source, go.mod, docs, samples, and CI or tooling changes. Applies the Azure SDK for Go design and implementation guidelines to client constructors, service methods, options structs, pagers, pollers, error handling, models, pipeline and logging, dependencies, docs, tests, and examples, and suppresses comments on generated code.
- Reads credentials
188 other projects use a version of this.
Trending
Quiet this year.thin dataabout the whole repository
Most recently taken up by
- github/spec-kittheir own version, first seen Nov 23, 2026
- microsoft/vscodetheir own version, first seen Nov 12, 2026
- mattpocock/skillstheir own version, first seen Oct 8, 2026
- rafaelob/pragmatic-agent-skillstheir own version, first seen Oct 5, 2026
- Kangentic/kangentictheir own version, first seen Oct 5, 2026
- dzhng/skillstheir own version, first seen Oct 4, 2026
Who's talking about Azure/azure-sdk-for-go
- hashicorp/terraform-provider-azurerm“Support for Flux v2 AKS cluster extension”GitHub · Jan 18, 2022 · 120 reactions
- hashicorp/terraform-provider-azurerm“New Resource request: Azure Data Factory”GitHub · Aug 3, 2018 · 78 reactions
- hashicorp/terraform-provider-azurerm“Support for Azure Red Hat OpenShift (ARO)”GitHub · Jun 7, 2019 · 77 reactions
- hashicorp/terraform-provider-azurerm“New Resource request: Network Watcher Flow Log”GitHub · Aug 15, 2018 · 74 reactions
- hashicorp/terraform-provider-azurerm“Storage Soft Delete Support”GitHub · Apr 4, 2018 · 65 reactions
The biggest 5 of 9 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 9
Talked about on GitHub (9 times).
On GitHub · 9
- Jan 18, 2022Support for Flux v2 AKS cluster extension — hashicorp/terraform-provider-azurerm120 reactions · 17 comments
- Aug 3, 2018New Resource request: Azure Data Factory — hashicorp/terraform-provider-azurerm78 reactions · 8 comments
- Jun 7, 2019Support for Azure Red Hat OpenShift (ARO) — hashicorp/terraform-provider-azurerm77 reactions · 12 comments
- Aug 15, 2018New Resource request: Network Watcher Flow Log — hashicorp/terraform-provider-azurerm74 reactions · 14 comments
- Apr 4, 2018Storage Soft Delete Support — hashicorp/terraform-provider-azurerm65 reactions · 12 comments
4 more on GitHub
- Apr 13, 2022Issue with the size of the API surface of the models package — microsoftgraph/msgraph-sdk-go53 reactions · 105 comments
- Sep 13, 2019AKS: support setting cluster outbound IPs when using standard loadbalancer — hashicorp/terraform-provider-azurerm50 reactions · 4 comments
- May 17, 2022Support for additional properties in azurerm_api_connection — hashicorp/terraform-provider-azurerm42 reactions · 7 comments
- Jun 25, 2019Logic App: Add callback url as attribute of http request trigger — hashicorp/terraform-provider-azurerm37 reactions · 12 comments
Used with
Projects with it also use starter, media-processing and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ww-w-aiSkillstarter
Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).
Also in 4 projects that use this
mrgoonieSkillmedia-processing
Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.
Also in 5 projects that use this
loulanyueSkillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 15 projects that use this
mrgoonieSkillaesthetic
Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.
Also in 4 projects that use this
AWSSkillask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Also in 32 projects that use this
AWSSkillresolving-merge-conflicts
Use when you need to resolve an in-progress git merge/rebase conflict.
Also in 48 projects that use this
- +1 more from mrgoonie
- +2 more from aws
Other versions188 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 188
- mattpocock/skills★ 335ksame name
- microsoft/vscode★ 196ksame name
- github/spec-kit★ 153ksame name
- shareAI-lab/learn-claude-code★ 78ksame name
- github/awesome-copilot★ 40ksame name
- langchain-ai/deepagents★ 30ksame name
- microsoft/vcpkg★ 28ksame name
- anthropics/knowledge-work-plugins★ 26ksame name
- Donchitos/Claude-Code-Game-Studios★ 26ksame name
- microsoft/onnxruntime★ 22ksame name
178 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- upgrade-emitter-versionSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 0 are common, 11 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 174 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Before writing any comment, run through this gate.
- Very specific: line 24
Generated code: If the file contains a DO NOT EDIT.
- Very specific: line 28
Only report a clear, demonstrable bug not covered by those rules.
- Distinctive: line 47
Never flag casing of function or method locals, in generated or handwritten code.
- Distinctive: line 51
Unchanged code: Only comment on lines in the diff, or on pre-existing code the diff directly breaks.
- Distinctive: line 53
Restating the diff: If the comment doesn't ask for a change or flag a risk, don't post it.
- Distinctive: line 63
Prefer a few high-confidence comments over broad coverage.
- Very specific: line 71
All client types end in Client, take unexported state, and are returned by reference from their constructor.
- Distinctive: line 99
Options structs: Every service operation takes an options pointer as its last parameter — named per the table above — even when it …
- Very specific: line 135
Use errors.Is / errors.As-friendly wrapping (%w) when the underlying cause aids diagnosis.
- Very specific: line 138
Don't invent error types: Use types from the service, the standard library, or azcore.
- Distinctive: line 139
Use distinct types so callers can tell a client-side parameter error from a transport/marshalling failure.
- Very specific: line 155
Authentication: Use azcore / azidentity credential types and policies.
- Very specific: line 175
Every .go file starts with the copyright header (which may follow a //go:build directive):
- Distinctive: line 187
Every exported top-level declaration — constant, function, type, and method — has a doc comment starting with its own name.
- Distinctive: line 190
Document parameters where it adds information the signature doesn't already convey — a non-obvious format, unit, ownership, or nil-handling.
- Very specific: line 214
Do not flag domain-specific helpers that compose testify — a requireEqualAttributes(t, a, b) asserting a model's fields, or a helper that …
- Very specific: line 235
Unit tests: must be deterministic and free of external state — flag a time.Sleep standing in for real synchronization, wall-clock or …
- Very specific: line 252
Use context.TODO(), never context.Background(), so readers know to supply their own context.
- Distinctive: line 282
Consolidate repeated findings: When the same nit recurs in a file, leave one comment that lists the occurrences instead of one comment per …
- Distinctive: line 286
If you are not confident the change is required, don't post the comment.
“Common” is measured: kept by at least 6 in 10 of the 174 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Azure SDK for Go Code Review
Review changes against the Azure SDK for Go
design guidelines and
implementation guidelines, together with
AGENTS.md, CONTRIBUTING.md, and the repository
Copilot instructions.
Repository-specific instructions win. Where this skill or a file under .github/instructions/ contradicts the
published guidelines, follow the repository. The published guidelines describe the cross-language ideal; this repo
has deliberate exceptions.
Comment only on issues that a Go SDK maintainer would ask to change before merging.
Step 0 — Decide whether to comment at all
Before writing any comment, run through this gate. If any item applies, stay silent.
Generated code. If the file contains a
DO NOT EDIT.code-generation marker (emitted by both the current Go Code Generator and the retired AutoRest generator), do not comment on style, naming, doc comments, example values, constants, or any pattern listed in.github/instructions/go-code.instructions.md. Only report a clear, demonstrable bug not covered by those rules. When in doubt, say nothing — the fix belongs inazure-rest-api-specsor the emitter, not in this repo. Never suggest editing generated output directly; it is overwritten on regeneration. Point the fix at the source spec, the generator inputs (e.g.tsp-location.yaml), or the generator itself — see generation guidance. Files that are generated but intentionally hand-maintained, such asversion.go, omit this marker so their version const can be updated; treat them as regular editable code.The one exception is acronym casing (see "Naming and file conventions" below). Go uppercases acronyms in exported identifiers while most other languages don't, so these are routinely missed upstream. Flag them on generated code too, for types, struct fields, methods, enum/constant member names, and function parameters —
userId stringshould beuserID string. Parameters aren't public surface, but leaving them inconsistent looks sloppy and spreads. Because generated files are overwritten, the comment must say the fix belongs upstream inazure-rest-api-specs(via a client-name customization such as@clientName), not in this repository. Never suggest editing the generated file directly.Raise casing as a low-priority
nit:(see "Comment style"), and consolidate: one comment per file listing the identifiers, never one comment per occurrence. A spec-wide casing slip can touch dozens of lines, and a correct finding repeated thirty times is still a bad review. Never flag casing of function or method locals, in generated or handwritten code.This applies to the identifier only, never the string value it is assigned: renaming
S3WithHmactoS3WithHMACis in scope; changing its"S3WithHmac"wire value is not.- Unchanged code. Only comment on lines in the diff, or on pre-existing code the diff directly breaks.
- Style nits.
gofmt, import ordering, line length, and comment wrapping are handled by tooling. Don't comment. - Restating the diff. If the comment doesn't ask for a change or flag a risk, don't post it.
- Non-Go changes. Docs, samples, CI, and tooling PRs are in scope, but judge them on their own terms — assess the changed instructions or behavior. Don't apply the Go API checklist below to them.
- Security findings. Flag a security regression introduced by this PR on the changed line before merge,
briefly explaining the risk and a safe remedy. Do not include working payloads, attack steps, credentials,
live endpoints, or details that could expose a vulnerability in deployed code. If the flaw already affects
deployed or released code, do not disclose technical details publicly; ask a maintainer to follow the private
reporting process in
AGENTS.md. The reviewer cannot send email, so it must not claim to have reported the vulnerability privately or substitute a public issue for that process.
Prefer a few high-confidence comments over broad coverage. Each comment should name the guideline it enforces and suggest the concrete replacement code.
Public API surface
These are breaking-change risks and deserve a comment every time.
Client naming depends on the service family — check which one you're in before flagging anything. All client types end in
Client, take unexported state, and are returned by reference from their constructor. Beyond that the conventions differ:Client type Constructor options Operation options / responses Data plane, single client in the package Client*ClientOptionsunprefixed — CreateKeyOptions,CreateKeyResponseData plane, multiple clients in one package <Name>Client*<Name>ClientOptionsprefixed — <Name>ClientCreateOptionsManagement plane ( arm*)<Resource>Clientshared *arm.ClientOptionsprefixed — <Resource>ClientGetOptionsThe client prefix exists only to disambiguate within a package. A data-plane package with one client names it
Client, which leaves nothing to disambiguate — so its options and responses are unprefixed (azkeys.CreateKeyOptions). As soon as a package exposes more than one client, operation names collide and the prefix is required, exactly as in ARM. Multi-client data-plane packages are uncommon; the deciding factor is how many clients share the package, not whether the package is data plane or management plane.Judge sub-packages independently:
azblob/containerandazblob/blobeach expose a singleClient, so each gets unprefixed types.Constructors take the endpoint, then any additional required parameters, then the credential, then the options pointer —
NewSenderClient(endpoint, topic string, cred azcore.TokenCredential, options *SenderClientOptions). ARM constructors instead takesubscriptionIDand the shared*arm.ClientOptions; don't flag a valid ARM constructor for not looking data-plane. Credential-free and connection-string variants follow the same pattern (NewClientWithNoCredential,New<Name>ClientFromConnectionString).- No exported fields on client types. Client state must be unexported and safe for concurrent use by multiple goroutines.
- Service client methods have pointer receivers.
func (c *WidgetClient) Get(...). context.Contextis the first parameter of every method that performs I/O, sleeps, or does significant CPU work. Required parameters follow it; where the method takes options, the pointer is last.- Options structs. Every service operation takes an options pointer as its last parameter — named per the
table above — even when it currently
has no optional parameters (use a placeholder comment). Passing
nilmust be semantically identical to passing a zero-valued struct — flag any code whereniland&Options{}diverge. This applies to methods that call the service. Lifecycle and accessor methods are established exceptions — don't flagClose(ctx),Endpoint(),URL()and similar for lacking an options parameter (ProducerClient.Closeinsdk/messaging/azeventhubs/producer_client.go). - Model types export all fields (to support mocking) and document read-only fields, which must be omitted when marshalling.
- One method per REST endpoint. Flag added overloads/convenience duplicates of an existing operation.
- A single service operation doesn't spin up goroutines or channels. One operation maps to one request; don't
hide concurrency inside it, and don't return a channel from a public API.
This does not ban concurrency outright. Higher-level convenience APIs that fan out over many requests —
the storage upload/download helpers, for example — intentionally use bounded worker pools driven by a
caller-visible
Concurrencyoption (sdk/storage/azblob/internal/shared/batch_transfer.go, surfaced viablockblob.UploadFileOptions.Concurrency). Concurrency the caller opts into and bounds is fine; concurrency the caller can't see or control is not. - Exchange types come from the standard library or
azcore. Flag any exported signature that leaks a third-party type. Being allowlisted in.github/instructions/go-mod-standards.instructions.mdonly permits the dependency; it does not make that module's types acceptable in public signatures. Keep flagging them by default. The one established exception isazopenai, whose public surface intentionally exchangesgithub.com/openai/openai-go/v3types. Don't extend that exception to other modules, or to other dependencies withinazopenai.
Paging
- Return
*runtime.Pager[T], namedNew<Operation>Pager. - The pager constructor performs no I/O: it takes no
context.Contextand returns noerror.
Long-running operations
- Return
*runtime.Poller[T]from a method prefixed withBegin. - The options struct for the
Beginmethod exposes aResumeToken stringfield. - Context cancellation stops polling only — flag code that cancels the service-side operation.
Error handling
- Errors are the last return value; a method that fails to do its job returns an error.
- Use
errors.Is/errors.As-friendly wrapping (%w) when the underlying cause aids diagnosis. - HTTP failures must carry the response and originating request — use
runtime.NewResponseError()(orazcore.ResponseError), not a hand-rolledfmt.Errorfthat drops the response. - Don't invent error types. Use types from the service, the standard library, or
azcore. - Use distinct types so callers can tell a client-side parameter error from a transport/marshalling failure.
- Error messages should be actionable and name the parameter or operation involved.
Parameter validation
- Validate client parameters — values used to build a URI, read a file, or drive client-side logic.
- Do not validate service parameters. Flag added nil/empty-string checks on values passed straight to the service; let the service return the error.
Service implementation
Judge the changed behavior, not whether a particular helper name appears in the diff.
- Pipeline. REST calls go through the
azcorepipeline with the standard policies (telemetry, retry, authentication, response downloader, distributed tracing, logging, transport). Flag a hand-rolledhttp.Clientcall path or a custom policy that duplicates an existingazcoreone. - Authentication. Use
azcore/azidentitycredential types and policies. Credentials must not be persisted, cached to disk, or logged. - Logging. Log through the
azcorelogging API. Headers and query parameters are redacted unless they're on the allow-list — flag any change that logs a request/response value, URL, or error detail that could carry a token, key, or PII. - Tracing. Spans propagate the caller's
context.Contextrather than creating a detached root span. - Configuration. Client behavior must not change in response to configuration mutated after construction.
The documented exceptions are log level and tracing on/off, which take effect immediately.
Service-specific environment variables are prefixed
AZURE_.
Naming and file conventions
- Acronyms are fully uppercased in every identifier a customer can see: exported types, fields, methods,
functions, and constants (
UserIDnotUserId,ACSRecordedEventnotAcsRecordedEvent), plus function and method parameter names (userID, notuserId) — parameters appear in the published signature and godoc. Parameter casing isn't API surface, so raise it as a low-prioritynit:, but don't skip it — inconsistency spreads by copy-paste. This rule stops at the signature: never flag function or method locals, which customers never see, and it does not apply to string constant values. It's also the one naming rule that applies to generated code — see "Step 0" above for how to word the comment. Every
.gofile starts with the copyright header (which may follow a//go:builddirective):// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License.- Package names are all lowercase (no uppercase letters, hyphens, or underscores) and match the leaf directory name.
The
arm/azprefix applies only to a module's top-level package —armfor management plane,azfor everything else. Sub-packages within a module take an unprefixed, descriptive name:sdk/storage/azblobis packageazblob, butsdk/storage/azblob/containeris packagecontainer, notazcontainer. Don't flag an unprefixed sub-package. - Every exported top-level declaration — constant, function, type, and method — has a doc comment starting
with its own name. This does not extend to struct fields, whose comments are descriptive prose and needn't
repeat the field name (
// A custom endpoint address that can be used...aboveCustomEndpointis fine). - Document parameters where it adds information the signature doesn't already convey — a non-obvious format, unit, ownership, or nil-handling. Don't require a mechanical line per parameter; the published guidelines show that style, but maintained handwritten clients in this repo don't follow it.
Dependencies (go.mod)
Per .github/instructions/go-mod-standards.instructions.md,
flag any new direct requirement outside:
- other
github.com/Azure/azure-sdk-for-go/sdk/...modules - the standard library and
golang.org/x/... github.com/stretchr/testify,github.com/joho/godotenv,go.opentelemetry.io/otel/*,github.com/golang/mock- the module-specific allowances (e.g.
azidentity,azservicebus/azeventhubs,azopenai)
Also flag native (cgo) dependencies, and version bumps that would force a consumer's hand on compatibility.
A module being released must not retain replace directives — flag any left in a go.mod that a release
would pick up. See the release checklist.
Tests (*_test.go)
- Assertions use
github.com/stretchr/testify— flag a hand-rolled replacement: bareif got != want { t.Errorf(...) }chains, a customassertEqual, or a home-grown assertion package reimplementing what testify already provides. Do not flag domain-specific helpers that compose testify — arequireEqualAttributes(t, a, b)asserting a model's fields, or a helper that normalizes recorded values before comparing, is the encouraged pattern. The distinction is reimplementing testify (flag) versus building on it (don't). If such a helper is missingt.Helper(), that's worth a comment, since failures will otherwise point at the helper instead of the caller. requirevs.assertis a judgment call, not a style rule. Don't comment on the choice in general — only when the assertion is a post-condition the following code depends on, where continuing past a failure would panic or cascade into misleading failures. The common cases are a nil check before a dereference, an error check before using the result, and a length check before indexing:// wrong: a nil Value panics the test run rather than failing it assert.NotNil(t, resp.Value) assert.Equal(t, "value", *resp.Value) // right require.NotNil(t, resp.Value) assert.Equal(t, "value", *resp.Value)Conversely, don't ask for
requireon independent assertions — severalassertcalls that each check an unrelated field are good practice, since they report every mismatch in one run.- Unit tests must be deterministic and free of external state — flag a
time.Sleepstanding in for real synchronization, wall-clock or timezone assumptions, and mutable package-level state shared across tests. - Live and recorded suites are different. They intentionally provision real Azure resources and may wait for
eventual consistency, as in
armterraform's suite setup. Don't flag that as nondeterminism. Comment only on a concrete timing or interference risk — an unbounded wait, a fixture that leaks between tests, or a resource name that collides when suites run in parallel. - Tests with a playback path wait with
recording.Sleep, nottime.Sleep.recording.Sleepsleeps while recording and is a no-op inPlaybackMode, so a rawtime.Sleepmakes every playback run pay a delay that only matters against the live service. This applies only where playback exists. Live-only tests may usetime.Sleep— waiting on real resource provisioning is unavoidable and there's no playback run to slow down. Check whether the test actually records and plays back before flagging; if it doesn't, say nothing. - Live-test configuration comes from
recording.Getenv()/os.Getenv()backed by a module-root.env; flag hard-coded endpoints, subscription IDs, or anything resembling a secret.
Examples (example*_test.go)
- Use
context.TODO(), nevercontext.Background(), so readers know to supply their own context. Error handling uses exactly this form, comment included:
if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) }- No
// Output:comment — examples in this repo are not executable. This intentionally contradicts the published guidelines, which recommend adding one; the repository rule wins. Never ask for an// Output:comment, and flag one that's added. - One scenario per example; don't chain unrelated operations.
Changelog and docs
- A user-visible behavior change, new API, bug fix, or breaking change needs a
CHANGELOG.mdentry in the module's Unreleased section, under the correct heading (Features Added,Breaking Changes,Bugs Fixed,Other Changes). - Breaking changes to stable public APIs require a major version bump and a migration note. Preview APIs can change between prerelease versions without a major bump, but breaking changes should still be documented.
- New or changed exported APIs should have accompanying examples and README updates.
Comment style
- One issue per comment, anchored to the offending line.
- Prefix non-blocking findings with
nit:. Naming and casing, doc-comment wording, and test-helper ergonomics are nits: real, worth fixing, but they shouldn't read as merge blockers. Correctness, API compatibility, security, and dependency violations are not nits — state those plainly. - Consolidate repeated findings. When the same nit recurs in a file, leave one comment that lists the occurrences instead of one comment per line.
- State the rule, then the fix: "Per the Go guidelines, pager constructors perform no I/O — drop the
ctxparameter and theerrorreturn, and move the request intoFetcher." - Link the relevant guideline section when it isn't obvious.
- If you are not confident the change is required, don't post the comment.
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.

