ctfdlisted
Install: claude install-skill Lu1sDV/skillsmd
# CTFd Development & Operations
CTFd is a Python 3.11 Flask-based Capture The Flag platform. SQLAlchemy 1.4, Redis, Jinja2 themes, plugin system.
## When to Use
- Developing CTFd plugins (custom challenge types, scoring, auth)
- Debugging CSRF 302 errors, API 500 responses, or session issues
- Standing up or modifying the Docker Compose stack (nginx, MySQL, Redis)
- Customizing Jinja2 themes or static assets
- Writing pytest tests against CTFd's Flask test infrastructure
- Running database migrations with SQLAlchemy 1.4
- Diagnosing nginx reverse proxy misconfigurations
## When NOT to Use
- Other CTF platforms (CTFx, FBCTF) — different codebases
- General Flask development unrelated to CTFd
## Architecture
```
nginx → ctfd (gunicorn+gevent) → MySQL/SQLite + Redis
├── plugins/ # Extensible plugin system
└── themes/ # Jinja2 theme directories
```
## Quick Reference
```bash
# Docker stack
docker compose up --build -d # Build + start
docker compose logs -f ctfd # Stream logs
docker compose exec ctfd bash # Shell in
docker compose down # Stop
# Testing
pytest -rf --cov=CTFd -n auto # Full suite parallel
# Local dev
python serve.py # Debug server (port 4000)
# Database
flask db upgrade # Apply migrations
flask db migrate -m "description" # Generate migration
```
## Docker Stack
| Service | Default Port | Purpose |
|---------|--------