unifi-mcp-server / rules
Cursor rule294 starsChanged 18 days agoApache-2.0View on GitHub
Common mistakes to avoid and best practices to follow
We split this common-mistakes.mdc into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
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
- Distinctive: line 11
Use synchronous blocking calls in async functions
- Distinctive: line 16
Commit without running pre-commit hooks
- Distinctive: line 23
Use async/await consistently
- Distinctive: line 25
Write tests first (TDD)
- Distinctive: line 28
Run full test suite before committing
- Very specific: line 29
Use async with for resource management
- Distinctive: line 31
Follow project guidelines in CLAUDE.md and AGENTS.md for consistent development practices
- Distinctive: line 71
Security Matters: Never expose credentials or sensitive data
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 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: Common mistakes to avoid and best practices to follow globs: ["src/**/*.py"] alwaysApply: false --- # Common Mistakes to Avoid ## ❌ DON'T - Use synchronous blocking calls in async functions - Omit type hints or use `Any` unnecessarily - Skip tests for new features - Forget `confirm=True` safety checks on mutating operations - Expose sensitive data in logs - Commit without running pre-commit hooks - Mix sync and async code improperly - Return untyped dicts when Pydantic models are appropriate - Ignore project guidelines (`CLAUDE.md`, `AGENTS.md`) when editing command/agent assets or MCP tool instructions ## ✅ DO - Use async/await consistently - Provide comprehensive type hints - Write tests first (TDD) - Implement dry-run mode for dangerous operations - Mask passwords and keys in logs - Run full test suite before committing - Use `async with` for resource management - Define Pydantic models for complex data structures - Follow project guidelines in `CLAUDE.md` and `AGENTS.md` for consistent development practices ## Quick Commands ```bash # Development uv run mcp dev src/main.py # Run with MCP Inspector # Testing pytest # Run all tests pytest -m unit # Unit tests only pytest -m integration # Integration tests only pytest --cov=src --cov-report=html # With coverage report # Code Quality black src/ tests/ # Format isort src/ tests/ # Sort imports ruff check src/ tests/ --fix # Lint and fix mypy src/ # Type check bandit -r src/ # Security scan # Pre-commit pre-commit run --all-files # Run all hooks ``` ## Key Resources - **Project Documentation**: README.md, API.md, CONTRIBUTING.md, SECURITY.md - **MCP Specification**: https://modelcontextprotocol.io/ - **FastMCP Docs**: https://gofastmcp.com/ - **UniFi API**: Official UniFi Controller API documentation - **Pydantic**: https://docs.pydantic.dev/ ## Remember - **Safety First**: Require `confirm=True` for all network modifications - **Test Everything**: 80%+ coverage is not optional - **Type Everything**: Type hints improve code quality and catch bugs - **Document Well**: Future you (and other developers) will thank you - **Async Always**: This is an async-first project - respect the pattern - **Security Matters**: Never expose credentials or sensitive data
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 3,978 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 repository52 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/fastmcp/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .claude/skills/fastmcp/CLAUDE.mdCLAUDE.md
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/environment-setup.mdcCursor rule
- .cursor/rules/mcp-tools.mdcCursor rule
- .cursor/rules/project-context.mdcCursor rule
- .cursor/rules/README.mdCursor rule
- .cursor/rules/unifi-api.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
- FastMCP DevelopmentSkill
- mcp-builderSkill
- source-command-build-dockerSkill
- source-command-check-depsSkill
- source-command-cleanSkill
- source-command-docsSkill
- source-command-formatSkill
- source-command-lintSkill
- source-command-prSkill
- source-command-securitySkill
- source-command-setupSkill
- source-command-testSkill
- source-command-unifi-api-docs-update-2Skill
- source-command-unifi-api-docs-updateSkill
- source-command-unifi-mcp-add-toolSkill
- source-command-unifi-mcp-release-prepSkill
- source-command-unifi-mcp-test-coverageSkill
- source-command-unifi-mcp-update-docsSkill
- unifi-cloud-fleet-toolsSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-protect-toolsSkill
- unifi-security-toolsSkill
- FastMCP DevelopmentSkill
- mcp-builderSkill
- unifi-cloud-fleet-toolsSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-protect-toolsSkill
- unifi-security-toolsSkill
- unifiSkill
- unifi-channel-planningSkill
- unifi-cloud-fleet-toolsSkill
- unifi-devicesSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-networkSkill
- unifi-protect-toolsSkill
- unifi-securitySkill
- unifi-security-toolsSkill
- unifi-systemSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

