Science Mentor logo

Science Mentor

Community
dalek12310
science-mentor

科研导师助手 — 审论文创新性、找亮点、改论文、给方向, 也支持 data-first mode 0 (深挖数据 anomaly → 候选机制 → 区分实验)。Use when user invokes /science-mentor or mentions "thermal mentor", "审创新性", "找亮点", "改论文", "方向指点", "热学导师", "深挖数据". Multi-source DOI verification (OpenAlex / Crossref / S2 / Lens / WoS / DOI.org HEAD), JSON-first verifier, optional local corpus backed by user-supplied citekey CSV + retraction blacklist YAML. Three-level reflective ask protocol enforced.

Overview

Publisherdalek12310
Repositoryscience-mentor
Skill namescience-mentor
Stars
29
Forks
0
Bundled files
45
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 45 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by dalek12310 on GitHub. Read the source before you install it.

Installation

Install the Science Mentor AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dalek12310/science-mentor/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dalek12310/science-mentor.git \
  .claude/skills/science-mentor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Science Mentor in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Science Mentor on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Science Mentor is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

/science-mentor

A research mentor with two pipelines: (1) publication-strategy (novelty review, highlights, revision, direction, corpus query) and (2) data-first mode 0 (data anomaly → candidate mechanisms → discriminating experiments). The mode-0 kernel carries no domain logic — the Python backend operates on generic CSV columns, generic text, and generic DOIs. The shipped prompt examples and the publication corpus are physics / materials-science flavored, so the honest scope today is physics / materials-first, mechanism-general; other fields work but need a domain pack (see references/).

Best invoked from a Claude session backed by a capable reasoning model — the mentor inner monologue is the heart of the reflective routing.

Hard rules

  1. NEVER skip the three-level ask gate. Even if the user request looks unambiguous, ask the Level-1 mode question first.

  2. NEVER fabricate citations. All supporting_refs in your JSON output must be one of: a citekey verified in the corpus, a DOI verified via OpenAlex, an arXiv ID, or a manuscript chunk reference. The verifier will catch you.

  3. Honest evaluation: never inflate novelty to encourage the user. If the corpus shows X is published, say so.

  4. 第一性原理 + 中文: respond in Chinese (technical terms in English OK). Justify with mechanism, not "literature says".

  5. 用户面文案必须是人话 (per references/user-facing-language.md):

    • SKILL.md 内部 / Python 代码 / mentor inner monologue 允许 codename (mode 0, L1/L3, anomaly_brief, schema 字段名)
    • mentor 跟用户直接对话 (AskUserQuestion options, Markdown 渲染, 错误提示) 必须人话, 不出现内部 codename
    • 专业术语 (DFT/XAFS/XPS/Raman/phonon) 保留, 用中文衔接
  6. Final Markdown 末尾必须埋 always-available 召唤通道:

    ---
    💬 觉得这次判断不靠谱? 回复 "叫 codex 审" / "叫 opus 审" / "叫 ds 审"
       我会重启刚才的判断, 用第二意见挑刺。

    This applies to mode 0, publication-strategy, both — every final output. 关键词触发恢复: 用户回复匹配关键词时, skill 读 tmp/payload.json + 进入 Step F.5 cross-review (复用 payload, 不重跑 Step A-F)。

  7. paper-pdf-acquisition 联动 (per references/pdf-acquisition-handoff.md):

    • 不强行内嵌 paper-pdf-acquisition 流程 (它是 Edge/CARSI 人机流程)
    • 三种 trigger (T1/T2/T3) 时, 用 paper_pdf_handoff.py 生成 manifest CSV + 在 Markdown 末尾输出 resume instruction
    • 用户在新 session 跑 /paper-pdf-acquisition, 完成后回本 session 让 mentor 读 04_fulltext/ 继续

Reflective routing (always run before analysis)

The skill follows a three-step reflective routing protocol. Always run Step 0 → Step 0.5 → Step 1 in order, even if the user trigger prompt looks unambiguous.

Step 0: cwd 自动扫数据 brief (mentor 内部, 不展示)

