Skip to content

Add Claude Code skills for the example pipelines#402

Merged
bobokvsky merged 33 commits into
masterfrom
add-e2e-template-claude-skill
Jul 8, 2026
Merged

Add Claude Code skills for the example pipelines#402
bobokvsky merged 33 commits into
masterfrom
add-e2e-template-claude-skill

Conversation

@Varfalamei

@Varfalamei Varfalamei commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What

Adds Claude Code skills as project skills under .claude/skills/ for the example pipelines, plus a README section on how they are added and used:

  • setup-e2e-templateexamples/e2e_template (YOLO detection / keypoints + Label Studio → train → FiftyOne). Includes an optional tags-addon.md recipe for per-scenario tag metrics (tag images → part flows into training → a separate tag_metrics table; old vs new model on the tagged subset).
  • setup-embedder-fiftyoneexamples/embedder_fiftyone (DINOv2/DINOv3 embeddings → FiftyOne UMAP + similarity search).
  • setup-sam-cvatexamples/sam_cvat (SAM3 text-prompt boxes + masks → CVAT pre-annotations).

Why

Lowers the barrier to running each example on real data first-try: external prerequisites, env knobs, and data-alignment gotchas are baked in. Being committed project skills, they are auto-discovered by Claude Code with zero install for anyone who clones the repo.

Notes

The datapipe-examples router skill (picks the right example + universal prerequisites) is not included here and can follow separately.

Project skill under .claude/skills/setup-e2e-template covering setup, run,
training and troubleshooting of the e2e_template pipeline on your own data,
plus an optional tags-addon recipe for per-scenario metrics. README documents
how it is auto-discovered and used.
@Varfalamei Varfalamei force-pushed the add-e2e-template-claude-skill branch from 58f01ba to db97c6a Compare June 30, 2026 14:20
Adds project skills setup-embedder-fiftyone and setup-sam-cvat alongside the
e2e_template skill, and generalizes the README section to list all three.
@Varfalamei Varfalamei changed the title Add Claude Code skill for examples/e2e_template Add Claude Code skills for the example pipelines Jun 30, 2026
…d, fix S3/demo knobs

master's config separates input ($DATAPIPE_E2E_DIR/images) from the working
dir ($DATAPIPE_E2E_DIR/datapipe), so the working-dir-overlap and dataset-grows
notes no longer apply; rewrote the 'where your images go' knobs to the env vars
master actually ships, corrected the seed-demo description, and dropped the
node-specific offline/pre-AVX2 note (polars-lts-cpu is pinned for old CPUs and
the seed already retries per image).
…cs-0 note and stale train-race advice

DETECTION_MODEL_CONFIG ([16,16]) is the pre-annotation fallback model, not the
training config (training is yolov8n imgsz 320), so metrics~0 on the seed set is
a data-size issue, not that config. master also ships resume_config that
auto-retries failed/raced training attempts, so the manual re-run note is stale.
@Varfalamei Varfalamei requested review from bobokvsky and korotaS and removed request for korotaS June 30, 2026 20:41

This skill = run the DINO→FiftyOne embedder on YOUR images. The FiftyOne-zoo dataset (caltech101) is just a smoke-test; the real goal is your own images — set the knobs below first.

**Before starting, if not already provided, ask the user:** demo (zoo) or your own data? external Postgres up or provision it? GPU? — ask only what's unresolved, then do only what's needed.

@korotaS korotaS Jul 1, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я бы здесь добавил что-то типа "задай максимум вопросов", потому что мне при прогоне не хватило как минимум нескольких штук:

  1. он сам вписал в .env путь к локальной постгре (которая слава богу была пустая), так что надо бы явно спрашивать "какую именно базу в постгре используем", а не только "используем ли локальную или поднимает докер". также можно в явном виде прописать отдельный шаг "подготовить .env", чтобы он его подготовил, потом ты вручную проверил, а потом уже запускать дальше
  2. он все шаги трубы типа create-all и run прогонял без логов, типа datapipe run 2>&1 | tail -60, а лучше пусть спросит, нужны ли логи или нет
  3. можно еще спросить про uv, вдруг есть уже готовое окружение, чтобы не ставить новое. кстати тут он сам понял, что с текущим toml на мак не встанет, поэтому пофиксил его - это прикольно

плюс не хватило немного отчетности - чтобы он сначала, как все прочитал, сказал "план такой, выполняем?" и на каждом этапе говорил побольше, типа "я сделал вот это и вот это". сейчас он сам сразу стартанул и все сделал, но довольно мало говорил

но вообще это все мелочи, потому что пишешь чисто /setup-embedder-fiftyone и происходит магия)))

@Varfalamei Varfalamei self-assigned this Jul 1, 2026
Varfalamei added 14 commits July 1, 2026 13:29
…irst with an .env checkpoint

From real-run feedback: ask which Postgres/database to use (don't silently write a
localhost default or target an existing DB), whether to reuse an existing venv, and
whether to surface stage logs; propose a plan before acting, prepare .env and pause
for the user to verify it, and report what changed after each stage instead of running
the pipeline silently.
…ebug-sql into a file + grep

Replaces the tail-60 guidance (which hid progress and still cost tokens): run
stages with their normal INFO logs shown, and only when a failure's cause is
unclear re-run with datapipe --debug (or --debug-sql) written to a file and
grepped, instead of dumping the verbose debug firehose into context.
Documents how to recreate the tag demo end-to-end: seed a non-trivial cat/dog
set, build a darkened tagged scenario with inherited GT, train a baseline with
the scenario excluded, retrain with it included, compute tag_metrics, and
compare on the val holdout. Notes evaluating on final-epoch weights.
Router that points to the right example + setup skill and lists the universal
prerequisites (Postgres, GPU, annotation backend, uv env, HF auth). Carries the
same ask-first / plan-first / logs / --debug guidance as the setup skills.
…emo recipe

