Sd Export logo

Sd Export

Community
cookjohn
sd-export

Export citations from ScienceDirect in RIS, BibTeX, or plain text format. Supports pushing to Zotero.

Overview

Publishercookjohn
Repositorysd-skills
Skill namesd-export
Stars
88
Forks
12
Bundled files
1
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.

  • 1 bundled files

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

  • Open source

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

Installation

Install the Sd Export 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/cookjohn/sd-skills/tree/master/skills/sd-export
  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/cookjohn/sd-skills.git /tmp/sd-skills
mkdir -p .claude/skills
cp -r /tmp/sd-skills/skills/sd-export .claude/skills/sd-export
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sd Export 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 Sd Export 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 Sd Export 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.

ScienceDirect Citation Export

Export article citations from ScienceDirect search results. Supports RIS, BibTeX, plain text, and Zotero push.

Export API

ScienceDirect uses a POST endpoint for citation export:

{BASE_URL}/search/api/export-citations

Parameters (form POST):

FieldDescription
piiArticle PII (e.g. S0957417426005245). Multiple PIIs for batch.
typeExport format: ris, bibtex, text
tSecurity token (must be extracted from the page)

Single Article Export

Step 1: Ensure on search results page

The export API requires a token that exists only on search results pages. If you have a PII but are not on a search results page, first search for the article or navigate back to results.

Note: When navigating to search results, always include initScript to prevent bot detection:

initScript: "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"

Step 2: Click the article's Export button and extract token

Use evaluate_script:

javascript
(pii) => {
  // Find the result item with this PII
  const checkbox = document.getElementById(pii);
  const resultItem = checkbox?.closest('li.ResultItem');
  if (!resultItem) return { error: 'Article with PII ' + pii + ' not found on this page.' };

  // Click the Export button for this result
  const exportBtn = resultItem.querySelector('button[aria-label="Export"]');
  if (exportBtn) exportBtn.click();

  // Wait briefly for the export panel to appear, then extract token
  return new Promise(resolve => {
    setTimeout(() => {
      const form = resultItem.querySelector('.ExportCitationOptions form');
      if (!form) { resolve({ error: 'Export panel did not open.' }); return; }

      const token = form.querySelector('input[name="t"]')?.value || '';
      const formAction = form.action;

      resolve({ token, formAction, pii });
    }, 500);
  });
}

Step 3: Submit export request

Use evaluate_script to submit the form with the desired format:

javascript
(token, pii, format) => {
  // format: 'ris', 'bibtex', or 'text'
  const typeMap = {
    'ris': 'ris',
    'bibtex': 'bibtex',
    'text': 'text',
  };

  const form = document.createElement('form');
  form.method = 'POST';
  form.action = window.location.origin + '/search/api/export-citations';
  form.target = '_blank';

  const fields = { type: typeMap[format] || 'ris', t: token, pii: pii };
  for (const [name, value] of Object.entries(fields)) {
    const input = document.createElement('input');
    input.type = 'hidden';
    input.name = name;
    input.value = value;
    form.appendChild(input);
  }

  document.body.appendChild(form);
  form.submit();
  document.body.removeChild(form);

  return { success: true, format: format, pii: pii };
}

Batch Export

Step 1: On search results page, click the top Export button

Use evaluate_script to select multiple articles and trigger batch export:

javascript
(piis) => {
  // Select all specified articles
  piis.forEach(pii => {
    const cb = document.getElementById(pii);
    if (cb && !cb.checked) cb.click();
  });

  // Click the batch export button
  const exportBtn = document.querySelector('.export-all-link-button');
  if (exportBtn) exportBtn.click();

  return { success: true, selected: piis.length };
}

Then wait for the export dropdown to appear and select the desired format.

Zotero Push

To push citations to a locally running Zotero instance. Two modes are supported:

Prerequisites: Zotero desktop must be running with the Connector API enabled (default on port 23119).

Mode 1: RIS import (simple, no PDF)

Use when you have RIS data from the export API or constructed from metadata.

bash
python {SKILL_DIR}/scripts/push_to_zotero.py --ris-file "{RIS_FILE_PATH}"

Or push RIS content directly:

bash
python {SKILL_DIR}/scripts/push_to_zotero.py --ris-data "{RIS_CONTENT}"

The script uses a deterministic session ID (MD5 hash of content) so:

  • First call → 201 (saved successfully)
  • Repeat call → 409 → treated as success ("already saved, no duplicates")

This avoids the SESSION_EXISTS error that occurs with random session IDs, since Zotero's session cleanup is buggy and sessions persist until restart.

Mode 2: JSON import (structured data with optional PDF attachment)

Use when you have structured paper data (e.g., from sd-paper-detail) and want to attach PDFs.

Save paper data as a JSON file, then run:

bash
python {SKILL_DIR}/scripts/push_to_zotero.py --json "{JSON_FILE_PATH}"

JSON format (single paper or array):

json
{
  "title": "Paper Title",
  "authors": ["Author One", "Author Two"],
  "journal": "Journal Name",
  "date": "2026",
  "doi": "10.1016/...",
  "volume": "76",
  "issue": "3",
  "pages": "109460",
  "abstract": "...",
  "keywords": ["keyword1", "keyword2"],
  "url": "https://www.sciencedirect.com/science/article/pii/{PII}",
  "pdfUrl": "https://www.sciencedirect.com/..../pdfft?md5=...&pid=...",
  "cookies": "cf_clearance=...; JSESSIONID=..."
}

When pdfUrl and cookies are provided, the script will:

  1. Save metadata via /connector/saveItems
  2. Download PDF using the browser cookies
  3. Upload PDF as attachment via /connector/saveAttachment

Listing Zotero collections

bash
python {SKILL_DIR}/scripts/push_to_zotero.py --list

Export Format Buttons on Page

Each result item has these export option buttons (inside .export-options):

Button textdata-aa-button attributeFormat
Save to RefWorkssrp-export-single-refworksRefWorks
Export citation to RISsrp-export-single-risRIS
Export citation to BibTeXsrp-export-single-bibtexBibTeX
Export citation to textsrp-export-single-textPlain text

Notes

  • Authentication required: Export buttons, result checkboxes, and the batch action toolbar are only visible to authenticated users. The user must be logged in (institutional or personal account) for export to work.
  • The security token t is session-specific and page-specific. It must be extracted from the export form on the page.
  • Batch export is much more efficient than exporting one-by-one.
  • For Zotero push, ensure Zotero desktop is running before invoking.
  • If the page shows captcha during export, auto-click the Cloudflare Turnstile checkbox: use take_snapshot to find checkbox "确认您是真人" inside the Turnstile iframe, then click(uid). Wait 3-5s and verify. If auto-click fails after 2 attempts, fall back to asking the user. After solving once, the session cookie persists.

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 Sd Export AI skill do?

Export citations from ScienceDirect in RIS, BibTeX, or plain text format. Supports pushing to Zotero.

Why use Sd Export on TypingMind?

Because you install it once and use it with any model. Sd Export 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 Sd Export in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cookjohn/sd-skills/tree/master/skills/sd-export. 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 Sd Export?

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 Sd Export?

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

Is the Sd Export AI skill free?

It is published on GitHub by cookjohn. Check the repository for licensing terms. 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 👇