一键导入
io-wrapper
Wrap file-like objects with read/write counters. Use when implementing IO wrappers, tracking file access, or counting bytes read/written through a proxy.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Wrap file-like objects with read/write counters. Use when implementing IO wrappers, tracking file access, or counting bytes read/written through a proxy.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Renders markdown to self-contained HTML with a custom dark stylesheet and opens in browser. Use when previewing markdown documents, generating styled HTML from README or report files.
Inform the user what is happening — skip passive lookups
Manage version control with Jujutsu (jj) — no staging area, immediate changes, smart rebasing. Use when navigating history, squashing, or pushing to Git remotes.
Programmatic hunk selection for Jujutsu — split, commit, or squash specific hunks without interactive prompts. Use when making partial commits or selective squashes.
Gather facts from the web using evidence-first approach with mandatory citations. Use when researching topics, answering factual questions, or any task requiring web-sourced evidence.
Model minimum-move problems as BFS over a state space. Use when solving bucket pouring puzzles, sliding tiles, or any problem asking for the shortest sequence of moves to reach a goal.
| name | io-wrapper |
| description | Wrap file-like objects with read/write counters. Use when implementing IO wrappers, tracking file access, or counting bytes read/written through a proxy. |
| topic | File-Like Wrapper + Counters |
| token_cost | 120 |
| related | ["recursion-backtracking"] |
| keywords | ["io wrapper","wrap file","read counter","write counter","nreads","nwrites","context manager","__enter__","__exit__","passthrough","delegate","paasio","MetaRead","MetaWrite"] |
To wrap a file-like object and count reads/writes.
Thread safety: if the test uses threads, wrap counter updates in a threading.Lock.
class MetaRead:
def __init__(self, wrapped): self._wrapped = wrapped; self.nreads = 0
def read(self, size=-1):
data = self._wrapped.read(size)
self.nreads += len(data) # count returned bytes, not requested
return data