Skip to content

tim-hub/powerball-harness / .claude/skills/generate-video

generate-video

Verified

Generates product demo videos and release walkthroughs via Remotion. Use when creating video documentation or animated demos.

FileKindSize
SKILL.mdskill md6.6 KB
assets/backgrounds/backgrounds.jsonconfig4.9 KB
assets/sounds/sounds.jsonconfig5.7 KB
package.jsonmanifest710 B
references/MIGRATION-11.2.mdmarkdown7.9 KB
references/analyzer.mdmarkdown4.5 KB
references/asset-customization.mdmarkdown11.2 KB
references/best-practices.mdmarkdown8.6 KB
references/direction-guide.mdmarkdown14.6 KB
references/generator.mdmarkdown25.9 KB
references/image-generator.mdmarkdown9.0 KB
references/image-patterns.mdmarkdown14.5 KB
references/image-quality-check.mdmarkdown6.9 KB
references/naming-conventions.mdmarkdown6.0 KB
references/planner.mdmarkdown7.6 KB
references/visual-effects.mdmarkdown11.0 KB
remotion/components/BackgroundLayer.tsxother7.5 KB
remotion/components/EmphasisBox.tsxother5.9 KB
remotion/components/ProgressIndicator.tsxother6.8 KB
remotion/components/README.mdmarkdown8.5 KB
remotion/components/TransitionWrapper.tsxother5.7 KB
remotion/components/index.tsscript1004 B
remotion/tsconfig.jsonconfig617 B
schemas/README.mdmarkdown8.1 KB
schemas/animation.schema.jsonconfig5.2 KB
schemas/assets.manifest.schema.jsonconfig5.9 KB
schemas/character.schema.jsonconfig16.0 KB
schemas/direction.schema.jsonconfig4.5 KB
schemas/emphasis.schema.jsonconfig8.6 KB
schemas/examples/scenario-example.jsonconfig1.6 KB
schemas/examples/scene-example.jsonconfig1.6 KB
schemas/examples/video-script-example.jsonconfig5.1 KB
schemas/examples/visual-patterns/comparison-example.jsonconfig1.0 KB
schemas/examples/visual-patterns/concept-example.jsonconfig2.1 KB
schemas/examples/visual-patterns/flow-example.jsonconfig1.8 KB
schemas/examples/visual-patterns/highlight-example.jsonconfig745 B
schemas/scenario.schema.jsonconfig3.6 KB
schemas/scene.schema.jsonconfig8.2 KB
schemas/validate-schemas-basic.jsscript2.7 KB
schemas/validate-schemas.jsscript6.6 KB
schemas/video-script.schema.jsonconfig7.6 KB
schemas/visual-patterns.schema.jsonconfig14.2 KB
scripts/README.mdmarkdown7.4 KB
scripts/generate-schemas.jsexecutablescript6.2 KB
scripts/load-assets.jsexecutablescript14.1 KB
scripts/merge-scenes.jsexecutablescript15.0 KB
scripts/render-video.jsexecutablescript14.0 KB
scripts/template-registry.jsexecutablescript10.0 KB
scripts/validate-scenario.jsexecutablescript8.0 KB
scripts/validate-scene.jsexecutablescript4.3 KB
scripts/validate-video.jsexecutablescript13.0 KB
src/schemas/animation.tsscript3.7 KB
src/schemas/assets.manifest.tsscript2.8 KB
src/schemas/character.tsscript6.5 KB
src/schemas/direction.tsscript3.2 KB
src/schemas/emphasis.tsscript5.2 KB
src/schemas/index.tsscript423 B
src/schemas/scenario.tsscript2.7 KB
src/schemas/scene.tsscript5.5 KB
src/schemas/video-script.tsscript9.4 KB
src/schemas/visual-patterns.tsscript8.2 KB
src/types/README.mdmarkdown4.1 KB
src/types/components.tsscript6.0 KB
src/types/index.tsscript108 B
src/utils/README.mdmarkdown6.1 KB
src/utils/converters.jsscript5.9 KB
src/utils/converters.tsscript5.7 KB
src/utils/index.tsscript109 B
templates/image-prompts/comparison.txtmarkdown1.3 KB
templates/image-prompts/concept.txtmarkdown2.3 KB
templates/image-prompts/flow.txtmarkdown2.8 KB
templates/image-prompts/highlight.txtmarkdown3.2 KB
templates/intro-3min.jsonconfig8.9 KB
templates/teaser-90s.jsonconfig7.0 KB
tests/asset-loader.test.jsscript12.1 KB
tests/character-schema.test.jsscript7.9 KB
tests/converters.test.jsscript8.3 KB
tests/determinism.test.jsscript11.4 KB
tests/e2e/merge-e2e.test.jsscript13.3 KB
tests/e2e/render.test.jsscript6.1 KB
tests/fixtures/minimal-video-script.jsonconfig1.2 KB
tests/merge-scenes.test.jsscript17.2 KB
tests/schema-validation.test.jsscript3.7 KB
tests/validation-integration.test.jsscript12.9 KB
tests/visual-patterns.test.jsscript12.1 KB

