Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/giantswarm/muster/architecturegit clone --depth 1 https://github.com/giantswarm/musterWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01283 | $0.01283 |
| Opus 5 | $0.00642 | $0.00642 |
| Sonnet 5 | $0.00257 | $0.00257 |
| Haiku 4.5 | $0.00128 | $0.00128 |
Grade A, and why
architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.
-
Architectural principles
- This document outlines the fundamental architectural principles and patterns for the
mustercodebase. Adherence to these guidelines is mandatory to maintain a clean, decoupled, and testable system.
- This document outlines the fundamental architectural principles and patterns for the
-
The API Service Locator Pattern
- All inter-package communication MUST go through the central API layer. This is the most critical rule in our architecture. It prevents direct coupling between packages, enabling them to be developed, tested, and refactored independently.
-
Core Concepts
- Central API: The
internal/apipackage acts as a service locator. It contains handlers for all core muster functionality and also the tool definitions exposed by the aggregator package. - Interface-Driven: Packages communicate using interfaces defined in
internal/api/handlers.go. They do not know about each other's concrete implementations. - One-Way Dependency: All packages can depend on
internal/api, butinternal/apidepends on no other package in the project. This is crucial for preventing circular dependencies.
- Central API: The
-
Define Interface in API: Add a new handler interface to
internal/api/handlers.go.// internal/api/handlers.go type MyServiceHandler interface { DoSomething(ctx context.Context) error } -
Implement Adapter in Service Package: In the package providing the functionality (e.g.,
internal/myservice), create anapi_adapter.go. This adapter implements the interface and calls the package's internal logic.// internal/myservice/api_adapter.go type Adapter struct { logic *ServiceLogic } func (a *Adapter) DoSomething(ctx context.Context) error { return a.logic.performAction(ctx) } -
Register the Adapter: Implement a
Register()method on the adapter that calls the registration function in theapipackage.// internal/myservice/api_adapter.go func (a *Adapter) Register() { api.RegisterMyService(a) } -
Consume via API: Any other package that needs to use the service MUST retrieve the handler from the
apipackage. It MUST NOT import the service package directly.// in another_package/logic.go import "github.com/giantswarm/muster/internal/api" func DoWork(ctx context.Context) { handler := api.GetMyService() if handler == nil { // Handle case where service is not available return } handler.DoSomething(ctx) } -
Workflow executions
- From the user perspective workflows are executed via the tools
workflow_<workflow-name>. - In the workflows and api package these workflow execution tools are still called
action_<workflow-name>. - The aggregator maps the
action_<workflow-name>tools to the actualworkflow_<workflow-name>.
- From the user perspective workflows are executed via the tools
-
CRITICAL: Anti-Patterns
- NEVER import workflow, mcpserver, serviceclass and service packages directly. This creates tight coupling and violates the core architectural principle.
- NEVER USE TIMER/SLEEP/WAIT TO FIX TESTS OR RACE CONDITIONS. NEVER!!
- ALWAYS retrieve handlers from the
apipackage. - Don't change schema.json manually It is generated via
muster test --generate-schemaand changes are the result of the actual api ofmuster serve.
-
BDD test scenarios
- Execute test scenarios like this:
muster test --scenario <scenario> --verbose - Make sure muster is up to date: Use
go install - Always update muster after a code change in go
- There is no need to start muster serve: Each test scenario is executed in its own environment and its own instance of
muster serve - Always treat the scenario as the defined and supposed user behavior: If a scenario fails it is most likely a regression and the code needs to be fixed and not the scenario.
- To see debug messages during test scenario execution: You need to add a
--debugflag:muster test --scenario <scenario> --verbose --debug - Never ever stop or commit with failing test scenarios: You must fix them.
- Execute test scenarios like this:
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 105 lines · 1,283 tokens per session scan A f7eadfd8c142
architecture is a cursor rule published in the GitHub repository giantswarm/muster (28 stars, last pushed 2d ago), licensed Apache-2.0. It adds 1,283 tokens to every session, about $0.0064 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
tdd
Final Verification: Always use: go test -v ./backend/api/handler/... | grep FAIL.
05-web-development
Use the following format for code blocks.
03-project-structure
The repository is organized in a monorepo using pnpm workspaces: pnpm-workspace.yaml. It contains the following.
php-types-validation
Guidelines for type definitions and validation in PHP MCP SDK.
php-client-implementation
Guidelines for implementing MCP clients in PHP.
on-load-rule
This guide outlines the critical development principles for this Swift project.