papermill/skills/init/SKILL.md
Initialize a paper repository: discover structure, infer format, gather author info, and create .papermill/state.md. On existing repos, refresh mode adds missing schema fields without overwriting data. Migrates legacy .papermill.md to .papermill/state.md automatically.
npx skillsauth add queelius/claude-anvil initInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Initialize a paper repository for use with papermill. Follow every step below in order. Be thorough in discovery but conservative in action -- never overwrite existing state.
Check for state files in this order (Read tool):
.papermill/state.md (current format).papermill.md (legacy format — needs migration).papermill/state.md existsRead it, display a summary (title, stage, format, authors), then offer refresh:
This repository is already initialized. Current state is shown above.
Would you like to refresh the state file? This will:
- Add any missing YAML fields from the current schema (preserving all existing data)
- Re-discover repo structure for new files or assets
- Ask about anything not yet captured (e.g., related papers)
Nothing will be overwritten or removed. Or use
/papermill:statusfor a quick look.
If the user declines refresh, stop here. If they accept, proceed to Refresh Mode below.
.papermill.md exists (legacy)Migrate to the new directory structure:
.papermill/ directory and .papermill/reviews/ subdirectory (Bash tool: mkdir -p .papermill/reviews).papermill.md content.papermill/state.md (Write tool).papermill.md (Bash tool: rm .papermill.md)Migrated state file. Moved
.papermill.md→.papermill/state.mdand created.papermill/reviews/for review output. All existing data preserved.
Then display the summary and offer refresh as in Case A.
Continue to Step 2 (fresh initialization).
Refresh is additive only -- it fills gaps without touching existing data. Run through each check below, report what was found, and apply changes only with user confirmation.
Compare the existing YAML frontmatter against the current schema (shown in Step 7). For each field in the schema that is missing from the file, add it with its default value. Common cases:
thesis block → add with empty claim, novelty, refined: nullprior_art block → add with empty defaultsexperiments → add as []venue block → add with target: null, candidates: []review_history → add as []related_papers → add as []authors[].orcid → add as ""Report what was added: "Added N missing fields to bring the state file up to the current schema." If nothing is missing, say so.
Run the same discovery as Step 2 (format detection, asset scan). Compare against what the state file already records. Report any new findings:
.bib files since initializationresearch/, scripts/, etc.).Rmd files but format says latex)For format mismatches, ask the user: "The state file says latex but I also found .Rmd files. Should I update the format?" Only update with confirmation.
Check for content that the current init flow captures but older versions may not have asked about:
related_papers is empty or missing, run the repoindex discovery query (if repoindex is available) and present any papermill-tracked projects found. Also re-ask the Step 6 question about related work and software. If related_papers is already populated, still offer repoindex discovery to catch newly-initialized projects: "You have N related papers linked. Want me to check for any new papermill-tracked projects?"## Related Work heading, run the related-work question from Step 6. If the user provides context, append it to the notes.authors[].orcid is empty, check deets and offer to fill it in.title is empty or looks like a placeholder, re-run title inference from Step 4.Display what changed:
Refresh complete.
| Action | Details | |--------|---------| | Schema fields added | N (list them) | | New assets discovered | (list or "none") | | Context updated | (what was added or "nothing new") |
Append a timestamped note to the markdown body:
- YYYY-MM-DD (init refresh): Refreshed state file. [brief summary of changes].
Do NOT modify existing field values (stage, thesis, prior_art content, experiments, reviews, venue selections) unless the user explicitly asks. Those are managed by their respective skills.
Search the repository to understand what kind of paper project this is (Glob tool). Look for all of the following and report what you find:
*.tex files (Glob tool). If found, set format: latex.*.Rmd files (Glob tool). If found, set format: rmarkdown.paper.md, manuscript.md, or any markdown file that looks like a JOSS-style paper (contains title: in YAML frontmatter) (Glob/Grep tools). If found, set format: markdown.format: latex if they are unsure.*.bib files (bibliography)research/ or code/ or scripts/ or analysis/ directories (computational work)CITATION.cff (citation metadata)figures/ or img/ or images/ directories (graphics)Makefile, latexmkrc, or build configuration filesREADME.md or CLAUDE.md (project documentation)Report a brief inventory of what was found, for example:
Discovered structure:
- Format: latex (found
paper/main.tex)- Bibliography:
paper/references.bib(12 entries)- Research code:
research/directory present- Figures:
figures/directory with 3 PDF files- Build system:
latexmkconfiguration found
Try to obtain the primary author's identity using the deets CLI tool, which manages personal metadata (Bash tool).
Run these commands (each may fail if deets is not installed -- that is fine):
deets get identity.name
deets get contact.email
deets get academic.orcid
deets is available and returns values: Use them as the primary author. Show the user what was found and ask for confirmation.deets is not available or returns errors: Ask the user directly:
I could not find author information via
deets. Please provide:
- Your full name (as it appears on papers)
- Your email address
- Your ORCID (optional, e.g., 0000-0002-1234-5678)
Also check for author info in existing files (Read/Grep/Bash tools):
\author{} blocks in .tex filesCITATION.cff author fieldsgit config user.name, git config user.email)If multiple sources conflict, prefer: deets > tex file > CITATION.cff > git config. Always confirm with the user.
Attempt to extract the title automatically (Grep/Read tools):
\title{...} in .tex files. Handle multiline titles and macro-containing titles.# heading or a title: field in YAML frontmatter.title: field.If a title is found, show it to the user and ask for confirmation. If no title is found, ask:
I could not detect a paper title. What is the working title for this paper?
Determine the project stage based on what exists in the repository:
| Condition | Stage |
|-----------|-------|
| No paper content files exist (empty or new repo) | idea |
| Only outline/notes exist, minimal prose | outlining |
| Substantial paper content exists (multiple sections with prose) | drafting |
| Paper appears complete with abstract, conclusion, references | review |
Use your judgment. When in doubt, default to drafting if paper content exists, or idea if the repo is new or nearly empty. Tell the user what stage you inferred and why.
Ask the user whether this paper connects to any of their other projects or software:
Is this paper related to any of your other work? For example:
- Part of a series (e.g., "Part II of...")
- Builds on a foundation paper you wrote
- A companion covering a different angle of the same research
- Has an associated software package (CRAN, PyPI, GitHub, etc.)
- Uses results or software from another project
If so, briefly describe the relationships. If not, just say "standalone" and we'll move on.
This step is optional — if the user says "standalone" or skips it, proceed without adding anything. Do not press for detail.
If the user describes relationships or software, do two things:
Freeform notes: Note them verbatim for inclusion in the Notes section of .papermill/state.md (Step 7), under a ## Related Work and Software heading. This preserves context for Claude in future sessions.
Structured entries: For each relationship the user describes, create a related_papers entry. Ask the user to confirm for each:
~/-relative).rel). Present the vocabulary and suggest the best fit:
extends / extended-by — builds on or is built uponimplements / implemented-by — theory ↔ softwarecompanion — different angle on the same researchseries — part of a numbered seriesmerged-into — absorbed into another papersupersedes — replaces a previous versionExample interaction:
You mentioned this paper extends the foundation paper in
~/github/papers/masked-causes-in-series-systems. I'll add:- path: ~/github/papers/masked-causes-in-series-systems rel: extends label: "Foundation paper — general masked-cause framework"Does that look right?
After the manual question, check if repoindex is available (Bash tool: command -v repoindex). If it is:
Query for other papermill-tracked projects:
repoindex sql "SELECT name, path FROM repos WHERE path IN (SELECT repo_path FROM files WHERE name = 'state.md' AND relative_path LIKE '.papermill/%')" --json
Filter out the current project from results.
If matches are found, present them:
I found N other papermill-tracked projects via repoindex:
| Project | Path | |---------|------| | masked-causes-in-series-systems | ~/github/papers/masked-causes-in-series-systems | | maskedcauses | ~/github/rlang/maskedcauses | | ... | ... |
Are any of these related to this paper? If so, I'll add them to the
related_papersblock.
For each confirmed match, ask for rel type and label as above.
If repoindex is not available or the query fails, skip silently and proceed.
Also check for clues already in the repo (Read/Glob/Grep tools):
If any are found, mention them: "I noticed this repo contains a DESCRIPTION file for an R package called foo — is the paper about this package? I also see references to [X] in the bibliography — is that related work of yours?"
.papermill/state.mdCreate the .papermill/ directory structure and the state file.
Read the canonical schema (Read tool): ${CLAUDE_PLUGIN_ROOT}/docs/state-schema.md. This is the single source of truth for the state file structure, field constraints, and list field shapes.
Create the directory (Bash tool): mkdir -p .papermill/reviews
Write .papermill/state.md (Write tool) using the template from the schema doc. Populate placeholder values from earlier steps:
title from Step 4stage from Step 5format from Step 2authors[0].{name, email, orcid} from Step 3Append related-work context (if the user described related papers or software in Step 6): add a ## Related Work and Software section below the ## Notes section with the user's description in their own words. Preserve this verbatim; it is context for future Claude sessions.
After creating .papermill/state.md, display a summary:
Papermill initialized.
| Field | Value | |---------|--------------------| | Title | <title> | | Stage | <stage> | | Format | <format> | | Author | <name> (<email>) |
State file:
.papermill/state.md
Then suggest the next skill based on the inferred stage:
| Stage | Suggestion |
|-------|------------|
| idea | "Run /papermill:thesis to develop your core claim and novelty statement." |
| thesis | "Run /papermill:thesis to refine your thesis, or /papermill:prior-art to survey related work." |
| literature | "Run /papermill:prior-art to survey related work and identify gaps." |
| outlining | "Run /papermill:outline to structure your paper sections." |
| drafting | "Run /papermill:thesis to articulate your core claim, or /papermill:status to review your progress." |
| review | "Run /papermill:review to get feedback on your draft." |
| submission | "Run /papermill:status to review submission readiness." |
tools
This skill should be used when the user asks about research directions, open problems, future work, or follow-up research from the academic literature. Trigger phrases include "open problems in X", "what's next for Y", "future work for paper Z", "research directions on T", "salient follow-up research", "what should I work on next in", "find me follow-up research unrelated to my prior work", "broad survey of W", "neglected directions in V". Routes the request to the right Vista MCP tool, reads back the structured paper sections, and synthesizes research directions in the conversation.
testing
Discover latent themes in the metafunctor corpus. Use when the user wants to find implicit through-lines across their blog posts, surface recurring ideas they have not consciously framed as a series, or get candidate themes for a synthesis post. Reads titles, descriptions, and tags; proposes 3 themes that connect 4+ posts each, each with a single-sentence through-line. Output is a proposal, not a draft. Trigger phrases include "find themes in my posts", "what threads connect my writing", "latent themes in my corpus", "scribe".
development
Use when drafting prose sections for a bookwright (technical non-fiction) project. Encodes the Bernoulli-textbook workflow: atom-outward design, deferral discipline, running threads, page budgets, Path A subagent pattern, header comment block convention.
testing
Use when drafting or executing a paired notebook for a bookwright chapter. Covers when notebooks are required vs optional, numerical-sanity-target convention, exec-from-fresh-kernel requirement, and stack-specific execution commands (Jupyter/R Markdown/Quarto).