unraid-management-agent: Command for GitHub Copilot

.github/prompts/Add REST Endpoint.prompt.md

Add REST Endpoint is a command for GitHub Copilot from ruaan-deysel/unraid-management-agent. It costs 11 tokens per session (506 once invoked), scanned A, original, MIT.

A step-by-step guide for adding a REST API endpoint. REST is a common way for clients to request data or trigger actions over HTTP.

In plain words
What is it for?
Use it to add GET endpoints for cached data or POST endpoints for actions such as controlling a container.
Why use it?
It removes guesswork about choosing a read or control endpoint, validating input, calling the right code, and returning JSON responses.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt.

This is ruaan-deysel/unraid-management-agent's own configuration. It tells GitHub Copilot how to work on unraid-management-agent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything unraid-management-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ruaan-deysel/unraid-management-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ruaan-deysel/unraid-management-agent/main/.github/prompts/Add REST Endpoint.prompt.md
Clone the repo
git clone --depth 1 https://github.com/ruaan-deysel/unraid-management-agent

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Add REST Endpoint

README.md
[![agentmods](https://agentmods.dev/badge/commands/ruaan-deysel/unraid-management-agent/add-rest-endpoint/github.svg)](https://agentmods.dev/commands/ruaan-deysel/unraid-management-agent/add-rest-endpoint)
Your own site
<a href="https://agentmods.dev/commands/ruaan-deysel/unraid-management-agent/add-rest-endpoint"><img src="https://agentmods.dev/badge/commands/ruaan-deysel/unraid-management-agent/add-rest-endpoint/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Add REST Endpoint

Your own site · 80×15
<a href="https://agentmods.dev/commands/ruaan-deysel/unraid-management-agent/add-rest-endpoint"><img src="https://agentmods.dev/badge/commands/ruaan-deysel/unraid-management-agent/add-rest-endpoint.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 506 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.00506
Opus 5 $0.00005 $0.00253
Sonnet 5 $0.00002 $0.00101
Haiku 4.5 $0.00001 $0.00051

Measured 3d ago against content hash c567107d070b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

Add REST Endpoint scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/Add REST Endpoint.prompt.md · 86 lines

What it actually says

Add a New REST Endpoint

Follow these steps to add a new REST API endpoint.

Step 1: Determine Endpoint Type

  • Read-only (GET): Returns cached data from a collector
  • Control (POST): Executes an action via a controller

Step 2: Add Handler

In daemon/services/api/handlers.go:

For GET (cached data)

func (s *Server) handleMyResource(w http.ResponseWriter, _ *http.Request) {
    s.cacheMutex.RLock()
    data := s.myResourceCache
    s.cacheMutex.RUnlock()
    respondJSON(w, http.StatusOK, data)
}

For POST (control operation)

func (s *Server) handleMyAction(w http.ResponseWriter, r *http.Request) {
    vars := mux.Vars(r)
    id := vars["id"]

    // Validate input
    if err := lib.ValidateContainerID(id); err != nil {
        respondJSON(w, http.StatusBadRequest, dto.Response{
            Status:  "error",
            Message: err.Error(),
        })
        return
    }

    // Execute action via controller
    if err := s.controller.MyAction(id); err != nil {
        respondJSON(w, http.StatusInternalServerError, dto.Response{
            Status:  "error",
            Message: err.Error(),
        })
        return
    }

    respondJSON(w, http.StatusOK, dto.Response{
        Status:  "success",
        Message: "Action completed",
    })
}

Step 3: Register Route

In daemon/services/api/server.go setupRoutes():

router.HandleFunc("/api/v1/myresource", s.handleMyResource).Methods("GET")
// or
router.HandleFunc("/api/v1/myresource/{id}/{action}", s.handleMyAction).Methods("POST")

Step 4: Add Swagger Annotations

Add Swagger comments above the handler function, then run make swagger.

Step 5: Test

  • Add handler tests in handlers_test.go or a new test file
  • Test both success and error cases
  • Include security test cases for any user input

Step 6: Document

  • Update CHANGELOG.md
  • Update API documentation in docs/api/
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 86 lines · 11 tokens per session scan A c567107d070b

Subscribe to this mod's changes

Add REST Endpoint is a command published in the GitHub repository ruaan-deysel/unraid-management-agent (53 stars, last pushed 2d ago), licensed MIT. It adds 11 tokens to every session and 506 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.