name: clip-factory
version: "2.0"
description: >
  Multi-clip extraction pipeline. Takes long-form content (webinar, stream, presentation,
  interview) and produces multiple short clips optimized for social distribution.
  Outputs N independent deliverables from a single source. EP orchestration adds quality
  gates for clip selection, batch consistency, and hook placement.
category: custom
stability: beta
default_checkpoint_policy: guided

orchestration:
  mode: executive-producer
  skill: pipelines/clip-factory/executive-producer
  budget_default_usd: 1.00
  max_revisions_per_stage: 3
  max_send_backs: 3
  max_wall_time_minutes: 12

extensions:
  custom_scripts: true
  custom_playbooks: true
  custom_skills: true
  custom_tools: false

required_skills:
  - pipelines/clip-factory/executive-producer
  - pipelines/clip-factory/idea-director
  - pipelines/clip-factory/script-director
  - pipelines/clip-factory/scene-director
  - pipelines/clip-factory/asset-director
  - pipelines/clip-factory/edit-director
  - pipelines/clip-factory/compose-director
  - pipelines/clip-factory/publish-director
  - meta/reviewer
  - meta/checkpoint-protocol

compatible_playbooks:
  recommended:
    - clean-professional
    - flat-motion-graphics
  also_works: []
  custom_allowed: true

stages:
  - name: idea
    skill: pipelines/clip-factory/idea-director
    optional_artifacts_in:
      - source_media_review
    produces:
      - brief
      - decision_log
    tools_available: []
    checkpoint_required: true
    human_approval_default: true
    review_focus:
      - Source content type identified (webinar, stream, interview, etc.)
      - Target platforms and clip count are realistic
      - Clip selection criteria are clear (hook, coherence, value, energy, platform fit)
    success_criteria:
      - Schema-valid brief artifact
      - Brief specifies clip count target and platform mix

  - name: script
    skill: pipelines/clip-factory/script-director
    required_artifacts_in:
      - brief
    produces:
      - script
    required_tools:
      - transcriber
    optional_tools:
      - scene_detect
    tools_available:
      - transcriber
      - scene_detect
    checkpoint_required: true
    human_approval_default: true
    review_focus:
      - Full transcription with accurate timestamps
      - Clip-worthy segments identified and ranked
      - Each candidate clip is self-contained (makes sense without context)
    success_criteria:
      - Schema-valid script artifact
      - At least N candidate clips identified (where N >= brief target)

  - name: scene_plan
    skill: pipelines/clip-factory/scene-director
    required_artifacts_in:
      - script
    optional_artifacts_in:
      - brief
    produces:
      - scene_plan
    required_tools: []
    optional_tools:
      - frame_sampler
    tools_available:
      - frame_sampler
    checkpoint_required: true
    human_approval_default: true
    review_focus:
      - Each clip has clear in/out points with clean boundaries
      - Clips don't start or end mid-sentence
      - Platform-specific framing planned (vertical vs square vs landscape)
    success_criteria:
      - Schema-valid scene_plan artifact
      - Each clip scene has platform, aspect ratio, and duration specified

  - name: assets
    skill: pipelines/clip-factory/asset-director
    required_artifacts_in:
      - scene_plan
    optional_artifacts_in:
      - script
    produces:
      - asset_manifest
    required_tools:
      - subtitle_gen
    optional_tools:
      - audio_enhance
    tools_available:
      - subtitle_gen
      - audio_enhance
    checkpoint_required: true
    human_approval_default: false
    review_focus:
      - Per-clip subtitles generated with correct time offsets
      - Shared title / hook / branding assets prepared for each clip
      - Audio normalized consistently across all clips
    success_criteria:
      - Schema-valid asset_manifest artifact
      - Assets exist for every planned clip

  - name: edit
    skill: pipelines/clip-factory/edit-director
    required_artifacts_in:
      - scene_plan
      - asset_manifest
    optional_artifacts_in:
      - script
    produces:
      - edit_decisions
    tools_available: []
    checkpoint_required: true
    human_approval_default: false
    review_focus:
      - Each clip edit is independent and self-contained
      - Hook placement within first 2-3 seconds per clip
      - Subtitle styling consistent across all clips
    success_criteria:
      - Schema-valid edit_decisions artifact
      - Edit decisions exist for every planned clip

  - name: compose
    skill: pipelines/clip-factory/compose-director
    required_artifacts_in:
      - edit_decisions
      - asset_manifest
    optional_artifacts_in:
      - scene_plan
    produces:
      - render_report
      - final_review
    required_tools:
      - video_compose
      - video_trimmer
      - audio_mixer
    optional_tools:
      - audio_enhance
      - color_grade
    tools_available:
      - video_compose
      - video_trimmer
      - audio_mixer
      - audio_enhance
      - color_grade
    checkpoint_required: true
    human_approval_default: false
    review_focus:
      - All clips rendered successfully
      - Each clip meets its target platform specs (resolution, aspect ratio)
      - Audio levels consistent across clips
    success_criteria:
      - Schema-valid render_report artifact
      - All clip output files exist and pass ffprobe validation

  - name: publish
    skill: pipelines/clip-factory/publish-director
    required_artifacts_in:
      - render_report
      - final_review
    optional_artifacts_in:
      - brief
    produces:
      - publish_log
    tools_available: []
    checkpoint_required: true
    human_approval_default: true
    review_focus:
      - Per-clip metadata with platform-specific titles and descriptions
      - Clips numbered/ordered for posting schedule
      - Export package organized by platform
    success_criteria:
      - Schema-valid publish_log artifact
      - Export directory contains all clips with per-clip metadata
