archive-reprocessing
БесплатноБез исполняемых скриптовНе проверенFlexible, version-tracked reprocessing system for archive transformations using design patterns (Strategy, Template Method, Observer). Activate when working…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
Archive Reprocessing System
Auto-activates when: Working with tools/scripts/lib/, reprocessing scripts, transform versions, or discussing archive transformations.
Quick Reference
When to use:
- New transformations on existing archives (flattening, normalization)
- After version bumps (v1.0 → v1.1)
- Vocabulary/model updates
- Regenerating derived outputs
When NOT to use:
- Adding new videos →
ingest_youtube.py - Rebuilding Qdrant cache →
reingest_from_archive.py
Scripts:
reprocess_qdrant_metadata.py- Flattening + weights (fast, no LLM)reprocess_normalized_tags.py- Tag normalization (slow, LLM calls)
Common commands:
# Dry run (test 10 archives)
uv run python tools/scripts/reprocess_qdrant_metadata.py --dry-run --limit 10
# Full run
uv run python tools/scripts/reprocess_qdrant_metadata.py
Design
Strategy + Template Method + Observer patterns for incremental, version-tracked reprocessing:
- Pluggable transformers (Strategy) eliminate copy-paste
- Template Method for consistent workflows
- Observer hooks for progress tracking
- Semantic versioning works during development (not git-dependent)
- Incremental processing skips unchanged archives
Core Components
1. Version Registry (transform_versions.py)
VERSIONS = {
"normalizer": "v1.0",
"vocabulary": "v1",
"qdrant_flattener": "v1.0",
"weight_calculator": "v1.0",
"llm_model": "claude-3-5-haiku-20241022",
}
Bump versions on: logic changes (v1.0 → v1.1), vocabulary updates (v1 → v2), breaking changes (v1.x → v2.0)
2. Metadata Transformers (metadata_transformers.py)
from tools.scripts.lib.metadata_transformers import (
QdrantMetadataFlattener,
RecommendationWeightCalculator,
create_qdrant_transformer,
)
# Pre-built
transformer = create_qdrant_transformer()
metadata = transformer.transform(archive_data)
# Custom
class MyTransformer(BaseTransformer):
def get_version(self) -> str:
return get_version("my_transformer")
def transform(self, archive_data: dict) -> dict:
return {"transformed": True}
3. Reprocessing Pipeline (reprocessing_pipeline.py)
from tools.scripts.lib.reprocessing_pipeline import (
BaseReprocessingPipeline,
ConsoleHooks,
)
class MyPipeline(BaseReprocessingPipeline):
def get_output_type(self) -> str:
return "my_transformation_v1"
def get_version_keys(self) -> list[str]:
return ["my_transformer"]
def process_archive(self, archive: YouTubeArchive) -> str:
return json.dumps(result)
pipeline = MyPipeline(hooks=ConsoleHooks())
stats = pipeline.run(limit=10)
Common Tasks
# Dry run (test)
uv run python tools/scripts/reprocess_qdrant_metadata.py --dry-run --limit 10
uv run python tools/scripts/reprocess_normalized_tags.py --dry-run --limit 3
# Full run (~12min Qdrant, ~2hr normalization for 470 videos)
uv run python tools/scripts/reprocess_qdrant_metadata.py
uv run python tools/scripts/reprocess_normalized_tags.py
# After version bump (only processes stale archives)
# Edit: tools/scripts/lib/transform_versions.py → "normalizer": "v1.1"
uv run python tools/scripts/reprocess_normalized_tags.py
# Options
--no-context # Skip semantic retrieval (faster, lower quality)
--no-vocabulary # Skip vocabulary normalization
Archive Data Structure
{
"llm_outputs": [
{"output_type": "tags", "cost_usd": 0.0012, "model": "claude-3-5-haiku-20241022"}
],
"derived_outputs": [
{
"output_type": "normalized_metadata_v1",
"transformer_version": "v1.0+v1",
"transform_manifest": {"normalizer": "v1.0", "vocabulary": "v1"},
"source_outputs": ["tags"]
}
]
}
llm_outputs cost money (permanent), derived_outputs free to regenerate (version-tracked)
Incremental Processing
Staleness detection: compare stored transform_manifest to current VERSIONS. Reprocess if changed, skip if match.
Performance: First run (all 470): ~12min Qdrant / ~2hr normalization. Subsequent runs: ~5s (skip if current). Version bump: only affected archives.
Creating New Transformations
Steps:
- Add version to
transform_versions.py:"my_transformer": "v1.0" - Create transformer class with
get_version()andtransform()methods - Create pipeline script extending
BaseReprocessingPipeline
# Transformer
class MyTransformer(BaseTransformer):
def get_version(self) -> str:
return get_version("my_transformer")
def transform(self, archive_data: dict) -> dict:
return {"result": "value"}
# Pipeline
class MyReprocessor(BaseReprocessingPipeline):
def get_output_type(self) -> str:
return "my_output_v1"
def get_version_keys(self) -> list[str]:
return ["my_transformer"]
def process_archive(self, archive: YouTubeArchive) -> str:
return json.dumps(MyTransformer().transform(archive.model_dump()))
Arch
Установить archive-reprocessing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл archive-reprocessing?
Flexible, version-tracked reprocessing system for archive transformations using design patterns (Strategy, Template Method, Observer). Activate when working with tools/scripts/lib/, reprocessing scripts, transform versions, archive transformations, metadata transformers, or incremental processing workflows.
Как установить скилл archive-reprocessing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл archive-reprocessing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic