Skip to content

gooseworks-ai/goose-skills / skills/video/render-street-interview

render-street-interview

Verified

Write a street-interview ad from a complete inspected commercial interaction and current brand facts. Render product guessing, or prepare mic-only, prepared-sample or visible-task conversation script/prompt previews. Premise, actions and ad connection vary; capture rules stay fixed. Conversation media delivery is unverified.

FileKindSize
REFERENCE.mdmarkdown7.4 KB
SKILL.mdskill md16.7 KB
TAKES.mdmarkdown1.5 KB
brands/demo-tallgrass-oat.jsonconfig3.9 KB
brands/fizzroot-ep3-a.jsonconfig2.2 KB
brands/fizzroot-ep3-b.jsonconfig2.6 KB
brands/fizzroot-ep3-c.jsonconfig2.3 KB
brands/grimwater.jsonconfig4.6 KB
brands/oleara-ep1-a2.jsonconfig2.5 KB
brands/oleara-ep1-b.jsonconfig2.7 KB
brands/oleara-ep1-c.jsonconfig2.5 KB
episodes/fizzroot-ep3.jsonconfig1009 B
episodes/oleara-ep1.jsonconfig784 B
references/cast-writing.mdmarkdown9.6 KB
references/h3-generation.mdmarkdown2.2 KB
references/model-behaviors.mdmarkdown5.0 KB
references/reference-format-rules.mdmarkdown7.5 KB
references/reference-ledger-items-01-23.mdmarkdown15.6 KB
references/reference-ledger-items-17-28.mdmarkdown13.2 KB
references/reference-ledger-items-29-42.mdmarkdown14.3 KB
references/reference-pipeline.mdmarkdown7.3 KB
references/street-reference-library.jsonconfig6.6 KB
references/street-script-writing.mdmarkdown16.7 KB
scripts/bench.pyscript18.2 KB
scripts/brandkit.pyscript19.3 KB
scripts/build.pyscript8.0 KB
scripts/build_episode.pyscript77.5 KB
scripts/build_looks.pyscript32.2 KB
scripts/check-cut.pyscript66.3 KB
scripts/conversation.pyscript12.8 KB
scripts/edit_timeline.pyscript7.6 KB
scripts/falsify-all.pyscript19.8 KB
scripts/fit_grade.pyscript7.7 KB
scripts/format_spec.pyscript93.2 KB
scripts/measure-pace.pyscript2.8 KB
scripts/media_proxy.pyscript56.8 KB
scripts/paths.pyscript3.0 KB
scripts/phone_look_video.pyscript7.2 KB
scripts/prepare_script_context.pyscript12.0 KB
scripts/recut.pyscript26.5 KB
scripts/selftest.pyscript23.5 KB
scripts/single_gen.pyscript24.9 KB
scripts/variants_gen.pyscript14.0 KB
skill.meta.jsonconfig656 B
tests/READINESS.mdmarkdown13.3 KB
tests/fixtures/brands/grimwater-4816.jsonconfig4.6 KB
tests/fixtures/brands/grimwater-4817.jsonconfig2.3 KB
tests/fixtures/brands/grimwater-4818.jsonconfig2.6 KB
tests/fixtures/brands/grimwater-4819.jsonconfig2.1 KB
tests/fixtures/brands/grimwater-4820.jsonconfig2.8 KB
tests/fixtures/brands/grimwater-4821.jsonconfig2.8 KB
tests/fixtures/brands/grimwater-4822.jsonconfig2.5 KB
tests/fixtures/brands/grimwater-4823.jsonconfig2.3 KB
tests/fixtures/brands/grimwater-4824.jsonconfig4.1 KB
tests/fixtures/brands/grimwater-4827.jsonconfig4.6 KB
tests/fixtures/brands/grimwater-4828.jsonconfig4.3 KB
tests/fixtures/brands/grimwater-4829.jsonconfig3.8 KB
tests/fixtures/brands/grimwater-4830.jsonconfig3.9 KB
tests/fixtures/brands/grimwater-4831.jsonconfig4.2 KB
tests/fixtures/brands/grimwater-4832.jsonconfig3.5 KB
tests/fixtures/brands/grimwater-4833.jsonconfig3.7 KB
tests/fixtures/brands/grimwater-4834.jsonconfig3.9 KB
tests/fixtures/brands/grimwater-4835.jsonconfig3.9 KB
tests/fixtures/episodes/grimwater-ep1.jsonconfig2.2 KB
tests/fixtures/episodes/grimwater-ep2.jsonconfig2.2 KB
tests/fixtures/episodes/grimwater-ep2fix-v2.jsonconfig4.9 KB
tests/fixtures/episodes/grimwater-ep2fix-v3.jsonconfig5.7 KB
tests/fixtures/episodes/grimwater-ep2fix.jsonconfig3.7 KB
tests/fixtures/episodes/grimwater-ep3.jsonconfig2.5 KB
tests/fixtures/episodes/grimwater-ep3b.jsonconfig2.3 KB
tests/fixtures/episodes/grimwater-ep3c.jsonconfig2.3 KB
tests/fixtures/episodes/grimwater-ep4.jsonconfig3.7 KB
tests/fixtures/prompt-snapshots.jsonconfig20.3 KB
tests/smoke-test.mdmarkdown627 B
tests/test_cast_advice.pyscript3.6 KB
tests/test_conversation.pyscript20.5 KB
tests/test_edit_timeline.pyscript8.6 KB
tests/test_finishing.pyscript10.9 KB
tests/test_h3_provider_route.pyscript9.2 KB
tests/test_opt_in_hold_grammar.pyscript4.7 KB
tests/test_prompt_budget.pyscript10.5 KB
tests/test_recut_media.pyscript6.2 KB
tests/test_selector_route.pyscript8.7 KB
tests/test_single_gen_rejection.pyscript7.6 KB
tests/test_skin_and_voice_options.pyscript4.1 KB