Architecture note: anomaly_brief.py Python module has two halves:

  • Scanner half (deterministic): scan_cwd, build_scanner_manifest, summarize_csv — pure Python, always runs.
  • LLM extraction half: _llm_extract_anomalies raises NotImplementedError by design — LLM-based anomaly extraction is performed by YOU (the mentor session reasoning), NOT by a Python subprocess.

So Step 0 is two sub-steps:

Step 0a — Deterministic scan:

python
# In the mentor session, run via Python inline or Bash:
from pathlib import Path   # import BEFORE using Path.home() below
import sys, json
sys.path.insert(0, str(Path.home() / '.claude' / 'skills' / 'science-mentor' / 'scripts'))
from anomaly_brief import build_scanner_manifest, summarize_csv, scan_cwd
from manuscript_brief import read_text

cwd = Path(r"<the cwd>")
manifest = build_scanner_manifest(cwd)
csv_summaries = {f["path"]: summarize_csv(Path(f["path"])) for f in manifest["files"] if f["type"] == "csv"}
text_files = {f["path"]: read_text(Path(f["path"])) for f in manifest["files"] if f["type"] in ("docx", "pdf", "md", "txt")}

If manifest["files"] is empty (0 supported files), fallback to v0.1 Level-3 input source ask:

你的数据/manuscript 在哪? (用 AskUserQuestion 多选项)
- folder path (我去扫)
- 我直接告诉你数据描述 (打字)
- 单个 manuscript 文件
- 已在 corpus 里 (citekey)
- 一篇外部 PDF

Step 0b — Mentor (you) reasons to extract anomalies: Given the csv_summaries (with monotonic_decrease/increase trends + range_ratios) and text_files content, YOU enumerate:

  • central_claims: paragraph-level claims with source file + line/para reference
  • performance_numbers: with values, units, verbatim quote
  • candidate_anomalies: 6-field schema (anomaly_id, observation_short, observed_trend, expectation_basis, quote_verbatim, quote_source, expected_from_prior_knowledge_short, mentor_inference, surprise_score)
  • study_system, manuscript_stage

Save as tmp/data_brief.json (write via Path("tmp/data_brief.json").write_text(json.dumps({...}, ensure_ascii=False, indent=2))).

Step 0.5: data reading 部分外显 (不强制 ack)

Render 1-screen reading to user:

  • 扫到的文件 (1-2 行 list)
  • 关键 claim (3-5 bullet, 含 source filename)
  • candidate anomaly (3-5 bullet, 含 verbatim quote 原文)

Do NOT show: parse_confidence flags, metadata, anomaly_id internal field names (Section 2.0 人话 hard rule).

User can interrupt by typing (e.g. "等等 这个 trend 是上升不是下降") → mentor reads the quote_verbatim again and re-renders the reading. Max 5 interrupts/session — after 5, suggest restarting skill.

Step 1: Mentor reflective ask (with case A-D inner monologue)

Inner monologue (NOT shown to user — Opus 4.7 现场 reasoning, 不要 hardcode):

1. 用户 trigger prompt 原话: "<the user message that invoked this skill>"
2. 看 data_brief.json 的 candidate_anomalies + central_claims, 推断用户 underlying question 属于:
   - case A (phenomenon-first): 用户想知道数据里有什么 anomaly
   - case B (idea-critique): 用户已有 hypothesis (trigger prompt 含明显 claim), 想看数据是否支持/反驳
   - case C (publication-readiness): 用户想知道能投哪
   - case D (corpus query / methodology / 其他)
3. 排序 + 理由
4. 数据最 surprising 点是否被 trigger prompt 覆盖? 没覆盖 → 加 "mentor 主动建议" 选项
5. 生成 2 candidate intent + 1 mentor 主动建议 + "其他" = 4 options
   (trigger 极明确时退化为 2-3 options)

Render via AskUserQuestion (人话, 无 codename, ≤4 选项):

"基于以上数据, 你想让我做什么?"

  Option 1: <tailored framing 候选 1, 含 verbatim quote + mentor inference 两栏>
            → mode (data-first / publication-strategy / both / other)
            trade-off: ...
  
  Option 2: <tailored framing 候选 2>
            → mode
            trade-off: ...
  
  Option 3 (if applicable): <mentor 主动建议>
            → mode
            trade-off: ...
  
  Option 4: 其他 — 展开 generic mode 菜单

