Presubmit Activator
What this skill is
A Claude-Code-native launcher and setup wizard for the presubmit Python CLI — the standalone, API-driven adversarial peer-review pipeline that produces a consolidated review report on disk.
This skill does not itself perform the review. It:
- Verifies presubmit is installed (and walks you through install if not).
- Verifies your Anthropic API key is set (and walks you through obtaining and configuring one if not).
- Asks where you want review outputs to live (the first time only — saves to a config file).
- Receives a paper path, derives a sensible slug, confirms it with you, and invokes presubmit with the right
--work-dirso outputs land in the conventional location. - Monitors the run, reports cost / wall-time / where the consolidated report landed, and points you at the file to read first.
The actual review work is done by the presubmit package (Anthropic API calls, ~30 stages, ~$5–10 per full run on a typical manuscript).
What this skill is NOT
- Not a re-implementation of presubmit. It calls the existing CLI; the CLI must be installed.
- Not a replacement for
paper-review-lite. That skill performs the review itself using parallel Claude Code sub-agents (no API key, no per-token cost). This skill activates the heavier standalone tool. Both have a place — see "When to use which" below. - Not for peer-reviewing other people's manuscripts. For that, the user maintains a separate
reviews/workflow with a different agents-basedCLAUDE.md. This skill is for self-audit of your own drafts pre-submission.
Setup phase (run once per machine)
Before any per-paper invocation, the skill must verify the install + config. Use this checklist; only run the steps whose check fails.
Step 1 — Is presubmit installed?
command -v presubmit && presubmit --help | head -3
If the command is found and --help returns the usage banner, presubmit is installed — skip to Step 2.
If not, walk the user through:
# Clone (or update) the repo
git clone https://github.com/scdenney/presubmit ~/Documents/GitHub/resources/presubmit \
|| git -C ~/Documents/GitHub/resources/presubmit pull
cd ~/Documents/GitHub/resources/presubmit
# Create a venv
python3 -m venv .venv
source .venv/bin/activate
# Install — first time pulls marker-pdf + PyTorch, ~5–10 min
pip install -e .
# Force-upgrade past marker-pdf's transitive cap (anthropic 0.46 lacks the `thinking` kwarg)
pip install -U 'anthropic>=0.60'
Confirm install with:
~/Documents/GitHub/resources/presubmit/.venv/bin/presubmit --help | head -3
The CLI lives in the venv. Either source the venv each session (source ~/Documents/GitHub/resources/presubmit/.venv/bin/activate) or invoke the absolute binary path.
On first conversion, marker-pdf will download ~3.3 GB of OCR / layout / table-recognition models to ~/Library/Caches/datalab/models/. Subsequent runs reuse this cache. The download is bandwidth-limited; warn the user.
Step 2 — Is ANTHROPIC_API_KEY set?
[ -n "$ANTHROPIC_API_KEY" ] && case "$ANTHROPIC_API_KEY" in sk-ant-*) echo "key OK";; *) echo "key set but unexpected prefix: ${ANTHROPIC_API_KEY:0:8}…";; esac
If empty, also check whether it's defined in ~/.zshrc but the current shell hasn't sourced it:
eval "$(grep -E '^export ANTHROPIC_API_KEY=' ~/.zshrc | head -1)" 2>/dev/null && [ -n "$ANTHROPIC_API_KEY" ] && case "$ANTHROPIC_API_KEY" in sk-ant-*) echo "found in .zshrc";; esac
If still missing, walk the user through:
-
Generate a key at https://console.anthropic.com/ → Settings → API Keys → Create Key.
-
Add to
~/.zshrc(or equivalent shell rc), placed above any wrapper functions that re-setANTHROPIC_API_KEYto an empty string for routing theclaudeCLI to local Ollama models — those would shadow the real key:export ANTHROPIC_API_KEY="sk-ant-api03-..." -
source ~/.zshrcor open a new terminal. -
Confirm a positive credit balance is on the account — presubmit fails fast on credit/billing 400s rather than burning the retry budget. Empty balance halts the run on the first call.
The key is billed to the user's Anthropic account and is independent of any Claude Code subscription.
Step 3 — Where should outputs live?
Read ~/.config/presubmit/config.json for an existing output_base. If it exists and the path is writable, use it.
If it does not exist, ask the user (use AskUserQuestion):
Where should presubmit reviews be stored by default?
Offer at least these options and one custom path:
~/presubmit-reviews/— generic, no project-folder assumption~/Documents/presubmit/— under Documents~/Documents/GitHub/pre-submission/— for users who keep all repos under~/Documents/GitHub/- Custom path
After the user picks, write the choice to ~/.config/presubmit/config.json:
{
"output_base": "/absolute/path/the/user/picked",
"saved_at": "ISO 8601 timestamp"
}
Also offer to write export PRESUBMIT_OUTPUT_BASE=… to ~/.zshrc so the bare CLI (without this skill) can pick up the same default. Make this offer explicit; do not write to .zshrc without asking.
The config file is the source of truth for this skill; the env var is a convenience for direct CLI invocation.
Per-paper run phase
Once setup is done, every invocation follows the same pattern.
Step 1 — Slug
Read the input filename. Derive a default slug:
- Strip extension and path.
- Lowercase.
- Replace runs of non-alphanumeric characters with single hyphens.
- Trim leading/trailing hyphens.
- Aim for
<lastname>_<year>_<short-title>shape if the filename already follows it.
Example: Denney_2026_What-Were-They-Thinking.pdf → denney_2026_what-were-they-thinking.
Confirm the proposed slug with the user via AskUserQuestion. Allow override.
Step 2 — Mode
Ask which run mode (AskUserQuestion):
- Smoke —
--stop-stage 2.0. Runs metadata extraction + Red Team + numbers auditor. ~15–25 min on a 70-page paper, ~$1–2. Useful for verifying setup or catching show-stopper issues fast. - Standard — full pipeline. ~30–90 min, ~$5–10. The default for a real audit.
- Custom — ask for additional flags (
--code-dir,--math,--supp,--no-copyedit,--no-editor-note,--start-stage,--stop-stage,--skip-size-check).
Step 3 — Construct paths and run
WORK_DIR="$OUTPUT_BASE/$SLUG/presubmit_run"
mkdir -p "$WORK_DIR"
~/Documents/GitHub/resources/presubmit/.venv/bin/presubmit "$PAPER_PATH" \
--work-dir "$WORK_DIR" \
$EXTRA_FLAGS
Run in the background using the Bash tool's run_in_background: true. Stream the log to a file so the user (and you) can check progress separately.
Tell the user: the wall time, where to watch the live log (tail -f instructions), and what files to expect in $WORK_DIR as stages complete.
Step 4 — Report when done
When the background task notifies completion:
- Confirm exit code is 0 and no
FATAL: Claude refusedappears in the log. - Locate the consolidated report — it's the file matching
$WORK_DIR/<slug>_*.txt(presubmit auto-names it<author_title_uuid>.txt). - Report wall time, total tokens (input + output across stages — visible at the end of the log), and the location of the consolidated report.
- Note that cost reports may say
MISSINGuntilpricing.csvis updated for Claude rates — point at the Anthropic console for actual cost. - Offer to open the report (
less/Read) and to write a per-paper README.md alongside the work_dir capturing: invocation date, flags used, models, wall time.
If the run failed:
Messages.create() got an unexpected keyword argument 'thinking'— anthropic SDK is < 0.60. Fix:pip install -U 'anthropic>=0.60'in the venv.FATAL: Claude refused: <stage_name>— a Red Team prompt tripped Claude's