agentleFS
Microsoft AzureKnown publisherAzure/ARO-RP/AGENTS.md

ARO-RP

AGENTS.md120 starsChanged 59 days agoApache-2.0View on GitHub

Azure Red Hat OpenShift RP — ARM resource provider for OpenShift clusters on Azure. A single aro binary is produced with both RP-side services and the in-cluster ARO Operator, with the service selected in the command line (e.g. aro rp, aro portal, aro operator master) All Golang code in this repository is written for Go 1.26+. Cluster mutations (PUT/DELETE) are async: Frontend writes to CosmosDB with non-terminal state → Backend polls and processes → updates with terminal state. Never bypass…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All Golang code in this repository is written for Go 1.26+.

    line 5
  2. Very specific:

    Pointer utils: Use pkg/util/pointerutils, not autorest/to or k8s.io/utils/ptr.

    line 77
  3. Distinctive:

    Before considering any change complete:

    line 83
  4. Very specific:

    No new lint violations: make lint-go

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Azure Red Hat OpenShift RP — ARM resource provider for OpenShift clusters on Azure. A single aro binary is produced with both RP-side services and the in-cluster ARO Operator, with the service selected in the command line (e.g. aro rp, aro portal, aro operator master)

All Golang code in this repository is written for Go 1.26+.

Architecture Invariant

Cluster mutations (PUT/DELETE) are async: Frontend writes to CosmosDB with non-terminal state → Backend polls and processes → updates with terminal state. Never bypass this: public API frontend handlers must NOT perform cluster operations directly.

Two Go Modules (critical)

ModulePathgo.mod
Rootgithub.com/Azure/ARO-RPgo.mod
APIgithub.com/Azure/ARO-RP/pkg/apipkg/api/go.mod

Root imports API via replace directive. ./... from root excludes pkg/api/ tests.

Read docs/agent-guides/build.md when changing build, test, or formatting targets.

Essential Commands

make fmt                 # Format BOTH modules (golangci-lint, NOT gofmt)
make unit-test-go        # Unit tests
make lint-go             # Lint
make generate            # Code generation (go generate, swagger)
make go-tidy             # go mod tidy for BOTH modules
go test -v ./pkg/frontend/... -run TestSpecificFunction   # Single test

Safety Rails

STOP — read before touching these areas:

TriggerRequired reading
Modifying pkg/api/v* typesdocs/agent-guides/api-type-system.md
Adding/changing VM sizesdocs/agent-guides/azure-product-constraints.md
Changing Makefile, CI, or build targetsdocs/agent-guides/build.md

client-generate is destructive — it deletes all generated SDK clients before regenerating. If Docker/autorest fails mid-run, restore with git checkout -- pkg/client/ python/client/.

Where Code Runs

Runtime contextPackages
RP control plane (Azure VMSS)pkg/frontend, pkg/backend, pkg/cluster, pkg/monitor, pkg/gateway, pkg/portal
Customer OpenShift clusterpkg/operator/controllers
CI/dev only (NOT production)pkg/util/cluster, hack/cluster, test/e2e
RP infra deploymentpkg/deploy

Admin API Handler Pattern ("Underscore Pattern")

Admin API endpoints decouple HTTP parsing from business logic. The main handler extracts parameters and calls an underscore-prefixed function with raw values:

func (f *frontend) postAdminFoo(w http.ResponseWriter, r *http.Request) {
    // HTTP layer: extract params, get logger
    err := f._postAdminFoo(log, ctx, r)
    adminReply(log, w, nil, nil, err)
}

func (f *frontend) _postAdminFoo(log *logrus.Entry, ctx context.Context, r *http.Request) error {
    // Business logic: testable without HTTP mocking
}

This allows business logic to be invoked by other Go packages without HTTP mocking. When adding admin APIs, follow this pattern and register routes in pkg/frontend/frontend.go.

Code Style (enforced by CI)

  • Imports: gci is used to order Golang imports. See .golangci.yml.
  • Formatting: make fmt (not gofmt). Pre-commit hook runs make fmt.
  • Pointer utils: Use pkg/util/pointerutils, not autorest/to or k8s.io/utils/ptr.
  • Error handling: Wrap with fmt.Errorf("...: %w", err). Use errors.Is/errors.As.
  • No files directly in pkg/util/ — must use subpackages.

Definition of Done

Before considering any change complete:

  1. make fmt passes
  2. make unit-test-go passes
  3. No new lint violations: make lint-go

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.