agentleFS
giantswarmgiantswarm/mcp-kubernetes/.cursor/rules/architecture.mdc

mcp-kubernetes / rules

Cursor rule2 starsChanged 8 days agoApache-2.0View on GitHub

This document outlines the fundamental architectural principles and patterns for the mcp-kubernetes codebase. Adherence to these guidelines is mandatory to maintain a clean, decoupled, and testable system.

The file

We split this architecture.mdc into the rules it gives an agent

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

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Minimum Coverage: All new code MUST achieve at least 80% unit test coverage.

    line 14
  2. Distinctive:

    Formatting: Before every commit, run:

    line 21
  3. Very specific:

    Dependencies: Before adding a new dependency with go get, search the web to find its latest stable version.

    line 26
  4. Distinctive:

    File Size: Keep files focused and under 500 lines.

    line 28
  5. Very specific:

    Packages: Every package MUST have a doc.go file explaining its purpose.

    line 34
  6. Distinctive:

    Exported Members: Every exported function, type, and variable MUST have a GoDoc comment.

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule 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
architecture.mdc
---
description:
globs: **/*
alwaysApply: true
---
# Architecture Principles

This document outlines the fundamental architectural principles and patterns for the `mcp-kubernetes` codebase. Adherence to these guidelines is **mandatory** to maintain a clean, decoupled, and testable system.

---

## 1. Testing Standards

-   **Minimum Coverage:** All new code **MUST** achieve at least **80% unit test coverage**.
-   **No Flaky Tests:** Tests **MUST** be deterministic. Do not use `time.Sleep` or other mechanisms that can lead to race conditions. Use dependency injection for things like clocks or timers to make code testable.

---

## 2. Go Development & Style

-   **Formatting:** Before **every commit**, run:
    ```bash
    goimports -w .
    go fmt ./...
    ```
-   **Dependencies:** Before adding a new dependency with `go get`, search the web to find its latest stable version. This is a must!
-   **Error Handling:** Wrap errors with `fmt.Errorf("context: %w", err)` to preserve context.
-   **File Size:** Keep files focused and under **500 lines**. Refactor larger files.

---

## 3. Documentation

-   **Packages:** Every package **MUST** have a `doc.go` file explaining its purpose.
-   **Exported Members:** Every exported function, type, and variable **MUST** have a GoDoc comment.
-   **Project Docs:** New features or significant changes require updates to the relevant documents in the `docs/` directory.

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.