Skip to content
Back to skills

Command Wrappers

ASecurity

"Guides agents using pysam samtools and bcftools command wrappers,

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
toolspythonshellapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill command-wrappers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Command Wrappers?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Command Wrappers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-command-wrappers/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-command-wrappers)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: command-wrappers
description: "Guides agents using pysam samtools and bcftools command wrappers,
  PysamDispatcher calls, stdout/stderr capture, usage messages, aliases, and
  SamtoolsError troubleshooting."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# command-wrappers

Use this sub-skill when a task asks to run bundled `samtools` or `bcftools` functionality from Python with `pysam.samtools`, `pysam.bcftools`, or top-level `pysam` aliases such as `pysam.view`, `pysam.sort`, `pysam.index`, `pysam.idxstats`, or `pysam.faidx`.

## Read first

- `references/command-reference.md` for the dispatcher contract, command inventory, aliases, return types, and error model.
- `references/workflows.md` for translating shell `samtools`/`bcftools` commands into safe Python calls.
- `references/troubleshooting.md` for `SamtoolsError`, stdout/stderr capture, `save_stdout`, binary output, invalid arguments, and notebook capture issues.
- `scripts/command_wrapper_smoke.py` for a source-free JSON smoke helper that checks dispatchers and safe commands when a working pysam install is available.

## Scope

This sub-skill owns bundled command invocation through `pysam.utils.PysamDispatcher`: `pysam.samtools.*`, `pysam.bcftools.*`, top-level samtools aliases imported into `pysam`, `catch_stdout`, `save_stdout`, `split_lines`, `raw`, `usage()`, `get_messages()`, and `pysam.SamtoolsError`.

Use sibling sub-skills instead for object-level `AlignmentFile`/`AlignedSegment` workflows, `VariantFile`/`VariantRecord` workflows, tabix/FASTA object APIs, or build/install troubleshooting.

## Defaults that prevent common mistakes

- Pass command-line tokens as separate Python string arguments, not as one shell string.
- Keep output redirection explicit: use captured return values for text output, `save_stdout=...` for stdout-to-file, or command-native `-o` plus `catch_stdout=False` for commands that write files.
- Use `catch_stdout=False` when the command writes binary data or owns stdout redirection; otherwise pysam may capture data the command expected to write elsewhere.
- Read `dispatcher.usage()` before guessing required arguments, and catch `pysam.SamtoolsError` around user-supplied command inputs.
- After a command call, inspect the same dispatcher’s `get_messages()` for captured stderr warnings or diagnostics.
- Remember non-identifier command aliases: `pysam.samtools.cram_size` maps to `samtools cram-size`, and `pysam.samtools.fqimport` maps to `samtools import`.

Files in this skill

  • SKILL.md2.5 KB
  • references/command-reference.md5.5 KB
  • references/troubleshooting.md5.5 KB
  • references/workflows.md5.5 KB
  • scripts/command_wrapper_smoke.py9.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.