Skip to content
Back to skills

2894 Subprocess Audit 3e7361df

ASecurity

Scripts that call `gh`, `glab`, or `git` via `subprocess` instead of using Python libraries. All identified instances require migration to library equivalents.

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 11, 2026
businesspythongitapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2894-subprocess-audit_3e7361df --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2894 Subprocess Audit 3e7361df?

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

Security grade badge for 2894 Subprocess Audit 3e7361df
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2894-subprocess-audit-3e7361df/badge)](https://www.skillsdirectory.com/skills/tools-only-2894-subprocess-audit-3e7361df)

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

SKILL.md
# Subprocess Audit: Python Scripts Using CLI Tools via subprocess

Scripts that call `gh`, `glab`, or `git` via `subprocess` instead of using Python libraries.
All identified instances require migration to library equivalents.

## Files Requiring Migration

### 1. `.claude/skills/create-merge-request-changelog/scripts/fetch_gitlab_mr.py`

**Current pattern:** `subprocess.run(["glab", ...])` for MR metadata, commits, and diffs

**Replace with:** `python-gitlab` library

**Reference example:** `plugins/gitlab-skill/skills/gitlab-skill/scripts/gitlab_context.py` (line 4+)

---

### 2. `.claude/skills/create-merge-request-changelog/scripts/analyze_git_changes.py`

**Current pattern:** `subprocess.run(["git", ...])` for `log`, `diff`, `rev-parse`, `merge-base`, `rev-list`

**Replace with:** `GitPython` library

**Reference example:** `plugins/gitlab-skill/skills/gitlab-skill/scripts/gitlab_context.py` (lines 31, 48–50, 64)

---

### 3. `.claude/skills/daily-releases/scripts/publish_daily_release.py`

**Current pattern:** `subprocess` calls for both `git` and `gh` CLI operations

**Replace git calls with:** `GitPython`

**Replace gh calls with:** `PyGithub`

**Reference examples:**
- PyGithub: `.claude/skills/gh/scripts/github_project_setup.py` (line 6+)
- PyGithub: `.claude/skills/backlog/scripts/backlog.py` (line 55+)
- GitPython: `plugins/gitlab-skill/skills/gitlab-skill/scripts/gitlab_context.py` (lines 31, 48–50, 64)

---

### 4. `.claude/skills/daily-releases/scripts/list_daily_ranges.py`

**Current pattern:** `subprocess` calls for `git` operations

**Replace with:** `GitPython`

**Reference example:** `plugins/gitlab-skill/skills/gitlab-skill/scripts/gitlab_context.py` (lines 31, 48–50, 64)

---

### 5. `plugins/holistic-linting/skills/holistic-linting/scripts/install_agents.py`

**Current pattern:** `subprocess.run(["git", "rev-parse", "--show-toplevel"])` — single call to find git root

**Replace with:**

```python
import git
git.Repo(search_parent_directories=True).git.rev_parse("--show-toplevel")
```

**Reference example:** `plugins/gitlab-skill/skills/gitlab-skill/scripts/gitlab_context.py`

---

## Borderline Cases

### 6. `plugins/holistic-linting/skills/holistic-linting/scripts/discover_linters.py`

**Current pattern:** `subprocess` to `git` — used only to detect if running inside a git repo and to find `hooksPath` config

**Replace with:** `GitPython`

**Replacement pattern:**

```python
import git
try:
    repo = git.Repo(search_parent_directories=True)
    hooks_path = repo.config_reader().get_value("core", "hooksPath", None)
except git.InvalidGitRepositoryError:
    # not in a git repo
    hooks_path = None
```

---

## Available Libraries

Libraries already present in `pyproject.toml`:

| Library | Version constraint | Purpose |
|---|---|---|
| `gitpython` | `>=3.1.45` | Git operations (log, diff, rev-parse, merge-base, rev-list, repo root) |
| `pygithub` | `>=2.1.1` | GitHub API (gh CLI replacement) |

`python-gitlab` is available via PEP 723 inline metadata only — not in `pyproject.toml`. Add it as a dev dependency if scripts using it need IDE tooling support.

---

## Reference File Locations

- **PyGithub pattern:** `.claude/skills/backlog/scripts/backlog.py` line 55+
- **PyGithub pattern:** `.claude/skills/gh/scripts/github_project_setup.py` line 6+
- **python-gitlab pattern:** `plugins/gitlab-skill/skills/gitlab-skill/scripts/gitlab_context.py` line 4+
- **GitPython pattern:** `plugins/gitlab-skill/skills/gitlab-skill/scripts/gitlab_context.py` lines 31, 48–50, 64

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.