skills/claw-integration-design/SKILL.md
Design and implement secure APIs and integration points for external AI bots and agents (OpenAI tool-calling, LangChain, OpenClaw). Use this skill whenever the user mentions agent integrations, tool manifests, bot API access, OAuth2 scopes for bots, webhook integrations, or designing endpoints for agentic workflows. Also trigger when users ask about securing bot writes or designing APIs for AI-powered automation.
npx skillsauth add fatih-developer/fth-skills claw-integration-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides guidelines and patterns for integrating web applications (SaaS/internal tools/products) with external bots and agent systems (e.g., OpenAI tool-calling, LangChain, OpenClaw). The goal is to allow agents to securely connect, read, and write data without turning the application itself into a bot.
Adapt the integration to the project's existing domain model.
schema.prisma, models/, OpenAPI specs, or route definitions to understand the core resources (e.g., orders, products, leads).When building agent integrations based on your discovery, implement these foundational concepts:
All read/write operations MUST be scoped to a specific tenant/workspace:
tenant_id, org_id, or workspace_id in requests (via header, path, or body).Design endpoints that match the discovered entities exactly. Agents should write data directly to where it belongs:
/items endpoint unless the application itself is a generic CMS./v1/invoices, /v1/leads, /v1/candidates).Authorization: Bearer <API_KEY> header.You MUST enforce a granular scope model based on the discovered resources using the {action}:{resource} pattern. Do not give agents root access.
Standard Scopes (Generic Examples):
read:{resource}: Read access to a specific resource (e.g., read:invoices).write:{resource}: Access to create/update resources (e.g., write:leads).admin:audit: Access to read audit logs.High-Risk Scopes:
write:{resource}:delete: Permission to delete items (e.g., write:invoices:delete).write:{resource}:bulk: Permission for bulk modifications.Enforce these standards on all agent-facing endpoints:
/v1 (e.g., https://<domain>/v1)application/jsonIdempotency-Key header (UUID) for all POST (create) endpoints.X-Agent-Name (e.g., openclaw, langchain) and X-Trace-Id for log correlation.When setting up the API, implement these minimal required endpoints dynamically based on Phase 1 discovery.
GET /v1/health: Returns { "status": "ok", "version": "0.1.0" }.GET /v1/openapi.json: Serve the OpenAPI spec so agents can auto-generate tools.For every entity you decided to expose in Phase 1 (e.g., invoices):
GET /v1/{resource}?tenant_id=...&status=open (Scope: read:{resource})GET /v1/{resource}/{id} (Scope: read:{resource})POST /v1/{resource} (Scope: write:{resource}, require Idempotency-Key)PATCH /v1/{resource}/{id} (Scope: write:{resource})DELETE /v1/{resource}/{id} (Requires specialized scope write:{resource}:delete)GET /v1/search?tenant_id=...&q=...&types={resource1},{resource2}tsvector, SQLite FTS5).text-embedding-3-small from OpenAI, or nomic-embed-text locally) to generate vectors, stored in a vector DB:
pgvector extension (lowest ops overhead for most projects)POST /v1/semantic-search { text, types, limit, threshold }See
references/oauth2-flow.mdfor auth setup andassets/tools-manifest-template.jsonfor a ready-to-use manifest.
If the domain model is highly relational (e.g., an invoice belongs to a customer):
POST /v1/linkswrite:linkstenant_id, from_id, to_id, relation (e.g., belongs_to).GET /v1/auditadmin:auditagent_name), action (e.g., create_invoice), target, and trace_id.Always return errors in this consistent format for predictability:
{
"error": {
"code": "insufficient_scope",
"message": "write:invoices scope required",
"details": { "required": ["write:invoices"] }
}
}
Common codes: unauthorized, insufficient_scope, not_found, validation_error, rate_limited, conflict, internal_error.
When requested to build a tool manifest for an agent framework, use the ready-to-use template at:
assets/tools-manifest-template.json
The template includes definitions for search_[RESOURCE_NAME]s, create_[RESOURCE_NAME], update_[RESOURCE_NAME], and create_link. Replace <your-domain> with the actual API base URL.
Key manifest conventions:
"type": "bearer" for authtenant_id as a required field in every tool's input_schemadescription fields agent-friendly — they guide LLM tool selectionEvery record/capture created by an agent MUST trace back to its origin. Add these fields to database schemas:
source: Should indicate agent (vs human).agent_name: Identifying name of the bot.trace_id: For request correlation.metadata: Flexible JSON column for arbitrary agent state/data.tools
Create, optimize, critique, and programmatically structure prompts for AI systems. Use this skill whenever the user is designing or improving a static prompt, system prompt, coding prompt, agent prompt, workflow prompt, MCP-oriented prompt package, or an algorithmic prompt optimization pipeline. Also use it when the user asks to turn vague AI behavior into a precise instruction set, tool policy, agent spec, evaluation metric, or prompt architecture.
testing
Assumption-first architecture review skill to stress-test project plans and expose hidden risks.
testing
Enforce and manage DESIGN.md specifications, extract design systems from URLs, and combine design reasoning with token roles to prevent drift.
testing
Forces the agent to act with a Claude-like product mindset, prioritizing user journey, UX states, and visual quality before coding.