tests/asset-loader.test.js

View on GitHub
/**
 * Asset Loader Tests
 *
 * Tests for scripts/load-assets.js functionality
 */

const {
  loadBackgrounds,
  loadSounds,
  loadAssetFile,
  updateManifest,
  getAssetPaths,
  initUserAssetDir
} = require('../scripts/load-assets.js');
const fs = require('fs');
const path = require('path');
const os = require('os');

// Test data paths
const SKILL_ROOT = path.join(__dirname, '..');
const ASSETS_DIR = path.join(SKILL_ROOT, 'assets');
const TEST_USER_DIR = path.join(os.tmpdir(), 'test-harness-assets-' + Date.now());

describe('Asset Loader', () => {
  // Mock USER_ASSETS_DIR for testing
  beforeAll(() => {
    // Create test user asset directory
    if (!fs.existsSync(TEST_USER_DIR)) {
      fs.mkdirSync(TEST_USER_DIR, { recursive: true });
    }
  });

  afterAll(() => {
    // Clean up test directory
    if (fs.existsSync(TEST_USER_DIR)) {
      fs.rmSync(TEST_USER_DIR, { recursive: true, force: true });
    }
  });

  describe('loadBackgrounds()', () => {
    test('loads skill default backgrounds', () => {
      const backgrounds = loadBackgrounds();

      expect(backgrounds).toBeDefined();
      expect(backgrounds.version).toBe('1.0.0');
      expect(backgrounds.backgrounds).toBeInstanceOf(Array);
      expect(backgrounds.backgrounds.length).toBeGreaterThan(0);
    });

    test('contains all 5 background types', () => {
      const backgrounds = loadBackgrounds();
      const ids = backgrounds.backgrounds.map(bg => bg.id);

      expect(ids).toContain('neutral');
      expect(ids).toContain('highlight');
      expect(ids).toContain('dramatic');
      expect(ids).toContain('tech');
      expect(ids).toContain('warm');
    });

    test('each background has required fields', () => {
      const backgrounds = loadBackgrounds();

      backgrounds.backgrounds.forEach(bg => {
        expect(bg.id).toBeDefined();
        expect(bg.name).toBeDefined();
        expect(bg.description).toBeDefined();
        expect(bg.type).toBeDefined();
        expect(bg.colors).toBeDefined();
        expect(bg.colors.primary).toBeDefined();
        expect(bg.colors.secondary).toBeDefined();
        expect(bg.usage).toBeDefined();
        expect(bg.usage.scenes).toBeInstanceOf(Array);
      });
    });

    test('neutral background has correct properties', () => {
      const backgrounds = loadBackgrounds();
      const neutral = backgrounds.backgrounds.find(bg => bg.id === 'neutral');

      expect(neutral).toBeDefined();
      expect(neutral.type).toBe('gradient');
      expect(neutral.colors.primary).toMatch(/^#[0-9a-fA-F]{6}$/);
      expect(neutral.gradient).toBeDefined();
      expect(neutral.gradient.type).toBe('linear');
      expect(neutral.gradient.stops).toBeInstanceOf(Array);
    });

    test('tech background has pattern definition', () => {
      const backgrounds = loadBackgrounds();
      const tech = backgrounds.backgrounds.find(bg => bg.id === 'tech');

      expect(tech).toBeDefined();
      expect(tech.type).toBe('pattern');
      expect(tech.pattern).toBeDefined();
      expect(tech.pattern.type).toBe('grid');
      expect(tech.pattern.size).toBeGreaterThan(0);
    });
  });

  describe('loadSounds()', () => {
    test('loads skill default sounds', () => {
      const sounds = loadSounds();

      expect(sounds).toBeDefined();
      expect(sounds.version).toBe('1.0.0');
      expect(sounds.sounds).toBeInstanceOf(Array);
      expect(sounds.sounds.length).toBeGreaterThan(0);
    });

    test('contains all 4 sound types', () => {
      const sounds = loadSounds();
      const ids = sounds.sounds.map(s => s.id);

      expect(ids).toContain('impact');
      expect(ids).toContain('pop');
      expect(ids).toContain('transition');
      expect(ids).toContain('subtle');
    });

    test('each sound has required fields', () => {
      const sounds = loadSounds();

      sounds.sounds.forEach(sound => {
        expect(sound.id).toBeDefined();
        expect(sound.name).toBeDefined();
        expect(sound.description).toBeDefined();
        expect(sound.type).toBe('effect');
        expect(sound.category).toBeDefined();
        expect(sound.emphasis_level).toBeDefined();
        expect(sound.volume).toBeDefined();
        expect(sound.volume.default).toBeGreaterThan(0);
        expect(sound.volume.with_narration).toBeGreaterThan(0);
        expect(sound.usage).toBeDefined();
      });
    });

    test('emphasis levels are correctly assigned', () => {
      const sounds = loadSounds();
      const impact = sounds.sounds.find(s => s.id === 'impact');
      const pop = sounds.sounds.find(s => s.id === 'pop');
      const subtle = sounds.sounds.find(s => s.id === 'subtle');

      expect(impact.emphasis_level).toBe('high');
      expect(pop.emphasis_level).toBe('medium');
      expect(subtle.emphasis_level).toBe('low');
    });

    test('volume with narration is lower than default', () => {
      const sounds = loadSounds();

      sounds.sounds.forEach(sound => {
        expect(sound.volume.with_narration).toBeLessThan(sound.volume.default);
      });
    });
  });

  describe('loadAssetFile()', () => {
    test('returns null for non-existent file', () => {
      const result = loadAssetFile('backgrounds', 'nonexistent.json');
      expect(result).toBeNull();
    });

    test('finds skill default backgrounds.json', () => {
      const result = loadAssetFile('backgrounds', 'backgrounds.json');
      expect(result).toBeDefined();
      expect(result).toContain('backgrounds.json');
      expect(fs.existsSync(result)).toBe(true);
    });

    test('finds skill default sounds.json', () => {
      const result = loadAssetFile('sounds', 'sounds.json');
      expect(result).toBeDefined();
      expect(result).toContain('sounds.json');
      expect(fs.existsSync(result)).toBe(true);
    });
  });

  describe('updateManifest()', () => {
    test('creates new manifest if not exists', () => {
      const manifestPath = path.join(TEST_USER_DIR, 'manifest.json');
      const asset = {
        id: 'test-asset',
        path: 'test.png',
        type: 'image',
        hash: 'abc123',
        size: 1000
      };

      const success = updateManifest(manifestPath, asset);
      expect(success).toBe(true);
      expect(fs.existsSync(manifestPath)).toBe(true);

      const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
      expect(manifest.version).toBe('1.0.0');
      expect(manifest.assets).toBeInstanceOf(Array);
      expect(manifest.assets.length).toBe(1);
      expect(manifest.assets[0].id).toBe('test-asset');
    });

    test('appends to existing manifest', () => {
      const manifestPath = path.join(TEST_USER_DIR, 'manifest2.json');
      const asset1 = { id: 'asset1', path: 'a.png', type: 'image', hash: 'aaa', size: 100 };
      const asset2 = { id: 'asset2', path: 'b.png', type: 'image', hash: 'bbb', size: 200 };

      updateManifest(manifestPath, asset1);
      updateManifest(manifestPath, asset2);

      const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
      expect(manifest.assets.length).toBe(2);
      expect(manifest.assets[0].id).toBe('asset1');
      expect(manifest.assets[1].id).toBe('asset2');
    });

    test('updates generated_at timestamp', () => {
      const manifestPath = path.join(TEST_USER_DIR, 'manifest3.json');
      const asset = { id: 'test', path: 'test.png', type: 'image', hash: 'xyz', size: 500 };

      updateManifest(manifestPath, asset);
      const manifest1 = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
      const timestamp1 = manifest1.generated_at;

      // Wait a bit
      setTimeout(() => {
        updateManifest(manifestPath, { id: 'test2', path: 'test2.png', type: 'image', hash: 'xyz2', size: 600 });
        const manifest2 = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
        const timestamp2 = manifest2.generated_at;

        expect(timestamp2).not.toBe(timestamp1);
      }, 100);
    });
  });

  describe('getAssetPaths()', () => {
    test('returns asset search paths', () => {
      const paths = getAssetPaths();

      expect(paths).toBeDefined();
      expect(paths.user).toBeDefined();
      expect(paths.skill).toBeDefined();
      expect(paths.backgrounds).toBeDefined();
      expect(paths.backgrounds.user).toBeDefined();
      expect(paths.backgrounds.skill).toBeDefined();
      expect(paths.sounds).toBeDefined();
      expect(paths.sounds.user).toBeDefined();
      expect(paths.sounds.skill).toBeDefined();
    });

    test('skill path points to correct directory', () => {
      const paths = getAssetPaths();
      expect(paths.skill).toContain('generate-video/assets');
      expect(fs.existsSync(paths.skill)).toBe(true);
    });
  });

  describe('Integration: Background structure', () => {
    test('all backgrounds have valid color hex codes', () => {
      const backgrounds = loadBackgrounds();
      const hexPattern = /^#[0-9a-fA-F]{6}$/;

      backgrounds.backgrounds.forEach(bg => {
        expect(bg.colors.primary).toMatch(hexPattern);
        expect(bg.colors.secondary).toMatch(hexPattern);
        if (bg.colors.accent) {
          expect(bg.colors.accent).toMatch(hexPattern);
        }
        if (bg.colors.grid) {
          expect(bg.colors.grid).toMatch(hexPattern);
        }
      });
    });

    test('gradient stops are in ascending order', () => {
      const backgrounds = loadBackgrounds();

      backgrounds.backgrounds.forEach(bg => {
        if (bg.gradient && bg.gradient.stops) {
          for (let i = 1; i < bg.gradient.stops.length; i++) {
            expect(bg.gradient.stops[i].position).toBeGreaterThanOrEqual(
              bg.gradient.stops[i - 1].position
            );
          }
        }
      });
    });

    test('usage.scenes is not empty', () => {
      const backgrounds = loadBackgrounds();

      backgrounds.backgrounds.forEach(bg => {
        expect(bg.usage.scenes).toBeDefined();
        expect(bg.usage.scenes.length).toBeGreaterThan(0);
      });
    });
  });

  describe('Integration: Sound structure', () => {
    test('volume ranges are valid', () => {
      const sounds = loadSounds();

      sounds.sounds.forEach(sound => {
        expect(sound.volume.default).toBeGreaterThanOrEqual(0);
        expect(sound.volume.default).toBeLessThanOrEqual(1);
        expect(sound.volume.with_narration).toBeGreaterThanOrEqual(0);
        expect(sound.volume.with_narration).toBeLessThanOrEqual(1);
        expect(sound.volume.with_bgm).toBeGreaterThanOrEqual(0);
        expect(sound.volume.with_bgm).toBeLessThanOrEqual(1);
      });
    });

    test('timing offsets are reasonable', () => {
      const sounds = loadSounds();

      sounds.sounds.forEach(sound => {
        if (sound.timing) {
          expect(sound.timing.offset_before_visual).toBeGreaterThanOrEqual(-0.5);
          expect(sound.timing.offset_before_visual).toBeLessThanOrEqual(0.5);
        }
      });
    });

    test('expected duration is reasonable', () => {
      const sounds = loadSounds();

      sounds.sounds.forEach(sound => {
        if (sound.file && sound.file.expected_duration) {
          expect(sound.file.expected_duration).toBeGreaterThan(0);
          expect(sound.file.expected_duration).toBeLessThan(5); // Max 5 seconds
        }
      });
    });
  });

  describe('Metadata', () => {
    test('backgrounds.json has metadata', () => {
      const backgrounds = loadBackgrounds();
      expect(backgrounds.metadata).toBeDefined();
      expect(backgrounds.metadata.created_at).toBeDefined();
      expect(backgrounds.metadata.author).toBeDefined();
    });

    test('sounds.json has metadata', () => {
      const sounds = loadSounds();
      expect(sounds.metadata).toBeDefined();
      expect(sounds.metadata.created_at).toBeDefined();
      expect(sounds.metadata.author).toBeDefined();
    });

    test('sounds.json has guidelines', () => {
      const sounds = loadSounds();
      expect(sounds.guidelines).toBeDefined();
      expect(sounds.guidelines.frequency).toBeDefined();
      expect(sounds.guidelines.combinations).toBeDefined();
    });

    test('sounds.json has fallback configuration', () => {
      const sounds = loadSounds();
      expect(sounds.fallback).toBeDefined();
      expect(sounds.fallback.if_file_missing).toBeDefined();
      expect(sounds.fallback.placeholder_sources).toBeInstanceOf(Array);
    });
  });
});
rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).Stars: 198kUpdated Claude CodeCodexUnverifiedInstall
doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.Stars: 198kUpdated Claude CodeCodexVerifiedInstall