Agent skill

Backend Guide

by lightly-ai in lightly-ai/lightly-studio

Read before adding or changing backend code in lightlystudio - FastAPI routes, services, resolvers, SQLModel tables, or database access.

Apache-2.0Auto-check passedBackend & APIs

Install Backend Guide

skills CLI
$ npx skills add lightly-ai/lightly-studio --skill backend-guide -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lightly-ai/lightly-studio backend-guide --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lightly-ai/lightly-studio.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/backend-guide .claude/skills/backend-guide && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
backend-guide
GitHub stars
896
Token cost
~1.2k tokens
SKILL.md length
573 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
Apache-2.0

At a glance

Read before adding or changing backend code in lightlystudio - FastAPI routes, services, resolvers, SQLModel tables, or database access.

  • Tasks that involve Backend development
  • SKILL.md covers Core technologies, Main packages, Model organization and Request flow, plus 4 more sections
  • Calls uv and make
  • Tasks that involve GraphQL

What it does

Backend Guide is an agent skill from lightly-ai/lightly-studio. Read before adding or changing backend code in lightlystudio - FastAPI routes, services, resolvers, SQLModel tables, or database access. Explains the api/services/resolvers/models layering, the Base/Create/Table/View model split, request flow, error handling, DuckDB and PostgreSQL persistence, Alembic migrations, and how to navigate the package.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Backend development, GraphQL and Database migrations. It works with DuckDB, PostgreSQL and FastAPI. The repository describes itself as: LightlyStudio - The Unified Data Platform for Multimodal ML. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Backend development
  • Tasks that involve GraphQL
  • Tasks that involve Database migrations

Example prompts

  • “/backend-guide”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 66da613. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • make

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Backend Guide loads about 1.2k tokens when it runs. Until then it costs about 91 tokens; SKILL.md has 573 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~91
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from lightly-ai/lightly-studio at commit 66da613, republished under its Apache-2.0 licence (© lightly-ai). 573 words, ~1,223 tokens.

