agentleFS
giantswarmgiantswarm/muster/AGENTS.md

muster

AGENTS.md40 starsChanged 10 months agoApache-2.0View on GitHub

Muster is a universal control plane and meta-MCP (Model Context Protocol) server aggregator for platform engineers and AI agents. It manages multiple backend MCP servers, provides intelligent tool discovery/filtering, includes a mcp-native workflow engine, and exposes its own functionality through mcp tools as well. All inter-package communication goes through internal/api. This is the most critical architectural rule:

  • Installs packages

The file

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

7 rules. About 0 are common, 2 are distinctive, and 5 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.

  • 5

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

    All inter-package communication goes through internal/api.

    line 35
  2. Very specific:

    Anti-pattern: Never import workflow or mcpserver packages directly

    line 41
  3. Distinctive:

    File size: Keep under 400 lines, refactor larger files

    line 71
  4. Very specific:

    Package docs: Every package must have a doc.go

    line 72
  5. Very specific:

    No flaky tests: Never use time.Sleep in tests.

    line 74
  6. Very specific:

    Schema: Don't edit schema.json manually — generated via muster test --generate-schema

    line 75
  7. Distinctive:

    BDD scenarios are truth: If a scenario fails, fix the code, not the scenario

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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

This file provides guidance to coding agents working with code in this repository.

What is Muster

Muster is a universal control plane and meta-MCP (Model Context Protocol) server aggregator for platform engineers and AI agents. It manages multiple backend MCP servers, provides intelligent tool discovery/filtering, includes a mcp-native workflow engine, and exposes its own functionality through mcp tools as well.

Build & Development Commands

# Build
go build -o ./muster .         # Build the worktree-local binary (gitignored); rebuild after every code change
./muster ...                    # Run it from the worktree; do not `go install` (overwrites the shared ~/.go/bin/muster)

# Testing
make test                         # Unit tests with race detector
./muster test --scenario <name> --verbose         # Run a single BDD scenario
./muster test --scenario <name> --verbose --debug # With debug output
./muster test --parallel 50 --base-port 20000     # Run all scenarios (never 30000-32767: kind NodePorts)

# Code quality (run before every commit)
goimports -w . && go fmt ./...    # Format code
make lint                         # golangci-lint with gosec and goconst
make vet                          # go vet

# Helm
make helm-lint                    # Lint Helm chart

Architecture

Service Locator Pattern (mandatory)

All inter-package communication goes through internal/api. This is the most critical architectural rule:

  • internal/api defines handler interfaces in handlers.go and depends on no other internal package
  • Each service package creates an api_adapter.go implementing the handler interface
  • Adapters register themselves via api.RegisterXxx() functions
  • Consumers retrieve handlers via api.GetXxx() — never import service packages directly
  • Anti-pattern: Never import workflow or mcpserver packages directly

Key Packages

  • cmd/ — CLI commands (serve, agent, auth, test, create, get, list)
  • internal/api/ — Central service locator with handler interfaces and type definitions
  • internal/app/ — Application bootstrap, lifecycle, config loading, service registration
  • internal/aggregator/ — MCP server aggregation, registry, transports (SSE, stdio, streamable-http)
  • internal/agent/ — MCP client, interactive REPL, MCP server mode for AI assistants
  • internal/mcpserver/ — MCP server process management and health checking
  • internal/workflow/ — Workflow definitions, execution engine, templating
  • internal/orchestrator/ — Service lifecycle orchestration and state machine
  • internal/testing/ — BDD test framework, scenarios in scenarios/*.yaml
  • pkg/ — Public packages (Kubernetes APIs, auth, logging, OAuth)

Workflow Tool Naming

  • Internal/API layer: action_<workflow-name>
  • Exposed to users: workflow_<workflow-name> (aggregator maps between them)

Entry Points

  • muster serve → app.NewApplication() → initializes all services, starts aggregator
  • muster agent → REPL, MCP server, or monitoring modes
  • muster test → BDD scenario test runner

Conventions

  • Go version: 1.26.0 (toolchain 1.27.2)
  • Error handling: Wrap with fmt.Errorf("context: %w", err)
  • File size: Keep under 400 lines, refactor larger files
  • Package docs: Every package must have a doc.go
  • Test coverage: 80% minimum for new code
  • No flaky tests: Never use time.Sleep in tests. Never use timers to fix race conditions.
  • Schema: Don't edit schema.json manually — generated via muster test --generate-schema
  • BDD scenarios are truth: If a scenario fails, fix the code, not the scenario
  • Tool naming: <prefix>_<category>_<action> (e.g., x_kubernetes_list_pods)
  • Exit codes: 0=success, 1=error, 2=auth required, 3=auth failed

Releases

  • The squash title of a merged pull request decides its release version. Never mark a commit or pull request title breaking (fix(aggregator)!:) and never add a BREAKING heading to the CHANGELOG unless a maintainer asked for a major release in that conversation: the release automation cuts the major from the title within seconds. Describe a behaviour change in the CHANGELOG entry and ask whether it warrants a major before merging.
  • Debugging a failing scenario, a CI-only failure or a race report: docs/contributing/debugging.md.

Config Locations

  • Default: ~/.config/muster/config.yaml
  • Project: ./.muster/config.yaml
  • Custom: --config-path flag
  • Entity definitions: {configPath}/{workflows,mcpservers}/

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.