advanced-alchemy

advanced-alchemy is a skill for Claude Code from litestar-org/litestar-skills. It costs 48 tokens per session (4,363 once invoked), scanned A, original, MIT.

Coding guidance for Advanced Alchemy, a library that connects Python applications to databases through SQLAlchemy and supports several web frameworks.

In plain words
What is it for?
Building or maintaining Advanced Alchemy models, repositories, services, filters, authentication-related storage, and database setup in supported web applications.
Why use it?
It reduces uncertainty about the library’s project structure, database sessions, repositories, services, and framework integration.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is **Choosing between `advanced-alchemy` and `sqlspec`:** `advanced-alchemy` (this skill) gives you an opinionated ORM service layer with `UUIDAuditBase`, lifecycl.

Part of the litestar plugin — 20 skills, 1 agent, 1 hook shipped together

Good fit Building or maintaining Advanced Alchemy models, repositories, services, filters, authentication-related storage, and database setup in supported web applications.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/litestar-org/litestar-skills
agentmods
npx agentmods add skills/litestar-org/litestar-skills/advanced-alchemy

Made for: Claude Code.

Or install litestar, the plugin that ships this one along with the rest of its 20 skills, 1 agent, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for advanced-alchemy

README.md
[![agentmods](https://agentmods.dev/badge/skills/litestar-org/litestar-skills/advanced-alchemy/github.svg)](https://agentmods.dev/skills/litestar-org/litestar-skills/advanced-alchemy)
Your own site
<a href="https://agentmods.dev/skills/litestar-org/litestar-skills/advanced-alchemy"><img src="https://agentmods.dev/badge/skills/litestar-org/litestar-skills/advanced-alchemy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for advanced-alchemy

Your own site · 80×15
<a href="https://agentmods.dev/skills/litestar-org/litestar-skills/advanced-alchemy"><img src="https://agentmods.dev/badge/skills/litestar-org/litestar-skills/advanced-alchemy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,363 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.04363
Opus 5.5 $0.00019 $0.01745
Sonnet 5.5 $0.00010 $0.00873
Haiku 4.5 $0.00005 $0.00436

Measured 7d ago against content hash 8c5810e5dd66, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

advanced-alchemy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/litestar/skills/advanced-alchemy/SKILL.md · 292 lines

How it starts

The opening of the file, as written. The whole thing — 292 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Advanced Alchemy

Code Style Rules

  • Use Mapped[...] for columns and T | None for optional fields.
  • Keep business transformations in service lifecycle hooks.
  • Prefer the inner Repo service pattern and advanced_alchemy.* imports.
  • Use from __future__ import annotations when it matches the project; 1.12 supports it in model modules.

Match-Your-Framework — read first

advanced-alchemy ships first-party extensions for five web frameworks. If your project uses one of these, jump directly to the matching integration guide and skip the others:

  • Litestar — SQLAlchemyPlugin with full DI, session store, CLI. The rest of this SKILL.md covers Litestar by default; also see references/litestar_plugin.md.
  • FastAPI → references/fastapi-integration.md — AdvancedAlchemy(config=..., app=app), Depends(alchemy.provide_session()) DI, provide_service()/provide_filters(), Alembic CLI via assign_cli_group.
  • Flask → references/flask-integration.md — AdvancedAlchemy(config=..., app=app) or init_app() factory, pull-based alchemy.get_sync_session(), async-via-portal.
  • Sanic → references/sanic-integration.md — AdvancedAlchemy(sqlalchemy_config=..., sanic_app=app) (note: sqlalchemy_config= kwarg, not config=), sanic-ext DI, request.ctx sessions.
  • Starlette → references/starlette-integration.md — AdvancedAlchemy(config=..., app=app), request.state session access, lifespan wrapping.

Transaction configuration is framework-specific. Litestar uses before_send_handler; FastAPI, Flask, Starlette, and Sanic use commit_mode="manual", "autocommit", or "autocommit_include_redirect". Read the matching framework guide, then references/commit-modes.md and references/multi-database.md.

Read the full file on GitHub · 292 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed 8c5810e5dd66
  2. 23d ago Changed · +5 lines e73bc3533902
  3. 1mo ago Changed · +4 lines · -6 tokens per session 163279b643a3
  4. 1mo ago First seen · 283 lines · 54 tokens per session scan A 3f5c118a8f10

Subscribe to this mod's changes

advanced-alchemy is a skill published in the GitHub repository litestar-org/litestar-skills (16 stars, last pushed yesterday), licensed MIT. It adds 48 tokens to every session and 4,363 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.