4.7 KiB
4.7 KiB
name, description
| name | description |
|---|---|
| vlm-library-workflow | 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, execute, rollback, and developer verification. Use when requests involve organizing a video library, producing or reviewing `inventory.csv`/`identities.json`/`analysis.json`/`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.
Workflow Order
Run commands in this default sequence unless the user asks for a specific stage:
vlm config initthen setlibrary_rootin~/.vlm/config.yamlvlm scanto produceinventory.csvvlm parse --inventory inventory.csvto produce metadata-richidentities.jsonvlm enrichwhen bilingual titles and reputation signals are neededvlm analyze --inventory inventory.csvto produceanalysis.jsonvlm plan --analysis analysis.jsonto produceplan.jsonvlm execute(dry-run) and inspect summaryvlm execute --confirmonly after explicit user confirmationvlm rollbackif the user requests revert
Preflight Checks
Run these checks before executing workflow commands:
- Confirm current working directory is repository root.
- Probe command availability in this order:
vlm --help- if unavailable, switch all commands to
uv run vlm --help
- Run the target subcommand
--helpwhen options are uncertain. - Confirm config validity with
vlm config validateafter config edits. - Verify required input files exist before downstream stages.
- 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
plan.jsonas reviewable contract; summarize counts and conflicts before execution. - 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 user asks for partial workflow, run only required stages and clearly state skipped dependencies.
- Before
execute --confirm, runvlm review-plan --input plan.json --output plan_manual_review.csvand report high-risk counts. - If high-risk operations > 0, default to pause and require user explicit override to continue confirm execution.
Decision Points
Use these decision policies:
- Duplicate handling:
Choose
plan.duplicate_keeppolicy (by_quality,by_reputation,first_seen,manual) based on user preference. - Enrichment:
Skip
vlm enrichonly when user does not need translations/reputation or API keys are unavailable. - Metadata quality:
Prefer
vlm parse --inventory inventory.csvwhen duplicate quality ranking matters. - Analysis-assisted planning:
Prefer
vlm plan --analysis analysis.jsonwhen user wants automatic duplicate quarantine decisions. - Parser boundary risk:
Treat filenames containing resolution-like
1920x1080/1440x1080andSampleclips as high-risk; require review-plan output before confirmation.
Output Contract
Return concise, operational summaries:
- Commands executed.
- Artifacts generated or updated.
- 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, verify integrity with these recipes:
- Full Suite:
pytest - Core Components:
pytest tests/test_scanner.py tests/test_planner.py tests/test_executor.py - Property Tests:
pytest tests/test_analysis_properties.py - Integration:
pytest tests/test_reports_integration.py
References
Load these references on demand:
references/command-recipes.md: command syntax, artifact expectations, and failure triage.references/workflow.md: end-to-end operator workflow guidance.references/cli-reference.md: command and config option quick reference.references/dev-guide.md: project architecture and developer modification patterns.