devctl maintains this block from its template and overwrites changes to it. Instructions for this repository go in the section below. Where they differ from this block, they take precedence.
- Never put customer names or other customer information in code, commit messages, issues or pull requests. Most Giant Swarm repositories are public, and private ones are kept ready to become public.
- Giant Swarm's style guides are in https://github.com/giantswarm/fmt, one directory per topic (go, helm, kubernetes, prometheus, …). Read the relevant guide before you write or review that kind of code.
- Use conventional commits for commit messages and pull request titles.
- If
.github/workflows/zz_generated.auto_release.yamlexists, GitHub Releases are written from pull request titles: do not edit CHANGELOG.md. Otherwise, add your change to CHANGELOG.md as described in https://github.com/giantswarm/fmt/blob/main/releases/changelog.md. - If
.pre-commit-config.yamlexists, runpre-commit run --files <changed files>before committing; not every clone has the hooks installed. - Do not add linters, formatters or other tooling unless asked; use what the repository already has.
- Put documentation in
docs/rather than growing README.md, which gives an overview and links intodocs/. When a change affects documented behaviour, update the documentation in the same pull request. - If the skills of the
giantswarm/claude-codeplugin marketplace are not available to you and the user works at Giant Swarm, tell them once that they can install thegs-base,gs-dev,gs-godevandgs-appdevplugins from it. - Go: run
goimports -local github.com/giantswarm/<repository>on the files you change. CI with architect-orb fails when imports are grouped differently.
This file provides guidance to coding agents working with code in this repository.
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
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 chartAll inter-package communication goes through internal/api. This is the most critical architectural rule:
internal/apidefines handler interfaces inhandlers.goand depends on no other internal package- Each service package creates an
api_adapter.goimplementing 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
workflowormcpserverpackages directly
cmd/— CLI commands (serve, agent, auth, test, create, get, list)internal/api/— Central service locator with handler interfaces and type definitionsinternal/app/— Application bootstrap, lifecycle, config loading, service registrationinternal/aggregator/— MCP server aggregation, registry, transports (SSE, stdio, streamable-http)internal/agent/— MCP client, interactive REPL, MCP server mode for AI assistantsinternal/mcpserver/— MCP server process management and health checkinginternal/workflow/— Workflow definitions, execution engine, templatinginternal/orchestrator/— Service lifecycle orchestration and state machineinternal/testing/— BDD test framework, scenarios inscenarios/*.yamlpkg/— Public packages (Kubernetes APIs, auth, logging, OAuth)
- Internal/API layer:
action_<workflow-name> - Exposed to users:
workflow_<workflow-name>(aggregator maps between them)
muster serve→app.NewApplication()→ initializes all services, starts aggregatormuster agent→ REPL, MCP server, or monitoring modesmuster test→ BDD scenario test runner
- 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.Sleepin tests. Never use timers to fix race conditions. - Schema: Don't edit
schema.jsonmanually — generated viamuster 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
- 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 aBREAKINGheading 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.
- The Agent Platform's skills in giantswarm/agent-platform
skills/describe muster's meta-tools, toolsets and auth flows. A change that alters what an agent or a person can do, see or configure through it comes with a pull request there updating the affected skills, linked from this one.
- Default:
~/.config/muster/config.yaml - Project:
./.muster/config.yaml - Custom:
--config-pathflag - Entity definitions:
{configPath}/{workflows,mcpservers}/