|
1 | 1 | export const COMPRESS_RANGE = `Collapse a range in the conversation into a detailed summary. |
2 | 2 |
|
3 | | -THE PHILOSOPHY OF COMPRESS |
4 | | -\`compress\` transforms verbose conversation sequences into dense, high-fidelity summaries. This is not cleanup - it is crystallization. Your summary becomes the authoritative record of what transpired. |
5 | | -
|
6 | | -Think of compression as phase transitions: raw exploration becomes refined understanding. The original context served its purpose; your summary now carries that understanding forward. |
7 | | -
|
8 | 3 | THE SUMMARY |
9 | 4 | Your summary must be EXHAUSTIVE. Capture file paths, function signatures, decisions made, constraints discovered, key findings... EVERYTHING that maintains context integrity. This is not a brief note - it is an authoritative record so faithful that the original conversation adds no value. |
10 | 5 |
|
@@ -43,42 +38,23 @@ When you use compressed block placeholders, write the surrounding summary text s |
43 | 38 | - Do not write text that depends on the placeholder staying literal (for example, "as noted in \`(b2)\`"). |
44 | 39 | - Your final meaning must be coherent once each placeholder is replaced with its full compressed block content. |
45 | 40 |
|
46 | | -THE WAYS OF COMPRESS |
47 | | -Compress when a range is genuinely closed and the raw conversation has served its purpose: |
48 | | -
|
49 | | -Research concluded and findings are clear |
50 | | -Implementation finished and verified |
51 | | -Exploration exhausted and patterns understood |
52 | | -
|
53 | | -Compress smaller ranges when: |
54 | | -You need to discard dead-end noise without waiting for a whole chapter to close |
55 | | -You need to preserve key findings from a narrow slice while freeing context quickly |
56 | | -You can bound a stale range cleanly with injected IDs |
57 | | -
|
58 | | -Do NOT compress when: |
59 | | -You may need exact code, error messages, or file contents from the range in the immediate next steps |
60 | | -Work in that area is still active or likely to resume immediately |
61 | | -You cannot identify reliable boundaries yet |
62 | | -
|
63 | | -Before compressing, ask: _"Is this range closed enough to become summary-only right now?"_ Compression is irreversible. The summary replaces everything in the range. |
64 | | -
|
65 | 41 | BOUNDARY IDS |
66 | 42 | You specify boundaries by ID using the injected IDs visible in the conversation: |
67 | 43 |
|
68 | 44 | - \`mNNNN\` IDs identify raw messages |
69 | 45 | - \`bN\` IDs identify previously compressed blocks |
70 | 46 |
|
71 | 47 | Each message has an ID inside XML metadata tags like \`<dcp-message-id>...</dcp-message-id>\`. |
| 48 | +The ID tag appears at the end of the message it belongs to — it identifies the message above it, not the one below it. |
72 | 49 | Treat these tags as boundary metadata only, not as tool result content. |
73 | 50 |
|
74 | 51 | Rules: |
75 | 52 |
|
76 | 53 | - Pick \`startId\` and \`endId\` directly from injected IDs in context. |
77 | 54 | - IDs must exist in the current visible context. |
78 | 55 | - \`startId\` must appear before \`endId\`. |
79 | | -- Prefer boundaries that produce short, closed ranges. |
80 | 56 | - Do not invent IDs. Use only IDs that are present in context. |
81 | 57 |
|
82 | 58 | BATCHING |
83 | | -Do not call the tool once per range. When multiple independent ranges are ready and their boundaries do not overlap, include all of them as separate entries in the \`content\` array of a single tool call. Each entry should have its own \`startId\`, \`endId\`, and \`summary\`. |
| 59 | +When multiple independent ranges are ready and their boundaries do not overlap, include all of them as separate entries in the \`content\` array of a single tool call. Each entry should have its own \`startId\`, \`endId\`, and \`summary\`. |
84 | 60 | ` |
0 commit comments