arch-database
DB architecture: relational vs document vs graph vs vector, schema design, indexing, replication, sharding
What this skill does
# arch-database
## Purpose
This skill helps the AI agent advise on database architecture decisions, including selecting between relational, document, graph, and vector databases; designing schemas; optimizing indexing; and planning replication and sharding for scalable systems.
## When to Use
Use this skill when architecting a new application backend, migrating databases, handling high-traffic data needs, or resolving performance issues. For example, choose it for e-commerce apps needing transactions (relational) versus social graphs (graph DBs). Avoid for low-level coding tasks like writing SQL queries; pair with query-focused skills instead.
## Key Capabilities
- Compare database types: Evaluate relational (e.g., PostgreSQL) vs. document (e.g., MongoDB) based on data structure and queries.
- Design schemas: Generate ER diagrams or JSON schemas with constraints, e.g., defining primary keys and relationships.
- Optimize indexing: Recommend indexes like B-tree for relational or full-text for document DBs to reduce query times.
- Handle replication and sharding: Suggest setups like master-slave for fault tolerance or horizontal sharding for load balancing.
- Support polyglot persistence: Advise on mixing SQL and NoSQL in a system, e.g., using Redis for caching with PostgreSQL.
## Usage Patterns
Invoke this skill via OpenClaw prompts prefixed with "arch-database:", e.g., "arch-database: compare relational and graph for a social network." For programmatic use, call the OpenClaw API endpoint `/api/skills/arch-database` with a JSON payload. Always include context like app requirements (e.g., read-heavy vs. write-heavy). If using in a script, wrap calls in error checks to handle API failures. For multi-step tasks, chain with other se-architecture skills, like starting with schema design then moving to indexing.
## Common Commands/API
Use OpenClaw CLI for quick interactions: `openclaw run arch-database --compare relational document --app-type social` (outputs pros/cons). For API, POST to `https://api.openclaw.ai/v1/skills/arch-database` with body like:
```json
{
"action": "design-schema",
"params": {"db-type": "relational", "tables": ["users", "posts"]}
}
```
Require authentication via header: `Authorization: Bearer $OPENCLAW_API_KEY`. Common flags: `--verbose` for detailed output, `--output json` for structured results. For config files, use YAML like:
```yaml
db-arch:
type: graph
schema: {nodes: users, edges: friendships}
```
To generate indexing advice, run: `openclaw run arch-database --index-suggest --query "SELECT * FROM users WHERE name LIKE '%john%'"`.
## Integration Notes
Integrate by setting environment variables for API access, e.g., export `OPENCLAW_API_KEY=your-secret-key`. When embedding in larger workflows, use OpenClaw's SDK: import openclaw; client = openclaw.Client(api_key=os.environ['OPENCLAW_API_KEY']); response = client.invoke('arch-database', {'action': 'replication-plan', 'replicas': 3}). For polyglot setups, ensure compatibility by specifying DB drivers in your app config, like adding "postgresql" and "neo4j" to a Node.js project's package.json. Test integrations in a sandbox environment before production.
## Error Handling
When invoking, check for errors like invalid parameters (e.g., API returns 400 if db-type is misspelled). Handle with try-except in code: try: response = client.invoke('arch-database', params) except openclaw.APIError as e: print(f"Error: {e.status_code} - {e.message}"). For common issues, retry on 5xx errors with exponential backoff. If the skill returns "incompatible architecture," refine your input (e.g., specify data volume). Log all responses for debugging, and use the `--debug` flag in CLI to get detailed traces.
## Concrete Usage Examples
1. **Example 1: Compare DB types for a user profile system**
Prompt: "arch-database: compare relational and document for a system with 1M user profiles, frequent updates."
Expected: The agent outputs: "Use relational (e.g., MySQL) for structured data and ACID compliance; document (e.g., MongoDB) for flexible schemas. Recommendation: Relational with indexing on user_id."
Follow up: Use the output to generate a schema via API: POST to /api/skills/arch-database with {"action": "design-schema", "db-type": "relational"}.
2. **Example 2: Design schema with sharding for a social network**
Command: `openclaw run arch-database --design-schema --db-type graph --sharding key-based --entities users,posts`
Expected: Agent responds with: "Schema: Nodes: users {id, name}; Edges: friendships {from, to}. Sharding: Shard by user ID for even distribution."
Integrate: Export as YAML and apply in your app's deployment script.
## Graph Relationships
- Related to: se-architecture cluster (e.g., links to data-modeling for schema refinement).
- Connected via: tags like "database" to query-optimization skill for indexing follow-ups.
- Dependencies: Requires se-architecture base for replication advice; outputs can feed into deployment skills.
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.