Files
oh-my-pi/packages/coding-agent/src/prompts/tools/read.md
T
can1357 af1832af1b feat(coding-agent/prompts): refined tool prompts for shell, browser, and eval workflows
- Simplified `bash` guidance to tighten allowed command patterns, pipeline limits, and launch-based process handling.
- Reworked `browser` instructions into grouped helper sections while preserving selector restrictions and key action semantics.
- Harmonized `eval`, `irc`, `read`, and `todo` prompt wording around state reuse, messaging, selector formats, and task operations.
2026-07-15 03:28:21 +02:00

2.0 KiB

Read files, directories, archives, SQLite, images, documents, internal resources, and web URLs via path.

- SHOULD parallelize independent reads. - SHOULD use `read` (not browser) for web content; browser only when `read` can't deliver.

Selectors — append :<sel> to path (e.g. src/foo.ts:50-200, src/foo.ts:raw, db.sqlite:users:42)

  • :50 / :50- — from line 50 | :50-200 — inclusive | :50+150 — 150 lines from 50 | :5-16,960-973 — multiple ranges
  • :raw — verbatim, no anchors/prefixes | :2-4:raw / :raw:2-4 — range + verbatim
  • :conflicts — one line per unresolved git merge conflict block

Source kinds

  • Parseable code, no selector → structural summary (declarations only, body elided). Footer names recovery selector — re-issue ONLY those ranges.
  • {{#if IS_HL_MODE}}File + selector → [foo.ts#1A2B] snapshot header + numbered lines. Copy [FILENAME#TAG] for anchored edits; NEVER fabricate the tag.{{/if}}
  • Directory → depth-limited dirent listing.
  • SQLite (.sqlite, .sqlite3, .db, .db3): file.db (tables), file.db:table (schema+rows), file.db:table:key (by PK), ?limit=/?where=/?q=SELECT.
  • Archives (.tar, .tar.gz, .tgz, .zip): archive.ext:path/inside/archive reads a member.
  • Documents → extracted text. Notebooks → editable cells. Images → {{#if INSPECT_IMAGE_ENABLED}}metadata; call inspect_image{{else}}decoded inline{{/if}}. :raw bypasses converters.
  • URLs → reader-mode clean text/markdown; :raw → untouched HTML. Bare host:port needs trailing slash.
  • Internal URIs — all schemes take selectors. artifact://<id> recovers spilled output; page with :N-M/:raw:N-M.
  • ssh://host/<path> reads remote file/dir (UTF-8, ≤1 MiB); bare ssh:// lists hosts; also write/search-able. Literal :, ?, # → percent-encode (%3A/%3F/%23). Requires POSIX shell (else ssh tool).
Summary footer names elided ranges? Re-issue ONLY those ranges. NEVER guess `..`/`…` content.