Optimizes file reading operations by providing smarter read strategies (head/tail/grep/diff) to reduce token usage and latency. Use this when you need to inspect large files efficiently without dumping the entire content.
Reads the first N lines and the last N lines of a file. Good for logs or large docs.
node skills/read-optimizer/index.js --file <path> --mode smart --lines 100
Reads lines matching a pattern (regex supported).
node skills/read-optimizer/index.js --file <path> --mode grep --pattern "error|exception"
Reads only the lines changed since the last git commit (if in a git repo).
node skills/read-optimizer/index.js --file <path> --mode diff
--file : Path to the file.--mode : Operation mode (default: smart).--lines : Number of lines for head/tail (default: 50).--pattern : Regex pattern for grep mode.--context : Context lines for grep (default: 2).共 1 个版本