muster / rules
Cursor rule34 starsChanged 10 months agoApache-2.0View on GitHub
- Core Testing Loop - Whenever you change Go code and want to test the new functionality, you MUST follow these steps: 1. Restart the Service: Run the development restart script to rebuild and restart the muster service with your changes. 2. Initial Log Check: Verify that the service started correctly by checking the logs. Look for any startup errors or unexpected messages. - Debugging Examples - 1. Verify All Services Are Running: Start by checking the overall health of…
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/github-workflow.mdcCursor rule
- .cursor/rules/zz_generated.base-llm-rules.mdcCursor rule
- .cursor/rules/zz_generated.go-llm-rules.mdcCursor rule
The file
Show its rules and text
We split this mcp-debugging.mdc into the rules it gives an agent
28 rules. About 0 are common, 21 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Run the development restart script to rebuild and restart the muster service with your changes.
- Distinctive: line 14
Verify that the service started correctly by checking the logs.
- Distinctive: line 18
Look for any startup errors or unexpected messages.
- Very specific: line 21
Use the mcp-debug tools to interact with the running service and test your new functionality.
- Distinctive: line 22
Start by listing the available tools to ensure your new features are registered.
- Very specific: line 38
Always use
--no-pager: When using journalctl or systemctl, you MUST include the --no-pager flag. - Distinctive: line 43
Use mcp-debug tools as the primary debugging interface rather than manual inspection
- Distinctive: line 58
Start by checking the overall health of the system:
- Distinctive: line 63
Verify that all expected MCP servers are properly registered with the aggregator:
- Very specific: line 68
Check its detailed status: core_service_status
- Distinctive: line 70
Check if its MCP client is attached in the service list
- Very specific: line 72
Use core_workflow_validate to check syntax
- Very specific: line 73
Ensure tool names exist (check with mcp_mcp-debug_list_tools)
- Distinctive: line 74
Verify argument schemas match the tool requirements
- Very specific: line 89
All MCP servers services show "health": "Healthy" and "state": "Running"
- Distinctive: line 128
Action: Check MCP server health, restart if needed
- Distinctive: line 132
✅ DO: Always clean up test ServiceClasses, Workflows, MCP servers and Services after debugging
- Distinctive: line 133
✅ DO: Use unique, identifiable labels for test instances (e.g., "debug-test-<timestamp>")
- Distinctive: line 134
❌ DON'T: Leave test ServiceClasses, Workflows, MCP servers and Services
- Distinctive: line 137
Document the issue in the debugging session
- Distinctive: line 138
Update the debugging workflow if new issues are discovered
- Distinctive: line 139
Add specific examples to the common issues section
- Distinctive: line 140
Create reproduction steps for any bugs found
- Distinctive: line 143
NEVER skip health verification when debugging
- Distinctive: line 144
ALWAYS clean up test instances after debugging sessions
- Distinctive: line 145
DOCUMENT new issues in the documentation
- Distinctive: line 146
USE mcp-debug tools as the primary debugging interface
- Distinctive: line 147
FOLLOW a systematic approach rather than ad-hoc investigation
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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.
Files
---
description:
globs:
alwaysApply: false
---
- **Core Testing Loop**
- Whenever you change Go code and want to test the new functionality, you **MUST** follow these steps:
1. **Restart the Service:**
Run the development restart script to rebuild and restart the `muster` service with your changes.
```bash
./scripts/dev-restart.sh
```
2. **Initial Log Check:**
Verify that the service started correctly by checking the logs.
```bash
journalctl --user -u muster.service --no-pager |tail -n 50
```
Look for any startup errors or unexpected messages.
- **Test with `mcp-debug`:**
- Use the `mcp-debug` tools to interact with the running service and test your new functionality.
- Start by listing the available tools to ensure your new features are registered.
```
# Example: List all tools from the mcp-debug server
mcp_mcp-debug_call_tool(name="core_mcpserver_list_tools", arguments={ "serverName": "mcp-debug" })
```
- Then, call the specific tools related to your changes to validate their behavior.
```
# Example: Call a specific tool
mcp_mcp-debug_call_tool(name="your_new_tool", arguments={...})
```
- **Final Log Check:**
- Inspect the logs again to see the output and any errors generated during your testing.
```bash
journalctl --user -u muster.service --no-pager |tail -n 50
```
- **Important Note**
- **Always use `--no-pager`:** When using `journalctl` or `systemctl`, you **MUST** include the `--no-pager` flag. Without it, the output will be piped to a pager program, and you will not receive a response in the terminal.
- **Debugging muster via mcp-debug**
- mcp-debug provides core debugging tools to test and explore the functionality of muster exposed in its aggregated MCP server.
- Use mcp-debug tools as the primary debugging interface rather than manual inspection
- **mcp-debug Tools**
- mcp_mcp-debug_list_tools: list all the tools exposed by the aggregated mcp server
- mcp_mcp-debug_describe_tool: describe a tool exposed by the aggregated mcp server
- mcp_mcp-debugcall_tool: execute a tool exposed by the aggregated mcp server
- **Aggregated MCP server**
- The aggregated MCP server is exposed by muster. This is the main subject of development and debugging here.
- The aggregated MCP server exposes tools via the model-context-protocol that you can explore via mcp-debug
- The main functionality of muster is exposed through the tools that are prefixed with `core_*`
- The aggregated MCP server can be compiled and restarted via `./scripts/dev-restart.sh`
- **Debugging Examples**
- 1. Verify All Services Are Running:
Start by checking the overall health of the system:
```
mcp_mcp-debug_call_tool(name="core_service_list", arguments={})
```
- 2. Check MCP Server Registration:
Verify that all expected MCP servers are properly registered with the aggregator:
```
mcp_mcp-debug_call_tool(name="core_mcpserver_list", arguments={})
```
- 3. If a service shows as unhealthy:
1. Check its detailed status: `core_service_status`
2. Try restarting it: `core_service_restart`
3. Check if its MCP client is attached in the service list
- 4. Workflow validation fails:
- Use `core_workflow_validate` to check syntax
- Ensure tool names exist (check with `mcp_mcp-debug_list_tools`)
- Verify argument schemas match the tool requirements
- **Important Notes**
- The tools with the prefix `x_` are coming from the MCP servers that are managed by muster and then aggregated in its own MCP server. Please don't try to fix them. They are separate projects.
- Tool names from individual MCP servers get prefixed like this `x_kubernetes_*` for the kubernetes MCP server and `x_prometheus_*` for the prometheus MCP server
- **Debugging Approach**
- Phase 1: System Health Verification
```
mcp_mcp-debug_call_tool(name="core_mcpserver_list", arguments={})
mcp_mcp-debug_call_tool(name="core_serviceclass_list", arguments={})
mcp_mcp-debug_call_tool(name="core_workflow_list", arguments={})
mcp_mcp-debug_call_tool(name="core_service_list", arguments={})
```
Key Checks:
- All MCP servers services show `"health": "Healthy"` and `"state": "Running"`
- ServiceClasses show `"available": true`
- No `missingTools` in ServiceClass definitions
- ServiceClass-Specific Testing
```
# Test specific ServiceClass availability
mcp_mcp-debug_call_tool(name="core_serviceclass_available", arguments={"name": "<serviceclass-name>"})
# Test instantiation with safe parameters
mcp_mcp-debug_call_tool(name="core_service_create", arguments={
"serviceClassName": "<name>",
"label": "debug-test",
"parameters": {...}
})
```
- Dependency Verification
```
# Test underlying tools directly
mcp_mcp-debug_call_tool(name="<required-tool>", arguments={...})
# Verify connectivity to external systems
```
- Service Recovery
```
# Restart failed services
mcp_mcp-debug_call_tool(name="core_service_restart", arguments={"label": "<service-name>"})
# Check detailed status
mcp_mcp-debug_call_tool(name="core_service_status", arguments={"label": "<service-name>"})
```
- Service Instance Management
```
# List and clean up test instances
mcp_mcp-debug_call_tool(name="core_service_list", arguments={})
mcp_mcp-debug_call_tool(name="core_service_delete", arguments={"instanceId": "debug-test"})
```
- **Tool Missing Errors**
- **Pattern:** `missingTools` array not empty in ServiceClass list
- **Action:** Check MCP server health, restart if needed
- **Root Cause:** Usually failed MCP server initialization
- **Cleanup Protocol**
- **✅ DO:** Always clean up test ServiceClasses, Workflows, MCP servers and Services after debugging
- **✅ DO:** Use unique, identifiable labels for test instances (e.g., "debug-test-<timestamp>")
- **❌ DON'T:** Leave test ServiceClasses, Workflows, MCP servers and Services
- **When Debugging ServiceClasses, Workflows, MCP servers and Services**
- Document the issue in the debugging session
- Update the debugging workflow if new issues are discovered
- Add specific examples to the common issues section
- Create reproduction steps for any bugs found
- **Mandatory Workflow Adherence**
- NEVER skip health verification when debugging
- ALWAYS clean up test instances after debugging sessions
- DOCUMENT new issues in the documentation
- USE mcp-debug tools as the primary debugging interface
- FOLLOW a systematic approach rather than ad-hoc investigation
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
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.