scripts/prepare_script_context.py

View on GitHub
#!/usr/bin/env python3
"""Select complete commercial interactions; snippets cannot satisfy an ad-writing gap."""
import argparse
import copy
import json
from pathlib import Path

HERE = Path(__file__).resolve().parent
DEFAULT_LIBRARY = HERE.parent / "references" / "street-reference-library.json"
MODES = ("product-guess", "conversation")
INTERACTIONS = ("product-guess", "mic-only", "product-sample", "concept-challenge")
SITUATION_FIELDS = ("edited_opening", "visible_setup", "participant_reason", "viewer_hook",
                    "product_connection", "payoff", "unseen_setup")
# The route contract. It binds any project built on this format, including a custom one.
# product-guess allows four participants because the recipe casts "the four people on the
# corner"; conversation allows one because conversation.py writes "One adult participant".
# Neither route accepts an image of a person: the likeness gate refuses uploaded people
# (REFERENCE #4), so people are written in the prompt.
ROUTES = {
    "product-guess": {"support": "render", "max_participants": 4,
                      "person_reference": "forbidden",
                      "reference_images": ["standalone physical product photo on a plain background"],
                      "offering_types": ["physical"]},
    "conversation": {"support": "preview-only", "max_participants": 1,
                     "person_reference": "forbidden", "reference_images": [],
                     "offering_types": ["physical", "service", "digital"]},
}
DEFAULT_PARTICIPANTS = {"product-guess": 4, "conversation": 1}
MIC_ONLY = {"route": "conversation/mic-only", "differs": "one participant; preview only, no paid render yet"}
ALTERNATIVES = [
    {"route": "ugc-street-testimonial", "differs": "one person talking to camera, no interviewer; needs a creator still"},
    {"route": "custom", "differs": "keeps this format's hard constraints: people in text, one take, deep focus, "
                                   "720p first, local lettering; unvalidated"},
]
# What going custom still forbids when the offering is not a physical product. make-custom-video
# keeps "product-guess only with a physical product the brand sells", so a customer who picks
# custom to hand over a mascot, a prop or a phone has picked a route that does not exist
#. Say so on the alternative, not after they choose it.
CUSTOM_NO_GUESS = ("no guessing game: nothing stands in for a product, not a mascot, a prop, "
                   "a phone or a screen; ")
NUMBER_WORDS = {1: "one", 2: "two", 3: "three", 4: "four"}