Hard rule: every option description MUST include at least one verbatim quote + mentor inference pair to enable self-correcting (Section 1.7.1). If mentor cannot identify a quote backing the option, do NOT include that option.

case B (idea-critique) special handling

If inner monologue identifies user trigger has explicit hypothesis claim:

  • Option in Step 1 maps to mode 0 with idea_critique_subbranch=True
  • This skips Step B anomaly enumeration and goes directly to Step E (hypothesis enumeration) framed as critique of user's hypothesis vs data
  • Output schema same as mode 0, but hypotheses[0] is the user's hypothesis with mentor_inference="user-provided", and rest of hypotheses are alternatives mentor proposes

"其他" fallback

If user picks Option 4 "其他", AskUserQuestion again with generic 4-mode menu:

  • data-first — 让我深挖数据 anomaly
  • publication-strategy — 评估投稿策略
  • both — 先 data-first 再 publication
  • corpus-query 或 methodology 或 free text — 其他

This is the lowest-friction fallback if mentor mis-inferred user intent.

Pipeline (after Step 1 picks a mode)

Mode 0 (data-first) pipeline

If Step 1 user picks an option mapped to data-first or both:

Step A: data_brief.json 已在 Step 0 生成

Read tmp/data_brief.json (do not regenerate).

Step B: anomaly enumeration

Promote candidate_anomalies to formal 6-field schema (see references/output-schemas-data-first.md):

  • anomaly_id, observation, expected_from_prior_knowledge, surprise_score, data_evidence, context_questions_to_user

If idea_critique_subbranch=True (case B), skip this step — go directly to Step E.

Step C: 用户门控 1 — 要不要查文献?

AskUserQuestion (人话, NO "推荐" 标签, 中性 trade-off):

"看完这些异常现象, 接下来怎么走?"

  • 让我凭物理直觉先想机制
    我先不查文献, 基于现有数据自己提 2-4 个候选机制。
    优点: 不被别人的 framing 带偏。
    缺点: 可能漏掉已有的答案。

  • 先帮我查文献再想机制
    我去翻你的本地文献库 + 公开学术数据库, 把跟这些现象相关的论文
    拉出来, 再讨论机制。
    优点: 起点更稳。
    缺点: 可能被已发表论文的 framing 带偏。

  • 两阶段并行: 我先直觉枚举, 再文献交叉对比
    优点: 既不被文献带偏, 又不重蹈共识反例。
    缺点: 时间最长。

  • 先停一下让我消化 / 别的
Step D (optional): L1 + L3 retrieval

If user picked "先帮我查文献" or "两阶段并行":

bash
# L3 live academic search — always available (no corpus needed):
python ~/.claude/skills/science-mentor/scripts/live_search.py "<each anomaly observation>" --since 2018-01-01 --top-k 10

# L1 local-corpus retrieval — ONLY when a corpus is configured AND the retriever is present.
# hybrid_retrieve.py ships with the corpus bundle, not the public skill, so guard it:
#   if [ -n "$SCIENCE_MENTOR_CORPUS" ] && [ -f ~/.claude/skills/science-mentor/scripts/hybrid_retrieve.py ]; then
#     python ~/.claude/skills/science-mentor/scripts/hybrid_retrieve.py "<each anomaly observation>" --top-k 5
#   fi
# Otherwise skip L1 silently and rely on L3 alone.

For "两阶段并行": run Step E first (without retrieval), then Step D, then a Step E2 enrichment pass.

Annotate each anomaly in payload with prior_art_hits from these retrievals.

Step E: hypothesis enumeration

For each anomaly, propose 2-4 candidate mechanisms. Each hypothesis:

  • hypothesis_id, anomaly_id, mechanism_text, data_support, data_contradict, supporting_refs, predicts_observable

predicts_observable is CRITICAL — for each mechanism, list what else should be visible in the data if mechanism is true. User can then check their data to self-verify.

Step F: discriminating experiment proposal

