@slatesvideo/shared 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +31 -0
  2. package/dist/operations/index.d.ts +4 -8
  3. package/dist/operations/index.js +26 -38
  4. package/dist/prompts/character-sheet.d.ts +19 -18
  5. package/dist/prompts/character-sheet.js +84 -38
  6. package/dist/prompts/environment-sheet.d.ts +9 -1
  7. package/dist/prompts/environment-sheet.js +17 -3
  8. package/dist/prompts/model-facts.js +4 -1
  9. package/dist/prompts/partials.generated.d.ts +2 -0
  10. package/dist/prompts/partials.generated.js +14 -0
  11. package/dist/prompts/prompting-tips.js +50 -19
  12. package/dist/prompts/reference-composer.d.ts +1 -1
  13. package/dist/prompts/reference-composer.js +3 -4
  14. package/dist/prompts/reference-rules.d.ts +43 -14
  15. package/dist/prompts/reference-rules.js +51 -27
  16. package/dist/skills/content.js +14 -14
  17. package/exports/slates-prompt-builder/generated/SKILL.md +59 -0
  18. package/exports/slates-prompt-builder/generated/reference-character.md +78 -0
  19. package/exports/slates-prompt-builder/generated/reference-content-policy.md +75 -0
  20. package/exports/slates-prompt-builder/generated/reference-kling.md +212 -0
  21. package/exports/slates-prompt-builder/generated/reference-nano-banana.md +182 -0
  22. package/exports/slates-prompt-builder/generated/reference-seedance.md +353 -0
  23. package/exports/slates-prompt-builder/generated/slates-prompt-builder-manifest.json +79 -0
  24. package/exports/slates-prompt-builder/generated/slates-prompt-builder.skill +0 -0
  25. package/package.json +8 -3
  26. package/skills/_partials/decision-log.md +12 -0
  27. package/skills/_partials/reference-rules-core.md +12 -0
  28. package/skills/_partials/reference-tips-short.md +2 -0
  29. package/skills/_partials/references-read-literally.md +11 -0
  30. package/skills/_partials/still-gate.md +3 -0
  31. package/skills/slates-character-identity.md +100 -0
  32. package/skills/slates-cost-discipline.md +10 -0
  33. package/skills/slates-edit-and-iterate.md +17 -2
  34. package/skills/slates-model-selection.md +24 -1
  35. package/skills/slates-one-prompt-film.md +22 -3
  36. package/skills/slates-prompting-flux-2-max.md +36 -5
  37. package/skills/slates-prompting-gpt-image-2.md +1 -1
  38. package/skills/slates-prompting-kling-v3.md +40 -9
  39. package/skills/slates-prompting-nano-banana-2.md +44 -12
  40. package/skills/slates-prompting-omni-flash.md +1 -1
  41. package/skills/slates-prompting-seedance.md +295 -90
  42. package/skills/slates-prompting-veo-3.md +33 -4
  43. package/skills/slates-storyboard-from-script.md +19 -0
  44. package/skills/slates-vision-feedback-loop.md +49 -2
  45. package/skills/slates-character-turnaround.md +0 -55
