Stop tracking personal workflow artifacts at repo root, add CI and MIT license, align README and agent skills with artifacts/ defaults, and enable Ruff in dev/CI so releases are verifiable without local-only runs. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
5.1 KiB
5.1 KiB
Documentation Status
- Synced with artifacts/ baseline on 2026-06-01.
name: vlm-library-workflow
description: Operate and extend the Video Library Manager (vlm) with a safety-first, human-in-the-loop workflow across scan, parse, enrich, analyze, plan, review-plan, apply-review, execute, rollback, and developer verification. Use when requests involve organizing a video library, producing or reviewing artifacts/inventory.csv, artifacts/identities.json, artifacts/analysis.json, artifacts/plan.json, tuning VLM config templates, resolving duplicates or episode gaps, running dry-run/confirm execution, recovering changes via rollback, explaining VLM CLI usage, or developing/modifying VLM features (parser, providers, planner, executor, commands, tests).
VLM Library Workflow
Overview
Run the repository's built-in media organization pipeline with consistent safety checks and explicit output verification. Prefer incremental, reviewable steps and never skip dry-run and plan inspection before destructive operations.
Do not commit generated CSV/JSON under artifacts/ or at the repository root.
Workflow Order
Run commands in this default sequence unless the user asks for a specific stage:
vlm config initthen setlibrary_rootin~/.vlm/config.yamlvlm scan→artifacts/inventory.csvvlm parse --inventory artifacts/inventory.csv→artifacts/identities.json(v2 schema)vlm enrichwhen bilingual titles and reputation signals are neededvlm analyze --inventory artifacts/inventory.csv→artifacts/analysis.jsonvlm plan --analysis artifacts/analysis.json→artifacts/plan.jsonvlm review-plan→artifacts/plan_manual_review.csv(use--tuionly when Textual is installed)- Edit CSV if needed, then
vlm apply-reviewto sync decisions intoplan.json vlm execute(dry-run) and inspect summaryvlm execute --confirmonly after explicit user confirmationvlm rollbackif the user requests revert
If vlm is not on PATH, prefix commands with uv run.
Preflight Checks
Run these checks before executing workflow commands:
- Confirm current working directory is repository root.
- Probe command availability:
vlm --helporuv run vlm --help. - Run the target subcommand
--helpwhen options are uncertain. - Confirm config validity with
vlm config validateafter config edits. - Verify required input artifacts exist under
artifacts/(or paths passed via flags). - Treat
execute --confirmas destructive and require explicit user confirmation.
Execution Rules
Follow these rules while executing tasks:
- Prefer read-only stages first: scan, parse, enrich, analyze, plan.
- Treat
artifacts/plan.jsonas the reviewable contract; summarize counts and conflicts before execution. - Run
review-planandapply-reviewbeforeexecute --confirmwhen manual decisions are required. - Run dry-run (
vlm execute) beforevlm execute --confirm. - If execution is interrupted or results are incorrect, locate rollback logs and run
vlm rollback. - Keep outputs explicit in responses: file path, record counts, and next command.
- If the user asks for a partial workflow, run only required stages and state skipped dependencies.
- Before
execute --confirm, runvlm review-planand report high-risk counts; pause if the user has not reviewed high-risk operations.
Decision Points
Use these decision policies:
- Duplicate handling: choose
plan.duplicate_keep(by_quality,by_reputation,by_reputation_quality_time,first_seen,manual) per user preference. - Enrichment: skip
vlm enrichonly when translations/reputation are not needed or API keys are unavailable. - Metadata quality: prefer
vlm parse --inventory artifacts/inventory.csvwhen duplicate quality ranking matters. - Analysis-assisted planning: prefer
vlm plan --analysis artifacts/analysis.jsonfor automatic duplicate quarantine decisions. - Parser boundary risk: treat resolution-like tokens (
1920x1080) andSampleclips as high-risk; require review-plan output before confirmation.
Output Contract
Return concise, operational summaries:
- Commands executed.
- Artifacts generated or updated (under
artifacts/by default). - Key counts (files scanned, identities parsed, duplicate groups, plan operations).
- Risk counts from
review-plan(manual_review / sample_source / high_season / high_episode / conflicts). - Blocking errors and exact remediation command.
- Safe next step.
Developer Verification
When modifying VLM core logic:
- Full suite:
uv run pytest -q - Core components:
uv run pytest tests/test_scanner.py tests/test_planner.py tests/test_executor.py - Property tests:
uv run pytest tests/test_analysis_properties.py - Lint (with dev extras):
uv run ruff check src tests
References
Load these references on demand:
references/command-recipes.md— command syntax, artifact expectations, failure triage.references/workflow.md— end-to-end operator workflow.references/cli-reference.md— command and config quick reference.references/dev-guide.md— architecture and developer modification patterns.