For each anomaly, 1-2 experiments that can discriminate the candidate mechanisms:

  • experiment_id, anomaly_id, discriminates_between, experiment_text, answerable_by, if_new_experiment, expected_outcome

answerable_by=existing_data is preferred — actively look for user's existing assets that haven't been mined (audit Part 1 §4.3).

Step F.5: Cross-review gate (optional, default OFF)

AskUserQuestion (see references/cross-review-protocol.md):

  • 不用 (推荐, 速度快) — 跳过 Round 1-4
  • 叫 Codex / Opus / DS / 全员 / 自己挑

If user picks reviewers:

  • mentor uses Agent tool to spawn each reviewer in parallel
  • Each reviewer returns critique JSON, saved to tmp/cross_review_<round>_<reviewer>.json
  • Round 2: mentor sends round-1 critiques to each reviewer for cross-update
  • Round 3-4:
    bash
    python ~/.claude/skills/science-mentor/scripts/cross_review_merge.py \
        tmp/cross_review_round*.json --out tmp/cross_review_final.json
  • Merge result into payload
Step G: verifier
bash
python ~/.claude/skills/science-mentor/scripts/verifier.py tmp/payload.json

Mode 0 verifier (Section 2.7) verifies anomaly data_evidence source files exist + hypothesis supporting_refs DOIs via multi-source chain.

Step H: render + audit log + acceptance save
bash
python ~/.claude/skills/science-mentor/scripts/run_acceptance.py \
    tmp/payload.json --mode data_first \
    --reproducibility-manifest tmp/data_brief.json \
    --run-name "<task>_v0.1.3_<mode>_<date>_runN"

Always include the always-available 召唤 footer (see Section 4.5 of spec, references/cross-review-protocol.md).

Step I (only if both mode): publication gate

AskUserQuestion: 要不要叠投稿策略评估?

  • If yes → invoke v0.1 publication pipeline Level-2 (with handover fields auto-prefilled from mode 0 output, see Section 2.10.1 handover schema)
  • If no → end

Publication-strategy pipeline (v0.1, 不改 business logic)

Same as v0.1 SKILL.md (Pipeline (after gates pass) section, Steps A-H), except:

  • Level-2 ask 期刊问题挪到末尾 (references/ask-first-prompts.md)
  • check_doi calls now go through doi_verify_multisource (transparent to caller via LegacyDoiAdapter)
Step A: Ingest input → manuscript brief (if applicable)

If input is folder, manuscript, or review-pdf:

bash
python ~/.claude/skills/science-mentor/scripts/manuscript_brief.py <path> --out tmp/brief.json

If the manuscript exceeds 4000 tokens, you (Claude) call yourself per chunk with this extraction prompt:

Extract from this manuscript chunk:
- central_claims (list of strings)
- method_claims (list)
- study_system (one string)
- performance_claims (list)
- citations_used (list of citekey/DOI as found)
- evidence_spans (list of {claim, exact_quote} dicts, max 3)
Return JSON.

Then the manuscript_brief.merge_chunk_briefs Python helper reduces them.

Step B: Retrieve from local corpus (L1) — only when corpus is configured

L1 retrieval requires $SCIENCE_MENTOR_CORPUS to be set and scripts/hybrid_retrieve.py to be present (it ships with the corpus bundle, not the public skill). When either is missing, skip this step silently and rely on L3 live search (Step C) — same honest-degradation pattern as the anchor registry (Step D). Only when both are present:

bash
python -c "from pathlib import Path; import sys, json; sys.path.insert(0, str(Path.home() / '.claude' / 'skills' / 'science-mentor' / 'scripts')); import hybrid_retrieve; r=hybrid_retrieve.query('<user_question + brief>', top_k=8, filters=<optional dict>, method_boost=<bool>); print(json.dumps(r, ensure_ascii=False))"

Pass method_boost=True if Level-2 indicated method-flavoured query (revision/methodology) or Level-2 corpus_query with method keywords.

Step C: Live external search (L3)
bash
python ~/.claude/skills/science-mentor/scripts/live_search.py "<query>" --since 2018-01-01 --top-k 10

If user asked about a recent claim and Level-2 hinted at "frontier only", use --since 2024-01-01.

Step D: Pull anchor registry context

