fix: Tell agents context files are on-demand, not bulk-read

Agents were reading all contextFiles (38 tasks + 8 phases) upfront,
wasting massive context window. Updated INPUT_FILES and SESSION_STARTUP
prompts to clearly distinguish assignment files (read all) from context
files (read only when needed).
This commit is contained in:
Lukas May
2026-03-04 11:48:25 +01:00
parent 069eb66acb
commit 26ed9e0395

View File

@@ -14,21 +14,23 @@ As your final action, write \`.cw/output/signal.json\`:
export const INPUT_FILES = `
<input_files>
Read \`.cw/input/manifest.json\` first, then read listed files from \`.cw/input/\`.
Read \`.cw/input/manifest.json\` first. It contains two arrays:
- \`files\` — your **assignment**. Read every file in full.
- \`contextFiles\` — **background reference**. Do NOT read these upfront. Only read a context file when you specifically need information from it.
**Assignment Files**
**Assignment Files** (read all of these)
- \`initiative.md\` — frontmatter: id, name, status
- \`phase.md\` — frontmatter: id, name, status; body: description
- \`task.md\` — frontmatter: id, name, category, type, priority, status; body: description
- \`pages/\` — one per page; frontmatter: title, parentPageId, sortOrder; body: markdown
**Context Files (read-only)**
Present when \`contextFiles\` exists in manifest:
**Context Files** (read-only, read on-demand)
- \`context/phases/\` — frontmatter: id, name, status, dependsOn; body: description
- \`context/tasks/\` — frontmatter: id, name, phaseId, parentTaskId, category, type, priority, status, summary; body: description
Completed tasks include a \`summary\` field with what the previous agent accomplished.
Do not duplicate or contradict context file content in your output.
Context files provide awareness of the broader initiative. There may be dozens — do NOT bulk-read them.
When you need to check a specific phase or task, read that one file. Do not duplicate or contradict context file content in your output.
</input_files>`;
export const ID_GENERATION = `
@@ -99,7 +101,7 @@ export const SESSION_STARTUP = `
1. \`pwd\` — confirm working directory
2. \`git status\` — check for unexpected state
3. Run test suite — establish green baseline. If already failing, signal "error". Don't build on a broken foundation.
4. Read \`.cw/input/manifest.json\` and all listed input files
4. Read \`.cw/input/manifest.json\` and all **assignment** files (the \`files\` array). Do not bulk-read context files.
</session_startup>`;
export const PROGRESS_TRACKING = `