From local-library
Use when comparing code or implementation against method descriptions in one or more source papers — covers decomposition of code into checkable claims (algorithm shape, hyperparameters, loss/objective terms, normalization, initialization, edge cases), per-claim grounding via the grounding-against-library kernel, math-verification fallback to the PDF via the handling-extraction-quality skill, and an assertion-table output mapping each code claim to its paper locus and a status (match / mismatch / partial / not-found). Multi-source. Also fires on phrasings like "compare this code/file against @<citekey>", "does this implementation match the paper", "audit my implementation of <method>", "verify that this code follows @<citekey>", "check whether the hyperparameters match", "does this loss function match what's in @<citekey>".
How this skill is triggered — by the user, by Claude, or both
Slash command
/local-library:implementation-check-against-papersThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Reviewing code that claims to implement a method described in a paper
# follows X et al. (YEAR) comment in codehandling-extraction-quality to read the PDF directly. Marker's extracted markdown is unreliable for tightly-spaced subscripts, summation indices, and mathematical operators.Read the target code. List one claim per checkable assertion, organized by area:
1/√d_kEach bullet becomes one row in the assertion table. Resist the urge to consolidate — if two claims would have different statuses, they need separate rows.
For each claim, invoke the grounding-against-library kernel with the assertion phrased as: "Paper @ specifies that ." Capture per-source evidence with chunk indices.
For equation/symbol claims where the kernel's retrieved markdown shows garbling cues (subscript collapse, escape-sequence remnants, empty math delimiters — see handling-extraction-quality recognition cues), cross-invoke handling-extraction-quality: extract the **Original path:** from show_document, Read the PDF with a pages: range covering the relevant section, and quote the equation from the PDF with the page number as provenance.
Aggregate the per-claim grounding results into a table. Required columns and example shape:
| # | Claim | Code locus | Paper locus | Status | Notes |
|---|-------|-----------|-------------|--------|-------|
| 1 | softmax over time dim before value projection | reranking.py:128 | @Vaswani2017 §3.2.1 (chunk 14) | match | quote: "we apply a softmax function to obtain the weights on the values" |
| 2 | learning rate warmup over 4000 steps | train.py:62 | @Vaswani2017 §5.3 (chunk 31) | mismatch | code uses warmup_steps=8000; paper says "warmup_steps = 4000" |
| 3 | mask out padded positions in attention | reranking.py:142 | @Vaswani2017 §3.2.3 (chunk 18) | partial | paper masks only future positions in decoder; code's mask scope is broader (all padding tokens in encoder too) |
| 4 | dropout layer after attention output | reranking.py:155 | searched §3, §5; no equivalent | not-found | searched chunks 12-22 and 30-35 with `doc_id="@Vaswani2017"`; no mention of post-attention dropout — paper's only dropout reference is to residual connections (§5.4) |
Status values (use exactly these strings):
match — paper directly specifies the same thing the code does, with a verbatim quoted excerpt.mismatch — paper specifies a different value/structure than the code; quote the divergent specifications from both.partial — paper specifies something related but not identical (different scope, qualified, conditional); explain the gap in Notes.not-found — searched the paper (with doc_id="@<citekey>" retries on the named document) and the claim's analog is not present.@<citekey> §<section> (chunk <N>) for prose-level claims; @<citekey> p.<page> for math/figure-level claims read from the PDFmatch), divergent specifications (for mismatch), gap description (for partial), or search-scope description (for not-found)If handling-extraction-quality was invoked for any row, the Notes field for that row should explicitly state "from PDF page N" rather than chunk index, and the quoted excerpt is from the PDF reading.
| Excuse | Reality |
|---|---|
| "Loose correspondence is good enough at this granularity" | Loose correspondence hides bugs. One claim per row, even if the rows look similar. |
| "Math markdown is garbled but I can guess from the surrounding prose" | Cross-invoke handling-extraction-quality. Don't reconstruct from training — that's how false-match rows get written. |
| "Notational difference, surely just a rewrite" | Verify substitutions. The paper might use Q, K, V while the code uses query, key, value — fine. But subscripts (W^Q_i vs W_Q_i) and signs (- vs + in a residual) flip more often than expected. |
| "Couldn't find it in §3, must not be in the paper" | Don't tag not-found after searching one section. Use search_library(query, doc_id="@<citekey>") to retry across chunks; or fetch the section outline via get_document_text first to locate the right area. |
| "Multiple claims map to the same paper section; I'll merge the rows" | No. One claim per row. Two claims that share a paper locus can have different statuses (one match, one partial). |
"I'll mark match if the code looks roughly aligned with the paper's intent" | match requires a quoted excerpt that supports the specific claim. Without the quote, the right tag is partial. |
"The Notes column is optional — I'll leave it blank for match rows" | Notes is required for every row. For match, the quote is the audit trail. Without it, the row isn't independently verifiable. |
match without a quoted excerpt in the Notes columnnot-found without having searched the full paper (use the section outline from get_document_text to verify scope)npx claudepluginhub strophios/local-library --plugin local-libraryGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.