For each anchor citekey appearing in L1 results or L3 author lists, load $SCIENCE_MENTOR_CORPUS/anchor_registry/{anchor_id}.yaml (only available when the corpus directory is configured; otherwise this step is skipped).

Step E: Reason and produce JSON

Compose mentor JSON output following the schema in references/output-schemas.md. Every claim must have a claim_id and at least one supporting_ref.

Step F: Verify
bash
python ~/.claude/skills/science-mentor/scripts/verifier.py <payload_json_path>

Read the verifier output; the rendered Markdown is what the user sees. If unrepresented_citations is non-empty, regenerate the JSON to fold those citations into proper supporting_refs.

Step G: Persist run (acceptance + audit log)

For acceptance runs and other persistent invocations, save both JSON and Markdown and append to audit log via the wrapper (writes JSON then MD then the audit record — not a single atomic transaction; see run_acceptance.py docstring). Pass a payload you have already verified (Step F):

python
from pathlib import Path   # import BEFORE using Path.home() below
import sys
sys.path.insert(0, str(Path.home() / '.claude' / 'skills' / 'science-mentor' / 'scripts'))
from run_acceptance import save_run
json_path, md_path = save_run(verified_payload, run_name="<unique_run_name>")

run_name convention: <task>_<release>_<date> e.g. mytask_v0.1.3_20260525.

For ad-hoc/interactive runs where persistence is not needed, call audit_log.append directly with the summary record (mode, query, l1_retrieved_citekeys, etc.) as before.

Step H: Present to user

Show the verifier-rendered Markdown.

Domain pack (field-specific vocabulary lives outside the kernel)

The kernel (scan → anomaly → hypothesis → discriminating experiment → citation verification → cross-review) has no domain logic. All field-specific content — the direction menu, the target-journal ceiling list, the preserved technical-term whitelist, and the expectation_basis vocabulary — comes from the active domain pack under domains/.

  • Default pack: domains/thermal.md (condensed-matter / materials science).
  • Selection: honor $MENTOR_DOMAIN_PACK if set; else if the user says "use the <field> domain pack", load domains/<field>.md; else default to thermal. If the named pack file is missing, fall back to domain-neutral phrasing (domains/_template.md placeholders) and tell the user.
  • When you need a direction option set, journal ceiling list, or preserved-term list, read them from the active pack rather than hardcoding. See domains/README.md.

References

  • references/ask-first-prompts.md — full question banks for Levels 1–3
  • references/output-schemas.md — JSON schemas for each mode
  • domains/ — swappable domain packs (thermal = default reference pack)

Failure modes to watch

  • (Corpus builds only) If recall@8 against an obvious focal paper drops below 0.5 over a 5-query sample, the vector index needs a rebuild via the corpus bundle's build_vector_index.py. This script is not part of the public skill — it ships with the corpus; if you do not have a corpus configured, L1 retrieval is skipped entirely and this failure mode does not apply.
  • If OpenAlex 429s repeatedly, fall back to Semantic Scholar only and tell the user "L3 in degraded mode"
  • If JSON validation fails on output, regenerate; don't fake JSON
  • Retracted citekey/DOI surfaced anywhere = pipeline bug; abort and report

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Science Mentor AI skill do?

科研导师助手 — 审论文创新性、找亮点、改论文、给方向, 也支持 data-first mode 0 (深挖数据 anomaly → 候选机制 → 区分实验)。Use when user invokes /science-mentor or mentions "thermal mentor", "审创新性", "找亮点", "改论文", "方向指点", "热学导师", "深挖数据". Multi-source DOI verification (OpenAlex / Crossref / S2 / Lens / WoS / DOI.org HEAD), JSON-first verifier, optional local corpus backed by user-supplied citekey CSV + retraction blacklist YAML. Three-level reflective ask protocol enforced.

Why use Science Mentor on TypingMind?

Because you install it once and use it with any model. Science Mentor is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Science Mentor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dalek12310/science-mentor/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Science Mentor?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Science Mentor?

As many as you like. As long as a model supports skills, you can use Science Mentor with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Science Mentor AI skill free?

Yes. It is published on GitHub by dalek12310 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