def reference_gap(ref):
    """Check observation coverage, not prose quality or claimed performance."""
    if ref.get("use_status") in ("excluded", "rejected"):
        return ref.get("exclusion_reason", "reference excluded from ad writing")
    if ref.get("commercial") is not True or not ref.get("commercial_evidence"):
        return "no evidenced commercial interaction; editorial material is not an ad reference"
    inspection = ref.get("inspection")
    if not isinstance(inspection, dict):
        return "missing complete-clip inspection record"
    duration = inspection.get("duration_s")
    if (inspection.get("coverage") != "complete-clip"
            or not {"visual", "transcript"}.issubset(inspection.get("modalities", []))
            or not isinstance(duration, (int, float)) or isinstance(duration, bool) or duration <= 0
            or not inspection.get("method")):
        return "full visual interaction and complete spoken exchange have not been inspected"
    if not (ref.get("observed") is True and ref.get("source") and ref.get("transfer_rule")
            and ref.get("limitations") and ref.get("allowed_offering_types")
            and ref.get("interaction_types")):
        return "missing source, observation limits or interaction compatibility"
    situation = ref.get("ad_interaction")
    if not isinstance(situation, dict):
        return "missing ad interaction record"
    if not all(isinstance(situation.get(k), str) and situation[k].strip() for k in SITUATION_FIELDS):
        return "missing ad setup, participation reason, hook, product connection or payoff"
    turns = ref.get("speaker_turns", [])
    if (not isinstance(turns, list) or len(turns) < 3 or not all(isinstance(t, dict) for t in turns)
            or len({t.get("speaker") for t in turns if t.get("speaker")}) < 2):
        return "missing complete two-person turn sequence"
    previous_start = -1
    for turn in turns:
        start, end = turn.get("start"), turn.get("end")
        if (not isinstance(start, (int, float)) or not isinstance(end, (int, float))
                or isinstance(start, bool) or isinstance(end, bool)
                or not 0 <= start < end <= duration + 0.5 or start < previous_start
                or not isinstance(turn.get("text"), str) or not turn["text"].strip()
                or not turn.get("speaker") or not turn.get("does")):
            return "turns need ordered clip timestamps and observed content (labeled if paraphrased), not functions alone"
        previous_start = start
    return None


def valid_participants(value):
    return isinstance(value, int) and not isinstance(value, bool) and value >= 1


def route_contract(brief, mode):
    """The route this brief asks for, and why the format cannot render it (if it cannot)."""
    rule = ROUTES[mode]
    participants = brief.get("participants", DEFAULT_PARTICIPANTS[mode])
    limit = rule["max_participants"]
    allowed = "one participant" if limit == 1 else f"up to {NUMBER_WORDS[limit]} participants"
    too_many = valid_participants(participants) and participants > limit
    wrong_offering = (brief.get("offering_type") in ("physical", "service", "digital")
                      and brief["offering_type"] not in rule["offering_types"])
    gaps = []
    if too_many:
        gaps.append(f"{mode} supports {allowed}; {participants} requested")
    if wrong_offering:
        gaps.append(f"{mode} needs a physical product to hand over")
    interaction = brief.get("interaction_type")
    route = dict(copy.deepcopy(rule), name=mode, interaction_type=interaction,
                 participants=participants if valid_participants(participants) else None)
    if not gaps:
        return route, gaps, []
    alternatives = []
    if too_many and not wrong_offering:
        # The same route with fewer people is the closest thing the customer can still choose.
        support = "preview only, no paid render yet" if rule["support"] == "preview-only" else "renders"
        name = mode if interaction in (None, mode) else f"{mode}/{interaction}"
        alternatives.append({"route": name, "differs": f"{allowed}; {support}"})
    elif wrong_offering:
        alternatives.append(dict(MIC_ONLY))
    alternatives += [dict(a) for a in ALTERNATIVES]
    if wrong_offering:
        for alt in alternatives:
            if alt["route"] == "custom":
                alt["differs"] = CUSTOM_NO_GUESS + alt["differs"]
    return route, gaps, alternatives


