← 返回 Skills 市场
agents365-ai

figshare-skill

作者 Agents365.ai · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
93
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install figshare-skill
功能描述
Use whenever the user wants to interact with Figshare - searching public datasets/articles, downloading Figshare files, listing their own articles/collection...
使用说明 (SKILL.md)

Figshare Skill

Interact with the Figshare v2 REST API to search, download, create, and upload research outputs.

Prerequisites

  • curl and jq available on PATH.

  • For authenticated endpoints (anything under /account/... or uploads), a personal token from https://figshare.com/account/applications exported as:

    export FIGSHARE_TOKEN=xxxxxxxxxxxxxxxx
    
  • Public endpoints (search, public articles, downloads) need no token.

Always confirm with the user before creating, modifying, publishing, or deleting anything on their account — these are hard to reverse.

API Basics

  • Base URL: https://api.figshare.com/v2
  • Auth header: Authorization: token $FIGSHARE_TOKEN
  • Content-Type: application/json for POST/PUT bodies
  • Rate limit: keep it under ~1 request/second to avoid abuse throttling
  • Errors: JSON body with message, code; common codes 400/401/403/404/422

Common Recipes

Search public articles

curl -s -X POST https://api.figshare.com/v2/articles/search \
  -H "Content-Type: application/json" \
  -d '{"search_for": ":title: single cell", "page_size": 20}' | jq

Field operators: :title:, :author:, :tag:, :category:, :doi:, :resource_doi:.

Get a public article (by ID or DOI)

curl -s https://api.figshare.com/v2/articles/{article_id} | jq
# or resolve from a figshare.com URL: the numeric tail is the article_id

Download all files from a public article

ART=12345678
curl -s https://api.figshare.com/v2/articles/$ART/files \
  | jq -r '.[] | "\(.download_url)	\(.name)"' \
  | while IFS=$'	' read -r url name; do curl -L -o "$name" "$url"; done

List your own articles

curl -s -H "Authorization: token $FIGSHARE_TOKEN" \
  "https://api.figshare.com/v2/account/articles?page=1&page_size=50" | jq

Create an article (draft)

curl -s -X POST https://api.figshare.com/v2/account/articles \
  -H "Authorization: token $FIGSHARE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My dataset",
    "description": "Full description here.",
    "defined_type": "dataset",
    "tags": ["demo"],
    "categories": [2]
  }' | jq

Response is { "location": ".../account/articles/{id}", "entity_id": 123 }.

Update / publish an article

# update metadata
curl -s -X PUT https://api.figshare.com/v2/account/articles/$ART \
  -H "Authorization: token $FIGSHARE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "New title"}'

# publish (becomes public, assigns DOI, version is frozen)
curl -s -X POST https://api.figshare.com/v2/account/articles/$ART/publish \
  -H "Authorization: token $FIGSHARE_TOKEN"

Always ask before publishing — it's permanent for that version.

Collections & projects

# create collection that groups existing articles
curl -s -X POST https://api.figshare.com/v2/account/collections \
  -H "Authorization: token $FIGSHARE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "My Collection", "articles": [123, 456]}'

# create project
curl -s -X POST https://api.figshare.com/v2/account/projects \
  -H "Authorization: token $FIGSHARE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "Research Project"}'

Uploading Files (Multi-part Flow)

Figshare uploads are 3-step: initiate → PUT each part → complete. Use the bundled helpers for anything non-trivial:

# upload a file to an existing draft article
./scripts/upload.sh \x3Carticle_id> \x3Cpath/to/file>

# batch-download every file from a public article (accepts id or figshare.com URL)
./scripts/download.sh \x3Carticle_id_or_url> [output_dir]

# reserve + upload + publish a new version of an already-published article
./scripts/new-version.sh \x3Carticle_id> \x3Cpath/to/file>

