to instructions on voice in editor not good yet #5

Open
opened 2026-03-25 06:39:19 +00:00 by despiegk · 3 comments
Owner

image

when we click instruction we get not good result

see the result instructions

we need much better prompt to generate the instructions, it needs to say, start from the instructions we have, use the new instructions at back of the current ones (if there are any), to improve the slide isntructiosn

but result needs to be clear for slide generation

![image](/attachments/c3da2695-17de-4e85-bbe1-6e46a36d840b) when we click instruction we get not good result see the result instructions we need much better prompt to generate the instructions, it needs to say, start from the instructions we have, use the new instructions at back of the current ones (if there are any), to improve the slide isntructiosn but result needs to be clear for slide generation
Author
Owner

Implementation Spec — Issue #5: Improve the "Intent" (Voice-to-Instructions) Prompt

Objective

The hero_slides intent subcommand generates an intent.md file by sending each slide's markdown through an AI prompt (build_intent_prompt). The current prompt is too generic — it asks the model to summarize slides for "thematic coherence," producing vague output not useful for slide generation.

The fix implements three behaviors:

  1. Start from the existing intent entry for the slide (if one exists in intent.md).
  2. Incorporate new slide content as an additive update, placed after the existing instructions.
  3. Produce output phrased as clear, actionable generation instructions — not summaries.

Requirements

  • When intent.md already contains an entry for a slide, pass that existing text to the AI as the "current instructions" baseline.
  • The AI must treat the existing intent entry as the foundation and extend it (appending, not replacing) using any new or updated slide content.
  • If no prior intent entry exists, the AI generates a first-time instruction block from scratch, using instruction-oriented phrasing.
  • The output must be worded as explicit visual/layout/content directions for an image-generation model — not prose descriptions.
  • build_intent_prompt must accept an optional existing_description: Option<&str> parameter.
  • Call sites in generate_intent_entry and cmd_intent must pass the correct prior entry where available.
  • Existing unit tests must be updated; new tests must cover both None and Some branches.

Files to Modify

  • src/generator.rs — core prompt builder build_intent_prompt and public generate_intent_entry
  • src/main.rscmd_intent orchestration loop must pass prior descriptions through

Implementation Plan

Step 1: Update build_intent_prompt in generator.rs

Files: src/generator.rs

  • Add existing_description: Option<&str> parameter
  • Replace generic summary-focused prompt with instruction-oriented prompt
  • When Some(text): include existing entry as "Current Slide Instructions" and tell model to extend (not replace)
  • When None: generate fresh instruction set
  • Closing directive: "Write explicit, imperative instructions for a slide image generator. Each line should be a direct directive (e.g., 'Show a bold headline...', 'Place a bullet list...'). Do not write a description or summary."
    Dependencies: none

Step 2: Update generate_intent_entry signature in generator.rs

Files: src/generator.rs

  • Add existing_description: Option<&str> parameter to signature
  • Forward it to the updated build_intent_prompt
    Dependencies: Step 1

Step 3: Update cmd_intent in main.rs

Files: src/main.rs

  • In the changed-slide loop, look up prior intent entry from existing_intents
  • Pass Some(&existing.description) or None to generate_intent_entry
    Dependencies: Step 2

Step 4: Update unit tests

Files: src/generator.rs

  • Update existing test_build_intent_prompt to pass None
  • Add test_build_intent_prompt_no_prior and test_build_intent_prompt_with_prior
    Dependencies: Step 1

Acceptance Criteria

  • build_intent_prompt accepts existing_description: Option<&str> and includes it when Some
  • Prompt instructs AI to write actionable imperative instructions, not prose summaries
  • Prior intent entry flows through: cmd_intentgenerate_intent_entrybuild_intent_prompt
  • None is passed when no prior entry exists
  • All existing unit tests pass (updated for new signatures)
  • New tests cover both None and Some branches
  • intent.md output reads as a directive list, not description paragraphs

Notes

  • "Voice to instructions" / "click instruction" maps to the hero_slides intent subcommand
  • The intent.md file provides per-slide generation instructions consumed by build_prompt
  • Current model: Model::Llama3_3_70B — improved prompt should work; stronger model is a fallback option
  • generate_slide / build_prompt does not need changes
