api-integration

api-integration is a skill for Claude Code from atretyak1985/swarmery. It costs 43 tokens per session (819 once invoked), scanned A, original, Apache-2.0.

A development guide for connecting application layers through REST APIs, database queries, WebSockets, and server-sent events. These are ways for software to exchange ordinary requests or live updates.

In plain words
What is it for?
Use it to build route handlers, ORM queries, telemetry connections, live browser updates, and API clients.
Why use it?
It provides checks for authentication, input validation, database use, environment settings, and cleanup of live connections while implementing integrations.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the core plugin — 37 skills, 8 commands, 13 agents shipped together

Good fit Use it to build route handlers, ORM queries, telemetry connections, live browser updates, and API clients.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/atretyak1985/swarmery/api-integration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add atretyak1985/swarmery --skill api-integration
Clone the repo
git clone --depth 1 https://github.com/atretyak1985/swarmery

Made for: Claude Code.

Or install core, the plugin that ships this one along with the rest of its 37 skills, 8 commands, 13 agents.

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 api-integration

README.md
[![agentmods](https://agentmods.dev/badge/skills/atretyak1985/swarmery/api-integration/github.svg)](https://agentmods.dev/skills/atretyak1985/swarmery/api-integration)
Your own site
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/api-integration"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/api-integration/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 api-integration

Your own site · 80×15
<a href="https://agentmods.dev/skills/atretyak1985/swarmery/api-integration"><img src="https://agentmods.dev/badge/skills/atretyak1985/swarmery/api-integration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 819 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.00043 $0.00819
Opus 5.5 $0.00017 $0.00328
Sonnet 5.5 $0.00009 $0.00164
Haiku 4.5 $0.00004 $0.00082

Measured 1mo ago against content hash 953b1539191f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-integration 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.

plugins/core/skills/api-integration/SKILL.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Purpose

Produce tested integration code connecting the platform's layers: REST route handlers in the main app (project.json -> mainApp), ORM queries, server-side WebSocket clients for device/edge telemetry (project.json -> device), and SSE endpoints fanning real-time data to browsers. Generated code follows project conventions; patterns use Drizzle ORM — adapt to the project's actual ORM (project.json -> stack.db).

Rules (never violate)

  • Verify the real ORM schema before writing; STOP and ask if table or column names are missing or ambiguous — never code against a guessed schema.
  • Always getDb() (lazy init), await auth() with 401 on authenticated routes, dynamic = 'force-dynamic' on session/env-reading routes, Zod on all external data.
  • Never hardcode environment-specific values (URLs, hostnames, API keys) — use getServerEnv(); refuse if asked.
  • Every useEffect opening an EventSource/WebSocket returns a cleanup function.
  • Never overwrite an existing file without reading it and informing the user first.
  • After any write, run api-contract to verify field alignment across layers.

Resources

  • Read resources/integration-patterns.md when writing code — the six reference patterns (REST handler, ORM queries, lazy DB init, WebSocket, SSE, EventSource hook).
  • Read resources/procedure-and-checks.md when executing a task — the 8-step procedure, self-check, common mistakes, escalation, failure modes, and a full worked example.

How to use

What it does

Writes the integration code connecting your layers: a REST route handler, an ORM query, a server-side WebSocket client ingesting device telemetry, or an SSE endpoint fanning it out. It checks your real schema before writing, then applies project conventions throughout.

When to use it

  • A new route handler under apps/<mainApp>/src/app/api/**/route.ts.
  • An ORM select, insert, update, or delete in a handler or Server Component.
  • A WebSocket telemetry subscription, SSE endpoint, or browser EventSource hook.

Read the full file on GitHub · 65 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 65 lines · 43 tokens per session scan A 953b1539191f

Subscribe to this mod's changes

api-integration is a skill published in the GitHub repository atretyak1985/swarmery (7 stars, last pushed today), licensed Apache-2.0. It adds 43 tokens to every session and 819 once invoked, about $0.0002 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-03.