def select_context(brief, references, limit=2):
    mode = brief.get("mode")
    if mode not in MODES:
        raise ValueError("mode must be product-guess or conversation")
    route, route_gaps, alternatives = route_contract(brief, mode)
    brief_gaps = []
    if not valid_participants(brief.get("participants", DEFAULT_PARTICIPANTS[mode])):
        brief_gaps.append("participants must be a whole number of people interviewed on screen, "
                          "not counting the interviewer")
    if brief.get("offering_type") not in ("physical", "service", "digital"):
        brief_gaps.append("offering_type must identify physical, service or digital")
    if brief.get("interaction_type") not in INTERACTIONS:
        brief_gaps.append("interaction_type must identify the proposed visible interaction")
    if mode == "product-guess" and brief.get("interaction_type") != "product-guess":
        brief_gaps.append("product-guess execution needs product-guess interaction")
    if mode == "conversation" and brief.get("interaction_type") == "product-guess":
        brief_gaps.append("object guessing belongs to product-guess execution")
    eligible, excluded = [], []
    # Project observations replace a seed summary with the same id. Private full
    # transcripts stay project-scoped rather than being copied into the library.
    unique = {r["id"]: r for r in references if isinstance(r, dict) and r.get("id")}
    for ref in unique.values():
        reason = None
        if ref.get("format") != "street-interview" or mode not in ref.get("execution_modes", []):
            reason = "wrong format or unsupported execution"
        elif ref.get("language") != brief.get("language", "en"):
            reason = "language mismatch"
        elif reference_gap(ref):
            reason = reference_gap(ref)
        elif brief.get("offering_type") not in ref["allowed_offering_types"]:
            reason = "product/service interaction mismatch"
        elif brief.get("interaction_type") not in ref["interaction_types"]:
            reason = "visible interaction mismatch"
        if reason:
            excluded.append({"id": ref.get("id"), "reason": reason})
            continue
        score = (100 if ref.get("origin") == "user" else 15 if ref.get("origin") == "project" else 0)
        score += 40 if ref.get("brand_id") == brief.get("brand_id") else 0
        score += 20 if ref.get("approved") is True else 0
        score += 10 if brief.get("buying_context") in ref.get("buying_contexts", []) else 0
        score += 10 if brief.get("audience_group") in ref.get("audience_groups", []) else 0
        score += 5 if ref.get("commercial") else 0
        eligible.append((score, ref))
    eligible.sort(key=lambda pair: (-pair[0], pair[1]["id"]))
    # An unsupported route selects nothing, so no downstream gate can treat it as ready.
    selected = [] if brief_gaps or route_gaps else [ref for _, ref in eligible[:limit]]
    queries = []
    if not selected:
        queries.append(f"{brief.get('offering_type', 'offering')} {brief.get('audience_group', 'audience')} "
                       f"{brief.get('interaction_type', mode)} branded street interview full ad video "
                       f"{brief.get('language', 'en')}")
    status = ("unsupported-route" if route_gaps
              else "needs-reference" if not selected else "ready-for-writing")
    return {
        "schema_version": "street-script-context.v3", "brand_id": brief.get("brand_id"),
        "mode": mode, "brief": brief,
        "route": route, "route_gaps": route_gaps, "alternatives": alternatives,
        "references": selected,
        "selection": [{"id": r["id"], "reason": "user reference" if r.get("origin") == "user"
                       else "complete commercial interaction; offering/action fit; audience/buying fit ranked"}
                      for r in selected],
        "excluded": excluded, "research_queries": queries, "brief_gaps": brief_gaps,
        "status": status,
        "limitations": ["This checks recorded observation coverage; it cannot verify that the observer's account is true.",
                         "Reference compatibility is not script quality, verified authorship or ad performance."]}


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--brief", type=Path, required=True)
    ap.add_argument("--library", type=Path, default=DEFAULT_LIBRARY)
    ap.add_argument("--references", type=Path, help="project/user observations appended to the seed library")
    ap.add_argument("--out", type=Path, required=True)
    args = ap.parse_args()
    refs = json.loads(args.library.read_text())["references"]
    if args.references:
        refs += json.loads(args.references.read_text())["references"]
    result = select_context(json.loads(args.brief.read_text()), refs)
    args.out.parent.mkdir(parents=True, exist_ok=True)
    args.out.write_text(json.dumps(result, indent=2)+"\n")
    print(result["status"], ", ".join(r["id"] for r in result["references"]))
    for gap in result["route_gaps"]:
        print("route gap:", gap)
    for alt in result["alternatives"]:
        print(f"alternative: {alt['route']} -- {alt['differs']}")
    if result["status"] != "ready-for-writing":
        raise SystemExit(2)


if __name__ == "__main__":
    main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexUnverifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall