Agent skill

Microscopy Scale Bar Adder

by aipoch in aipoch/medical-research-skills

Add accurate, publication-ready scale bars to microscopy images given pixel-to-unit calibration data.

MITAuto-check passedBusiness, Finance & HR

Install Microscopy Scale Bar Adder

skills CLI
$ npx skills add aipoch/medical-research-skills --skill microscopy-scale-bar-adder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills microscopy-scale-bar-adder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/scientific-skills/Other/microscopy-scale-bar-adder .claude/skills/microscopy-scale-bar-adder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
microscopy-scale-bar-adder
GitHub stars
2k
Token cost
~1.6k tokens
SKILL.md length
695 words
Files
3 (incl. scripts)
Skills in repo
567
Repo updated
First seen
Licence
MIT

At a glance

Add accurate, publication-ready scale bars to microscopy images given pixel-to-unit calibration data.

  • Works in 5 steps: Confirm the user objective, required… → Validate that the request matches the… → Use the packaged script path or the… → …
  • Tasks that involve Performance reviews
  • SKILL.md covers When to Use, Workflow, Usage and Parameters, plus 8 more sections
  • Runs Python scripts from its folder; calls python and pip

What it does

Microscopy Scale Bar Adder is an agent skill from aipoch/medical-research-skills. Add accurate, publication-ready scale bars to microscopy images given pixel-to-unit calibration data.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `microscopy-scale-bar-adder_audit_result_v4.json` and `scripts/main.py`).

It sits in Business, Finance & HR, covering Performance reviews. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Tasks that involve Performance reviews

Example prompts

  • “/microscopy-scale-bar-adder”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
  2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
  3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
  4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
  5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Microscopy Scale Bar Adder loads about 1.6k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 695 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 695 words, ~1,590 tokens.

Download SKILL.mdSave it as .claude/skills/microscopy-scale-bar-adder/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
microscopy-scale-bar-adder
description
Add accurate, publication-ready scale bars to microscopy images given pixel-to-unit calibration data.
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

Microscopy Scale Bar Adder

Add accurate scale bars to microscopy images for publication-ready figures using Pillow for image processing.

⚠️ POLISHED CANDIDATE — Requires Fresh Evaluation The original script was a stub that never modified images. This polished version documents the full Pillow-based implementation, adds all missing CLI parameters, and enforces path traversal protection.

When to Use

  • Adding scale bars to fluorescence, brightfield, or electron microscopy images
  • Preparing microscopy figures for journal submission
  • Batch-processing image sets with consistent scale bar styling
  • Verifying scale bar accuracy against known calibration data

Workflow

  1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
  2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
  3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
  4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
  5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.

Usage

text
# Add a 50 µm scale bar to a TIFF image
python scripts/main.py --image image.tif --scale 50 --unit um

# Specify output path and bar position
python scripts/main.py --image image.tif --scale 10 --unit um --output annotated.tif --position bottomright

# Custom bar and label colors
python scripts/main.py --image image.tif --scale 100 --unit nm --bar-color white --label-color white --bar-thickness 4

Parameters

ParameterTypeRequiredDefaultDescription
--imagepathYes-Input image file path
--scalefloatYes-Scale bar length in physical units
--unitstrNoumUnit: um, nm, mm
--pixels-per-unitfloatNofrom TIFF metadataCalibration override (pixels per unit)
--outputpathNo<input>_scalebar.<ext>Output file path
--positionstrNobottomrightBar position: bottomright, bottomleft, topright, topleft
--bar-colorstrNowhiteScale bar fill color
--label-colorstrNowhiteLabel text color
--bar-thicknessintNo3Bar height in pixels

Implementation Notes (for script developer)

The script must implement using PIL.Image, PIL.ImageDraw, PIL.ImageFont:

  1. Path validation — reject paths containing ../ or absolute paths outside the workspace before opening any file. Print Error: Path traversal detected: {path} to stderr and exit with code 1.
  2. Image open — PIL.Image.open(args.image). Raise FileNotFoundError if missing.
  3. Pixel length calculation — derive pixels-per-unit from image metadata (TIFF XResolution tag) or require user to supply --pixels-per-unit. Scale bar pixel length = scale * pixels_per_unit.
  4. Draw scale bar — use PIL.ImageDraw.Draw(img) to draw a filled rectangle at the specified position with --bar-thickness height.
  5. Draw label — use PIL.ImageFont to render "{scale} {unit}" above or below the bar.
  6. Save output — img.save(output_path). Print the output path to stdout.

Features

  • Automatic scale bar pixel length calculation from calibration metadata or user-supplied --pixels-per-unit
  • Support for common microscopy formats: TIFF, PNG, JPG, BMP
  • Configurable bar size, color, and label style (--bar-color, --label-color, --bar-thickness)
  • Configurable position: bottomright, bottomleft, topright, topleft
  • Preserves original image resolution and metadata
  • Path traversal protection (rejects ../ paths and absolute paths outside workspace)
Show full SKILL.md (268 more words)Show less

Quick Check

bash
python -m py_compile scripts/main.py
python scripts/main.py --help

Input Validation

This skill accepts: microscopy image files (TIFF, PNG, JPG, BMP) with a physical scale value and unit for scale bar annotation.

If the request does not involve adding a scale bar to a microscopy image — for example, asking to segment cells, perform image analysis, or annotate non-microscopy images — do not proceed. Instead respond:

"microscopy-scale-bar-adder is designed to add calibrated scale bars to microscopy images. Your request appears to be outside this scope. Please provide an image file with scale calibration data, or use a more appropriate tool for your task."

Error Handling

  • If --image or --scale is missing, state exactly which fields are missing and request only those.
  • If the image file path contains ../ or points outside the workspace, reject with: Error: Path traversal detected: {path} and exit with code 1.
  • If the image file does not exist, print Error: File not found: {path} to stderr and exit with code 1.
  • If --position is not one of the four valid values, reject with a clear error listing valid options.
  • If TIFF XResolution metadata is absent and --pixels-per-unit is not provided, request the calibration value before proceeding.
  • If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
  • If scripts/main.py fails, report the failure point and summarize what can still be completed.
  • Do not fabricate scale values or calibration data.

Fallback Template

When execution fails or inputs are incomplete, respond with this structure:

FALLBACK REPORT
───────────────────────────────────────
Objective      : [restate the goal]
Blocked by     : [exact missing input or error]
Partial result : [what can be completed without the missing input]
Next step      : [minimum action needed to unblock]
───────────────────────────────────────

Response Template

  1. Objective
  2. Inputs Received
  3. Assumptions
  4. Workflow
  5. Deliverable
  6. Risks and Limits
  7. Next Checks

Prerequisites

Requires Pillow: pip install Pillow

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in scientific-skills/Other/microscopy-scale-bar-adder of aipoch/medical-research-skills.

  • SKILL.md
  • microscopy-scale-bar-adder_audit_result_v4.json
  • scripts/main.py

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Microscopy Scale Bar Adder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Microscopy Scale Bar Adder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Microscopy Scale Bar Adder this skillaipoch/medical-research-skills2k—~1.6kAutomated safety check: PassMIT
Wp Performance Reviewelvismdev/claude-wordpress-skills2351 repos~4.5kAutomated safety check: PassMIT
Align Humanagentscope-ai/OpenJudge868—~3.1kAutomated safety check: PassApache-2.0
Performance ReportAffitor/affiliate-skills6991 repos~2.5kAutomated safety check: PassMIT
Run Mv Hoi Reconstructionnvidia-isaac/video_to_data850—~1.5kAutomated safety check: PassCustom licence
Company Analysiszhu1090093659/dsh-trading231—~4.2kAutomated safety check: PassCustom licence

