From 36c2dbf46ecb3dbc5566d3af96cd55262983cc52 Mon Sep 17 00:00:00 2001 From: Z User Date: Sat, 31 Oct 2026 00:12:22 +0000 Subject: [PATCH] Cline-aware bounded reads: cite exact line ranges (PROMPT A 53-156, PROMPT B 157-568, single-pass fence 30-428), run-don't-read the 62KB validator, chunking fallback for truncated reads - Cline caps reads at ~50k chars and cuts sooner on small model contexts --- README.md | 7 +++++++ h3-plan-gate/SKILL.md | 25 +++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8b89b8b..41570cc 100755 --- a/README.md +++ b/README.md @@ -299,6 +299,13 @@ output). ### Requirements +- **Local models through Cline (Windows 11 + llama.cpp):** Cline truncates file reads at + ~50,000 characters, and cuts sooner when the model's context window is small — raise + your llama.cpp context (`llama-server -c 32768`) so a whole task fits. SKILL.md accounts + for this: the scripts are run, never read (`verify_plan_rules.py` is ~62 KB and exceeds + Cline's cap by design), and the big prompt files are read in bounded line ranges cited + in Steps 1, 3, and the short-stories section. + - `build_plan.py` and `verify_plan_rules.py`: Python 3 stdlib only — no venv packages needed; the `.venv\Scripts\python.exe` form just matches a typical Windows project layout, and plain `python` / `python3` works anywhere. diff --git a/h3-plan-gate/SKILL.md b/h3-plan-gate/SKILL.md index 92584b9..9877eb1 100755 --- a/h3-plan-gate/SKILL.md +++ b/h3-plan-gate/SKILL.md @@ -29,6 +29,13 @@ never compose a scene from a guide the user has not approved. only the Python standard library — nothing to install. - Start every task by running the smoke test under "Before you start". If it fails because `h3-plan-gate` is missing files, stop and tell the user the folder is incomplete. +- **Never read `verify_plan_rules.py` or `build_plan.py`** — run them and work from their + printed output. Cline truncates file reads (~50,000 characters, sooner when the model's + context window is small), so the ~62 KB validator arrives cut no matter what. A + truncation notice is Cline's read cap, not repo corruption — do not "fix" truncated files. +- The two big prompt files are read in the **bounded line ranges** given in Step 1 and + Step 3 — never whole. If any read still arrives truncated, split it: read lines 1–230, + then 231 onward, and continue from where the last chunk ended. ## Before you start (smoke test) @@ -42,9 +49,10 @@ Expect the suite to pass and the second command to print ## Step 1 — Build the scene guide (outline) -The user gives you a story and how many scenes they want. Read -`h3-plan-gate/h3_scene_agent_system_prompt.md` (PROMPT A and its WORKED EXAMPLE are the -quality bar) and write `outline.json` — the guide for every scene — in exactly this +The user gives you a story and how many scenes they want. Read **lines 53–156** of +`h3-plan-gate/h3_scene_agent_system_prompt.md` — the PROMPT A section (its ROLE, OUTPUT +SHAPE, FIELD RULES, WORKED EXAMPLE and SELF-CHECK are the quality bar); never the whole +~36 KB file. Then write `outline.json` — the guide for every scene — in exactly this shape: ```json @@ -107,8 +115,11 @@ through the guide first — never straight into a scene file. ## Step 3 — Compose the scenes one at a time -Work only from the approved guide. Before writing scene 1, read the PROMPT B section of -`h3_scene_agent_system_prompt.md` — its SCENE COMPOSITION checklist (subject anchor, +Work only from the approved guide. Before writing scene 1, read **lines 157–568** of +`h3-plan-gate/h3_scene_agent_system_prompt.md` — the PROMPT B section (role, output +shape, turn template, SCENE COMPOSITION checklist, craft, audio, dialogue, timing, +worked example, self-check; ~3.6k tokens as a section, versus ~11k for the whole file). +Its SCENE COMPOSITION checklist (subject anchor, style anchor, continuity anchor, blocking, camera, performance, physical texture, exit state) is what each turn is for. Then, in story order: compose ONE scene file, validate it, fix it until it passes, and only then move to the next scene. Since you wrote the @@ -330,7 +341,9 @@ and sampler latent or the video can come out square. ## Short stories (2–4 scenes) You may use the single-pass prompt instead — read -`h3-plan-gate/h3_plan_json_system_prompt.md`, have its rules govern one turn that writes +`h3-plan-gate/h3_plan_json_system_prompt.md` (501 lines: the copyable system prompt is +the text fence spanning lines 30–428; on a limited-context agent read lines 1–230 +then 231–501 instead of the whole file), have its rules govern one turn that writes the whole plan, then run `--check` on the file. Use the full workflow for long stories, per-scene iteration, or when the user wants to revise single scenes or the guide.