/dev-flow:monorepo-add-python-servicefrom dev-flow
Adds a FastAPI Python service managed by uv to a turborepo monorepo, wired into pnpm workspaces and the turbo task graph with a generated TypeScript client. Supports generic HTTP and ML (vision/OCR) variants.
Ships in dev-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Some work does not belong in Node: a vision model, an OCR pipeline, anything whose ecosystem is Python. The instinct is a second repository, and it costs you the thing a monorepo is for — one install, one task graph, one CI, one version of the contract between the two sides.
This skill puts a FastAPI service in apps/<name>/, managed by uv, joined to the
monorepo through two seams and no others:
package.json whose scripts shell out to uv run — turbo runs scripts and does
not care what is behind them;packages/api/src/<name>/, so a schema change breaks
apps/web's typecheck instead of its users.Versions re-verified 2026-11-05, Python from PyPI and JS from npm —
[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected];[email protected]and[email protected]have not moved at all since 2026-09-11. FastAPI is the one to look at —0.141.1 → 0.162.0is 21 minors in eight weeks, so treat its version as a[VERIFY]surface rather than a pin you can carry. Every reference cites its source next to the instruction.⚠️ Read these from PyPI, not npm.
uvandfastapiare also the names of unrelated npm packages ([email protected],[email protected]on 2026-11-05), sonpm view uv versionanswers confidently with a number that has nothing to do with this file. The command iscurl -s https://pypi.org/pypi/<name>/json | python3 -c "…['info']['version']".
package.json bridge and not turbo's native Python supportTurborepo does discover uv workspace members natively — and it is behind a future flag, and its own documentation says: "uv support is experimental and can change at any time. We encourage you to try it out in side projects, proof-of-concepts, and other environments where stability is not essential." (Python (Experimental))
It also requires the repository root to become a uv workspace — a root pyproject.toml,
a root uv.lock, [tool.turbo].name — which changes what monorepo-bootstrap writes, for
every project, to serve one app.
So this skill takes the stable path: the Python app stays a plain pnpm workspace member with a
scripts-only package.json, and everything Python-shaped stays inside apps/<name>/. Revisit
when the flag graduates — references/turbo-integration.md carries the migration note.
See references/contracts.md (vendored from dev-flow). Key facts:
<project-root>/.workflow/meta.json#stack.framework — must be "monorepo".phase in {scaffolded, page_generated, module_added}.stack.monorepo.services (array; see the contract's stack section).history. Does not modify phase — same policy as monorepo-add-shared-package:
this skill adds a capability, it does not advance the build. Never regress phase.eve-agent does for the agent app.apps/<name>/ belongs to this skill, the way apps/agent/ belongs to eve-agent. Concretely:
design-md-to-app, screenshot-to-page, forms, transitions, shadscan, coss-ui and
the other web skills must never be proposed for this app. They target a Next.js app with a
UI; this app has neither. dev-flow's routing table says so — if something proposes them here,
that is the bug.module-add operates in apps/web/. It does not reach into apps/<name>/.packages/api/src/<name>/
and the <NAME>_SERVICE_URL environment variable. Nothing else crosses.scaffolded / page_generated / module_added when
stack.monorepo.services is empty and the PRD names such work. It is proposed, never
imposed — a Python service is a stack decision and a second runtime to deploy.monorepo-bootstrap/references/structure.md — the canonical apps/ + packages/ layout.dev-flow/references/stack-monorepo.md — the stack.monorepo.* sub-keys.references/service-layout.md — what lands in apps/<name>/ and why each file is there.references/turbo-integration.md — the task graph, and the caching trap that eats a day.references/openapi-client.md — FastAPI → packages/api → a typecheck that fails on drift.references/deploy-container.md — the Dockerfile, the registry, the runtime, both env sides.references/variant-ml.md — the model variant: memory, model_version, Metal vs CUDA, the
narrowest interface that makes a model swappable, the differential bench that decides whether
to swap it, and why a token limit is a wall the pipeline walks through rather than hits.Refuse, with the reason and the fix, if any of these is false:
| Check | Message when it fails |
|---|---|
.workflow/meta.json exists | "No dev-flow project here. Run dev-flow first." |
stack.framework == "monorepo" | "This skill is monorepo-only. A single Next app has no apps/ to add to — put the service in its own repo, or run monorepo-bootstrap first." |
phase ∈ {scaffolded, page_generated, module_added} | "Need a scaffolded monorepo. Current phase: <phase>." |
pnpm-workspace.yaml exists and its globs cover apps/* | "apps/* is not a workspace glob — the service would be invisible to pnpm." |
turbo.json exists | "No turbo.json at the root: this is not a turborepo." |
uv on PATH | "uv is required. Install it: curl -LsSf https://astral.sh/uv/install.sh | sh (macOS/Linux) — see https://docs.astral.sh/uv/getting-started/installation/." |
Read meta.json#project_slug for the package namespace.
One round-trip, with defaults, and say the variant out loud because it changes the dependency tree and the deploy target:
ml. kebab-case. Rejected: web, mobile, agent, root, and any
existing entry in apps/.8000. Must not collide with apps/web (3000) or an existing service.generic (default for anything else) or ml. The ml variant adds an
optional dependency group, a model registry with explicit unloading, and a different
production image. It does not add any inference code.bash <skill>/scripts/scaffold_python_service.sh <project-root> --name <name> --port <port> --variant <generic|ml>
Idempotent by construction: every file is written only if absent, and the script reports
created / exists per path. Re-running it is a no-op that prints what it found. See
references/service-layout.md for what each file is and why.
Patch the root turbo.json — references/turbo-integration.md has the exact JSON and the
reason for every key. The one that is not obvious and costs a day if missed:
inputsopts you out of turbo's.gitignoreawareness. A Python package without$TURBO_DEFAULT$in itsinputshashes__pycache__/,.venv/and.pytest_cache/, and the cache never hits again. (Configuring turbo.json →inputs)
pnpm --filter @<slug>/<name> run openapi # FastAPI → apps/<name>/openapi.json
pnpm --filter @<slug>/api run build # openapi.json → packages/api/src/<name>/
apps/web imports the client and reads <NAME>_SERVICE_URL from the environment. A hand-written
fetch to the service is the anti-pattern this whole seam exists to prevent — see
references/openapi-client.md, which also shows how to make the typecheck the gate.
python3 <skill>/scripts/check_python_service.py <project-root> --name <name>
It reports signals, never a verdict: uv present and its version, the Python version the service pins, whether the turbo tasks are registered, whether the client exists and is newer than the schema. Read them and decide; do not paste them as a pass.
Then the real thing, because a signal is not a run:
pnpm turbo dev --filter @<slug>/<name> # then: curl -s localhost:<port>/health
pnpm turbo test lint --filter @<slug>/<name>
meta.json#stack.monorepo.services gains one entry, and history gains one line:
python3 <dev-flow>/scripts/update_meta.py <project-root> append-history \
--skill 'monorepo-add-python-service' \
--inputs '{"name":"<name>","port":<port>,"variant":"<variant>"}' \
--outputs '{"app":"apps/<name>","client":"packages/api/src/<name>"}'
phase is untouched, before and after.
fetch("http://localhost:8000/…") in apps/web. The generated client exists so that a
schema change is a compile error, not a runtime 422 nobody sees until production.<NAME>_SERVICE_URL, both locally and on Vercel.inputs without $TURBO_DEFAULT$ — see Step 4.references/service-layout.md; taking it without reading that is how two
services end up owning one schema.torch in the base install means every
uv sync on every laptop and every CI job pulls gigabytes. references/variant-ml.md.ml variant in Docker on macOS expecting the GPU. Docker Desktop does not
expose Metal. Native locally, CUDA container in production.references/contracts.md (opens in a new tab)references/deploy-container.md (opens in a new tab)references/openapi-client.md (opens in a new tab)references/service-layout.md (opens in a new tab)references/turbo-integration.md (opens in a new tab)references/variant-ml.md (opens in a new tab)scripts/check_python_service.py (opens in a new tab)scripts/scaffold_python_service.sh (opens in a new tab)scripts/test_scaffold_python_service.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lukedj78/dev-flow --plugin dev-flow57 skills in this plugin
/animated-iconsAdd a Motion-animated icon to a Next.js app from a shadcn registry instead of hand-animating an SVG. Two registries, picked from the project's icon set: **heroicons-animated** (316 icons, `shadcn add @heroicons-animated/<name>`) and **hugeicons-animated** (165 icons, `shadcn add @hugeicons-animated/<name>`, which also installs a shared `lib/use-icon-animation.ts`). Both MIT, both on the `motion` runtime, both copied into your repo as source. This skill owns the install plus the two things the raw components lack: a `prefers-reduced-motion` guard and timing aligned to the project motion tokens (`lib/motion/`). Use when the user says "animated icon", "animate this icon", "make the bell/heart/menu icon animate on hover", "aggiungi un'icona animata", or wants an icon micro-interaction. Refuses outside Next.js web — for React Native use `rn-animations-gestures`. Not for: static icons, a whole motion system (`transitions`), or installing the runtime itself (`module-add motion`)./app-securityCheck whether an app's own code can be attacked before it ships — vulnerable dependencies, secrets in the code and in git history, Next.js authorization gaps (Server Actions and route handlers without a session check, queries by id with no owner filter — IDOR), data over-exposure, secrets in public env vars, raw SQL — then read the flagged code against an OWASP checklist, with an opt-in dynamic level (Strix) that proves exploits against the app running locally. The fifth pre-deploy gate, beside compliance-audit, vercel-doctor, shadscan and launch-audit; reports and routes, never blocks. Triggers: "security review", "è sicura l'app?", "controllo di sicurezza prima del deploy", "IDOR", "secrets in the repo", "pentest". Not for: GDPR and legal (compliance-audit), UI quality (shadscan), cost (vercel-doctor), launch readiness (launch-audit), a review of one branch diff (Claude Code's /security-review), third-party registry code (registry-intake).