## Implementation Spec — Issue #5: Improve the "Intent" (Voice-to-Instructions) Prompt ### Objective The `hero_slides intent` subcommand generates an `intent.md` file by sending each slide's markdown through an AI prompt (`build_intent_prompt`). The current prompt is too generic — it asks the model to summarize slides for "thematic coherence," producing vague output not useful for slide generation. The fix implements three behaviors: 1. Start from the existing intent entry for the slide (if one exists in `intent.md`). 2. Incorporate new slide content as an additive update, placed after the existing instructions. 3. Produce output phrased as clear, actionable generation instructions — not summaries. --- ### Requirements - When `intent.md` already contains an entry for a slide, pass that existing text to the AI as the "current instructions" baseline. - The AI must treat the existing intent entry as the foundation and extend it (appending, not replacing) using any new or updated slide content. - If no prior intent entry exists, the AI generates a first-time instruction block from scratch, using instruction-oriented phrasing. - The output must be worded as explicit visual/layout/content directions for an image-generation model — not prose descriptions. - `build_intent_prompt` must accept an optional `existing_description: Option<&str>` parameter. - Call sites in `generate_intent_entry` and `cmd_intent` must pass the correct prior entry where available. - Existing unit tests must be updated; new tests must cover both `None` and `Some` branches. --- ### Files to Modify - `src/generator.rs` — core prompt builder `build_intent_prompt` and public `generate_intent_entry` - `src/main.rs` — `cmd_intent` orchestration loop must pass prior descriptions through --- ### Implementation Plan #### Step 1: Update `build_intent_prompt` in `generator.rs` Files: `src/generator.rs` - Add `existing_description: Option<&str>` parameter - Replace generic summary-focused prompt with instruction-oriented prompt - When `Some(text)`: include existing entry as "Current Slide Instructions" and tell model to extend (not replace) - When `None`: generate fresh instruction set - Closing directive: "Write explicit, imperative instructions for a slide image generator. Each line should be a direct directive (e.g., 'Show a bold headline...', 'Place a bullet list...'). Do not write a description or summary." Dependencies: none #### Step 2: Update `generate_intent_entry` signature in `generator.rs` Files: `src/generator.rs` - Add `existing_description: Option<&str>` parameter to signature - Forward it to the updated `build_intent_prompt` Dependencies: Step 1 #### Step 3: Update `cmd_intent` in `main.rs` Files: `src/main.rs` - In the changed-slide loop, look up prior intent entry from `existing_intents` - Pass `Some(&existing.description)` or `None` to `generate_intent_entry` Dependencies: Step 2 #### Step 4: Update unit tests Files: `src/generator.rs` - Update existing `test_build_intent_prompt` to pass `None` - Add `test_build_intent_prompt_no_prior` and `test_build_intent_prompt_with_prior` Dependencies: Step 1 --- ### Acceptance Criteria - [ ] `build_intent_prompt` accepts `existing_description: Option<&str>` and includes it when `Some` - [ ] Prompt instructs AI to write actionable imperative instructions, not prose summaries - [ ] Prior intent entry flows through: `cmd_intent` → `generate_intent_entry` → `build_intent_prompt` - [ ] `None` is passed when no prior entry exists - [ ] All existing unit tests pass (updated for new signatures) - [ ] New tests cover both `None` and `Some` branches - [ ] `intent.md` output reads as a directive list, not description paragraphs --- ### Notes - "Voice to instructions" / "click instruction" maps to the `hero_slides intent` subcommand - The `intent.md` file provides per-slide generation instructions consumed by `build_prompt` - Current model: `Model::Llama3_3_70B` — improved prompt should work; stronger model is a fallback option - `generate_slide` / `build_prompt` does **not** need changes
Author
Owner

use strong model use

GPT-5.4 Nano

use strong model use GPT-5.4 Nano
Author
Owner

Implementation committed: 762df2e

Browse: 762df2e

Implementation committed: `762df2e` Browse: https://forge.ourworld.tf/lhumina_code/hero_slides/commit/762df2e
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_slides#5
No description provided.