Skip to content

refactor(verify): add read-only mode, widen trigger, extract citation anchors#25

Merged
bensonwong merged 3 commits into
mainfrom
refactor/skill-read-only-mode-and-anchors-extraction
Apr 15, 2026
Merged

refactor(verify): add read-only mode, widen trigger, extract citation anchors#25
bensonwong merged 3 commits into
mainfrom
refactor/skill-read-only-mode-and-anchors-extraction

Conversation

@bensonwong

@bensonwong bensonwong commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Widen skill trigger: description now fires on any PDF, office doc (DOCX/XLSX/PPTX/etc.), image, scan, or URL task — not just /verify. Adds explicit "Tool precedence" section listing forbidden alternatives (Read for PDFs, pdfplumber, python-docx, Tesseract, etc.) so agents default to deepcitation prepare for all document work.
  • Read-only mode: §1 Orient now picks between two modes — read-only (user wants text extracted, no citations needed) and verify (claims to check). Read-only gets a fast path at the end of §2 that stops after prepare + content delivery, skipping the full citation pipeline. Prevents agents from bailing to Read/pdfplumber when the task is just "summarize this PDF."
  • Extract citation anchors to rules file: ~150 lines of truncation strategies, anti-patterns, Domain A/B explanation, and the 9-entry failure-modes table moved to rules/citation-anchors.md. SKILL.md now holds concise rules + pointer; the heavy reference is lazy-loaded only when needed. Consistent with existing rules/auth.md and rules/cloud-sandbox-constraints.md pattern.
  • New CLI flags: --claim and --model added to verify command examples, with guidance on how to choose a claim label.
  • Improved results summary: final line uses emoji counts (✅ N verified ⚠️ N partial ❌ N not found) instead of the old prose form.
  • README: simplified install section — removes platform-specific subsections (CLI, Cowork, other agents), keeps npx skills add primary path + zip upload fallback.

Test plan

  • Read-only path: ask "what does this PDF say?" — confirm skill runs prepare, reads .deepcitation/*.txt, returns content without citation markers, no verify call
  • Verify path: ask /verify [claim] [doc] — confirm full §1→§4 pipeline runs as before
  • Tool precedence: ask to "parse this DOCX" — confirm skill fires (new description matches) and routes through prepare
  • Citation anchors: confirm rules/citation-anchors.md is referenced from SKILL.md and contains the full truncation/anti-pattern content
  • --claim/--model flags appear in the verify command output
  • README renders cleanly with two install paths

bensonwong and others added 2 commits April 15, 2026 14:50
Removes platform-specific subsections (Claude Code, Cowork, other agents)
in favor of a single `npx skills add` primary path plus a zip upload fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… anchors

- Widen skill description to trigger on any PDF/office doc/image/URL task,
  not just /verify — positions the skill as the document-reading default over
  Read, pdfplumber, Tesseract, etc.
- Add §1 read-only vs verify mode split; adds fast path (§2 read-only) that
  skips the citation pipeline for pure text-extraction requests
- Add "Tool precedence" section explicitly listing forbidden alternatives
- Extract ~150-line citation anchor reference (truncation strategies,
  anti-patterns, failure mode table) to rules/citation-anchors.md; SKILL.md
  now holds concise rules and pointers only
- Add --claim and --model flags to verify CLI command examples
- Improve final summary line format with emoji counts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude

claude Bot commented Apr 15, 2026

Copy link
Copy Markdown

PR Review

Overall this is a solid, well-motivated refactor. Extraction to rules/citation-anchors.md and the read-only fast path are both clear wins. A few issues worth addressing before merge.

ISSUES

  1. README structure is broken

The new headings make Agent Skills a sibling of Install with nothing under Install, leaving an empty section. The zip upload numbered list is orphaned by a bare "Or" fragment, and the deleted step 4 was the only line telling readers what to do after uploading. Either consolidate the headings or restore that payoff sentence.

  1. With-other-agents section removed without replacement

The old README noted that SKILL.md works with any agent that supports Markdown instructions. Still true and still in AGENTS.md, but gone from the public README. A single line under the zip path would restore discoverability without bloat.

  1. Trigger description mixes metadata with instruction prose

The description frontmatter is consumed by skill loaders for trigger matching. The sentence "Preferred over Read, pdfplumber, python-docx, openpyxl, and Tesseract..." is instruction content, not a trigger condition. The Tool Precedence section in the body covers this adequately — trim the description back to trigger conditions only to avoid confusing loaders that do strict semantic matching.

  1. Read-only resume assumption is too broad

The fast-path follow-up note says the .deepcitation output file is still valid without re-running prepare. This is only safe within the same session on the same document. Add a qualifier: only if the same document was used and the output file still exists. Otherwise agents may silently skip prepare on stale or absent output.

  1. --model flag underspecified

"Your own model name as a human-readable string" is ambiguous — model ID (e.g. claude-sonnet-4-6) or display label? A concrete example and a note to omit the flag when the agent cannot determine its identifier would close the gap.

MINOR NITS

  • The citation-anchors.md trigger list in SKILL.md omits one condition from the file's own "When to read this file" preamble: an anchor that "feels wrong". Keep them in sync.
  • Test plan is missing coverage for --model, the emoji summary format, and the read-only-then-verify session resume flow.
  • citation-anchors.md references paths under packages/deepcitation/docs/agents/ that appear to live outside this repo. A note that these are in a separate package would help agents installing the skill standalone.

WHAT WORKS WELL

  • Extracting ~150 lines to rules/citation-anchors.md is the right structural move. SKILL.md is meaningfully shorter and the heavy reference lazy-loads only when needed, consistent with rules/auth.md.
  • The read-only fast path fills a real gap. The "Why this branch exists" callout preempts the exact failure mode it is fixing.
  • The --claim guidance (question vs. filename vs. URL vs. pasted content) is practical and well-differentiated.
  • Emoji counts in the results line are a clear improvement over the old prose summary.
  • The triage table row for read-only mode integrates cleanly with the existing table structure.

…rim, resume guard, --model example, nits

- Fix: README — restore Install subsections (CLI/IDE + claude.ai Skills), add step 4 payoff, restore with-other-agents line
- Fix: SKILL.md description — remove instruction prose ("Preferred over...") from frontmatter trigger field; Tool Precedence section in body covers it
- Fix: read-only resume qualifier — guard re-use of .deepcitation output on same-document + file-exists condition; otherwise re-run prepare
- Fix: --model spec — add concrete examples (claude-sonnet-4-6, gpt-4o, gemini-2.5-pro) and note to omit when model ID is unknown
- Nit: sync citation-anchors.md trigger list in SKILL.md — add missing "feels wrong" condition
- Nit: citation-anchors.md — add note that packages/deepcitation/docs/agents/ paths are in a separate package

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bensonwong bensonwong merged commit 07cea76 into main Apr 15, 2026
@bensonwong bensonwong deleted the refactor/skill-read-only-mode-and-anchors-extraction branch April 15, 2026 21:14
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