Building an Open-Source Video Prompt Library in a Day: A Practical Walkthrough

    This article walks through the one-day build of an open-source video generation prompt library, explaining why reusable prompt assets matter, how the project is scoped, and how it is structured into asset, index, validation, and generation layers. It covers the development workflow with AI coding tools, automated quality checks that make prompts testable, the efficiency gains behind the compressed timeline, the open-source delivery checklist, and planned future improvements. Readers will find a concrete example prompt schema and a practical approach to building versioned, machine-readable prompt assets.

    1. Why an Open-Source Prompt Library

    During a casual technical conversation, I realized that the real time sink for our team was not writing code, but translating ideas into instructions that a model can reliably understand. Video generation tasks make this especially obvious: the same natural language description can produce very different results across models, resolutions, and durations. Tuning experience ends up scattered in personal notes, impossible to reuse or review.

    So I set a deliberately narrow goal: build a structured video generation prompt library that breaks prompts down into dimensions such as camera language, subject description, lighting and atmosphere, motion pacing, and negative constraints. The result would be composable, versionable, machine-readable assets rather than a pile of loose text fragments.

    2. Goals and Boundaries: Define What You Will Not Do First

    The most common reason open-source projects fail is not a lack of technical skill, but uncontrolled scope. Before starting, I set three boundaries:

    • No online service and no hosted inference; deliver only prompt assets and a validation toolchain.
    • No binding to any single model; prompts are described in plain text and structured fields, with a pluggable model adaptation layer.
    • No promise about visual output quality; only a promise of being reproducible, comparable, and regression-testable.

    Once the boundaries were clear, estimating the timeline became meaningful. I originally expected three to four days, but the core was done in a little over one day. The reason was not that I wrote faster, but that the toolchain absorbed the repetitive work.

    3. Overall Architecture: Four Layers

    I split the project into four layers that communicate through clear data contracts:

    1. Asset layer: prompt entries stored in a dual format of structured fields plus natural language templates.
    2. Index layer: indexes built by scene, shot type, and style tags, supporting combined search.
    3. Validation layer: checks for field completeness, length constraints, banned words, and style consistency.
    4. Generation layer: calls cloud multi-model services to batch-produce samples for regression comparison.

    A sample entry structure looks like this (field names are examples only):

    1. {
    2. "id": "closeup-portrait-soft-light",
    3. "scene": "portrait",
    4. "shot": "close_up",
    5. "style": ["cinematic", "soft_light"],
    6. "subject": "A pedestrian in a dark coat standing on a street corner after the rain",
    7. "camera": "Slow push-in, shallow depth of field",
    8. "motion": "Subtle breathing feel, hem of the coat swaying in the wind",
    9. "duration_hint": "5s",
    10. "negative": ["Shaky footage", "Text watermark", "Body distortion"]
    11. }

    Separating style, shot, and motion into independent fields means a program can generate Cartesian combinations and quickly build out a test matrix, instead of hand-writing hundreds of similar text entries.

    4. Development Process: What the AI Coding Tool Handled

    I used an AI coding tool to build the scaffold, index generation, validation scripts, and documentation skeleton, and a cloud multi-model service to batch-generate samples. Three lessons stood out:

    First, write requirements as verifiable acceptance criteria, not adjectives. For example, “every new entry must pass schema validation and have a non-empty negative constraint field.” Code generated from such criteria needed almost no rework.

    Second, have the tool produce a runnable skeleton first, then fill in details step by step. Get the minimal loop of read, validate, and output a list working, then expand the tag system and search strategy, avoiding a large batch of unverifiable code generated at once.

    Third, hand repetitive judgment to scripts. Naming conventions, field ordering, and tag whitelists are slow and error-prone for humans, but a script written once pays off over the long term.

    5. Quality Assurance: Making Prompts Testable

    Prompts may seem subjective, but most problems can be caught automatically:

    • Structural validation: missing required fields, out-of-range enum values, invalid duration hint formats.
    • Consistency validation: style tags conflicting with the description text, such as a realistic tag paired with heavy illustration-style modifiers.
    • Redundancy detection: merging or prioritizing entries with highly repetitive semantics.
    • Regression comparison: fixing random seeds and parameters, repeatedly generating the same batch of entries, recording differences, and identifying unstable descriptions.

    The value of this mechanism is that after open-sourcing, content submitted by external contributors can be screened by machine first, significantly lowering maintenance costs.

    6. Efficiency Review: Keys to Finishing in a Little Over a Day

    The compressed timeline came from three structural optimizations: first, narrowing scope by cutting the online service and account system; second, structuring assets so that composition and validation are programmable; third, parallelizing coding and content production, with the coding model handling engineering and the generation model handling samples so neither blocks the other. What feels convenient is essentially the reduction in cost of switching between and configuring multiple services, keeping context continuous.

    7. Open-Source Delivery Checklist

    • Directory conventions and naming convention documentation.
    • Entry schema documentation with field semantics explained.
    • Validation and regression scripts with local run instructions.
    • Contribution guide: how to add tags, how to submit samples, and review criteria.
    • Versioning strategy: asset changes record a version number, and breaking field changes bump the major version.

    8. Future Directions

    Next, I plan to add automatic tag weight recommendations, per-scene prompt coverage statistics, and cross-model stability scoring. The longer-term goal is a measurable approach to prompt engineering, where every prompt has clear applicable conditions, expected behavior, and known failure cases, instead of relying on personal intuition.