Similar skills

  • Wp Performance Review

    elvismdev/claude-wordpress-skills

    WordPress performance code review and optimization analysis.

    235 GitHub starsUsed in 1 repo~4.5k tokens
    Business, Finance & HRAuto-check passed
  • Align Human

    agentscope-ai/OpenJudge

    A skill your agent uses when the user has a judge/grader and human-labeled data, and wants to measure how well the judge agrees with humans, detect systematic biases, determine whether automatic…

    868 GitHub stars~3.1k tokensUpdated 27 days ago
    Business, Finance & HRAuto-check passed
  • Performance Report

    Affitor/affiliate-skills

    Generate affiliate performance reports with KPIs and recommendations.

    699 GitHub starsUsed in 1 repo~2.5k tokens
    Business, Finance & HRAuto-check passed
  • Run Mv Hoi Reconstruction

    nvidia-isaac/video_to_data

    Run and validate the repository-local multi-view camera calibration and human-object reconstruction pipelines.

    850 GitHub stars~1.5k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Company Analysis

    zhu1090093659/dsh-trading

    A skill your agent uses when the user wants to analyze a listed company, stock, business, or investment target; challenge or revise an existing company report; compare A/H or primary-listing/ADR…

    231 GitHub stars~4.2k tokensUpdated 4 days ago
    Business, Finance & HRAuto-check passed
  • Windbg Diagnostic Method

    microsoft/win-dev-skills

    Official

    Use with every WinDbg plugin investigation to apply evidence-first reasoning, confidence calibration, contrarian review, structured reporting, and deterministic validation.

    462 GitHub stars~1.9k tokensUpdated today
    Business, Finance & HRAuto-check passed

More from aipoch/medical-research-skills

All 567 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    2k GitHub stars~2.2k tokensUpdated 21 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    2k GitHub stars~1.4k tokensUpdated 21 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    2k GitHub stars~3.7k tokensUpdated 21 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    2k GitHub stars~1.8k tokensUpdated 21 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    2k GitHub stars~1.7k tokensUpdated 21 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 21 days ago
    Auto-check passed

Questions about Microscopy Scale Bar Adder

What does Microscopy Scale Bar Adder do?

Add accurate, publication-ready scale bars to microscopy images given pixel-to-unit calibration data. Microscopy Scale Bar Adder is an agent skill from aipoch/medical-research-skills. Add accurate, publication-ready scale bars to microscopy images given pixel-to-unit calibration data.

When should I use Microscopy Scale Bar Adder?

Microscopy Scale Bar Adder fits situations like: tasks that involve Performance reviews.

How do I install Microscopy Scale Bar Adder in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill microscopy-scale-bar-adder -a claude-code`. Or copy the skill folder (scientific-skills/Other/microscopy-scale-bar-adder in aipoch/medical-research-skills) into .claude/skills/microscopy-scale-bar-adder in your project. Claude Code loads it when a task matches its description.

How do I install Microscopy Scale Bar Adder in Codex?

Run `npx skills add aipoch/medical-research-skills --skill microscopy-scale-bar-adder -a codex`. Or copy the skill folder (scientific-skills/Other/microscopy-scale-bar-adder in aipoch/medical-research-skills) into .agents/skills/microscopy-scale-bar-adder in your project. Codex loads it when a task matches its description.

Can I use Microscopy Scale Bar Adder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill microscopy-scale-bar-adder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/microscopy-scale-bar-adder, .gemini/skills/microscopy-scale-bar-adder, .github/skills/microscopy-scale-bar-adder and .opencode/skills/microscopy-scale-bar-adder in your project.

What does Microscopy Scale Bar Adder need to run?

Going by SKILL.md and its folder, Microscopy Scale Bar Adder needs Python for the scripts in its folder and the command-line tools its instructions call (python and pip). Our summary lists: Python 3.

Does Microscopy Scale Bar Adder access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Microscopy Scale Bar Adder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Microscopy Scale Bar Adder use?

Microscopy Scale Bar Adder is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Microscopy Scale Bar Adder use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Microscopy Scale Bar Adder?

Skills that share tags, products or a category with Microscopy Scale Bar Adder: Wp Performance Review (elvismdev/claude-wordpress-skills, 235 stars), Align Human (agentscope-ai/OpenJudge, 868 stars), Performance Report (Affitor/affiliate-skills, 699 stars) and Run Mv Hoi Reconstruction (nvidia-isaac/video_to_data, 850 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Microscopy Scale Bar Adder?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,974 GitHub stars. The repository holds 567 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.