saiku: Command for GitHub Copilot

.github/prompts/add-rest-endpoint.prompt.md

add-rest-endpoint is a command for GitHub Copilot from spiculedata/saiku. It costs 19 tokens per session (434 once invoked), scanned A, original, Apache-2.0.

A coding workflow for adding a web API endpoint to Saiku, including its Java resource, application wiring, input checks, access rules, and tests. A web API endpoint is a URL that software can call to read or change data.

In plain words
What is it for?
Use it to add a REST endpoint, connect it to the application, define typed errors, enforce admin-only access where needed, and update the API tests and documentation.
Why use it?
It removes the need to remember Saiku's Jersey and Spring XML conventions and helps avoid exposing sensitive error details or accepting invalid input.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt. Also seen: mentions AGENTS.md.

This is spiculedata/saiku's own configuration. It tells GitHub Copilot how to work on saiku 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 saiku configures →

About the project

Saiku is an open-source semantic layer that represents data as analytical cubes for browser exploration, SQL queries, dashboards, and AI-agent access. It is for analysts and applications that need to query structured business data through Mondrian, Apache Calcite, REST, or MCP. The catalogue instruction helps agents work with Saiku.

spiculedata/saiku · 1,334 stars · on GitHub · saiku.bi

Reuse

Borrowing it

Nothing to install: this file belongs to spiculedata/saiku. 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/spiculedata/saiku/development/.github/prompts/add-rest-endpoint.prompt.md
Clone the repo
git clone --depth 1 https://github.com/spiculedata/saiku

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/spiculedata/saiku/add-rest-endpoint/github.svg)](https://agentmods.dev/commands/spiculedata/saiku/add-rest-endpoint)
Your own site
<a href="https://agentmods.dev/commands/spiculedata/saiku/add-rest-endpoint"><img src="https://agentmods.dev/badge/commands/spiculedata/saiku/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/spiculedata/saiku/add-rest-endpoint"><img src="https://agentmods.dev/badge/commands/spiculedata/saiku/add-rest-endpoint.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 434 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.00019 $0.00434
Opus 5.5 $0.00008 $0.00174
Sonnet 5.5 $0.00004 $0.00087
Haiku 4.5 $0.00002 $0.00043

Measured 1mo ago against content hash af49218a3d9a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 14 lines

What it actually says

Add a REST endpoint: ${input:endpoint:method, path and purpose, e.g. "GET /ai/foo — list foos"}.

  • Resource: a Jersey 3.1 class in saiku-core/saiku-web/src/main/java/org/saiku/web/rest/resources/ using jakarta.ws.rs.*, never Spring @RestController. Add the method to an existing resource if the path belongs to one, e.g. AiQueryResource for /ai/*.
  • Wiring: declare the bean in saiku-webapp/src/main/webapp/WEB-INF/saiku-beans.xml with setter <property> injection (no @Autowired, no @Configuration). SaikuJerseyApplication registers every Spring bean annotated with @Path automatically, so there's no separate Jersey registration step. Request-scoped resources that touch session-scoped beans need <aop:scoped-proxy/>.
  • Security: use @RolesAllowed for admin-only endpoints. Validate every input at the boundary. Never put exception messages, class names or SQL/MDX in responses; GenericExceptionMapper exists to prevent leaks, so return typed errors instead.
  • AI Query surface (/ai/*): keep the typed contract: VALIDATION_ERROR 400s with field and available candidate lists, and never expose MDX. Update docs/AI-QUERY-API.md for contract changes.
  • Tests: a resource test in saiku-core/saiku-web/src/test/java/org/saiku/web/rest/resources/, plus a launcher IT if the endpoint needs a live cube. Bump the module's floor in .github/test-floors.json if you add tests.
  • Finish: mvn spotless:apply, mvn -pl saiku-core/saiku-web -am verify, and a PR against development per AGENTS.md.
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. 1mo ago First seen · 14 lines · 19 tokens per session scan A af49218a3d9a

Subscribe to this mod's changes

add-rest-endpoint is a command published in the GitHub repository spiculedata/saiku (1,334 stars, last pushed yesterday), licensed Apache-2.0. It adds 19 tokens to every session and 434 once invoked, about $0.0001 per session on Opus 5.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-29.