From paper-deepstudy
Use when the user wants an in-depth treatment of a single topic in a paper that is already studied. Dispatches deep-dive-agent with topic + paper text + analysis files. Output lands at deep-dives/<topic-slug>.md.
npx claudepluginhub chansigit/studypaper --plugin paper-deepstudyThis skill is limited to using the following tools:
Invoke after `/paper:study` has produced the paper's analysis directory. Each invocation produces one deep-dive markdown file on the user-specified topic.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Invoke after /paper:study has produced the paper's analysis directory. Each invocation produces one deep-dive markdown file on the user-specified topic.
Required positional arg: <topic> (the topic to deep-dive on).
Optional flag: --paper <slug> (default: most recently modified paper folder).
Resolve target paper folder
Source the shared helper and resolve which paper folder this invocation targets:
source $CLAUDE_PLUGIN_ROOT/scripts/lib/resolve-paper.sh
resolve_paper "$@"
# After: $PAPER_DIR, $PAPER_SLUG, $PAPER_AUTODETECTED are set.
# If $PAPER_AUTODETECTED is "true", the helper already printed a warning to stderr.
If resolve_paper returns non-zero, abort with the helper's stderr message.
Verify required files:
$PAPER_DIR/analysis/ directory with at least 00-paper-profile.md$PAPER_DIR/paper.txt (or $PAPER_DIR/paper.pdf as fallback)If missing, abort with: "No analysis directory at $PAPER_DIR. Run /paper:study on this paper first."
Set:
ANALYSIS_DIR=$PAPER_DIR/analysisPAPER_TEXT=$PAPER_DIR/paper.txtPAPER_PDF=$PAPER_DIR/paper.pdfDEEP_DIVES_DIR=$PAPER_DIR/deep-dives (mkdir if absent)PLUGIN_ROOT=${CLAUDE_PLUGIN_ROOT}LANG=<english if user invocation language is English; chinese if Chinese; default english> — the orchestrator detects the user's invocation language for the current /paper:deep-dive call and sets LANG accordingly. Falls back to english if uncertain.Source the log-dispatch helper and extract plugin version:
source $CLAUDE_PLUGIN_ROOT/scripts/lib/log-dispatch.sh
PLUGIN_VERSION=$(grep -m1 '"version"' $CLAUDE_PLUGIN_ROOT/.claude-plugin/plugin.json | sed -E 's/.*"version"[^"]*"([^"]+)".*/\1/')
<topic> is the first positional argument (everything before --paper if present). Treat the entire string as the topic verbatim. If empty, abort with: "Usage: /paper:deep-dive <topic> [--paper <slug>]".
Set TOPIC=<verbatim topic string>.
TOPIC_SLUG=$(echo "$TOPIC" | node $PLUGIN_ROOT/scripts/slugify-objection.cjs)
(Despite the helper's name, the slugify logic is identical to what we want for topics — see Plan 5 Task 5.)
If $DEEP_DIVES_DIR/$TOPIC_SLUG.md already exists, find the next available suffix:
SUFFIX=2
while [ -e "$DEEP_DIVES_DIR/$TOPIC_SLUG-$SUFFIX.md" ]; do
SUFFIX=$((SUFFIX + 1))
done
TOPIC_SLUG="${TOPIC_SLUG}-${SUFFIX}"
Set OUTPUT_PATH=$DEEP_DIVES_DIR/$TOPIC_SLUG.md.
Agent(
description: "deep-dive-agent on <TOPIC>",
subagent_type: "general-purpose",
prompt: <contents of $PLUGIN_ROOT/prompts/deep-dive-agent.md> + concrete inputs:
PAPER_TEXT=$PAPER_TEXT
PAPER_PDF=$PAPER_PDF
ANALYSIS_DIR=$ANALYSIS_DIR
TOPIC="$TOPIC"
OUTPUT_PATH=$OUTPUT_PATH
TEMPLATE_PATH=$PLUGIN_ROOT/templates/deep-dive.md
WEBFETCH allowed (cap 3 fetches)
LANG=$LANG
PLUGIN_VERSION=$PLUGIN_VERSION
)
Wait for completion. Log the dispatch:
log_dispatch deep-dive-agent deep-dives/$TOPIC_SLUG.md ok
If the agent produced no output: log_dispatch deep-dive-agent deep-dives/$TOPIC_SLUG.md failed
If $OUTPUT_PATH does not exist or is empty, log a warning and report failure: "deep-dive-agent did not produce output. Run /paper:deep-dive again or check the agent dispatch."
Otherwise, print to chat (in user's invocation language):
✓ Deep dive complete.
Topic: <TOPIC>
Output: $OUTPUT_PATH
Length: <wc -w on the file> words
Run /paper:deep-dive again with another topic to continue the deep-dive series.
LANG accordingly when dispatching the agent. Section headings stay English so downstream tooling can grep them.-2, -3, ... suffix. The orchestrator does NOT overwrite existing deep-dives.