Files
hyperframes/skills/hyperframes-core/references/brief-contract.md
T
WaterrrForever b9be0b2625 feat(skills,studio,media-use): the intent layer, review loop, and user memory — BRIEF.md, companion mode, recipes; /website-to-video folds into /product-launch-video (#2133)
* feat(studio,cli): per-frame board comments, self-refreshing storyboard, status-aware preview landing

Per-frame comment boxes on the storyboard board batch into
.hyperframes/frame-comments.json (a resubmit wins per frame; unconsumed
comments on other frames are kept). Submitted-but-unconsumed comments
stay visible — a toolbar banner plus a per-tile echo — until the agent
consumes the file; the banner also says what to do next (reply anything
in the agent chat).

The board keeps itself current: GET /projects/:id/signature exposes the
watcher-cached project signature, the storyboard payload carries the
signature it was derived from, and the view polls at 2s (hidden tabs
skipped, re-checked on visibility), refetching in place with no loading
flash. Posters bake the signature into their URL so tiles fill in as
sketches land and a poster that failed mid-write retries on the next
version; the empty state upgrades itself when STORYBOARD.md appears,
and its handoff prompt now points the agent at the review loop and uses
the parser's real status vocabulary (outline, not planned).

preview lands the browser on the storyboard view while the board is the
review surface — any frame built, or pure planning (srcs declared, none
on disk yet) — and on the timeline once the video is assembled.

* feat(skills): the review loop — plan, sketch, build as one shared process

hyperframes-core/references/review-loop.md is the single source for the
three-pass collaborative review: the plan proposed on a live board
(§ 1), wireframe sketches marked built with one layout question (§ 2 —
real words on plain blocks, run no CLI; a confirmed board is itself a
valid deliverable when the user asked for a storyboard, not a video),
the build dressing confirmed layouts (§ 3, worker or inline), and the
final look (§ 4). Autonomous runs skip every gate and keep one question
before render.

The three narrative workflows' Steps 3/4/6 collapse to references plus
their sketch stand-ins (captured-asset blocks for product-launch-video,
plain code panels for pr-to-video); the confirmed-sketch handoff stays
in each frame-worker prompt. general-video plans on a board for
multi-scene narrative pieces in collaborative mode — its sketch pass is
layout-before-animation with the user watching. The router treats
"I want a storyboard" as a process request rather than a route, and
closes exploratory intake by recommending a route plus how the run will
review.

The supporting contracts land next door: the comments channel (silent
submit, one reply picks it up, check the file before the words) in
brief-contract § 1; the sidecar schema and the built status rung in
storyboard-format; the mode question asked first and alone in the three
workflows' Step 0.

* feat(media-use): user memory — remembered preferences and frozen recipes

Two tiers of memory on media-use's existing two-tier storage split.

Preferences (lightweight): confirmed brief answers — destination, aspect,
language, mode, voice, style preset — recorded to the project's
.media/preferences.json (committed, the team inherits it) and promoted
to the personal ~/.media/preferences.json once the same value is
confirmed in two different projects (a sightings ledger accumulates the
cross-project evidence user-side, since project files can't see each
other). prefs.mjs get/record; merge reads project-over-user; a changed
value restarts its provenance.

Recipes (heavyweight): one approved run frozen as a named, versioned
bundle — frame.md, the storyboard skeleton (structure kept: durations,
transitions, srcs, Video direction; statuses reset to outline; content
blanked to per-frame fill-ins naming the beat's role), and the confirmed
brief values. Named folders, not content hashes: re-freezing bumps
version and archives <name>@v<N>; a freeze is already confirmed, so it
promotes to the user tier immediately. recipe.mjs freeze/list/use, plus
resolve --type recipe --entity <name> delegating like grade/lut.

16 new node --test cases; the media-use lib suite is 168/168.

* feat(skills): wire user memory into the brief and the review loop

brief-contract § 2 gains Remembered defaults: read the merged
preferences before Round 2 and let a remembered value become the
recommended option with a receipt naming its source project. Memory
changes the default, never the question — every ask-marked field still
gets asked, and what the request says this time beats what was picked
last time. Record only what the user actually confirmed (a defaulted
voice nobody chose is not an answer; a "go" that accepts the
recommended defaults is). The first record announces itself once;
after that the receipts carry the reminder. In autonomous mode a
remembered value becomes the decided value, receipt included.

The three narrative workflows read the remembered defaults before
Round 2, record the confirmed answers at the Step 0 gate, record the
chosen preset at the Step 2 gate (pr-to-video excepted — its preset is
fixed), and fall back to the remembered voice when the request names
none. general-video's discovery reads the same defaults.

Recipes wire in at both ends: Step 0 checks for a matching recipe
before the mode question — one question, plural-aware, and adopting
one fills the brief, skips the design step, and drafts the storyboard
from the frozen skeleton while every review gate still runs. The
review loop's final look (§ 4) offers the freeze once after approval,
and the confirmation teaches the recall phrase — the name is something
the system reminds the user of, never something they must remember.
The router recognizes a named recipe or "like last time" as a route.

* docs(skills): the sketch pass names check, not the deprecated validate

* feat(skills): intent-layer references — process, route briefs, capability menu, BRIEF.md format

* feat(media-use): brief skeleton as the recipe's fourth artifact; flow/storyboard preference keys

* feat(skills): the intent layer conducts every brief — workflows execute BRIEF.md

* feat(skills): retire the mode preference key; sync catalog surfaces for intent layer

* refactor(skills): dedupe router vs intent-layer guidance — one owner per rule

* feat(skills): the design ask — own spec, pick by eye from showcases, or defer

* docs(skills): the design ask says the honest line on capture routes

* feat(skills): product-launch-video absorbs website-to-video as the tour angle

* refactor(skills): keep product-launch-video pristine — a tour is brief intent, not a pipeline branch

* feat(skills): production loop + genre lenses; general-video goes freeform (route yours, laws hold)

* refactor(skills): /hyperframes is the front door - route tables and scope lists leave the workflows

* docs(skills): review-loop pass across skill catalog

* fix(cli): pass project dir to openStudioBrowser in background-server path

* feat(skills): add pitch-round reference - verbalized sampling concept gate

* feat(skills): wire pitch round into intent layer - completeness triage + route eligibility

* feat(skills): editorial capability recommendations, handoff disciplines, menu-probe split

* feat(skills): pitches carry their machinery; source-only-formed requests pitch the telling

* feat(skills): companion goes director - ceiling treatment plus blueprint/rule citation discipline

* fix(scripts): sandbox npx-leak guard - private npm global prefix keeps npx on the branch CLI

* chore(skills): resync manifest hash after formatter pass reflowed general-video tables

* fix(skills): recipe freeze reads workflow from BRIEF.md; style_preset records require workflow scope

Two holes found by a live companion-run freeze: the agent-supplied --workflow
contradicted the run's actual workflow (recipe.json said faceless-explainer,
brief-skeleton said general-video), and the style_preset lookup missed because
the preference had been recorded under the bare key.

- freezeRecipe resolves the workflow from BRIEF.md frontmatter; the flag is a
  fallback for briefless projects and a contradicting flag is ignored (noted).
- recordPreference refuses a bare style_preset — the scoped key is the only
  writable shape; freeze tolerates legacy bare records via read fallback.
- review-loop § 4 / media-use SKILL / brief-format wording follow the machinery.
2026-07-15 21:19:14 +08:00

12 KiB

Brief contract

The intent layer (/hyperframes § 4) asks creation questions once. The executing workflow writes the confirmed result to BRIEF.md and does not ask those questions again. This contract defines the canonical run-shape fields, shared brief fields, and question rules. Route-specific options live in /hyperframesreferences/route-briefs.md.

Contents

1. Run shape

Three terms describe different concerns. Do not substitute one for another.

Term Values Owns
flow automation or companion Who drives execution. companion always executes in /general-video.
storyboard yes or no Whether the live board is used for plan and layout review.
mode collaborative or autonomous How later preference and checkpoint gates behave. The user never chooses this label directly.

Derive mode once from the confirmed run shape:

flow storyboard Derived mode
companion either value collaborative
automation yes collaborative
automation no autonomous

Default to collaborative only when a legacy project lacks enough state to derive a mode. /motion-graphics is autonomous by design and does not need the two run-shape questions.

Signals and persistence

  • An ongoing signal such as “surprise me”, “decide for me”, “just build it”, or “stop asking” sets flow: automation, storyboard: no, and therefore mode: autonomous when it appears during intent capture.
  • A bare “go” or “looks good” at a checkpoint accepts that checkpoint only. It does not change mode.
  • After STORYBOARD.md exists, persist the derived mode in its frontmatter. On resume, an explicit mode in STORYBOARD.md overrides the derivation because it may represent a later user change.
  • Mid-run “stop asking; finish it” changes only checkpoint behavior. Set STORYBOARD.md mode to autonomous when the file exists. Do not rewrite the already-confirmed flow or storyboard fields.
  • Resume collaborative checkpoints only after an explicit signal such as “let's review together”; ordinary feedback does not change mode.

Gate behavior

Gate Collaborative Autonomous
Preference: preset, voice, caption identity Ask when the workflow marks it as required. Decide and state the choice with a one-line reason.
Checkpoint: plan, sketches, pre-render review Ask and wait. Post the same summary, then continue.
Quality: fetch completeness, lint, hyperframes check, workflow verification Run and stop on errors. Run and stop on errors.
Routing ambiguity Resolve explicitly; a wrong route changes the deliverable. Same requirement.
Sign-in or credential unavailable Show status and wait for sign-in or explicit offline selection. Show status and continue through an available offline provider.

Autonomous mode never silently drops a required capability. If the selected workflow has no local, cached, or offline provider for it, surface the blocker instead of omitting the capability. A credential problem does not relax the quality gates.

Rendering remains user-gated in both modes. After checks pass, collaborative runs ask “render now, or what changes?” Autonomous runs ask “preview first, or render?” Render only after the answer.

Studio comments

Checkpoint feedback may arrive in chat or in .hyperframes/frame-comments.json (format: storyboard-format.md). When the user replies to a checkpoint, read that file before interpreting the chat reply. Apply only the named frame changes, delete the comments file after handling it, and re-present the affected frames. A board submission does not notify the agent, so tell the user to reply in chat after submitting comments.

Autonomous is not silent: replace absorbed questions with visible decisions and short reasons. Every autonomous visual or video delivery names the final preview or rendered artifact as applicable, reports the actual duration for a time-based deliverable, and includes a contact sheet or snapshot sheet plus relevant frame identifiers when available. For multi-scene work, use scene midpoints; for a single-scene piece, use one or more proof times. This gives the user a review surface even though intermediate checkpoints did not pause.

2. Shared fields

Ask only fields used by the selected route. Route entries identify their must-have questions and deferred questions. Values inferred or derived by policy are stated in the brief, not asked.

Field Meaning Policy
flow Who drives execution Ask at the end of intent capture when the route supports both flows. An autonomous signal answers it.
storyboard Whether to review on the live board Ask before flow when the route supports a board. A storyboard request answers it.
destination Where the video will play Infer from the request. Ask only when unknown and the answer changes aspect, type scale, or composition.
aspect Canvas size Derive from destination: social feed → 1080x1080; TikTok/Reels/Shorts → 1080x1920; YouTube/website/desktop → 1920x1080. State the derivation.
length Target duration Let the workflow recommend a range supported by the material; include the reason.
language Narration and caption language Use the user's language and state it.
audience Who will watch Infer when clear. Ask only when a different answer changes the story or terminology.
message The one thing the video must communicate Derive and echo one sentence. Do not storyboard until this is clear.
angle Route-specific story shape Recommend one route-defined option with a reason.
narration yes, minimal, or no, plus route-specific modes Follow the selected route.

Remembered defaults

Let <MEDIA_DIR> be the installed /media-use skill directory. Let <MEMORY_ROOT> be the existing project root. Before scaffolding, use a deliberately nonexistent probe path with no .media ancestor, such as /tmp/hyperframes-intent-memory-<run-id>; never use the current workspace as the probe. Read merged preferences with:

node <MEDIA_DIR>/scripts/prefs.mjs get --hyperframes <MEMORY_ROOT> --json

For the pre-project probe, <MEMORY_ROOT> is the nonexistent probe path, so only the personal tier can contribute. If that path already exists or contains .media, choose another. Do not claim project provenance before the real project exists.

A remembered value becomes the recommended answer and names its source. It never overrides the current request and never skips a required question. A confirmed recipe is different: adopting the bundle may fill the fields it contains because adoption itself is the confirmation.

Record only values the user confirmed, never values merely inferred or defaulted. Recording happens after the workflow writes BRIEF.md; supported keys are listed in brief-format.md. A user who sees the recommendation and accepts it has confirmed it. Personal defaults promote only according to /media-use memory rules.

The first time a project records a preference, say one short line that it will be remembered for future runs. Do not re-record a remembered value merely because an autonomous build reused it; only a confirmation in the current run creates a new memory event.

3. Question protocol

Follow these invariants:

  1. Ask only unanswered fields that materially affect the output.
  2. Ask one field per message and wait for its answer before asking the next field.
  3. Put the recommended option first and attach a short reason. A numbered choice list is allowed, but every option in that list must answer the same field. Option lists fit factual fields (destination, length, language), where they scaffold recall; a creative field (message, angle, tone) the request has not already shaped takes an anchored open question — a list there steers the answer instead of collecting it.
  4. Skip a question when the current request already answers it. Inference alone is not an answer.
  5. Ask storyboard and then flow last, only for routes that support them.
  6. Announce deferred questions before hand-off; do not surprise the user later.
  7. When an autonomous signal appears, ask no remaining preference or checkpoint questions. State the completed brief and the reasons for decisions, then build.
  8. Use native question UI when available. Otherwise send one plain-text question with one numbered option list; never place several fields in the same list.
  9. Before the hand-off summary, run one integration check: look for a consequence the combined answers create that no single answer showed, and surface it with a proposed adjustment.
  10. The hand-off summary separates fields the user stated from fields that were inferred or defaulted, with receipts on both.
  11. Revision is not confirmation: after any correction to the summary, present the updated summary and confirm before executing.

At a checkpoint, “go” accepts that checkpoint's displayed recommendation. If a message explicitly presents a complete brief and says that “go” will accept every displayed default, then “go” may confirm that whole displayed brief; do not assume broader acceptance without that sentence.