Download SKILL.mdSave it as .claude/skills/backend-guide/SKILL.md (or your agent's skills folder).
name
backend-guide
description
Read before adding or changing backend code in lightly_studio - FastAPI routes, services, resolvers, SQLModel tables, or database access. Explains the api/services/resolvers/models layering, the Base/Create/Table/View model split, request flow, error handling, DuckDB and PostgreSQL persistence, Alembic migrations, and how to navigate the package.

Backend Architecture Overview

The backend lives in lightly_studio/src/lightly_studio. It is a Python package that can run as a local app, expose a FastAPI server, and serve the built web UI.

Core technologies

  • FastAPI provides the HTTP API and application lifecycle.
  • Pydantic is used for request and response models, validation, and OpenAPI schema generation.
  • SQLModel is used for database models and typed database access on top of SQLAlchemy sessions.
  • The database layer supports DuckDB by default and PostgreSQL as an alternative backend.
  • uvicorn runs the backend server.

Main packages

  • api/: FastAPI app setup, route registration, exception handling, media endpoints, and webapp serving. api/app.py is the composition root.
  • services/: Small orchestration layer for workflows that span multiple resolvers or need branching business logic. Not every endpoint needs a service.
  • resolvers/: Database-facing query and mutation functions. This is where most persistence logic lives.
  • models/: SQLModel tables plus Pydantic/SQLModel request and view models shared across layers.
  • core/, dataset/, export/, metadata/, plugins/, few_shot_classifier/: Product-specific modules used by routes, services, or resolvers when the logic is not just CRUD.

Model organization

Backend models are usually split by role within the same module:

  • *Base: shared fields
  • *Create: input model for inserts
  • *Table: SQLModel table mapped to the database
  • *View: API-facing response model
  • *WithCount or similar wrappers: list responses with pagination or metadata

Keep database tables and API views separate even when they look similar. This keeps persistence concerns, validation, and response shaping explicit.

Request flow

Most request paths follow this shape:

text
FastAPI route -> optional service -> resolver(s) -> SQLModel / database

Use the layers with the following intent:

  • Routes translate HTTP input into typed models, wire dependencies, and map failures to HTTP responses.
  • Services coordinate multiple resolvers or enforce workflow-specific rules.
  • Resolvers own database access and reusable queries.

Thin endpoints may call resolvers directly. Services are mainly for cross-entity operations, not as a mandatory wrapper around every route.

Error handling

  • Raise specific exceptions in the api/ layer. FastAPI will handle converting them to HTTP responses. Do not raise HTTPException directly.
  • We let exceptions raised from the rest of Python code propagate cleanly to the api layer, and be ultimately handled by FastAPI.
Show full SKILL.md (228 more words)Show less

Runtime, persistence and the database

  • db_manager.py centralizes engine and session management.
  • FastAPI dependencies provide short-lived sessions for request handling.
  • The app lifespan also initializes and shuts down plugins, then closes the database engine cleanly.
  • Python API classes in core/ use a long-lived db_manager.persistent_session(). Currently this is a design limitation, causing issues with DuckDB's single-writer model.
DuckDB

Schema is created with SQLModel.metadata.create_all() on startup.

PostgreSQL and Alembic

See lightly_studio/MIGRATIONS.md for full details on Alembic setup, startup behavior, adding schema changes, and validation.

Build and generated artifacts

  • The Python package is built from lightly_studio/pyproject.toml with uv build.
  • The backend package build depends on make build-lightly_studio_view, which first exports backend-generated artifacts and then builds the frontend.
  • OpenAPI is generated from the FastAPI app with uv run src/lightly_studio/export_schema.py, which serializes app.openapi() to openapi.json.
  • The frontend uses that generated schema for API type generation before its own build.
  • After lightly_studio_view is built, its static output is copied into lightly_studio/src/lightly_studio/dist_lightly_studio_view_app.
  • api/routes/webapp.py serves that bundled frontend from inside the Python package, so the shipped backend can serve the UI directly.

How to navigate the codebase

  • Start in api/routes/ if the change is triggered by an HTTP endpoint.
  • Check services/ when the endpoint coordinates multiple entities or sample types.
  • Go to resolvers/ for query logic, filtering, and persistence details.
  • Look in models/ for request bodies, response models, and database tables.
  • Tests mirror this split under lightly_studio/tests/.

© lightly-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/backend-guide of lightly-ai/lightly-studio.

Open the folder on GitHubat commit 66da613

Compare with similar skills

Backend Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Backend Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Backend Guide this skilllightly-ai/lightly-studio896—~1.2kAutomated safety check: PassApache-2.0
cmux Backend Rulesmanaflow-ai/cmux28k1 repos~682Automated safety check: PassCustom licence
Fastapi Appccplugins/awesome-claude-code-plugins967—~1.1kAutomated safety check: NotesApache-2.0
Senior Backendalirezarezvani/claude-skills28k1 repos~3.8kAutomated safety check: PassMIT
Cookbook Tablesdatabricks-solutions/databricks-apps-cookbook183—~1.9kAutomated safety check: PassCustom licence
Twenty Syncable Entity Wiringtwentyhq/twenty58k—~2.9kAutomated safety check: PassCustom licence

Similar skills

  • cmux Backend Rules

    manaflow-ai/cmux

    Sets the backend TypeScript and Cloud VM rules for cmux: Effect-based services, thin route handlers, Postgres as source of truth, migrations and provider secrets.

    28k GitHub starsUsed in 1 repo~682 tokens
    Backend & APIsAuto-check passed
  • Fastapi App

    ccplugins/awesome-claude-code-plugins

    Bootstrap a new FastAPI backend with async SQLAlchemy 2.0, asyncpg, Alembic, Pydantic v2, and no deprecated APIs.

    967 GitHub stars~1.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes
  • Senior Backend

    alirezarezvani/claude-skills

    Designs and implements backend systems including REST APIs, microservices, database architectures, authentication flows, and security hardening.

    28k GitHub starsUsed in 1 repo~3.8k tokens
    Backend & APIsAuto-check passed
  • Cookbook Tables

    databricks-solutions/databricks-apps-cookbook

    Read and write Delta tables and connect to Lakebase (OLTP PostgreSQL) from Databricks Apps.

    183 GitHub stars~1.9k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Registers a new syncable entity in three NestJS modules and adds its service and GraphQL resolver layers when contributing to the Twenty server.

    58k GitHub stars~2.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Phoenix Server

    Arize-ai/phoenix

    Backend development guide for the Phoenix AI observability platform (Strawberry GraphQL, SQLAlchemy async, FastAPI).

    12k GitHub stars~1.6k tokensUpdated today
    Backend & APIsAuto-check passed

More from lightly-ai/lightly-studio

  • Frontend Guide

    lightly-ai/lightly-studio

    Read before writing or reviewing any frontend code in lightlystudioview - Svelte, TypeScript, or SvelteKit files.

    896 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Python Guide

    lightly-ai/lightly-studio

    Read before writing or reviewing any Python code in this repository.

    896 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Glossary

    lightly-ai/lightly-studio

    Read when naming anything user-facing - GUI text, docs, public Python API names, arguments, docstrings, or error messages.

    896 GitHub stars~482 tokensUpdated today
    Auto-check passed
  • Pull Requests

    lightly-ai/lightly-studio

    Read when opening a pull request, writing a PR description, splitting work into PRs, or deciding whether a change is too large to review.

    896 GitHub stars~709 tokensUpdated today
    Auto-check passed
  • Best Practices

    lightly-ai/lightly-studio

    Read when adding a new function, module, or component, or when a file is growing large enough that splitting it is worth considering.

    896 GitHub stars~424 tokensUpdated today
    Auto-check passed

Questions about Backend Guide

What does Backend Guide do?

Read before adding or changing backend code in lightlystudio - FastAPI routes, services, resolvers, SQLModel tables, or database access. Backend Guide is an agent skill from lightly-ai/lightly-studio. Read before adding or changing backend code in lightlystudio - FastAPI routes, services, resolvers, SQLModel tables, or database access.

When should I use Backend Guide?

Backend Guide fits situations like: tasks that involve Backend development; tasks that involve GraphQL; tasks that involve Database migrations.

How do I install Backend Guide in Claude Code?

Run `npx skills add lightly-ai/lightly-studio --skill backend-guide -a claude-code`. Or copy the skill folder (.agents/skills/backend-guide in lightly-ai/lightly-studio) into .claude/skills/backend-guide in your project. Claude Code loads it when a task matches its description.

How do I install Backend Guide in Codex?

Run `npx skills add lightly-ai/lightly-studio --skill backend-guide -a codex`. Or copy the skill folder (.agents/skills/backend-guide in lightly-ai/lightly-studio) into .agents/skills/backend-guide in your project. Codex loads it when a task matches its description.

Can I use Backend Guide in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lightly-ai/lightly-studio --skill backend-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/backend-guide, .gemini/skills/backend-guide, .github/skills/backend-guide and .opencode/skills/backend-guide in your project.

What does Backend Guide need to run?

Going by SKILL.md and its folder, Backend Guide needs the command-line tools its instructions call (uv and make). Our summary lists: Python 3.

Does Backend Guide access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Backend Guide safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Backend Guide use?

Backend Guide is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Backend Guide use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Backend Guide?

Skills that share tags, products or a category with Backend Guide: cmux Backend Rules (manaflow-ai/cmux, 28k stars), Fastapi App (ccplugins/awesome-claude-code-plugins, 967 stars), Senior Backend (alirezarezvani/claude-skills, 28k stars) and Cookbook Tables (databricks-solutions/databricks-apps-cookbook, 183 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Backend Guide?

lightly-ai (a GitHub organization) maintains it in lightly-ai/lightly-studio, which has 896 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

Source: lightly-ai/lightly-studio on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.