package/README.md CHANGED
@@ -3,3 +3,34 @@
3
3
  Internal shared layer for the [Slates](https://slates.video) MCP server and CLI: the auth/connection-file reader, the cloud and desktop HTTP clients, and the single operations array both surfaces register. You almost certainly want [@slatesvideo/mcp-server](https://www.npmjs.com/package/@slatesvideo/mcp-server) (MCP clients like Claude Desktop and Cursor) or [@slatesvideo/cli](https://www.npmjs.com/package/@slatesvideo/cli) (the `slates` command) instead — this package is published only as their dependency.
4
4
 
5
5
  Source: [github.com/EricDisero/slates-mcp](https://github.com/EricDisero/slates-mcp)
6
+
7
+ ## Prompt partials — how shared prompting prose stays de-forked
8
+
9
+ Prompting doctrine that applies to more than one model lives **once**, in `skills/_partials/<name>.md`. Every surface that needs it derives:
10
+
11
+ - **Skill markdown** (`skills/*.md`) carries a marker pair; `scripts/sync-partials.mjs` writes the resolved text between them and commits it, so each de-fork is visible in review and `install-skills` can keep writing the files verbatim to disk.
12
+
13
+ ```markdown
14
+ <!-- @inject:reference-rules-core -->
15
+ …generated; do not edit between the markers…
16
+ <!-- @end:reference-rules-core -->
17
+ ```
18
+
19
+ - **TypeScript** reads the same text from the generated `PARTIALS` record (`src/prompts/partials.generated.ts`) — that is how `REFERENCE_RULES_TEXT` and the doctrine-bearing cards in `prompting-tips.ts` are built.
20
+
21
+ `npm run build` runs `sync-partials.mjs --check`, which fails with a diff if anything inside a marker block was hand-edited, if a skill references a partial that doesn't exist, if markers are unbalanced, or if a partial is referenced by nothing. Run `npm run sync-partials` to apply changes after editing a partial.
22
+
23
+ **To change shared prompting doctrine: edit the partial.** Never edit between markers, never edit `partials.generated.ts`, and never hand-copy a shared rule into a new skill — a copy is a fork with a delay fuse. Per-model levers (a vendor's own official consistency mechanism, its caps and transport quirks) stay hand-authored, below the injected block, under a `### For <model> specifically` heading.
24
+
25
+ ## Portable Prompt Builder export
26
+
27
+ The downloadable Claude `.skill` is generated at `exports/slates-prompt-builder/generated/`. Its model, character, and content-policy references come directly from the resolved production files in `skills/`; its routing table derives from `MODEL_FACTS`; the portable wrapper owns only export-specific scope and output behavior.
28
+
29
+ ```bash
30
+ npm run sync-prompt-builder # regenerate markdown, manifest, and deterministic .skill
31
+ npm run typecheck # fails if the committed export is stale
32
+ ```
33
+
34
+ `scripts/build-prompt-builder.mjs --check` validates generated text content (normalizing LF/CRLF), keeps the archive byte-exact, opens it to verify its exact entry set, and enforces the runtime character contract (one sheet, the canonical `IDENTITY_PLATE_HEX`, flat/shadowless light, and the three-panel builder). Never edit `exports/slates-prompt-builder/generated/` directly.
35
+
36
+ The repository verification workflow runs both typecheck and build on every pull request and push to `main`, so stale exports cannot merge through the normal GitHub path.
@@ -89,11 +89,7 @@ export declare const createCharacter: Operation<{
89
89
  description?: string;
90
90
  style?: string;
91
91
  }>;
92
- export declare const setCharacterTurnaround: Operation<{
93
- characterId: string;
94
- assetId: string | null;
95
- }>;
96
- export declare const setCharacterExpression: Operation<{
92
+ export declare const setCharacterIdentity: Operation<{
97
93
  characterId: string;
98
94
  assetId: string | null;
99
95
  }>;
@@ -106,12 +102,12 @@ export declare const createEnvironment: Operation<{
106
102
  description?: string;
107
103
  style?: string;
108
104
  }>;
109
- export declare const generateCharacterSheets: Operation<{
105
+ export declare const generateCharacterIdentity: Operation<{
110
106
  characterId: string;
111
107
  projectId: string;
112
108
  baseAssetId: string;
113
- sheetTypes?: ('turnaround' | 'expression')[];
114
109
  userNotes?: string;
110
+ model?: 'nano-banana-2' | 'nano-banana-2-lite' | 'nano-banana-pro' | 'gpt-image-2';
115
111
  }>;
116
112
  export declare const generateEnvironmentPlate: Operation<{
117
113
  environmentId: string;
@@ -376,7 +372,7 @@ export declare const updateEnvironment: Operation<{
376
372
  name?: string;
377
373
  description?: string;
378
374
  style?: string;
379
- gridAssetId?: string | null;
375
+ referenceAssetId?: string | null;
380
376
  }>;
381
377
  export declare const deleteEnvironment: Operation<{
382
378
  environmentId: string;
@@ -528,9 +528,9 @@ export const createCharacter = {
528
528
  return ok(await ctx.desktop().post('/agent/characters', input));
529
529
  },
530
530
  };
531
- export const setCharacterTurnaround = {
532
- id: 'slates_set_character_turnaround_asset',
533
- description: 'Bind an image asset to the character\'s turnaround slot (or clear with assetId=null). The user sees the character card update live.',
531
+ export const setCharacterIdentity = {
532
+ id: 'slates_set_character_identity_asset',
533
+ description: 'Bind one image asset as the character identity (or clear with assetId=null). The user sees the character card update live.',
534
534
  input: z.object({
535
535
  characterId: z.string().uuid(),
536
536
  assetId: z.string().uuid().nullable(),
@@ -538,21 +538,7 @@ export const setCharacterTurnaround = {
538
538
  async run(input, ctx) {
539
539
  return ok(await ctx.desktop().post('/agent/characters/update', {
540
540
  id: input.characterId,
541
- data: { turnaroundAssetId: input.assetId },
542
- }));
543
- },
544
- };
545
- export const setCharacterExpression = {
546
- id: 'slates_set_character_expression_asset',
547
- description: 'Bind an image asset to the character\'s expression-sheet slot (or clear with assetId=null).',
548
- input: z.object({
549
- characterId: z.string().uuid(),
550
- assetId: z.string().uuid().nullable(),
551
- }),
552
- async run(input, ctx) {
553
- return ok(await ctx.desktop().post('/agent/characters/update', {
554
- id: input.characterId,
555
- data: { expressionAssetId: input.assetId },
541
+ data: { identityAssetId: input.assetId, expressionAssetId: null },
556
542
  }));
557
543
  },
558
544
  };
@@ -578,32 +564,32 @@ export const createEnvironment = {
578
564
  return ok(await ctx.desktop().post('/agent/environments', input));
579
565
  },
580
566
  };
581
- export const generateCharacterSheets = {
582
- id: 'slates_generate_character_sheets',
583
- description: "Generate a character's turnaround sheet (4 neutral full-body angles — identity: body, proportions, outfit) AND expression sheet (close-up facial detail) from a base portrait asset, on Nano Banana 2 at 2K, and bind both to the character. THE real character-building workflow — call right after slates_create_character. baseAssetId is the source portrait (a project asset). Both sheets generate by default. Afterward, carry the character into a scene by passing its turnaround + expression asset ids as characterAssetIds to slates_generate_video (or referenceAssetIds to slates_generate_image) so identity stays consistent across shots. Cost ~$0.36 for both sheets.",
567
+ export const generateCharacterIdentity = {
568
+ id: 'slates_generate_character_identity',
569
+ description: "Generate one character identity sheet from a base portrait asset and bind it as the character's canonical reference. Call after slates_create_character. Read slates-character-identity before calling and quote the cost from slates_estimate_generation_cost.",
584
570
  input: z.object({
585
571
  characterId: z.string().uuid(),
586
572
  projectId: z.string().uuid(),
587
- baseAssetId: z.string().uuid().describe('The base portrait asset the sheets are generated from.'),
588
- sheetTypes: z
589
- .array(z.enum(['turnaround', 'expression']))
590
- .optional()
591
- .describe('Which sheets to generate. Default both.'),
573
+ baseAssetId: z.string().uuid().describe('The base portrait asset the identity is generated from.'),
592
574
  userNotes: z.string().optional().describe('Extra instruction, e.g. "use the woman on the left".'),
575
+ model: z
576
+ .enum(['nano-banana-2', 'nano-banana-2-lite', 'nano-banana-pro', 'gpt-image-2'])
577
+ .optional()
578
+ .describe('Image model for the sheet. Omit for the default (nano-banana-2). Exists so the layout-vs-face tradeoff can be tested with comparison gens — do not switch without a receipt.'),
593
579
  }),
594
580
  async run(input, ctx) {
595
- return ok(await ctx.desktop().post('/agent/characters/generate-sheets', {
581
+ return ok(await ctx.desktop().post('/agent/characters/generate-identity', {
596
582
  characterId: input.characterId,
597
583
  projectId: input.projectId,
598
584
  baseAssetIds: [input.baseAssetId],
599
- sheetTypes: input.sheetTypes,
600
585
  userNotes: input.userNotes,
586
+ model: input.model,
601
587
  }));
602
588
  },
603
589
  };
604
590
  export const generateEnvironmentPlate = {
605
591
  id: 'slates_generate_environment_plate',
606
- description: "Generate an environment's single clean establishing plate (Nano Banana 2, 2K) from an optional base image, and bind it as the environment's reference. THE real environment-building workflow — call right after slates_create_environment. Afterward, pass the plate asset id as environmentAssetIds to slates_generate_video (or referenceAssetIds to slates_generate_image) so the location stays consistent across shots. Cost ~6 credits.",
592
+ description: "Generate one clean establishing image from an optional base image and bind it as the environment's canonical reference. Call after slates_create_environment and quote the cost from slates_estimate_generation_cost.",
607
593
  input: z.object({
608
594
  environmentId: z.string().uuid(),
609
595
  projectId: z.string().uuid(),
@@ -1379,7 +1365,7 @@ export const generateVideo = {
1379
1365
  lastFrameAssetId: z.string().optional().describe('Ending frame (UUID or badge code). Veo and Seedance only. Pairs with firstFrameAssetId for guided transitions.'),
1380
1366
  ingredientAssetIds: z.array(z.string()).max(9).optional().describe('Visual reference / ingredient assets (UUIDs or badge codes) for Kling Omni, Seedance, or Omni Flash. Up to 9 (Seedance), 4 (Kling), or 7 (Omni Flash, combined across all ref params).'),
1381
1367
  characterAssetIds: z.array(z.string()).optional().describe('Character sheet assets (UUIDs or badge codes) — keeps a character consistent across the shot.'),
1382
- environmentAssetIds: z.array(z.string()).optional().describe('Environment grid assets (UUIDs or badge codes) — keeps a location/setting consistent across the shot.'),
1368
+ environmentAssetIds: z.array(z.string()).optional().describe('Environment reference assets (UUIDs or badge codes) — keeps a location/setting consistent across the shot.'),
1383
1369
  styleAssetIds: z.array(z.string()).optional().describe('Style reference assets (UUIDs or badge codes) — locks the visual style of the shot.'),
1384
1370
  videoReferenceAssetId: z.string().optional().describe('Seedance ONLY: an existing VIDEO asset (UUID or badge code) to use as a reference — edit/relocate a clip, or MOTION TRANSFER (pair with a subject in ingredientAssetIds and a prompt like "the character from image 1 performs the motion from video 1"). 2-15s. Billing switches to input+output seconds (the vref key) — pass videoReferenceSeconds so the quote is right. If the clip contains a human/AI character, pair with seedanceFace=true (the default Seedance route blocks people). Ignored by Kling/Veo.'),
1385
1371
  videoReferenceSeconds: z.number().optional().describe('REQUIRED with videoReferenceAssetId: the reference clip\'s duration in seconds (from the asset listing). Feeds the vref cost key — a video-reference gen bills combined input+output seconds; the server re-derives this by probing the clip, so an understated value just gets corrected upward.'),
@@ -2527,7 +2513,7 @@ export const setFolderCover = {
2527
2513
  };
2528
2514
  export const updateCharacter = {
2529
2515
  id: 'slates_update_character',
2530
- description: 'Update a character\'s name, description, or style. (Turnaround / expression image slots have their own dedicated set_character_* ops.)',
2516
+ description: 'Update a character\'s name, description, or style. Use slates_set_character_identity_asset for its canonical image.',
2531
2517
  input: z.object({
2532
2518
  characterId: z.string().uuid(),
2533
2519
  name: z.string().min(1).max(120).optional(),
@@ -2551,13 +2537,13 @@ export const deleteCharacter = {
2551
2537
  };
2552
2538
  export const updateEnvironment = {
2553
2539
  id: 'slates_update_environment',
2554
- description: 'Update an environment\'s name, description, style, or bound grid asset (gridAssetId=null clears it).',
2540
+ description: 'Update an environment\'s name, description, style, or bound reference image (referenceAssetId=null clears it).',
2555
2541
  input: z.object({
2556
2542
  environmentId: z.string().uuid(),
2557
2543
  name: z.string().min(1).max(120).optional(),
2558
2544
  description: z.string().optional(),
2559
2545
  style: z.string().max(200).optional().describe("Art style. Omit to inherit the reference's style (the default). Canonical styles: photoreal, anime, painterly, 3d-render, comic. Or pass any free-text instruction, e.g. 'turn this into a real person'."),
2560
- gridAssetId: z.string().uuid().nullable().optional(),
2546
+ referenceAssetId: z.string().uuid().nullable().optional(),
2561
2547
  }),
2562
2548
  async run(input, ctx) {
2563
2549
  return ok(await ctx.desktop().post('/agent/environments/update', {
@@ -2566,7 +2552,7 @@ export const updateEnvironment = {
2566
2552
  name: input.name,
2567
2553
  description: input.description,
2568
2554
  style: input.style,
2569
- gridAssetId: input.gridAssetId,
2555
+ referenceAssetId: input.referenceAssetId,
2570
2556
  },
2571
2557
  }));
2572
2558
  },
@@ -2723,6 +2709,9 @@ function resolveGuideTopic(topic) {
2723
2709
  const t = topic.trim().toLowerCase();
2724
2710
  if (SKILLS[t])
2725
2711
  return t;
2712
+ if (t === 'slates-character-turnaround' || t === 'character-turnaround') {
2713
+ return 'slates-character-identity';
2714
+ }
2726
2715
  if (t === 'model-selection' ||
2727
2716
  t === 'model selection' ||
2728
2717
  t === 'which-model' ||
@@ -2775,7 +2764,7 @@ export const getPromptingGuide = {
2775
2764
  topic: z
2776
2765
  .string()
2777
2766
  .min(1)
2778
- .describe('Guide name, model id, or style name. Guides: slates-model-selection (which model for which job — read before choosing any model), slates-cost-discipline, slates-content-policy, slates-style-prompting, slates-prompting-nano-banana-2, slates-prompting-veo-3, slates-prompting-kling-v3, slates-prompting-seedance, slates-prompting-lip-sync, slates-prompting-motion-transfer, slates-prompting-flux-2-max, slates-prompting-seedream-5-lite, slates-edit-and-iterate, slates-vision-feedback-loop, slates-character-turnaround, slates-storyboard-from-script, slates-direct-response-ad, slates-one-prompt-film. Style names (photoreal, anime, painterly, 3d-render) resolve to slates-style-prompting.'),
2767
+ .describe('Guide name, model id, or style name. Guides: slates-model-selection (which model for which job — read before choosing any model), slates-cost-discipline, slates-content-policy, slates-style-prompting, slates-prompting-nano-banana-2, slates-prompting-veo-3, slates-prompting-kling-v3, slates-prompting-seedance, slates-prompting-lip-sync, slates-prompting-motion-transfer, slates-prompting-flux-2-max, slates-prompting-seedream-5-lite, slates-edit-and-iterate, slates-vision-feedback-loop, slates-character-identity, slates-storyboard-from-script, slates-direct-response-ad, slates-one-prompt-film. Style names (photoreal, anime, painterly, 3d-render) resolve to slates-style-prompting.'),
2779
2768
  }),
2780
2769
  async run(input) {
2781
2770
  const resolved = resolveGuideTopic(input.topic);
@@ -2809,11 +2798,10 @@ export const ALL_OPERATIONS = [
2809
2798
  moveAssetsToFolder,
2810
2799
  listCharacters,
2811
2800
  createCharacter,
2812
- setCharacterTurnaround,
2813
- setCharacterExpression,
2801
+ setCharacterIdentity,
2814
2802
  listEnvironments,
2815
2803
  createEnvironment,
2816
- generateCharacterSheets,
2804
+ generateCharacterIdentity,
2817
2805
  generateEnvironmentPlate,
2818
2806
  listStoryboards,
2819
2807
  createStoryboard,
@@ -1,24 +1,25 @@
1
- /** Turnaround = the IDENTITY reference. 4 neutral full-body angles. */
2
- export declare const CHARACTER_ANGLES_DESC = "front view, back view, left side profile, right side profile";
3
1
  /**
4
- * Expression-sheet close-ups = the FACE identity reference (high-res
5
- * eyes/skin/teeth/bone). Attached alongside the turnaround; the scene-time
6
- * reference label drives the rendered expression.
2
+ * The identity sheet's panels. The portrait is FIRST and DOMINANT — every
3
+ * detail the downstream model will ever know about the face comes from those
4
+ * pixels, so it gets the resolution. The body panels exist for build,
5
+ * proportion, wardrobe and hair, not for the face.
6
+ *
7
+ * The front panel is headless and the back panel KEEPS its head — that
8
+ * asymmetry is the whole rule. A front-facing body panel renders a ~40px face
9
+ * that cannot match the portrait's, so the sheet would carry two competing
10
+ * identities and the model averages them. A back view has no face to compete
11
+ * with, and it is the only panel where hair fall reads. See the header comment
12
+ * for the receipt and for why the phrasing must stay framing, not removal.
7
13
  */
8
- export declare const CHARACTER_EXPRESSIONS_DESC = "neutral expression on left, genuine smile showing teeth in center, serious frown on right";
9
- export declare const BODY_POSE_LABELS: readonly ["front", "back", "profile-left", "profile-right"];
10
- export declare const EXPRESSION_LABELS: readonly ["neutral", "smile", "serious"];
14
+ export declare const CHARACTER_SHEET_PANELS_DESC: string;
15
+ /** Panel identifiers, in sheet order. */
16
+ export declare const BODY_POSE_LABELS: readonly ["portrait", "front", "back"];
11
17
  /**
12
- * Body turnaround sheet — the identity reference.
18
+ * The character identity sheet — one asset, three panels.
19
+ *
13
20
  * @param userStyle optional natural-language style transform (e.g. "make her a real person")
14
21
  */
15
- export declare function buildCharacterTurnaroundPrompt(userStyle?: string | null): string;
16
- /**
17
- * Expression sheet — the close-up face reference. Its three portraits carry
18
- * high-res facial detail (eyes, skin, teeth, bone structure) plus the
19
- * character's expression range. Attached ALONGSIDE the turnaround; the
20
- * reference label drives identity-use + scene-driven expression so the multiple
21
- * expressions don't average the generated face.
22
- */
23
- export declare function buildExpressionSheetPrompt(userStyle?: string | null): string;
22
+ export declare function buildCharacterIdentityPrompt(userStyle?: string | null): string;
23
+ /** @deprecated Use buildCharacterIdentityPrompt. */
24
+ export declare const buildCharacterTurnaroundPrompt: typeof buildCharacterIdentityPrompt;
24
25
  //# sourceMappingURL=character-sheet.d.ts.map
@@ -1,25 +1,78 @@
1
- // Canonical character-sheet prompt content. ONE mode: inherit the source's
2
- // medium, render on a flat-lit plain background, optional natural-language
3
- // style transform. (Replaces the old photorealistic / match-reference fork
4
- // that baked studio lighting or a scene's lighting into the identity ref.)
1
+ // Canonical character-sheet prompt content.
5
2
  //
6
- // This is the SOURCE OF TRUTH that the desktop templates, the MCP skill
7
- // markdown, and the lead-magnet are RECONCILED against. They do NOT import it
8
- // yet (the skill-embed + desktop-import wiring is future work per
9
- // plans/2026-06-25-slates-prompting-system-overhaul.md), so when you change a
10
- // rule here, update those copies in the same pass until the wiring ships.
11
- import { IDENTITY_LIGHTING_CLAUSE, INHERIT_SOURCE_STYLE, } from './reference-rules.js';
3
+ // ARCHITECTURE (locked by Eric 2026-07-21): ONE identity sheet per character.
4
+ // A dominant off-frontal chest-up portrait carries the face; two full-body
5
+ // panels (front + back) carry build, wardrobe and hair. The result is the
6
+ // character's one canonical identity reference.
7
+ //
8
+ // Why one sheet and not two — three arguments, none of which depend on a
9
+ // comparison generation:
10
+ // 1. Reference-cap economics. Every character uses one reference slot.
11
+ // 2. One authoritative face avoids averaging competing renderings.
12
+ // 3. One generation means one asset to inspect and bind.
13
+ //
14
+ // KNOWN COST, accepted for v1: a neutral chest-up portrait carries no dental
15
+ // information, so a character who smiles in a shot gets invented teeth. The
16
+ // 2026-06-26 doctrine already holds that the user's prompt owns expression.
17
+ // Revisit only if a receipt shows invented teeth.
18
+ //
19
+ // THE FRONT PANEL IS HEADLESS (shipped 2026-07-22, receipt-gated). The face is
20
+ // cropped off the front body panel — the "ghost mannequin" treatment — taking
21
+ // competing face renderings 2 → 1. The BACK panel keeps its head: it has no
22
+ // face to compete with the portrait, and it is the only panel where hair fall
23
+ // reads. The rule is "kill every competing rendering of the FACE", not "kill
24
+ // every head".
25
+ //
26
+ // Two things had to be true before this shipped, and both were verified on
27
+ // real generations (research/model-prompting-research.md, "Head-crop receipt"):
28
+ // 1. It is prompt-reachable. NB2 renders a clean invisible-mannequin panel
29
+ // with no refusal. THIS DEPENDS ON THE PHRASING: it is framed as FRAMING
30
+ // ("cropped at the collarbone, head not shown, invisible-mannequin
31
+ // presentation"), a standard e-commerce genre with deep training data.
32
+ // Never phrase it as removal or decapitation.
33
+ // 2. The literal-reading law does NOT fire on it. This was the real risk and
34
+ // it is ours, not the source corpus's: `references-read-literally.md` says
35
+ // a baked-in property is read as a property of the SUBJECT, and this panel
36
+ // renders headlessness as CONTENT (empty plate above the collar), not as
37
+ // photographic framing. The predicted failure was a headless or
38
+ // neck-glitched downstream character. A Kling shot from a bound sheet came
39
+ // back head intact, identity holding, wardrobe held — in a MULTI-CHARACTER
40
+ // frame, which is the scope ByteDance's averaging failure lives in
41
+ // (ModelArk :1948-1994), so it is the hardest form of the test.
42
+ //
43
+ // Receipt strength: N=1 character, decisive for filterability, strong for the
44
+ // literal-reading risk, NOT a scored V2-vs-V3 comparison — nobody measured
45
+ // whether 2 → 1 improves identity hold, only that it doesn't break. HOW YOU'D
46
+ // KNOW THIS IS BEATEN: a downstream character generating headless,
47
+ // neck-glitched, or with a floating collar; or a scored run where heads-kept
48
+ // holds identity better. Reverting is a one-line change here — no migration,
49
+ // no data touched. Quadrupeds are carved out below (a horse has no collarbone).
50
+ //
51
+ // SOURCE OF TRUTH. The desktop imports these builders through
52
+ // `slate/src/shared/prompts/character-sheet.ts` (a thin re-export since 1.2.1)
53
+ // — there is no desktop prompt mirror to update. Map:
54
+ // second-brain business/projects/slates/product/prompting-ssot.md
55
+ import { IDENTITY_CRAFT_CLAUSE, IDENTITY_LIGHTING_CLAUSE, INHERIT_SOURCE_STYLE, } from './reference-rules.js';
12
56
  import { renderStyleInstruction } from './style-library.js';
13
- /** Turnaround = the IDENTITY reference. 4 neutral full-body angles. */
14
- export const CHARACTER_ANGLES_DESC = 'front view, back view, left side profile, right side profile';
15
57
  /**
16
- * Expression-sheet close-ups = the FACE identity reference (high-res
17
- * eyes/skin/teeth/bone). Attached alongside the turnaround; the scene-time
18
- * reference label drives the rendered expression.
58
+ * The identity sheet's panels. The portrait is FIRST and DOMINANT — every
59
+ * detail the downstream model will ever know about the face comes from those
60
+ * pixels, so it gets the resolution. The body panels exist for build,
61
+ * proportion, wardrobe and hair, not for the face.
62
+ *
63
+ * The front panel is headless and the back panel KEEPS its head — that
64
+ * asymmetry is the whole rule. A front-facing body panel renders a ~40px face
65
+ * that cannot match the portrait's, so the sheet would carry two competing
66
+ * identities and the model averages them. A back view has no face to compete
67
+ * with, and it is the only panel where hair fall reads. See the header comment
68
+ * for the receipt and for why the phrasing must stay framing, not removal.
19
69
  */
20
- export const CHARACTER_EXPRESSIONS_DESC = 'neutral expression on left, genuine smile showing teeth in center, serious frown on right';
21
- export const BODY_POSE_LABELS = ['front', 'back', 'profile-left', 'profile-right'];
22
- export const EXPRESSION_LABELS = ['neutral', 'smile', 'serious'];
70
+ export const CHARACTER_SHEET_PANELS_DESC = 'a large chest-up portrait on the left at a three-quarter angle (never dead-on), ' +
71
+ 'a full-body front view in a relaxed A-pose in the centre, framed from the collarbone down with the head not shown — ' +
72
+ 'an invisible-mannequin presentation where the clothing holds its own shape, ' +
73
+ 'and a full-body back view on the right with the head and hair fully visible';
74
+ /** Panel identifiers, in sheet order. */
75
+ export const BODY_POSE_LABELS = ['portrait', 'front', 'back'];
23
76
  // The sheet's style directive: a user transform REPLACES the inherit-source
24
77
  // instruction (so the model isn't told to both preserve the medium AND change
25
78
  // it); otherwise inherit the source medium.
@@ -27,27 +80,20 @@ function styleDirective(userStyle) {
27
80
  return renderStyleInstruction(userStyle).trim() || INHERIT_SOURCE_STYLE;
28
81
  }
29
82
  /**
30
- * Body turnaround sheet — the identity reference.
83
+ * The character identity sheet — one asset, three panels.
84
+ *
31
85
  * @param userStyle optional natural-language style transform (e.g. "make her a real person")
32
86
  */
33
- export function buildCharacterTurnaroundPrompt(userStyle) {
34
- return (`Character model reference sheet with 4 full body views of the same character: ${CHARACTER_ANGLES_DESC}. ` +
35
- `Neutral pose, neutral expression, consistent character appearance across all views. ` +
36
- `${styleDirective(userStyle)} ${IDENTITY_LIGHTING_CLAUSE} ` +
37
- `For upright/bipedal characters arrange side-by-side; for quadruped/animal characters use a 2x2 grid. ` +
38
- `No text, no labels, no captions.`);
39
- }
40
- /**
41
- * Expression sheet — the close-up face reference. Its three portraits carry
42
- * high-res facial detail (eyes, skin, teeth, bone structure) plus the
43
- * character's expression range. Attached ALONGSIDE the turnaround; the
44
- * reference label drives identity-use + scene-driven expression so the multiple
45
- * expressions don't average the generated face.
46
- */
47
- export function buildExpressionSheetPrompt(userStyle) {
48
- return (`Character expression reference sheet with 3 head and shoulder portraits arranged side by side horizontally: ${CHARACTER_EXPRESSIONS_DESC}. ` +
49
- `Consistent character appearance across all three. ` +
50
- `${styleDirective(userStyle)} ${IDENTITY_LIGHTING_CLAUSE} Same framing for each. ` +
51
- `No text, no labels, no captions.`);
87
+ export function buildCharacterIdentityPrompt(userStyle) {
88
+ return (`A single character identity reference sheet of one character, three panels side by side on one plate: ` +
89
+ `${CHARACTER_SHEET_PANELS_DESC}. ` +
90
+ `The portrait is the largest panel and occupies roughly a quarter to a third of the sheet — it is the sole authority for the face, so render it at maximum facial detail. ` +
91
+ `No second rendering of the face anywhere on the sheet. ` +
92
+ `Neutral expression and identical appearance, wardrobe and hair across all three panels. ` +
93
+ `${styleDirective(userStyle)} ${IDENTITY_LIGHTING_CLAUSE} ${IDENTITY_CRAFT_CLAUSE} ` +
94
+ `For quadruped or non-bipedal characters, replace the A-pose with a natural standing stance, show the whole animal including the head on both body panels, and keep the same three-panel layout. ` +
95
+ `No text, no labels, no captions, no panel borders.`);
52
96
  }
97
+ /** @deprecated Use buildCharacterIdentityPrompt. */
98
+ export const buildCharacterTurnaroundPrompt = buildCharacterIdentityPrompt;
53
99
  //# sourceMappingURL=character-sheet.js.map
@@ -5,5 +5,13 @@
5
5
  */
6
6
  export declare function buildEnvironmentEstablishingPrompt(userStyle?: string | null): string;
7
7
  /** Guidance shown to users/agents: prefer describing the environment in text. */
8
- export declare const ENVIRONMENT_DESCRIBE_FIRST = "Default to describing the environment in words and let the model build it to fit the shot. Generate an establishing plate only when a location must be locked exactly across shots.";
8
+ export declare const ENVIRONMENT_DESCRIBE_FIRST: string;
9
+ /**
10
+ * The continuity test for a location that must hold across shots: generate a
11
+ * SECOND frame from the reverse angle and approve the plate only if the anchor
12
+ * object, the openings, the light side, the materials and the palette all still
13
+ * match. A plate that fails this will drift the moment the camera turns — and a
14
+ * broken plate gives every later character failure a second plausible cause.
15
+ */
16
+ export declare const ENVIRONMENT_REVERSE_ANGLE_TEST = "Reverse-angle check: generate one frame from the opposite side of the space and confirm the anchor object, openings, light direction, materials and colour palette all still match. If they do not, the plate is not locked \u2014 fix the plate before staging anything in it.";
9
17
  //# sourceMappingURL=environment-sheet.d.ts.map
@@ -16,12 +16,26 @@ function styleDirective(userStyle) {
16
16
  * @param userStyle optional natural-language style transform
17
17
  */
18
18
  export function buildEnvironmentEstablishingPrompt(userStyle) {
19
- return (`A single clean establishing shot of this empty location: a wide, eye-level view that captures the space — its architecture or geography, materials, and depth. ` +
19
+ return (`A single clean establishing shot of this empty location, framed at a three-quarter angle — never a dead-on frontal view — so two walls or planes are visible and the floor reads as usable staging space. ` +
20
+ `Capture the space: its architecture or geography, materials, and depth. ` +
21
+ `Include a clearly readable ANCHOR OBJECT with a definite position in the room — a sofa, a doorway, a counter, a signpost — so later shots can be blocked against it. ` +
20
22
  `The location is empty and unpopulated, ready for scene staging. ` +
21
- `${styleDirective(userStyle)} Use ${ENVIRONMENT_NATURAL_LIGHT}. ` +
23
+ `${styleDirective(userStyle)} Use ${ENVIRONMENT_NATURAL_LIGHT}, motivated by ONE dominant source with shadows falling consistently away from it — soft and diffused for interiors, no hard visible light rays. ` +
24
+ `Add gentle atmospheric haze with distance so near and far planes separate in depth rather than reading at the same sharpness. ` +
22
25
  `If the reference image contains people or characters, generate the location as an empty space — ignore the figures. ` +
23
26
  `No text, no labels, no captions.`);
24
27
  }
25
28
  /** Guidance shown to users/agents: prefer describing the environment in text. */
26
- export const ENVIRONMENT_DESCRIBE_FIRST = 'Default to describing the environment in words and let the model build it to fit the shot. Generate an establishing plate only when a location must be locked exactly across shots.';
29
+ export const ENVIRONMENT_DESCRIBE_FIRST = 'Default to describing the environment in words and let the model build it to fit the shot. Generate an establishing plate only when a location must be locked exactly across shots. ' +
30
+ 'When you do: frame it three-quarter, never dead-on (a frontal facade turns the location into a backdrop characters stand in FRONT of; a three-quarter exposes side geometry and usable floor), ' +
31
+ 'name an anchor object so blocking can be stated as "between the sofa\'s hall-side arm and the window" instead of "on the left" — one is testable after a camera turn, the other drifts, ' +
32
+ 'give it one motivated light source with shadows falling away from it, and ask for atmospheric haze so depth separates.';
33
+ /**
34
+ * The continuity test for a location that must hold across shots: generate a
35
+ * SECOND frame from the reverse angle and approve the plate only if the anchor
36
+ * object, the openings, the light side, the materials and the palette all still
37
+ * match. A plate that fails this will drift the moment the camera turns — and a
38
+ * broken plate gives every later character failure a second plausible cause.
39
+ */
40
+ export const ENVIRONMENT_REVERSE_ANGLE_TEST = 'Reverse-angle check: generate one frame from the opposite side of the space and confirm the anchor object, openings, light direction, materials and colour palette all still match. If they do not, the plate is not locked — fix the plate before staging anything in it.';
27
41
  //# sourceMappingURL=environment-sheet.js.map
@@ -6,7 +6,10 @@
6
6
  export const MODEL_FACTS = [
7
7
  {
8
8
  id: 'nano-banana-2',
9
- label: 'Nano Banana 2 (Gemini 3 Image)',
9
+ // Gemini 3.1 FLASH Image — verified against the runtime slug map in
10
+ // slate/src/main/api/google.ts. Nano Banana PRO is a different model
11
+ // (gemini-3-pro-image-preview); do not conflate them.
12
+ label: 'Nano Banana 2 (Gemini 3.1 Flash Image)',
10
13
  kind: 'image',
11
14
  maxRefImages: 14, // 10 object-fidelity + 4 character-consistency; categories don't trade.
12
15
  maxIngredients: null,
@@ -0,0 +1,2 @@
1
+ export declare const PARTIALS: Record<string, string>;
2
+ //# sourceMappingURL=partials.generated.d.ts.map
@@ -0,0 +1,14 @@
1
+ // GENERATED — do not edit. Source: packages/shared/skills/_partials/*.md
2
+ // Regenerated by scripts/sync-partials.mjs on every build.
3
+ //
4
+ // This is the SAME text injected between the @inject markers in the
5
+ // per-model skills, so the TS consumers and the markdown consumers can
6
+ // no longer disagree. Edit the partial, not this file, not the skills.
7
+ export const PARTIALS = {
8
+ "decision-log": "When you surface the plan, include a short **decision log** — one line per decision *you* made that the user did not specify:\n\n```\nsource phrase or declared default → what you wrote → what it resolves\n\"in a diner\" → chrome-and-vinyl booth, 3/4 on the counter → fixes the anchor so blocking is repeatable\n(no time of day) → late afternoon, low warm key → default; say the word and it changes\n(no camera) → slow push-in, single move → one move per shot; stacking increases instability\n```\n\n**Hard rule: never silently add weather, props, style, or camera movement.** If it wasn't in the brief and you added it, it goes in the log. This is the \"why did you add that?\" affordance — for an agent that writes prompts on the user's behalf and spends their credits, it is what keeps the model in assembly and the user in the director's chair.\n\n> ❌ **Do NOT turn this into a question gate.** Clarifying questions before optimizing directly fight the locked fast-path rule: *if intent is clear, generate immediately with sane defaults, don't ask questions; only ask for production intent, and batch every question into one message.* Log the decisions, then go. The log is an **output**, not an interrogation — surfaced alongside the plan, never as a separate ceremony, and never as a reason to wait.",
9
+ "reference-rules-core": "Identity = a few flat-lit neutral angles; one reference per role, named inline; 2-4 refs not 12; describe environments instead of feeding a grid.\n\n1. **2-4 strong references beat both extremes.** Not 1 (warps toward itself), not 12 (averages worse). Start with 2-3 focused refs — each one adds context AND another variable to balance.\n2. **One reference per ROLE, named in the prompt** — identity / style-grade / environment. The model does **not** infer a reference's role from its position in the list; the inline name carries it. Same-role competitors drift (two \"identity\" refs of different people blend into a third face). Slates composes the naming for you from your `@mentions` / `#tags` — you never hand-write role labels.\n3. **One identity sheet per character, named inline.** A character's identity is a single asset (dominant portrait + body panels), so attach that one asset rather than a pile of views: **fewer competing renderings of a face is better, because the model cannot tell which one is authoritative and averages them.** Slates cites it as `Marcus (image 1)`. **Do NOT hand-write a \"Reference Image Instructions\" block or role essays** (\"use for identity, ignore the outfit, render a neutral expression\") — that drags the sheet's studio lighting and wardrobe into a scene that asked for neither. The prompt leads; the user's words own wardrobe, expression, lighting, and action.\n4. **Flat-light identity refs.** Prep identity references with flat, even, shadowless lighting on a plain neutral background. A studio-lit or scene-lit character sheet bleeds its lighting into every generation — the failure looks like the subject was green-screen-pasted in front of the location. Reference prep beats prompting here.\n5. **Environment: describe it, don't feed a grid.** Default to describing the location in words and let the model build a space that fits the shot. Reserve an environment reference for a mandatory exact-match, and then use ONE clean establishing image with natural ambient light that reads as the location's real light — never a multi-panel grid fed whole.\n6. **Grids: explore, don't input.** Use grids to explore compositions cheaply, then pick a cell. Never feed a grid back in as a reference — the cells share a split detail budget and were generated jointly, so their flaws propagate.\n7. **Reuse the same refs across every shot** in a sequence. Lock a set and keep it; swapping references mid-sequence causes drift, because the model adapts each reference to the current prompt rather than copying it.\n8. **Legible in-shot text → bake it into a still start frame, never trust text-to-video.** Have an image model render the text, then animate from that locked frame. Video models smear type.\n9. **Working from existing media — describe ONLY what changes.** The source already carries its composition, motion, timing, and performance; re-describing them fights the model. Narrate the delta. (Video lane: restyle your own clip while keeping the performance; delayed-VFX on \"video one\"; marker-object insertion; video-as-reference for a series.)\n10. **Style transforms happen in natural language.** By default the source's artistic medium and visual style are inherited. To change it, add a plain-text instruction (\"anime → real person\"). There are no preset pickers, and there is no style slider.",
10
+ "reference-tips-short": "Name each reference inline; never write role essays. Slates does this for you: `@mention` a subject or environment and it composes `Marcus (image 1) in the cafe (image 2)`, citing them in the exact order it sends them. One canonical identity image avoids competing facial renderings; a \"Reference Image Instructions\" block drags reference lighting into your scene. Start with 2-3 focused refs.",
11
+ "references-read-literally": "> **The general law: the model reads a reference literally.**\n> A reference image is not a suggestion. Whatever is baked into it — lighting, medium, texture, symmetry, competing identities — is read as a **property of the subject** and reproduced downstream. A baked rim light tints every shot made from that sheet. A sheet that looks like a 3D game render gets animated like game footage. Two competing renderings of one face get averaged into a third face.\n\nEvery reference rule below is a corollary of that one sentence, which is why \"prep the reference\" beats \"prompt around the reference\" every time:\n\n- **Flat, plain identity refs** — because scene lighting in the sheet becomes scene lighting in the output (Slates' own receipt: a studio-lit sheet produced a subject that looked green-screen-pasted in front of mountains).\n- **One authoritative rendering per subject** — because the model cannot tell which panel is the real one. ByteDance documents this failure directly: multi-view character assets \"confuse the model's character recognition, causing it to generate duplicate characters of the same appearance.\"\n- **No 3D-game-render look in a reference** — the model recognizes the render mood and inherits its motion character, so the *animation* comes out looking like game footage. This is not a taste rule; it is the same literal-reading mechanism applied to the temporal layer.\n- **Break perfect symmetry** — mirrored faces and dead-square framing read as synthetic, and the model preserves that reading rather than correcting it.\n\n**What this means in practice:** when output is wrong in a way that tracks the *subject* rather than the *scene* — the lighting is wrong the same way in every shot, the face drifts, the material looks synthetic everywhere — fix the reference, not the prompt. Prompting around a baked-in property is the expensive way to lose.",
12
+ "still-gate": "**A visible defect in the still is already a STOP.** Do not animate it. Fix the frame first, then move to motion — and go to motion only when the crop passes the still scan and you genuinely need movement to confirm an uncertain edge, reflection, or object.\n\nThis is a **cost** rule as much as a craft rule: a 1080p/10s premium video generation costs many multiples of an image re-roll, and video is where a defect stops being fixable. Anything wrong in the still gets worse in motion — soft geometry mushes, broken-but-plausible objects fall apart, oily textures start crawling. **Animating a known-bad frame is the single most expensive mistake in the pipeline.** Re-rolling the image is the cheap move; re-rolling the video is not.",
13
+ };
14
+ //# sourceMappingURL=partials.generated.js.map