agentleFS
Microsoft AzureKnown publisherAzure/aks-desktop/AGENTS.md

aks-desktop

AGENTS.md114 starsChanged 2 months agoApache-2.0View on GitHub

Navigation guide for AI coding agents. For Headlamp plugin API examples see plugins/aks-desktop/AGENTS.md. Headlamp source is generated under packages/headlamp-source/source/ and installed under node_modules/@headlamp-k8s/headlamp-source/. Do not edit generated copies as the source of a fix. See MAINTENANCE.md for source updates and the patch workflow. - headlamp-source is independent of AKS Desktop and must support other consumers. AKS code may depend on the package; the package must not import AKS build code, plugins, or product assets. - Product names, versions, icons, command…

  • 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.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    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
  1. Very specific:

    Use temporary, synthetic consumer projects.

    line 31
  2. Very specific:

    Run npm --prefix packages/headlamp-source run test:helpers for reusable helpers and contracts.

    line 37
  3. Distinctive:

    If a package test needs an AKS fixture from this checkout, move that assertion to the consumer suite instead of making the package depend …

    line 40
  4. Distinctive:

    Never import from another feature component's internals.

    line 66
  5. Very specific:

    No barrel files (enforced by ESLint no-barrel-files rule).

    line 67
  6. Very specific:

    Create <StepName>Step.tsx in the wizard's components/ directory.

    line 75
  7. Distinctive:

    Add the step to the wizard's step list in the parent wizard component.

    line 76
  8. Very specific:

    Add tests (co-located .test.tsx) and optionally a .stories.tsx.

    line 77
  9. Very specific:

    Add a typed wrapper in the appropriate src/utils/azure/<domain>.ts module, or create a new domain module if none fits.

    line 83
  10. Very specific:

    Call runAzCommand<T>(args, debugLabel, errorContext, parseOutput) and pass a parseOutput callback (for JSON output: stdout => …

    line 84
  11. Distinctive:

    Keep each azure util module single-responsibility.

    line 85
  12. Very specific:

    Call registerRoute() with the path, component, and sidebar entry name.

    line 91
  13. Very specific:

    Call registerSidebarEntry() for navigation.

    line 92
  14. Very specific:

    Use registerProjectDetailsTab() or registerProjectOverviewSection() in src/index.tsx.

    line 97

≈ “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

Navigation guide for AI coding agents. For Headlamp plugin API examples see plugins/aks-desktop/AGENTS.md.

Architecture Layers

LayerPathPurposeWhen to change
Pluginplugins/aks-desktop/AKS-specific UI, Azure integration, Kubernetes operationsMost changes go here
Buildbuild/Plugin setup, external tool bundling (Azure CLI, Python), post-build verificationPackaging, bundled tool versions, installer behavior
Source packagepackages/headlamp-source/Reusable Headlamp source assembly and build entry pointsConsumer-independent behavior
Headlamp patchespatches/Changes to the pinned Electron shell, backend, and frontendOnly when the product manifest or plugin APIs cannot express the behavior

Headlamp source is generated under packages/headlamp-source/source/ and installed under node_modules/@headlamp-k8s/headlamp-source/. Do not edit generated copies as the source of a fix. See MAINTENANCE.md for source updates and the patch workflow.

Source-Package Boundary

  • headlamp-source is independent of AKS Desktop and must support other consumers. AKS code may depend on the package; the package must not import AKS build code, plugins, or product assets.
  • Product names, versions, icons, command grants, shipped plugins, external-tool selections, and downstream patches belong to the consumer. Pass them through the documented configuration rather than adding AKS-specific branches to the package.
  • AKS runtime tool selection and digest checks belong in build/aks-tool-environment.cjs. Headlamp's 0071 patch provides only the app-owned commandEnvironment callback; do not move AKS's external-tools interpretation into Headlamp or its documentation.
  • Package helper tests belong beside the helpers in packages/headlamp-source/src/lib/. Use temporary, synthetic consumer projects. Package contract tests in packages/headlamp-source/test/ may read the package's own metadata, but must not discover this repository's root manifest, lockfile, plugins, icons, or installed app.
  • Tests that need real AKS configuration or its installed, patched Headlamp belong in the existing test/integration/ directory. headlamp-package.test.ts there owns the product version, branding, policy, installation, and patch contracts.
  • Run npm --prefix packages/headlamp-source run test:helpers for reusable helpers and contracts. From the repository root, npm run test:headlamp-package runs package contracts plus AKS integration tests and remains the CI entry point.
  • If a package test needs an AKS fixture from this checkout, move that assertion to the consumer suite instead of making the package depend on the checkout layout.

Decision Tree -- "Where does my change go?"

Change typeLocation
Azure CLI operationsplugins/aks-desktop/src/utils/azure/<domain-module>.ts (e.g., az-acr.ts, az-identity.ts, aks.ts)
Kubernetes operationsplugins/aks-desktop/src/utils/kubernetes/
GitHub integrationplugins/aks-desktop/src/utils/github/
New UI featureplugins/aks-desktop/src/components/<FeatureName>/
Shared hooksplugins/aks-desktop/src/hooks/
Shared typesplugins/aks-desktop/src/types/
Component-local typesCo-located in the component directory (e.g., plugins/aks-desktop/src/components/DeployWizard/components/types.ts)
Plugin registrationplugins/aks-desktop/src/index.tsx
Build / packagingbuild/
Reusable source assemblypackages/headlamp-source/
AKS source-package integration teststest/integration/
Headlamp corepatches/ (see MAINTENANCE.md)

Module Boundary Rules

In the sections below, src/ is shorthand for plugins/aks-desktop/src/.

  • Feature components (src/components/<Feature>/) own their sub-components, hooks, utils, types, and tests.
  • Cross-feature shared code lives in src/utils/, src/hooks/, or src/types/.
  • Never import from another feature component's internals. If two features need the same logic, extract it to a shared location.
  • No barrel files (enforced by ESLint no-barrel-files rule).

Common Patterns

Adding a wizard step

Wizard steps live in src/components/<Wizard>/components/. Each step is a standalone component (e.g., BasicsStep.tsx, NetworkingStep.tsx). See DeployWizard for the canonical example:

  1. Create <StepName>Step.tsx in the wizard's components/ directory.
  2. Add the step to the wizard's step list in the parent wizard component.
  3. Add tests (co-located .test.tsx) and optionally a .stories.tsx.

Azure CLI command (runAzCommand)

New Azure CLI calls should go through runAzCommand<T>() in src/utils/azure/az-cli-core.ts, which provides structured error handling and typed responses. Domain-specific modules (e.g., az-acr.ts, az-identity.ts, aks.ts) wrap this function with typed helpers. Some older modules still call runCommandAsync('az', ...) directly. To add a new Azure operation:

  1. Add a typed wrapper in the appropriate src/utils/azure/<domain>.ts module, or create a new domain module if none fits.
  2. Call runAzCommand<T>(args, debugLabel, errorContext, parseOutput) and pass a parseOutput callback (for JSON output: stdout => JSON.parse(stdout)) -- it handles process execution, error wrapping, and returns { success, data, error }.
  3. Keep each azure util module single-responsibility.

Route and sidebar entry

Register routes and sidebar entries in src/index.tsx:

  1. Call registerRoute() with the path, component, and sidebar entry name.
  2. Call registerSidebarEntry() for navigation.
  3. Gate Azure-specific routes behind Headlamp.isRunningAsApp().

Project tab or overview section

Use registerProjectDetailsTab() or registerProjectOverviewSection() in src/index.tsx. Gate behind isAksProject() to show only for AKS-managed projects.

Testing Conventions

  • Co-located tests: <Component>.test.tsx alongside the component file.
  • Accessibility tests: <Component>.guidepup.test.tsx files use guidepup for screen-reader-level a11y testing.
  • Fixtures: __fixtures__/ directories within feature components for shared test data.
  • Integration tests: src/utils/test/ for cross-module tests (Azure CLI, cluster settings, namespace utils).
  • Stories: .stories.tsx files for Storybook visual testing, co-located with components.

File Size Guidance

  • Aim for under 400 lines per file. If a file exceeds this, look for opportunities to extract sub-components, hooks, or utility functions.
  • Azure util modules (src/utils/azure/) should each cover a single domain (ACR, identity, federation, etc.). Split rather than grow a catch-all module.

Cross-References

  • Headlamp plugin API examples and patterns: plugins/aks-desktop/AGENTS.md
  • Source-package maintenance and patch workflow: MAINTENANCE.md

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.