Skip to content

feat: Agent Skill (local-context-router)#7

Merged
sid732 merged 3 commits into
mainfrom
feat/agent-skill
Jun 20, 2026
Merged

feat: Agent Skill (local-context-router)#7
sid732 merged 3 commits into
mainfrom
feat/agent-skill

Conversation

@sid732

@sid732 sid732 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Packages the router as an Agent Skill so Claude Code and Codex run the preflight automatically before sending a document to the model.

What

  • SKILL.md: trigger description (fires when the user shares a PDF/scan/screenshot) plus instructions — use text for text/ocr pages and attach the rendered image only for vision pages. Uses the open Agent Skills format, so the same folder works in Claude Code and Codex.
  • scripts/preflight.py: routes a PDF through route_pdf (or OCRs a bare image), renders visual pages into --vision-dir, and prints JSON or a human summary including tokens_saved. Falls back to the repo src/ when the package is not yet installed.

Tests

Validate the frontmatter (name matches directory, description present and bounded, mentions PDF/OCR/vision), run the script end to end on a text PDF, and confirm unsupported file types are rejected.

On a mixed 3-page document the skill routes prose to text, the table to vision (rendering its image), the scan to OCR, and reports ~3085 tokens saved.

Verified locally: ruff, ruff format, mypy (strict), pytest (42) all pass; the skill is discovered and usable in this repo.

sid732 added 3 commits June 20, 2026 10:17
Add the Agent Skill manifest: a trigger description and instructions to run
the preflight, use text for text/ocr pages, and attach images only for vision
pages. Open-standard format, so it works in Claude Code and Codex.
Route a PDF through the router (or OCR a bare image), render visual pages to a
vision directory, and emit JSON or a human summary. Falls back to the repo
source tree when the package is not installed.
Check the SKILL.md frontmatter, run the script on a text PDF, and confirm
unsupported file types are rejected.
@sid732 sid732 merged commit 0a3d2c6 into main Jun 20, 2026
6 checks passed
@sid732 sid732 deleted the feat/agent-skill branch June 23, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant