Borrowing it
Nothing to install: this file belongs to jhd3197/CachiBot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/jhd3197/CachiBot/main/.claude/skills/cachibot-api-route/SKILL.mdgit clone --depth 1 https://github.com/jhd3197/CachiBotWrote 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.
[](https://agentmods.dev/skills/jhd3197/cachibot/cachibot-api-route)<a href="https://agentmods.dev/skills/jhd3197/cachibot/cachibot-api-route"><img src="https://agentmods.dev/badge/skills/jhd3197/cachibot/cachibot-api-route/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.
<a href="https://agentmods.dev/skills/jhd3197/cachibot/cachibot-api-route"><img src="https://agentmods.dev/badge/skills/jhd3197/cachibot/cachibot-api-route.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.01833 |
| Opus 5 | $0.00028 | $0.00916 |
| Sonnet 5 | $0.00011 | $0.00367 |
| Haiku 4.5 | $0.00006 | $0.00183 |
Grade A, and why
cachibot-api-route 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 261 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CachiBot API Route Creation
Add new REST API endpoints following CachiBot's FastAPI patterns with Pydantic models, auth, and bot-scoping.
Architecture Overview
- Framework: FastAPI with APIRouter per domain
- Auth: JWT-based via
require_bot_accessdependency - Models: Pydantic BaseModel for request/response schemas
- Storage: Repository pattern with PostgreSQL (SQLAlchemy 2.0 + asyncpg)
- Registration: Routers included in
server.py
Step-by-Step Process
1. Define Pydantic Models
Create or extend models in cachibot/models/<domain>.py:
"""
<Domain> Models
Pydantic schemas for <domain> API.
"""
from pydantic import BaseModel
class YourItemCreate(BaseModel):
"""Request body for creating an item."""
name: str
description: str = ""
# Add fields as needed
class YourItemUpdate(BaseModel):
"""Request body for updating an item (all fields optional)."""
name: str | None = None
description: str | None = None
class YourItemResponse(BaseModel):
"""Response model for an item."""
id: str
botId: str # camelCase for frontend
name: str
description: str
createdAt: str
updatedAt: str
@classmethod
def from_db(cls, row: dict) -> "YourItemResponse":
"""Convert a database row to a response model."""
return cls(
id=row["id"],
botId=row["bot_id"],
name=row["name"],
description=row["description"] or "",
createdAt=row["created_at"],
updatedAt=row["updated_at"],
)
2. Create the Route File
Create cachibot/api/routes/<domain>.py:
"""
<Domain> API Routes
Endpoints for managing <domain resources>.
"""
from fastapi import APIRouter, Depends, HTTPException
from pydantic import BaseModel
from cachibot.api.auth import require_bot_access
from cachibot.models.auth import User
from cachibot.storage.repository import YourRepository
router = APIRouter(prefix="/api/bots/{bot_id}/<domain>", tags=["<domain>"])
# Repository instance
repo = YourRepository()
@router.get("")
async def list_items(
bot_id: str,
user: User = Depends(require_bot_access),
) -> list[YourItemResponse]:
"""List all items for a bot."""
items = await repo.get_items_by_bot(bot_id)
return [YourItemResponse.from_db(item) for item in items]
@router.post("", status_code=201)
async def create_item(
bot_id: str,
req: YourItemCreate,
user: User = Depends(require_bot_access),
) -> YourItemResponse:
"""Create a new item."""
import uuid
from datetime import datetime, timezone
now = datetime.now(timezone.utc).isoformat()
item_id = str(uuid.uuid4())
item = {
"id": item_id,
"bot_id": bot_id,
"name": req.name,
"description": req.description,
"created_at": now,
"updated_at": now,
}
await repo.save_item(item)
return YourItemResponse.from_db(item)
@router.get("/{item_id}")
async def get_item(
bot_id: str,
item_id: str,
user: User = Depends(require_bot_access),
) -> YourItemResponse:
"""Get a specific item."""
item = await repo.get_item(item_id)
if item is None or item["bot_id"] != bot_id:
raise HTTPException(status_code=404, detail="Item not found")
return YourItemResponse.from_db(item)
@router.put("/{item_id}")
async def update_item(
bot_id: str,
item_id: str,
req: YourItemUpdate,
user: User = Depends(require_bot_access),
) -> YourItemResponse:
"""Update an item."""
item = await repo.get_item(item_id)
if item is None or item["bot_id"] != bot_id:
raise HTTPException(status_code=404, detail="Item not found")
updates = req.model_dump(exclude_unset=True)
if updates:
from datetime import datetime, timezone
updates["updated_at"] = datetime.now(timezone.utc).isoformat()
await repo.update_item(item_id, updates)
updated = await repo.get_item(item_id)
return YourItemResponse.from_db(updated)
@router.delete("/{item_id}", status_code=204)
async def delete_item(
bot_id: str,
item_id: str,
user: User = Depends(require_bot_access),
) -> None:
"""Delete an item."""
item = await repo.get_item(item_id)
if item is None or item["bot_id"] != bot_id:
raise HTTPException(status_code=404, detail="Item not found")
await repo.delete_item(item_id)
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.
- 9d ago First seen · 261 lines · 57 tokens per session scan A 5079dd45df8e
cachibot-api-route is a skill published in the GitHub repository jhd3197/CachiBot (19 stars, last pushed 6mo ago), licensed MIT. It adds 57 tokens to every session and 1,833 once invoked, about $0.0003 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-08-30.
Other skills, from other repositories
eliza-cloud
Use when the task involves Eliza Cloud or elizaOS Cloud as a managed backend, app platform, deployment target, billing layer, or monetization surface. The catch-all skill for any user request about THEIR existing apps / containers / earnings / credits / api-keys / analytics / billing / payment requests / payouts …
remix
Build and review Remix 3 applications using the remix npm package and subpath imports. Use when working on Remix app structure, routes, controllers, middleware, validation, data access, auth, sessions, file uploads, server setup, UI components, hydration, HMR, navigation, or tests.
ai-mcp
Host-side Model Context Protocol (MCP) client for TanStack AI: connect to external MCP servers, discover and run their tools inside any adapter's chat() loop, read resources and prompts, generate TypeScript types (typed tool names/pool keys) with the bundled CLI, and manage lifecycle with close()/await using.
ai-core/chat-experience
End-to-end chat implementation: server endpoint with chat() and toServerSentEventsResponse(), client-side useChat hook with fetchServerSentEvents(), message rendering with UIMessage parts, multimodal content, thinking/reasoning display. Covers streaming states, connection adapters, and message format conversions. NOT…
ai-persistence/build-drizzle-adapter
Use when an app already runs Drizzle ORM and needs TanStack AI chat persistence — writes a chat-persistence.ts into the app against its existing db handle, schema file, and drizzle-kit journal. Covers the four tables (SQLite/Postgres/MySQL), the onConflict idempotency rules, JSON columns, and per-request bindings like…
ai-persistence/build-prisma-adapter
Use when an app already runs Prisma and needs TanStack AI chat persistence — writes a chat-persistence.ts into the app against its existing PrismaClient and schema.prisma. Covers the four models, BigInt timestamps, JSON-as-string columns, upsert-with-empty-update idempotency, and model renaming.