directus
Build backends and APIs with Directus headless CMS. Use when a user asks to create a headless CMS, build a content API without coding, set up a backend admin panel, create REST or GraphQL APIs from a database, manage content with roles and permissions, build a data platform with auto-generated APIs, or replace traditional CMS with a headless solution. Covers data modeling, auto-generated REST/GraphQL APIs, roles/permissions, flows (automation), file storage, and SDK integration.
What this skill does
# Directus ## Overview Directus is an open-source headless CMS and data platform that wraps any SQL database with auto-generated REST and GraphQL APIs, a visual admin dashboard, role-based access control, file storage, and automation flows. Unlike Strapi (which defines its own schema), Directus mirrors your existing database — add columns in the admin UI or directly in SQL, and the API updates instantly. Use it for content management, internal tools, data APIs, and backend-as-a-service. ## Instructions ### Step 1: Deployment ```bash # Docker (quickest start) docker run -d --name directus \ -p 8055:8055 \ -e SECRET="your-secret-key-min-32-chars" \ -e ADMIN_EMAIL="[email protected]" \ -e ADMIN_PASSWORD="your-secure-password" \ -e DB_CLIENT="sqlite3" \ -e DB_FILENAME="/directus/database/data.db" \ -v directus_data:/directus/database \ -v directus_uploads:/directus/uploads \ directus/directus:latest # Production with PostgreSQL docker run -d --name directus \ -p 8055:8055 \ -e SECRET="your-secret-key" \ -e ADMIN_EMAIL="[email protected]" \ -e ADMIN_PASSWORD="your-secure-password" \ -e DB_CLIENT="pg" \ -e DB_HOST="postgres" \ -e DB_PORT="5432" \ -e DB_DATABASE="directus" \ -e DB_USER="directus" \ -e DB_PASSWORD="dbpassword" \ directus/directus:latest # Access admin: http://localhost:8055 ``` ### Step 2: Data Modeling Create collections (tables) and fields via the admin UI or REST API: ```bash # Create a "posts" collection via API curl -X POST http://localhost:8055/collections \ -H 'Authorization: Bearer admin_token' \ -H 'Content-Type: application/json' \ -d '{ "collection": "posts", "meta": { "icon": "article", "note": "Blog posts" }, "fields": [ { "field": "id", "type": "uuid", "meta": { "special": ["uuid"] }, "schema": { "is_primary_key": true } }, { "field": "title", "type": "string", "meta": { "required": true } }, { "field": "slug", "type": "string", "meta": { "interface": "input" } }, { "field": "content", "type": "text", "meta": { "interface": "input-rich-text-html" } }, { "field": "status", "type": "string", "meta": { "interface": "select-dropdown", "options": { "choices": [{"text":"Draft","value":"draft"},{"text":"Published","value":"published"}] } } }, { "field": "published_at", "type": "timestamp" } ] }' ``` ### Step 3: Auto-Generated APIs Once collections exist, Directus auto-generates full CRUD APIs: ```bash # REST — List all published posts curl 'http://localhost:8055/items/posts?filter[status][_eq]=published&sort=-published_at&limit=10' \ -H 'Authorization: Bearer token' # REST — Get single post with related author curl 'http://localhost:8055/items/posts/POST_ID?fields=*,author.name,author.avatar' \ -H 'Authorization: Bearer token' # REST — Create post curl -X POST http://localhost:8055/items/posts \ -H 'Authorization: Bearer token' \ -H 'Content-Type: application/json' \ -d '{"title": "My Post", "content": "<p>Hello world</p>", "status": "draft"}' # GraphQL — Same queries curl -X POST http://localhost:8055/graphql \ -H 'Authorization: Bearer token' \ -H 'Content-Type: application/json' \ -d '{"query": "{ posts(filter: {status: {_eq: \"published\"}}, sort: [\"-published_at\"], limit: 10) { id title content published_at author { name } } }"}' ``` ### Step 4: SDK Integration ```javascript // lib/directus.js — JavaScript SDK for frontend/backend integration import { createDirectus, rest, readItems, createItem, authentication } from '@directus/sdk' const client = createDirectus('http://localhost:8055') .with(authentication()) .with(rest()) // Fetch published posts const posts = await client.request( readItems('posts', { filter: { status: { _eq: 'published' } }, sort: ['-published_at'], limit: 10, fields: ['id', 'title', 'slug', 'content', 'published_at', { author: ['name', 'avatar'] }], }) ) // Create a new post const newPost = await client.request( createItem('posts', { title: 'New Post', content: '<p>Content here</p>', status: 'draft', }) ) ``` ### Step 5: Roles and Permissions ```bash # Create a read-only "viewer" role curl -X POST http://localhost:8055/roles \ -H 'Authorization: Bearer admin_token' \ -H 'Content-Type: application/json' \ -d '{"name": "Viewer", "admin_access": false}' # Set permissions: viewer can read published posts only curl -X POST http://localhost:8055/permissions \ -H 'Authorization: Bearer admin_token' \ -H 'Content-Type: application/json' \ -d '{ "role": "VIEWER_ROLE_ID", "collection": "posts", "action": "read", "permissions": { "status": { "_eq": "published" } }, "fields": ["id", "title", "content", "published_at"] }' ``` ### Step 6: Flows (Automation) Directus Flows are visual automation pipelines triggered by events (like Zapier, but built-in). ```bash # Create a flow: when a post is published, send a webhook curl -X POST http://localhost:8055/flows \ -H 'Authorization: Bearer admin_token' \ -H 'Content-Type: application/json' \ -d '{ "name": "Notify on Publish", "trigger": "event", "options": { "type": "action", "scope": ["items.update"], "collections": ["posts"] }, "accountability": "all", "status": "active" }' ``` ## Examples ### Example 1: Build a content API for a marketing website **User prompt:** "I need a CMS backend for our marketing site — blog posts, team members, case studies, and FAQ. Non-technical editors should be able to manage content through a visual dashboard." The agent will: 1. Deploy Directus with Docker + PostgreSQL. 2. Create collections for posts, team_members, case_studies, and faqs. 3. Set up relational fields (posts → author, case studies → tags). 4. Configure a public role with read-only access for the frontend. 5. Connect the Next.js/Astro frontend using the Directus SDK. ### Example 2: Build an internal tool for operations data **User prompt:** "Our ops team tracks orders, suppliers, and inventory in spreadsheets. Build a proper backend with an admin panel where they can manage everything." The agent will: 1. Deploy Directus pointing at the existing PostgreSQL database. 2. Directus auto-detects existing tables and generates APIs + admin UI. 3. Create roles: admin (full access), manager (CRUD), viewer (read-only). 4. Set up flows for notifications (new order → Slack alert). ## Guidelines - Directus mirrors your database schema — it does not own it. You can add columns via Directus admin or directly in SQL, and both stay in sync. This makes it safe for existing databases. - Use Directus as a backend-as-a-service for content-heavy apps. For complex business logic (multi-step workflows, custom calculations), extend with custom endpoints or use a separate API layer. - Configure the `PUBLIC` role carefully — it defines what unauthenticated users can access. For a public blog, allow read access to published posts only. - File uploads go to local storage by default. In production, configure S3, Cloudflare R2, or Google Cloud Storage for scalability. - Directus supports PostgreSQL, MySQL, MariaDB, MS SQL, SQLite, CockroachDB, and OracleDB. PostgreSQL is recommended for production.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.