refactor: restructured and condensed agent prompts and system instructions
- Refactored and condensed numerous system prompts, agent instructions, and tool documentation files across packages. - Streamlined workflow rules, formatting constraints, and execution guidelines for improved clarity and brevity. - Updated discovery rules, recommendation criteria, and syntax standards in prompt templates.
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
Line-anchored patch language: name original lines/gaps to replace, insert, cut, or paste, then list new content. A header ending in `:` takes `+` body rows; colonless `PUT` (paste), `CUT`, `REM`, `MV` take none.
|
||||
Line-anchored patch language: name original lines/gaps to replace, insert, cut, or paste; then give new content. `:` headers take `+` body rows; colonless paste `PUT`, `CUT`, `REM`, `MV` take none.
|
||||
|
||||
<headers>
|
||||
Every file section starts `[PATH#TAG]`. `TAG` = 4-hex snapshot tag from your latest `read`/`search` — REQUIRED on every section. Create new files with `write`; hashline only edits existing files.
|
||||
Section: `[PATH#TAG]`; `TAG`: 4-hex snapshot from latest `read`/`search`, REQUIRED each section. New files: `write`; hashline edits existing files only.
|
||||
</headers>
|
||||
|
||||
<ops>
|
||||
`PUT N.=M:` — replace original lines N through M (INCLUSIVE) with body rows.
|
||||
`PUT N*:` — replace the syntactic block BEGINNING on line N; its closing line is resolved for you.
|
||||
`PUT <N:` / `PUT >N:` — insert body rows before / after line N (`PUT <1:` = file head, `PUT >$:` = file tail).
|
||||
`PUT >N*:` — insert body rows after the END of the block beginning at N (at sibling depth). Append inside a block → `PUT >M:`.
|
||||
`PUT <N` / `PUT >N` / `PUT N.=M @name` / `PUT N* @name` — paste a captured register at a gap, over a range, or over a resolved block (no `:` header, no body rows). Unlabeled gap `PUT` pastes the anonymous register; span/block paste requires `@name`.
|
||||
`CUT N.=M` / `CUT N*` — delete lines N through M / block N and capture them (anonymous, or `@name` when given).
|
||||
`REM` — delete the whole section file. `MV DEST` — move/rename to `DEST` (quote paths with spaces); edits above `MV` land on the source first, final content written at `DEST`.
|
||||
Single line: `PUT N.=N:` / `CUT N.=N`. Range = ORIGINAL lines touched (`N.=M`, inclusive); body length irrelevant.
|
||||
`PUT N.=M:`: replace original inclusive lines N–M with body.
|
||||
`PUT N*:`: replace syntactic block beginning N; closing line resolved.
|
||||
`PUT <N:` / `PUT >N:`: insert before/after N; `<1` head, `>$` tail.
|
||||
`PUT >N*:`: insert after block N's end, at sibling depth. Append inside block: `PUT >M:`.
|
||||
`PUT <N` / `PUT >N` / `PUT N.=M @name` / `PUT N* @name`: paste captured register at gap/range/resolved block; no `:` or body. Unlabeled gap paste: anonymous register; range/block paste: `@name` required.
|
||||
`CUT N.=M` / `CUT N*`: delete and capture inclusive lines N–M / block N; anonymous or given `@name`.
|
||||
`REM`: delete section file. `MV DEST`: move/rename (quote paths with spaces); prior edits apply to source, final content to `DEST`.
|
||||
Single line: `PUT N.=N:` / `CUT N.=N`. Ranges name original inclusive touched lines; body length irrelevant.
|
||||
</ops>
|
||||
|
||||
<body-rows>
|
||||
Only under a `:` header. Every row is `+TEXT`, verbatim (leading whitespace kept); `+` alone = blank line. NEVER `-old` or bare/context rows — the range deletes; the body is only the final content. Keep a line: leave it out of every range. Literal leading `-`/`+` keeps the prefix: `- item` → `+- item`, `+ item` → `++ item`.
|
||||
Only below `:` headers. Row: verbatim `+TEXT` (leading whitespace preserved); `+`: blank. NEVER `-old`, bare, or context rows: range deletes; body is final content. Keep line: exclude it from every range. Literal initial `-`/`+`: `- item` → `+- item`; `+ item` → `++ item`.
|
||||
</body-rows>
|
||||
|
||||
<rules>
|
||||
- Line numbers + `#TAG` come from your latest `read`/`search` (`LINE:TEXT` rows); numbers name ORIGINAL lines, never shifted by applied hunks.
|
||||
- Applied edits renumber the file and change the `#TAG` — take the next edit's numbers from the edit response or a fresh `read`.
|
||||
- Touch only displayed lines — hunks on undisplayed lines are REJECTED. Far from your read window? Re-`read`; confirm numbers map to the intended construct.
|
||||
- Elided regions are UNSEEN (`…`/`..` markers, collapsed `N-M:` summary rows) — NEVER place or span a hunk inside one; `read` the range first.
|
||||
- NEVER start or end a range mid-expression or mid-block.
|
||||
- Ranges cover ONLY changed lines — never widen over keepers. Non-adjacent changes = separate hunks.
|
||||
- Whole construct → `PUT N*:`; lines inside one → `PUT N.=M:`.
|
||||
- `PUT N*:` resolves EXACTLY the node at N: leading decorators/attributes/doc-comments are separate nodes — point N at the FIRST decorator to sweep both; standalone line-comments are never swept (use `PUT N.=M:`).
|
||||
- Block ops anchor the OPENING line of a MULTI-LINE construct — never the closer, last line, or a bare inner statement; one statement → plain op (`PUT N.=N:` / `CUT N.=N` / `PUT >N:`). Saw the closer? `PUT >M:`.
|
||||
- Markdown: a heading IS a block opener — block ops on `##`/`###` resolve the WHOLE section (through deeper nested headings, up to the next same-or-higher heading). `PUT >N*:` after a section: end the body with a blank line to keep the next heading separated.
|
||||
- Pure additions → `PUT <N:` / `PUT >N:`, never a widened `PUT N.=M:`.
|
||||
- Move code with `CUT`+`PUT`: `CUT 5.=9 @fn` captures into `@fn`; `PUT >40 @fn` pastes it. Unlabeled `CUT` + `PUT >40` works for a single call-local move. Named registers persist across edit calls.
|
||||
- NEVER format/restyle code with this tool; run the project formatter.
|
||||
- Numbers and `#TAG`: latest `read`/`search` `LINE:TEXT`; numbers are original, never shifted by hunks.
|
||||
- Each edit renumbers and changes `#TAG` → next numbers from edit response or fresh `read`.
|
||||
- Touch displayed lines only; undisplayed hunks REJECTED. Far from read window: re-`read`; confirm construct.
|
||||
- Elisions UNSEEN: `…`, `..`, collapsed `N-M:` rows. NEVER hunk in/across one; `read` first.
|
||||
- NEVER start/end range mid-expression or mid-block.
|
||||
- Ranges: changed lines only; NEVER widen over keepers. Non-adjacent changes: separate hunks.
|
||||
- Whole construct: `PUT N*:`; internal lines: `PUT N.=M:`.
|
||||
- `PUT N*:` resolves exactly node N. Leading decorators/attributes/doc-comments are separate nodes: point N at first decorator to include both. Standalone line-comments never swept: use `PUT N.=M:`.
|
||||
- Block ops: opening line of multi-line construct, NEVER closer, last line, bare inner statement. One statement: plain `PUT N.=N:` / `CUT N.=N` / `PUT >N:`. At closer: `PUT >M:`.
|
||||
- Markdown headings are block openers. Block op on `##`/`###`: whole section through deeper headings to next same/higher heading. After section `PUT >N*:`: end body with blank line to separate next heading.
|
||||
- Pure addition: `PUT <N:` / `PUT >N:`, NEVER widened `PUT N.=M:`.
|
||||
- Move: `CUT`+`PUT`; `CUT 5.=9 @fn` → `@fn`, `PUT >40 @fn` pastes. Single call-local move: unlabeled `CUT` + `PUT >40`. Named registers persist across edit calls.
|
||||
- NEVER format/restyle with this tool; run project formatter.
|
||||
</rules>
|
||||
|
||||
<example>
|
||||
@@ -54,7 +54,7 @@ PUT 1.=3:
|
||||
MV lib/greet.py
|
||||
```
|
||||
|
||||
Markdown bullets — the file receives `- task`:
|
||||
Markdown bullets — file receives `- task`:
|
||||
```
|
||||
[PLAN.md#A1B2]
|
||||
PUT >2:
|
||||
@@ -62,7 +62,7 @@ PUT >2:
|
||||
+ - nested task
|
||||
```
|
||||
|
||||
Move `greet` to a sibling file using a named register — flows across sections:
|
||||
Move `greet` to sibling file via named register; flows across sections:
|
||||
```
|
||||
[greet.py#A1B2]
|
||||
CUT 1* @fn
|
||||
@@ -70,7 +70,7 @@ CUT 1* @fn
|
||||
PUT <1 @fn
|
||||
```
|
||||
|
||||
`PUT 1*:` resolves lines 1–3 (`def` header through `print(msg)`); line 4 is a separate statement and stays:
|
||||
`PUT 1*:` resolves lines 1–3 (`def` through `print(msg)`); line 4 separate, remains:
|
||||
```
|
||||
[greet.py#A1B2]
|
||||
PUT 1*:
|
||||
@@ -78,7 +78,7 @@ PUT 1*:
|
||||
+ print(f"Hello, {name}")
|
||||
```
|
||||
|
||||
Decorator/doc-comment = SEPARATE block — point N at the decorator to take both; anchoring the `def` (line 2) would orphan `@cache`:
|
||||
Decorator/doc-comment separate block: point N at decorator to include both; anchoring `def` line 2 orphans `@cache`:
|
||||
```
|
||||
[svc.py#C3D4]
|
||||
PUT 1*:
|
||||
@@ -127,7 +127,7 @@ PUT >20 @fn:
|
||||
</anti-patterns>
|
||||
|
||||
<critical>
|
||||
1. RE-GROUND AFTER EVERY EDIT — applied edits renumber the file and change the `#TAG`; take next numbers from the edit response or a fresh `read`. Stale tag or surprise? STOP, re-`read`.
|
||||
2. RANGES ARE TIGHT — cover only lines that change. Whole construct → `PUT N*:`.
|
||||
3. BODY = FINAL CONTENT — every body row starts with `+`; Markdown bullets use `+- item`, not `- item`.
|
||||
1. RE-GROUND AFTER EVERY EDIT: edits renumber and change `#TAG`; take next numbers from edit response or fresh `read`. Stale tag/surprise: STOP; re-`read`.
|
||||
2. RANGES TIGHT: changed lines only. Whole construct: `PUT N*:`.
|
||||
3. BODY FINAL CONTENT: every row starts `+`; Markdown bullet: `+- item`, not `- item`.
|
||||
</critical>
|
||||
|
||||
Reference in New Issue
Block a user