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 skills add d-o-hub/github-template-ai-agents --skill document-rendering-and-locatorsgit clone --depth 1 https://github.com/d-o-hub/github-template-ai-agentsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/document-rendering-and-locators)<a href="https://agentmods.dev/skills/d-o-hub/github-template-ai-agents/document-rendering-and-locators"><img src="https://agentmods.dev/badge/skills/d-o-hub/github-template-ai-agents/document-rendering-and-locators.svg" alt="Measured on agentmods" height="20"></a>What 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.1 | $0.00078 | $0.00606 |
| Opus 5 | $0.00039 | $0.00303 |
| Sonnet 5 | $0.00016 | $0.00121 |
| Haiku 4.5 | $0.00008 | $0.00061 |
Grade A, and why
document-rendering-and-locators 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 7d 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 — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Document Rendering and Locators
Purpose: implement resilient document rendering, locator extraction, and annotation anchoring.
When to Use
- Integrating document rendering library or reader-core changes.
- Working on TOC, locator, or highlight/comment anchoring logic.
- Debugging annotation drift or document loading regressions.
Workflow
- Define data model -- confirm multi-signal locator requirements (position + text + chapter + DOM fallback).
- Design anchors -- map DOM selections -->
{ position, selectedText, chapterRef, elementIndex, charOffset }. - Implement -- use rendering library APIs for annotations and navigation, ensure async cleanup.
- Resilience -- add re-anchoring strategy (exact match --> fuzzy text --> chapter fallback --> user notice).
- Performance -- lazy-load document assets, reuse single rendition, clean up listeners to avoid leaks.
- Testing -- add test cases for locator serialization + re-anchor helpers; capture regressions.
Checklist
- Position + text excerpt + chapterRef persisted together.
- Anchor serialization uses stable casing + schema.
- Re-anchoring warns user when falling back.
- Event handlers removed on unmount.
- Telemetry events logged for load failures with trace IDs.
See Also
reader-ui-ux— Reader/admin UI with responsive layoutsturso-db— Database for document storage
Rationalizations
| Rationalization | Reality |
|---|---|
| "Exact match anchoring is always sufficient" | Documents change formatting across versions; multi-signal fallback prevents total anchor loss. |
| "Lazy loading complicates the code" | Eager loading wastes memory and blocks rendering; lazy loading is essential for large documents. |
| "Telemetry for load failures is overkill" | Without telemetry, silent anchor failures are invisible until users report them. |
Red Flags
- Relying on a single anchoring signal without fallback strategy
- Not cleaning up event handlers on unmount
- Skipping locator serialization tests
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 7d ago First seen · 65 lines · 78 tokens per session scan A f8f0df54620e
document-rendering-and-locators is a skill published in the GitHub repository d-o-hub/github-template-ai-agents (2 stars, last pushed today), licensed MIT. It adds 78 tokens to every session and 606 once invoked, about $0.0004 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
ima-skill
A unified IMA skill for managing personal notes and knowledge bases through the platform's APIs.
tencent-docs
A Tencent Docs assistant for creating, reading, editing, organizing, importing, and exporting online documents, spreadsheets, presentations, diagrams, and forms.
resilient-context-extraction
Ensures agents extract data from context files with validation and fallback strategies before resorting to assumptions or external searches.
wechat-article-publisher
A tool that takes a Markdown file or web page, converts it into a formatted WeChat Official Account article, and can create a draft or submit it for publication.
citra
Skill "citra" from SylphxAI/pdf-reader-mcp, covering citra — pdf evidence for agents, install, or, tools and sdk.
csv-to-sif
Export a project's FF&E product-library CSV as dealer-system SIF. Use to produce a .sif schedule; use sif-to-csv for the reverse direction.