The raw flow, in case you need to adapt it:

  1. Initiate — compute md5 + size, POST to article:

    SIZE=$(stat -f%z "$FILE" 2>/dev/null || stat -c%s "$FILE")
    MD5=$(md5sum "$FILE" | awk '{print $1}')   # or: md5 -q on macOS
    curl -s -X POST https://api.figshare.com/v2/account/articles/$ART/files \
      -H "Authorization: token $FIGSHARE_TOKEN" \
      -H "Content-Type: application/json" \
      -d "{\"md5\":\"$MD5\",\"name\":\"$(basename $FILE)\",\"size\":$SIZE}"
    

    Response has location pointing at /account/articles/$ART/files/$FILE_ID.

  2. Fetch upload info from that file record — it contains an upload_url. GET the upload_url to learn the part layout (parts: [{partNo, startOffset, endOffset}]).

  3. Upload parts — for each part, PUT the byte range to ${upload_url}/${partNo}:

    dd if="$FILE" bs=1 skip=$START count=$((END-START+1)) 2>/dev/null \
      | curl -s -X PUT --data-binary @- "${upload_url}/${partNo}" \
        -H "Authorization: token $FIGSHARE_TOKEN"
    
  4. Complete — POST to the file record to finalize:

    curl -s -X POST https://api.figshare.com/v2/account/articles/$ART/files/$FILE_ID \
      -H "Authorization: token $FIGSHARE_TOKEN"
    

Why three steps: Figshare streams large files through a separate upload service. Skipping the complete call leaves the file in a pending state and it won't appear on the article.

Pagination

Most list endpoints accept either page+page_size or limit+offset. Max page_size is typically 1000. For large harvests, loop until an empty page:

page=1
while :; do
  out=$(curl -s "https://api.figshare.com/v2/articles?page=$page&page_size=100")
  [ "$(echo "$out" | jq 'length')" = "0" ] && break
  echo "$out" | jq -c '.[]'
  page=$((page+1))
  sleep 1
done

Troubleshooting

  • 401 — token missing/expired; re-check $FIGSHARE_TOKEN.
  • 403 on /account/... — token lacks the needed scope; regenerate with full permissions.
  • 422 on article create — missing required field (usually title) or bad categories/defined_type.
  • Upload parts mismatch — md5 or size in step 1 didn't match the bytes actually uploaded; recompute and restart.
  • Published article won't update — publishing freezes a version; create a new version instead.

References

安全使用建议
This skill appears to do what it says (Figshare search, download, upload), but the metadata omitted the single required env var FIGSHARE_TOKEN while the SKILL.md and all scripts require it. Before installing: (1) inspect the included scripts (upload.sh, new-version.sh, download.sh) — they run curl/jq, read files, and will write downloads to disk; (2) only provide a Figshare personal token with the minimum needed scope and consider using a revocable test token; (3) confirm the agent prompts you before publishing/publishing new versions (SKILL.md says to ask, but verify the agent enforces it); (4) if you maintain the registry entry, ask the author to update metadata to declare FIGSHARE_TOKEN so the requirement is explicit. If you cannot review the scripts yourself, run the skill in a sandboxed environment or refrain from supplying production credentials.
能力标签
cryptocan-make-purchases
能力评估
Purpose & Capability
Name, description, and included scripts align with Figshare API operations (search, download, create/update/publish, multi-part uploads). The helper scripts and SKILL.md use the Figshare v2 REST API as advertised — capability is coherent with purpose.
Instruction Scope
SKILL.md gives explicit curl/jq recipes and the scripts perform expected actions (download to disk, stat files, compute md5, chunk with dd, PUT parts). The runtime instructions correctly require explicit user confirmation before destructive actions. These instructions do read local files (for uploads) and use an auth token — which is appropriate for the described upload/account flows.
Install Mechanism
This is an instruction-only skill with bundled shell scripts; there is no network-based install or third-party package download that would introduce extra code. Installation directions are simple git clones to user skill directories.
Credentials
The registry metadata lists no required environment variables, but SKILL.md and all helper scripts explicitly require FIGSHARE_TOKEN (and enforce it). The skill will read and use a personal Figshare token from the environment; that credential is appropriate for the stated functionality but must be declared up front. The metadata omission is an incoherence that could lead users to supply a token without realizing the skill will use it, increasing risk of accidental credential exposure or misuse.
Persistence & Privilege
The skill is not always-enabled and uses default autonomous-invocation behavior. It does not request or attempt to modify other skills or system-wide settings. Helper scripts write downloaded files to the current/output directory as expected.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install figshare-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /figshare-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release: search, batch download, multi-part upload, new-version publishing
元数据
Slug figshare-skill
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

figshare-skill 是什么?

Use whenever the user wants to interact with Figshare - searching public datasets/articles, downloading Figshare files, listing their own articles/collection... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 93 次。

如何安装 figshare-skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install figshare-skill」即可一键安装,无需额外配置。

figshare-skill 是免费的吗?

是的,figshare-skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

figshare-skill 支持哪些平台?

figshare-skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 figshare-skill?

由 Agents365.ai(@agents365-ai)开发并维护,当前版本 v0.1.0。

💬 留言讨论