claw-integration-design
Skill7 starsChanged 43 days agoMITView on GitHub
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.
- Reads credentials
In this repository83 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-enforcerSkill
- access-policy-designerSkill
- adaptive-guardSkill
- agent-reviewerSkill
- anti-ai-slop-designSkill
- api-mock-designerSkill
- api-observability-plannerSkill
- app-store-reviewerSkill
- ask-first-act-laterSkill
- assumption-checkerSkill
- auth-flow-designerSkill
- b2b-founder-roadmapSkill
- brand-name-labSkill
- breaking-change-detectorSkill
- changelog-generatorSkill
- checkpoint-guardianSkill
- claude-style-codingSkill
- context-compressorSkill
- contract-first-designerSkill
- coolify-orchestratorSkill
- crash-analystSkill
- data-lineage-tracerSkill
- data-maskerSkill
- deep-link-architectSkill
- design-intelligenceSkill
- design-md-enforcerSkill
- ecosystem-apiSkill
- ecosystem-databaseSkill
- ecosystem-mobileSkill
- ecosystem-orchestrationSkill
- ecosystem-productSkill
- ecosystem-reasoningSkill
- ecosystem-securitySkill
- ecosystem-webSkill
- error-recoverySkill
- fth-design-crafterSkill
- geo-auditorSkill
- geo-optimizerSkill
- index-advisorSkill
- jev-orchestratorSkill
- mastermind-loggerSkill
- memory-ledgerSkill
- migration-strategistSkill
- mobile-perf-auditorSkill
- mobile-security-auditorSkill
- multi-brain-debateSkill
- multi-brain-expertsSkill
- multi-brain-scoreSkill
- multi-brainSkill
- offline-sync-designerSkill
- onboarding-designerSkill
- output-criticSkill
- parallel-plannerSkill
- pgbouncer-architectSkill
- plan-hardenerSkill
- plan-implement-verify-recoverSkill
- proje-analizcisiSkill
- project-analyzerSkill
- project-focus-firstSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 9 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
When building agent integrations based on your discovery, implement these foundational concepts:
- Distinctive: line 23
All read/write operations MUST be scoped to a specific tenant/workspace:
- Very specific: line 25
Rule: Always require tenant_id, org_id, or workspace_id in requests (via header, path, or body).
- Very specific: line 31
Do NOT: use a generic /items endpoint unless the application itself is a generic CMS.
- Very specific: line 32
Do:: Use specific, pluralized endpoints based on the domain (e.g., /v1/invoices, /v1/leads, /v1/candidates).
- Very specific: line 38
MVP Validation: Use API Keys passed via the Authorization: Bearer <API_KEY> header.
- Distinctive: line 39
Production Standard: Use OAuth2 (Authorization Code + PKCE) for integrations with third-party agent providers.
- Distinctive: line 69
When setting up the API, implement these minimal required endpoints dynamically based on Phase 1 discovery.
- Very specific: line 90
V2 — Semantic Search: Use embedding models (e.g., text-embedding-3-small from OpenAI, or nomic-embed-text locally) to generate vectors, …
- Distinctive: line 94
When to use V2: When keyword search fails for paraphrased queries or conceptually similar content.
- Distinctive: line 100
If the domain model is highly relational (e.g., an invoice belongs to a customer):
- Very specific: line 110
Keep a detailed log of actor (agent_name), action (e.g., create_invoice), target, and trace_id.
- Distinctive: line 114
Always return errors in this consistent format for predictability:
- Distinctive: line 130
When requested to build a tool manifest for an agent framework, use the ready-to-use template at:
- Very specific: line 138
Use "type": "bearer" for auth
- Very specific: line 139
Always include tenant_id as a required field in every tool's input_schema
- Very specific: line 140
Keep description fields agent-friendly — they guide LLM tool selection
- Distinctive: line 144
Every record/capture created by an agent MUST trace back to its origin.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bot/Agent Integration Design (Claw)
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.
Phase 1: Host Application Analysis
Adapt the integration to the project's existing domain model.
- Analyze the Application: Review
schema.prisma,models/, OpenAPI specs, or route definitions to understand the core resources (e.g.,orders,products,leads). - Select Exposure Targets: Decide which specific entities the agent actually needs access to for the task at hand.
Core Architectural Concepts
When building agent integrations based on your discovery, implement these foundational concepts:
1. Multi-Tenant Context
All read/write operations MUST be scoped to a specific tenant/workspace:
- Rule: Always require
tenant_id,org_id, orworkspace_idin requests (via header, path, or body).
2. Domain-Specific Resource Model
Design endpoints that match the discovered entities exactly. Agents should write data directly to where it belongs:
- Do NOT use a generic
/itemsendpoint unless the application itself is a generic CMS. - Do: Use specific, pluralized endpoints based on the domain (e.g.,
/v1/invoices,/v1/leads,/v1/candidates).
Authentication and Authorization
Authentication Methods
- MVP Validation: Use API Keys passed via the
Authorization: Bearer <API_KEY>header. - Production Standard: Use OAuth2 (Authorization Code + PKCE) for integrations with third-party agent providers.
Scope / Permission Model (CRITICAL)
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:
- Rule: Isolate riskier operations behind specific scopes, default off.
write:{resource}:delete: Permission to delete items (e.g.,write:invoices:delete).write:{resource}:bulk: Permission for bulk modifications.
Standard HTTP Guidelines
Enforce these standards on all agent-facing endpoints:
- Base Path:
/v1(e.g.,https://<domain>/v1) - Content-Type:
application/json - Rate Limiting: Implement rate limits (e.g., 60 req/min per key/token).
- Idempotency: Require an
Idempotency-Keyheader (UUID) for allPOST(create) endpoints. - Agent Traceability: Suggest headers like
X-Agent-Name(e.g.,openclaw,langchain) andX-Trace-Idfor log correlation.
Standard API Endpoints
When setting up the API, implement these minimal required endpoints dynamically based on Phase 1 discovery.
1. Health and Meta
GET /v1/health: Returns{ "status": "ok", "version": "0.1.0" }.GET /v1/openapi.json: Serve the OpenAPI spec so agents can auto-generate tools.
2. Exposed Resources (CRUD)
For every entity you decided to expose in Phase 1 (e.g., invoices):
- List:
GET /v1/{resource}?tenant_id=...&status=open(Scope:read:{resource}) - Read:
GET /v1/{resource}/{id}(Scope:read:{resource}) - Create:
POST /v1/{resource}(Scope:write:{resource}, requireIdempotency-Key) - Update:
PATCH /v1/{resource}/{id}(Scope:write:{resource}) - Delete:
DELETE /v1/{resource}/{id}(Requires specialized scopewrite:{resource}:delete)
3. Search (Crucial for Agents)
- Endpoint:
GET /v1/search?tenant_id=...&q=...&types={resource1},{resource2} - MVP: SQL Full-Text Search (PostgreSQL
tsvector, SQLite FTS5). - V2 — Semantic Search: Use embedding models (e.g.,
text-embedding-3-smallfrom OpenAI, ornomic-embed-textlocally) to generate vectors, stored in a vector DB:- Managed: Pinecone, Weaviate, Qdrant Cloud
- Self-hosted / Postgres-native:
pgvectorextension (lowest ops overhead for most projects) - Endpoint:
POST /v1/semantic-search { text, types, limit, threshold } - When to use V2: When keyword search fails for paraphrased queries or conceptually similar content.
See
references/oauth2-flow.mdfor auth setup andassets/tools-manifest-template.jsonfor a ready-to-use manifest.
4. Links (Relationships)
If the domain model is highly relational (e.g., an invoice belongs to a customer):
- Endpoint:
POST /v1/links - Scope:
write:links - Payload:
tenant_id,from_id,to_id,relation(e.g.,belongs_to).
5. Audit Logging
- Endpoint:
GET /v1/audit - Scope:
admin:audit - Keep a detailed log of actor (
agent_name), action (e.g.,create_invoice), target, andtrace_id.
Standard Error Formatting
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.
Agent Manifest (tools.json)
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:
- Use
"type": "bearer"for auth - Always include
tenant_idas a required field in every tool'sinput_schema - Keep
descriptionfields agent-friendly — they guide LLM tool selection
Internal Data Tracking
Every record/capture created by an agent MUST trace back to its origin. Add these fields to database schemas:
source: Should indicateagent(vshuman).agent_name: Identifying name of the bot.trace_id: For request correlation.metadata: Flexible JSON column for arbitrary agent state/data.
References
references/EXAMPLES.md— domain-specific resource and tool-manifest designs for agent integrations. Read it when the expected output format or level of detail is unclear.
🔗 Next Steps & Handoffs
<!-- BEGIN GENERATED: handoffs (generated from the ecosystem workflow map by build_ecosystems.py — do not edit by hand) -->Ecosystem: @ecosystem-orchestration — Agent Orchestration.
Workflows:
- Agent Connectivity Flow (
orch-agent-connectivity, step 1 of 3): next →@auth-flow-designer(optional).
Handoff contract: pass results to the next skill through an inline Handoff block in your reply with the fields skill, workflow, created_at, inputs, summary, and next (the handoff contract of @ecosystem-orchestration). If a next skill is not installed, continue with its step from the ecosystem map, or install it with npx skills add fatih-developer/fth-skills --skill <name> after the user agrees.
<!-- END GENERATED: handoffs -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