The 10-image smoke default is too small — the pipeline's val metric is noisy and
its built-in metrics/checkpoint selection misbehave. Default --detection-limit to
120, at which a clean from-scratch run trains, computes metrics natively, and shows
the tag arc (baseline low on the tagged scenario, higher after the tag is added to
training). Pin the demo-scenario counts in tags-addon.md (120 base, ~40 night 30/10,
gamma 0.10) and soften the checkpoint-selection note now that native metrics work.
… ready-made GT

Skipping the human annotation step (injecting COCO/inherited ground truth) vs a real
Label Studio pass is a demo-shaping choice, so surface it in the Ask-first block and
flag it in the tag demo recipe rather than deciding silently.
Add the concrete recipe to surface tags as a graph node in datapipe-app: catalog
entries (tag/image__tag/tag_metrics) + an aggregation step, and note it MUST be a
DatatableBatchTransform (whole-table SQL group-by), not a chunked BatchTransform,
since it aggregates many images into one (model,tag,subset) row. These pipeline
edits stay docs-only / applied physically for the demo, not committed to the example.
…ation

For unattended/demo runs without a human annotator: write image__ground_truth +
image__subset directly, but following the pipeline conventions — image_name as
list_s3_images emits it (basename relative to INPUT_IMAGES_DIR, no invented prefix),
labels matching DETECTION_CLASSES casing (Cat/Dog not cat/dog), via DataStore so
_meta stays consistent. Captures the two mismatches that silently break freeze/metrics.
… pipeline schema AND public observability run history separately)
…ercase classes; drop tags-addon

New self-contained example examples/detection_tags: YOLO detection with tags built into the
pipeline (tag/image__tag/tag_metrics + a compute_tag_metrics BatchTransform), NO Label Studio and
NO FiftyOne, ground truth injected (COCO labels, lowercase cat/dog), postgres+minio only, deps pin
polars-lts-cpu + pi-heif so it runs from scratch. Two-step data load (base batch, tagged scenario
batch) via scripts/load_batch.py. New setup-detection-tags skill + router row. e2e_template
LABEL_CONFIG lowercased (cat/dog) to match COCO; the old tags-addon.md recipe is removed in favour
of the real example.
…oad BatchTransform)

Replace the standalone load_batch.py with a load stage in the pipeline: a load_request table
(request_id/n/offset/tag/darken) feeds a load BatchTransform that downloads COCO cat/dog, uploads
to MinIO and emits s3_images + ground truth (+ tag/image__tag). Loading a batch = add a request row
(scripts/add_request.py) then datapipe step --labels=stage=load run — so ingestion is datapipe-native
and shows in the graph. Two requests (base, tagged night) drive the two-model demo.
Varfalamei and others added 11 commits July 6, 2026 14:02
…otal), gamma 0.25, epochs 10; add pi-heif to e2e deps
compute_tag_metrics already summed per-image TP/FP/FN to derive
precision/recall/f1 but did not return them; surface them as
calc__TP/FP/FN and add the columns to the tag_metrics table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…problem->fix flow)

Reorder the demo so the low night/val tag metric is shown on the
baseline model first (metric stages run on model A over the new night
batch, no training) and framed as the problem, then retraining closes
it. Note the inference->count-metrics->tag-metrics ordering and that
night/val is small so the rise is directional.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixed val (correct A/B metric comparison):
- add_request.py --subset pins a batch to train/val; load_batch emits image__subset_hint;
  split honors it (random split only fills un-pinned images). Load base-val + night-val up
  front so val is frozen; add night-train only for the retrain.

FiftyOne (ported from e2e_template/image_detection):
- stage=fiftyone: download_images + publish GT and per-model predictions
  (predictions_model_a=baseline, predictions_model_b=retrained; slot by sorted model id);
  tag/subset as sample fields. mongo added to docker-compose; datapipe-ml[fiftyone]+fiftyone dep.

Tag dimension: numeric tag_id (deterministic via config.TAG_IDS) + tag_name + tag_description;
image__tag/tag_metrics key on tag_id, join tag for readable name.

Bug fixes:
- darken=NaN: a NULL numeric column arrives as NaN when several requests load in one batch;
  pd.isna guards so base batches are not darkened with gamma=NaN into garbage.
- download_images: don't pass S3 storage options to fsspec.open of a public HTTP URL.

Defaults/robustness: DB_SCHEMA defaults to public; standard ports.

SKILL.md: two-part checkpoint flow (demo-only), fixed-val rationale, pre-flight port/schema
checks, always-print-full-table rule, service-watch guidance, troubleshooting
(polars-lts on pre-AVX2, count-metrics ordering, double-train, port/tunnel/proxy pitfalls);
snapshot/rehearse as inline pg_dump/psql (no committed demo scripts).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move all COCO/demo-only code (constants, download+cache, gamma darkening) into a dedicated
detection/coco_demo.py (CocoDemoSource + darken). steps.load_batch is now source-agnostic
plumbing: it pulls (bytes, boxes, labels) from the source and lays them into the pipeline
tables. For real data you replace one file (coco_demo.py); steps.py/app.py are untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nto add-e2e-template-claude-skill

# Conflicts:
#	.claude/skills/setup-detection-tags/SKILL.md
@Varfalamei Varfalamei requested a review from korotaS July 8, 2026 17:04
@bobokvsky bobokvsky merged commit 22a29e2 into master Jul 8, 2026
1 check passed
@bobokvsky bobokvsky deleted the add-e2e-template-claude-skill branch July 8, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants