agentleFS
enunoenuno/unifi-mcp-server/.agents/skills/source-command-unifi-mcp-test-coverage/SKILL.md

source-command-unifi-mcp-test-coverage

Skill294 starsChanged 18 days agoApache-2.0View on GitHub

Run tests and analyze coverage gaps by module to reach 80% target

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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. Very specific:

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

    line 8
  2. Distinctive:

    Run full test suite with detailed coverage:

    line 18
  3. Very specific:

    Read TESTING_PLAN.md to understand priorities:

    line 34

≈ “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-test-coverage

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

Command Template

Analyze test coverage for the UniFi MCP Server and identify areas needing improvement.

This command runs comprehensive coverage analysis and provides actionable recommendations to reach the 80% coverage target.

Steps to execute:

  1. Run full test suite with detailed coverage:

    pytest --cov=src --cov-report=term-missing --cov-report=html --cov-report=json -v
  2. Analyze coverage by module:
    • Parse coverage.json to extract per-file coverage percentages
    • Identify modules below 80% threshold
    • Prioritize based on TESTING_PLAN.md priorities
  3. Generate coverage gap analysis:
    • List files with coverage < 80%
    • Show missing lines for each file
    • Calculate how many tests needed to reach 80%
  4. Read TESTING_PLAN.md to understand priorities:
    • Phase 1 (Critical): API client, config, webhooks
    • Phase 2 (High): Tool modules by usage frequency
    • Phase 3 (Medium): Utility modules
    • Phase 4 (Low): Edge cases and error scenarios
  5. Provide actionable recommendations:
    • Which module to focus on next
    • Specific functions/lines that need tests
    • Suggested test scenarios to add
    • Estimated effort (number of tests needed)
  6. Compare with previous coverage:
    • Show coverage trend (if available)
    • Highlight improvements or regressions

Report back with:

  • Current overall coverage percentage
  • Coverage by category:
    • API client modules
    • Tool modules (by category)
    • Model modules
    • Utility modules
    • Webhook modules
  • Top 5 files needing the most coverage
  • Recommended next steps based on TESTING_PLAN.md
  • Estimated tests needed to reach 80%

Example output:

Current Coverage: 34.10%
Target: 80%
Gap: 45.90%

Coverage by Category:
✓ Models: 86.62% (above target)
✗ API Client: 45.23% (needs +34.77%)
✗ Tools: 38.54% (needs +41.46%)
✗ Webhooks: 12.00% (needs +68.00%)

Top Priority Files (from TESTING_PLAN.md Phase 1):
1. src/api/client.py - 45.23% (55 missing lines)
   - Need tests for: rate limiting, error handling, retry logic
2. src/config/settings.py - 60.00% (20 missing lines)
   - Need tests for: environment variable loading, validation
3. src/webhooks/receiver.py - 12.00% (88 missing lines)
   - Need tests for: webhook validation, signature checking

Next Action: Focus on src/api/client.py
Estimated effort: 8-10 test cases
Expected coverage gain: +11.13%

Integration with TESTING_PLAN.md:

  • Reference Phase priorities
  • Track completion of milestones
  • Suggest updates to the plan based on findings

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.