agentleFS
enunoenuno/unifi-mcp-server/.agents/skills/source-command-unifi-mcp-add-tool/SKILL.md

source-command-unifi-mcp-add-tool

Skill294 starsChanged 18 days agoApache-2.0View on GitHub

Scaffold a new UniFi MCP tool with model, function, tests, and docs

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 10 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when the user asks to run the migrated source command unifi-mcp-add-tool.

    line 8
  2. Distinctive:

    Ask the user for tool details:

    line 18
  3. Very specific:

    Create or update the Pydantic model in src/models/:

    line 25
  4. Distinctive:

    If the model file for the category doesn't exist, create it

    line 26
  5. Distinctive:

    Add request/response models based on UniFi API schema

    line 27
  6. Distinctive:

    Add validators if needed

    line 29
  7. Very specific:

    Create the tool function in src/tools/:

    line 31
  8. Distinctive:

    If the tool file for the category doesn't exist, create it

    line 32
  9. Distinctive:

    Add confirmation/dry-run support for mutating operations

    line 34
  10. Very specific:

    Create comprehensive unit tests in tests/unit/:

    line 46
  11. Very specific:

    Test file following naming convention: test_<category>_tools.py

    line 47
  12. Distinctive:

    Add tool to appropriate category section

    line 56
  13. Distinctive:

    Never expose sensitive credentials in code

    line 87
  14. Distinctive:

    Always use async/await for I/O operations

    line 88
  15. Distinctive:

    Follow the principle of least privilege

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill 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
SKILL.md

source-command-unifi-mcp-add-tool

Use this skill when the user asks to run the migrated source command unifi-mcp-add-tool.

Command Template

Scaffold a complete new MCP tool for the UniFi MCP Server.

This command creates all necessary files and code for a new tool following the project's architecture and standards.

Steps to execute:

  1. Ask the user for tool details:
    • Tool name (e.g., "get_port_profile")
    • Tool category (e.g., "networks", "devices", "clients", "firewall")
    • Brief description of what the tool does
    • UniFi API endpoint it will use
    • Whether it's a read-only or mutating operation
  2. Create or update the Pydantic model in src/models/:
    • If the model file for the category doesn't exist, create it
    • Add request/response models based on UniFi API schema
    • Include proper type hints and field descriptions
    • Add validators if needed
  3. Create the tool function in src/tools/:
    • If the tool file for the category doesn't exist, create it
    • Implement async tool function with proper error handling
    • Add confirmation/dry-run support for mutating operations
    • Include comprehensive docstring with:
      • Description
      • Parameters
      • Returns
      • Raises
      • Example usage
  4. Register the tool in src/main.py:
    • Add import statement
    • Register tool with FastMCP
  5. Create comprehensive unit tests in tests/unit/:
    • Test file following naming convention: test_<category>_tools.py
    • Include tests for:
      • Success case with mocked API response
      • Error handling (authentication, network, API errors)
      • Validation of parameters
      • Confirmation/dry-run mode (if applicable)
    • Aim for 80%+ coverage
  6. Update API.md documentation:
    • Add tool to appropriate category section
    • Include description, parameters, returns, example
  7. Run validation:
    • Format code: black src/ tests/
    • Check tests: pytest tests/unit/test_<category>_tools.py -v
    • Verify registration: python -c "from src.main import mcp; print(mcp.list_tools())"

Report back with:

  • Summary of files created/modified
  • Tool registration confirmation
  • Test results
  • Next steps for integration testing
  • Reminder to update TESTING_PLAN.md if needed

Example workflow:

User: "I want to add a tool to get WLAN groups"
Assistant:
1. Creates src/models/wifi.py with WLANGroupResponse model
2. Creates src/tools/wifi.py with get_wlan_groups() function
3. Updates src/main.py to register the tool
4. Creates tests/unit/test_wifi_tools.py
5. Updates API.md with documentation
6. Runs tests and reports results

Safety checks:

  • Never expose sensitive credentials in code
  • Always use async/await for I/O operations
  • Include proper type hints for all parameters
  • Follow the principle of least privilege
  • Validate all user inputs

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.