.claude/skills/ts-directus/SKILL.md
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.
npx skillsauth add eliferjunior/Claude directusInstall 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.
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.
# 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
Create collections (tables) and fields via the admin UI or REST API:
# 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" }
]
}'
Once collections exist, Directus auto-generates full CRUD APIs:
# 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 } } }"}'
// 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',
})
)
# 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"]
}'
Directus Flows are visual automation pipelines triggered by events (like Zapier, but built-in).
# 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"
}'
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:
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:
PUBLIC role carefully — it defines what unauthenticated users can access. For a public blog, allow read access to published posts only.development
Expert guidance for Fireworks AI, the platform for running open-source LLMs (Llama, Mixtral, Qwen, etc.) with enterprise-grade speed and reliability. Helps developers integrate Fireworks' inference API, fine-tune models, and deploy custom model endpoints with function calling and structured output support.
development
Convert any website into clean, structured data with Firecrawl — API-first web scraping service. Use when someone asks to "turn a website into markdown", "scrape website for LLM", "Firecrawl", "extract website content as clean text", "crawl and convert to structured data", or "scrape website for RAG". Covers single-page scraping, full-site crawling, structured extraction, and LLM-ready output.
tools
Expert guidance for Firebase, Google's platform for building and scaling web and mobile applications. Helps developers set up authentication, Firestore/Realtime Database, Cloud Functions, hosting, storage, and analytics using Firebase's SDK and CLI.
development
When the user needs to build file upload functionality for a web application. Use when the user mentions "file upload," "image upload," "upload endpoint," "multipart upload," "presigned URL," "S3 upload," "file validation," "upload to cloud storage," or "accept user files." Handles upload endpoints, file validation (type, size, magic bytes), cloud storage integration, and upload status tracking. For image/video processing after upload, see media-transcoder.