agentleFS
mckinseymckinsey/agents-at-scale-ark/ark/CLAUDE.md

agents-at-scale-ark / ark

CLAUDE.md438 starsChanged 7 months agoApache-2.0View on GitHub

Kubernetes operator managing AI resources. Built with controller-runtime. The controller is the orchestration layer — it reconciles CRDs and dispatches query execution to executors via A2A. All executors — including the default completions executor — run as separate deployments and communicate with the controller over A2A. The ExecutionEngine CRD (api/v1prealpha1/) defines additional executors with an address (ValueSource). Custom executors implement BaseExecutor from the Python SDK (lib/ark-sdk/). See internal/annotations/annotations.go for MigrationWarningPrefix and internal/webhook/v1/model_webhook.go for implementation. When modifying Go types in api/v1alpha1/,…

The file

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

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

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

    When a Query arrives, the controller checks the target Agent's executionEngine field:

    line 21
  2. Very specific:

    All executors — including the default completions executor — run as separate deployments and communicate with the controller over A2A.

    line 25
  3. Distinctive:

    When deprecating fields or changing resource formats, use the migration warning pattern:

    line 48
  4. Very specific:

    When modifying Go types in api/v1alpha1/, use the ark-controller-development skill for guidance on syncing CRDs to the Helm chart.

    line 65

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

Ark Kubernetes Operator

Kubernetes operator managing AI resources. Built with controller-runtime. The controller is the orchestration layer — it reconciles CRDs and dispatches query execution to executors via A2A.

Build Commands

make dev           # Run locally without webhooks
make build         # Build (includes CRD validation)
make test          # Run tests
make lint-fix      # Format and fix linting
make manifests     # Regenerate CRDs from Go types

Architecture

Controller as Orchestrator

The controller watches CRDs (Agent, Model, Query, Team, MCPServer, ExecutionEngine, A2AServer) and dispatches queries to executors. It is the sole writer of Query CR status.

Executor Dispatch

When a Query arrives, the controller checks the target Agent's executionEngine field:

  • Not set → default completions executor (executors/completions/), a separate deployment that the controller reaches via A2A
  • Named executor → fetches the ExecutionEngine CR, dispatches to its resolved address via A2A

All executors — including the default completions executor — run as separate deployments and communicate with the controller over A2A. The ExecutionEngine CRD (api/v1prealpha1/) defines additional executors with an address (ValueSource). Custom executors implement BaseExecutor from the Python SDK (lib/ark-sdk/).

Key CRD Types

  • api/v1alpha1/ — Agent, Model, Query, Team, Tool, MCPServer, A2AServer, A2ATask, Memory
  • api/v1prealpha1/ — ExecutionEngine

Key Patterns

ValueSource Configuration

Resources support flexible configuration through ValueSource:

  • Direct values
  • ConfigMap/Secret references
  • Service references

Parameter Templating

Dynamic prompt/input processing using Go templates with resource context.

Tool Integration

  • Built-in tools (web search, calculations)
  • HTTP fetcher tools for API integration
  • MCP server tools for external service integration

Migration Warnings

When deprecating fields or changing resource formats, use the migration warning pattern:

  1. Mutating webhook detects old format and migrates it
  2. Add annotation annotations.MigrationWarningPrefix + "name" with warning message
  3. Validating webhook calls collectMigrationWarnings() to return warnings to user
model.Annotations[annotations.MigrationWarningPrefix+"provider"] = fmt.Sprintf(
    "spec.type is deprecated for provider values - migrated '%s' to spec.provider",
    originalType,
)

See internal/annotations/annotations.go for MigrationWarningPrefix and internal/webhook/v1/model_webhook.go for implementation.

CRD Changes

When modifying Go types in api/v1alpha1/, use the ark-controller-development skill for guidance on syncing CRDs to the Helm chart.

Testing

Unit Tests

make test          # Run all tests
go test ./internal/controller/... -v
go test ./internal/webhook/... -v

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.