AI Skills
One canonical SKILL.md file describes every Sentroy API surface, auth mode, SDK call and gotcha. AI coding tools read it, so your agent stops trial-and-erroring its way through our REST endpoints — and you stop pasting docs into chat.
Overview#
Sentroy publishes a single source-of-truth SKILL.md alongside the @sentroy-co/client-sdk npm package. Claude Code, Cursor, Windsurf, Codex, Aider and other agent harnesses read it as part of their working context, so they know — without guessing — that auth tokens start with stk_, that the SDK constructor takes a companySlug, that send.execute needs a permission scope, and so on.
The skill ships pinned to the SDK version. npm install @sentroy-co/client-sdk@latest bumps both, so when we ship a new resource (or break an old shape — rare, but it happens), your agent context updates with one command.
Why install the skill#
Three concrete wins for any team using AI to build against Sentroy.
- Hands-off coding. Agents immediately know which auth header to send for which endpoint —
stk_(Bearer access token, SDK entrypoint) vsaps_(Auth Project key, end-user pool) vsx-internal-secret(server-to-server). No more “why is this 401-ing” loops. - Less hallucination. Agents reference the canonical
SKILL.mdinstead of inventing endpoint shapes from training data (which is months out of date and missing every resource we shipped this year). Resource lists, payload shapes, error codes — all real. - Always-fresh.The skill ships pinned to the SDK version. Bumping the SDK bumps the skill in lock-step, so the agent context can never drift behind the code you're actually calling.
Installing the skill#
One command. The CLI autodetects which AI tools your project already uses and writes the skill in the right format for each.
Run it with npx — no install needed:
npx @sentroy-co/client-sdk ai installOr, if the SDK is already a dependency in your project, use the bin name directly:
sentroy ai installThe CLI walks your project root, identifies every supported AI tool present (Claude Code, Cursor, Windsurf, AGENTS.md consumers), and writes the skill into each at the canonical location for that tool. Re-running is idempotent — sentinel blocks let the CLI replace only its own section without touching anything you've added by hand.
Flags
| Name | Type | Description |
|---|---|---|
| --claude | boolean | Force-install for Claude Code / Claude Agent SDK (writes to .claude/skills/sentroy/SKILL.md), even if no .claude/ directory is detected. |
| --cursor | boolean | Force-install for Cursor (writes to .cursor/rules/sentroy.mdc in MDC format with appropriate frontmatter). |
| --windsurf | boolean | Force-install for Windsurf / Cascade (merges into .windsurfrules inside a sentinel block). |
| --agents | boolean | Force-install into AGENTS.md at the project root — the universal convention picked up by Codex, Aider, Continue, and most other agent harnesses. |
| --all | boolean | Install to every supported target regardless of autodetection. Useful for monorepos where the agent context may shift between editors. |
| --upgrade | boolean | Force-rewrite even if the existing sentinel block matches the current skill version. Use when re-syncing after a manual edit, or to repair a partially-written file. |
| --check | boolean | Dry-run mode. Reports which targets would be written / updated / skipped without touching any file. Exits non-zero if any target is out of date — handy in CI. |
| --source <path|url> | string | Override the source of the skill. Defaults to the SKILL.md bundled with the installed SDK; pass a file path or HTTPS URL to point at a fork (internal additions, pinned older version, etc.). |
What gets installed where#
The CLI maps each tool to its canonical location and format. Re-runs replace only the Sentroy block — your other content is untouched.
| Tool | Detected via | Written to | Format |
|---|---|---|---|
| Claude Code / Agent SDK | .claude/ or CLAUDE.md | .claude/skills/sentroy/SKILL.md | SKILL.md with frontmatter |
| Cursor | .cursor/ | .cursor/rules/sentroy.mdc | MDC format |
| Windsurf | .windsurfrules | .windsurfrules (sentinel block) | merged section |
| Universal (Codex, Aider, etc.) | always | AGENTS.md (cwd root, sentinel block) | merged section |
What’s in the skill#
A walk-through of the sections inside SKILL.md so you know what your agent is reading.
- Auth modes. Token prefixes (
stk_,aps_,oat_), header shape, when to use which, and concrete examples for each. - Base URLs. Production (
https://sentroy.com) plus subdomain map for mail / storage / auth and how SDK routing hides the/api/mail/*rewrites. - Install snippets. npm / bun / pnpm / yarn commands so the agent picks the right package manager from your lockfile.
- Common task recipes.“Send a transactional email,” “upload a file with multipart,” “list a bucket,” “sign up an end user” — each as a 5-10 line working snippet.
- Resource API surface. Method signatures for every
sentroy.domains.*,sentroy.mailboxes.*,sentroy.media.*etc. with required and optional params labelled. - LocalizedString gotcha. Why
nameon most resources is{tr, en}rather than a string, with the right shape inline. - Permission scopes. The full permission-string vocabulary (
domains.create,storage.view,send.execute, …) so agents can ask for the right scope when creating tokens. - Error codes. Response shapes for 400 / 401 / 403 / 422 / 429, with the canonical
{error: {code, message, details}}envelope. - Rate limits. Per-token RPS, per-endpoint burst windows, the headers we surface (
X-RateLimit-*) and back-off advice. - Gotchas. Cross-subdomain cookie quirks, the avatar upload split (
DirectAvatarUploadvsMediaManagerTrigger), build-time DB connection flakiness, and theSelectValueconvention. - CLI reference. Every
sentroy *subcommand with flags — so the agent can drive the CLI as well as the API. - Versioning. The skill embeds the SDK semver it was built against, so the agent can tell when its context is older than the installed package.
Public URLs#
For agents that can’t (or shouldn’t) run the CLI — fetch the skill straight off the docs origin.
We mirror the canonical skill on three stable URLs. Use llms.txt for discovery (small, lists every doc page), skill.md for the full SKILL.md with frontmatter, and agents.md for the frontmatter-stripped version that drops cleanly into AGENTS.md.
# Discovery index (~80 lines — what docs exist, which is canonical)
curl https://docs.sentroy.com/llms.txt
# Canonical SKILL.md (with frontmatter)
curl https://docs.sentroy.com/skill.md
# Frontmatter-stripped — paste into AGENTS.md
curl https://docs.sentroy.com/agents.md
# Raw GitHub backup (if docs.sentroy.com is unreachable)
curl https://raw.githubusercontent.com/Sentroy-Co/client-sdk/main/typescript/skill/SKILL.mdUpdating#
The skill is pinned to the SDK version. Bumping one bumps the other; the CLI handles the rest.
To pull the latest skill content, bump the SDK and re-run install with --upgrade:
bun add @sentroy-co/client-sdk@latest
# or: npm install @sentroy-co/client-sdk@latest
sentroy ai install --upgradeWithout --upgrade, the CLI hashes the existing sentinel block and skips the write if the content is unchanged. With it, every target is force-rewritten — useful if you've manually edited the block and want to discard your changes, or if a previous install was interrupted.
Building your own skill#
Have internal conventions, team-specific rules, or a private API your agent should know about? Append them below the Sentroy block — they survive re-installs.
For AGENTS.md and .windsurfrules, the sentinel block only owns its own region. Anything before or after it is preserved verbatim, even across --upgrade runs. Use that to layer your own rules on top:
# Project: acme-internal
Use Bun, not npm. Database is Postgres (Drizzle ORM). Never edit
`packages/legacy-billing/` — talk to @finance first.
<!-- sentroy-skill-begin -->
... auto-managed Sentroy SKILL.md ...
<!-- sentroy-skill-end -->
## Acme conventions
- Email sender domain is always `@acme.dev` (set via SENTROY_DEFAULT_DOMAIN).
- All storage uploads go in the `assets-prod` bucket — never create new buckets without ticket approval.
- For magic-link signups, use our internal wrapper at `lib/auth/sentroy.ts`, not the SDK directly.Claude Code is a special case — it reads every file under .claude/skills/, so the cleanest layout is to keep the Sentroy skill as its own file (.claude/skills/sentroy/SKILL.md) and add your conventions as separate sibling files (.claude/skills/acme/SKILL.md). No merging required.
Editor-specific tips#
How each supported tool surfaces the skill, plus the one or two settings that matter.
Claude Code#
The skill is auto-discovered on session start — no configuration needed. The agent can invoke it via the Skill tool whenever the user's prompt mentions Sentroy keywords (domains, mailboxes, buckets, send, auth project, access token). Frontmatter advertises trigger keywords; you can edit them in .claude/skills/sentroy/SKILL.md if your team uses different terminology.
Cursor#
The MDC rule defaults to alwaysApply: false with a keyword trigger list — so Cursor only injects the skill when the prompt or open file looks Sentroy-related. To force it into every prompt (handy if your project is Sentroy top-to-bottom), edit the frontmatter at the top of .cursor/rules/sentroy.mdc and set alwaysApply: true.
Windsurf / Cascade#
Cascade reads .windsurfruleson every prompt — no triggering, the file is always in context. Keep the file under ~6,000 tokens total; the Sentroy block is ~3,200 today, leaving room for your own rules. If you exceed Cascade's context budget, move project-specific rules to .codeiumignore-style scoped files and keep only the Sentroy block in .windsurfrules.
AGENTS.md (Codex, Aider, others)#
AGENTS.md sits at the project root and is read on every prompt by Codex CLI, Aider, Continue, and most other open-source harnesses. The CLI writes the Sentroy block in-place; you own everything around it. Re-installs touch only the sentinel region — your other content is safe.