agentleFS
enunoenuno/unifi-mcp-server/.agents/skills/source-command-unifi-api-docs-update/SKILL.md

source-command-unifi-api-docs-update

Skill294 starsChanged 18 days agoApache-2.0View on GitHub

Update UNIFI_API.md with latest endpoints from developer.ui.com

  • Installs packages

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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-api-docs-update.

    line 8
  2. Distinctive:

    Verify dependencies are installed:

    line 24
  3. Very specific:

    If not installed, run: npm install puppeteer

    line 30
  4. Distinctive:

    Run the API documentation updater:

    line 32
  5. Distinctive:

    Check how many new endpoints were discovered

    line 39
  6. Distinctive:

    Verify the markdown formatting is correct

    line 40
  7. Distinctive:

    All official API URLs are hardcoded (no user input)

    line 128

≈ “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-api-docs-update

Use this skill when the user asks to run the migrated source command unifi-api-docs-update.

Command Template

Scrape the latest UniFi API documentation from developer.ui.com and update docs/UNIFI_API.md with newly discovered endpoints.

This command runs the scripts/update-api-docs.js Puppeteer-based scraper to fetch API documentation from the official UniFi developer site and compare it against the current documentation.

API Sources:

Steps to execute:

  1. Verify dependencies are installed:

    npm list puppeteer

    If not installed, run: npm install puppeteer

  2. Run the API documentation updater:

    node scripts/update-api-docs.js
  3. Review the changes:
    • Check how many new endpoints were discovered
    • Verify the markdown formatting is correct
    • Review the extracted examples and descriptions
  4. Show summary:

    git diff --stat docs/UNIFI_API.md

What the script does:

  1. Extracts endpoints from each API source:
    • Navigates to the getting started page
    • Discovers all endpoint links from the sidebar
    • Filters out non-API pages (getting started, guides, etc.)
  2. Compares with existing documentation:
    • Loads current docs/UNIFI_API.md
    • Checks if each endpoint is already documented
    • Identifies new endpoints to add
  3. Extracts detailed information for new endpoints:
    • HTTP method (GET, POST, PUT, PATCH, DELETE)
    • Endpoint path
    • Description
    • Code examples (curl commands)
    • Reference link to official docs
  4. Updates documentation:
    • Generates markdown sections for each API product
    • Adds new endpoints with proper formatting
    • Appends sections to existing documentation
    • Preserves all existing content

Expected output:

🔍 UniFi API Documentation Updater

Loading existing documentation...
✓ Loaded (42243 characters)

Processing Site Manager v1.0.0...
  Loading https://developer.ui.com/site-manager/v1.0.0/gettingstarted...
  ✓ Found 11 endpoints
  → 4 new endpoints found
    Extracting: Query ISP Metrics...
    Extracting: List SD-WAN Configs...
    Extracting: Get SD-WAN Config by ID...
    Extracting: Get SD-WAN Config Status...

Processing Network v10.1.68...
  Loading https://developer.ui.com/network/v10.1.68/gettingstarted...
  ✓ Found 74 endpoints
  → 3 new endpoints found
    Extracting: Adopt Devices...
    Extracting: List DPI Application Categories...
    Extracting: Quick Start...

Processing Protect v6.2.83...
  Loading https://developer.ui.com/protect/v6.2.83/gettingstarted...
  ✓ Found 41 endpoints
  → 36 new endpoints found
    Extracting: Get application information...
    Extracting: Get viewer details...
    [... more endpoints ...]

Generating updated documentation...
✓ Updated documentation saved to: docs/UNIFI_API.md

📊 Summary:
  Site Manager: +4 new endpoints
  Network: +3 new endpoints
  Protect: +36 new endpoints

✅ Complete!

Report back with:

  • Number of new endpoints discovered per API product
  • Total lines added to documentation
  • Any errors or warnings during extraction
  • Git diff statistics showing the changes

Safety checks:

  • Script only adds new endpoints, never removes existing content
  • All official API URLs are hardcoded (no user input)
  • Runs in headless mode (no manual interaction needed)
  • Timeout handling for slow pages
  • Error handling to skip problematic endpoints

Notes:

  • The script uses Puppeteer to scrape public documentation (no authentication required)
  • First run may take 2-3 minutes depending on network speed
  • Subsequent runs will be faster as most endpoints are already documented
  • Script is safe to run multiple times (idempotent)

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.