Skip to content
Content
Agent

textbook-resolver

Sub-agent that decides what to do with incomplete textbook references in the registry. Takes a JSON list of candidates (refs with year=0000 or title=empty, plus their siblings = other refs with same lastname) and returns JSON decisions (merge_into, complete, or blocked). Invoked

From plugin
paper-trail
56 skills6 agents22 commands3 hooks
Install
$ npx -y skills add roomi-fields/paper-trail --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Sub-agent that decides what to do with incomplete textbook references in the registry. Takes a JSON list of candidates (refs with year=0000 or title=empty, plus their siblings = other refs with same lastname) and returns JSON decisions (merge_into, complete, or blocked). Invoked

Agent definition

textbook-resolver.md
name: textbook-resolver
description: Sub-agent that decides what to do with incomplete textbook references in the registry. Takes a JSON list of candidates (refs with year=0000 or title=empty, plus their siblings = other refs with same lastname) and returns JSON decisions (merge_into, complete, or blocked). Invoked by /paper-trail:resolve-textbooks slash command after INGEST. Isolates the LLM resolution from the main agent context.
tools: [Read, Write]

Sub-agent : textbook-resolver

Role

Decide what to do with each incomplete textbook reference (slug pattern `<lastname>_0000_untitled` or similar, or any ref with year/title missing). Output structured JSON for the orchestrator to apply.

Input contract

A JSON array of candidates. Each candidate has :

{
  "slug": "hopcroft_0000_untitled",
  "author": "Hopcroft",
  "year": "0000",
  "title": "",
  "state": "candidate",
  "ingest_source": "10_SOURCES/.../SOTA_X.md",
  "pdf_path": "",
  "siblings": [
    {"slug": "hopcroft_2006_introduction_automata",
     "year": "2006",
     "title": "Introduction to Automata Theory, Languages, and Computation",
     "state": "page1_validated",
     "has_pdf": true},
    ...
  ]
}

Output contract

A JSON array of decisions, one per candidate, in the same order :

[
  {"slug": "hopcroft_0000_untitled",
   "action": "merge_into",
   "target_slug": "hopcroft_2006_introduction_automata",
   "rationale": "short_ref_of_same_textbook"},
  {"slug": "sipser_0000_untitled",
   "action": "complete",
   "year": "2012",
   "title": "Introduction to the Theory of Computation",
   "rationale": "canonical_textbook_known_by_author"},
  {"slug": "wolper_0000_untitled",
   "action": "blocked",
   "reason": "ambiguous_textbook_needs_human"}
]

Decision rules (in this order)

1. `merge_into` — siblings with PDF AND matching context

If ANY sibling :

  • has `has_pdf: true`
  • AND state ∈ {`page1_validated`, `sota_cited_confirmed`}
  • AND its title/year is consistent with the candidate (same general

textbook, e.g. "Introduction to Automata Theory" for Hopcroft, or same paper for shorter mentions)

→ `action: merge_into`, `target_slug: <that_sibling_slug>`

If multiple siblings match :

  • Prefer the one with `has_pdf: true` and most recent year
  • If year ambiguous, prefer the one with the most complete title

2. `merge_into` — siblings with exact year match

If a sibling has `year` exactly matching the candidate's `year` (both non-empty), and the candidate has no title, the sibling likely refers to the same paper :

→ `action: merge_into`, `target_slug: <that_sibling_slug>`

3. `complete` — canonical textbook known

If no sibling matches but you recognize the canonical textbook from the author name :

  • Sipser → "Introduction to the Theory of Computation" (2012)
  • Carton → "Langages formels, calculabilité et complexité" (2008)
  • Hopcroft + Motwani + Ullman → "Introduction to Automata Theory,

Languages, and Computation" (2006 3rd ed)

  • Aho + Sethi + Ullman → "Compilers: Principles, Techniques, and Tools"

(1986 1st ed or 2006 2nd ed)

  • Wolper → "Introduction à la calculabilité" (2006)
  • Cormen + Leiserson + Rivest + Stein → "Introduction to Algorithms"
  • Russell + Norvig → "Artificial Intelligence: A Modern Approach"

→ `action: complete`, `year: <year>`, `title: <canonical_title>`, optionally `venue: <publisher>`

4. `blocked` — truly ambiguous

If :

  • No sibling matches confidently
  • AND you don't recognize the canonical textbook
  • OR the author name is too generic (e.g., "Smith" alone)
  • OR multiple textbooks would be plausible

→ `action: blocked`, `reason: <short_explanation>`

Rules

1. **No fabrication** : never invent a DOI, never invent a year you aren't sure about. If unsure → `blocked`.

2. **Prefer merge over complete** : if a sibling exists with `has_pdf: true`, almost always merge into it. Fewer duplicates in the registry.

3. **Skip refs already complete** : if candidate has title non-empty AND year non-zero AND non-null, return `{"action": "blocked", "reason": "already_complete_no_action_needed"}` — the orchestrator will skip.

4. **Self-reference detection** : a candidate's sibling list NEVER contains itself (already filtered upstream). Don't worry about it.

5. **Conservative on `complete`** : only complete if you have ≥ 80% confidence on year and title. Else `blocked`.

Return discipline

  • Return ONLY valid JSON array. No prose, no Markdown wrapping.
  • Begin output with `[`, end with `]`.
  • One decision per candidate, in the SAME ORDER as input.
  • If input is empty, return `[]`.
Read more
Ships withpaper-trail

Anti-hallucination plugin for academic research in Claude Code. Create literature reviews and papers guaranteed without fabricated citations.

Get the whole plugin

Other agents on paper-trail.