Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/stoa-platform/stoa/rewritenpx skills add stoa-platform/stoa --skill rewritegit clone --depth 1 https://github.com/stoa-platform/stoaWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00052 | $0.00971 |
| Opus 5 | $0.00026 | $0.00485 |
| Sonnet 5 | $0.00010 | $0.00194 |
| Haiku 4.5 | $0.00005 | $0.00097 |
Grade A, and why
rewrite scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rewrite — $ARGUMENTS
Invoked when Edit (patch) is the wrong tool. Research shows search/replace fails 20-30% on evolved code, and accumulated failed patches poison the context (Liu et al. "Lost in the Middle"; Databricks Mosaic). See
feedback_rewrite_after_fail.md.
When to use this skill
Triggered automatically via the hook post-edit-failure-tracker.sh at 2 consecutive Edit failures. Also invoke manually when:
- Diff estimated >30% of the file size
- Refactoring where structure changes, not just content
- File is small-to-medium (≤800 lines) and a clean rewrite is cheaper than hunting for correct search/replace anchors
- User says "just rewrite it"
Do NOT use for:
- Single-line changes (use Edit)
- Files >1500 lines (split first, or delegate to subagent)
- Files you haven't read yet in this session (read first, understand first)
Workflow
Step 1 — Parse arguments
Split $ARGUMENTS into:
FILE_PATH(first token, absolute path)INTENT(remainder — what the rewrite should accomplish)
If INTENT is empty, ask the user: "What should the rewrite accomplish? (e.g. 'fix the auth middleware bug', 'add tenant filtering')". Do NOT guess the intent from context alone.
Step 2 — Read the current file
Always Read the full file before rewriting. If >1500 lines, stop and suggest splitting or subagent delegation instead.
Step 3 — Check pollution signal
jq --arg path "$FILE_PATH" '[.[] | select(.path == $path)] | .[0]' .claude/state/edit-attempts.json
If consecutive_fails ≥ 2, the rewrite is warranted. If total ≥ 5 but consecutive_fails < 2, consider whether a subagent with fresh context would be better than an inline rewrite (Main context already has noise).
Step 4 — Rewrite strategy
Preserve by default:
- Public API surface (exported symbols, function signatures if referenced elsewhere)
- Import structure and file-level conventions
- Comments that explain non-obvious WHY (delete comments that explain WHAT)
- Type annotations, docstrings where they exist
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 80 lines · 52 tokens per session scan A 8679b3ac87e2
rewrite is a skill published in the GitHub repository stoa-platform/stoa (5 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 52 tokens to every session and 971 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
lyrik
Security assessment of a codebase — minimal mode for runner validation.
librarian
Read-only retrieval over the daily-digest kept set. Slash-invoke with /librarian ; returns items verbatim with citations.
notes
Create and manage text notes in the workspace.
tdx-assets
Look up staff devices, assets, and locations in TeamDynamix (TDX). Given a list of names, emails, or partial identifiers, resolve each person and return the assets assigned to them with location, model, ownership type, and status. Read-only.
aggregator
Daily fetch from a fixed public allowlist; score against the user's interests file; cluster into themes; push the digest to the configured channel.
csv-tools
Parse and analyze CSV data.