Skip to content
Back to skills

Forge Python Project Hygiene

ASecurity

Set up and work in modern Python projects: uv/pip, virtualenvs, ruff, mypy/pyright and pytest

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentspythonshellbash

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned November 30, 2026

npx -y skills add ansh44233/forge --skill forge-python-project-hygiene --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Forge Python Project Hygiene?

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

Security grade badge for Forge Python Project Hygiene
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ansh44233-forge-python-project-hygiene/badge)](https://www.skillsdirectory.com/skills/ansh44233-forge-python-project-hygiene)

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: forge-python-project-hygiene
description: "Set up and work in modern Python projects: uv/pip, virtualenvs, ruff, mypy/pyright and pytest"
---

<!-- Generated from catalog/skills/python-project-hygiene/SKILL.md by scripts/build-plugin.ts. Edit the catalog, not this file. -->

# Python project hygiene

Use when touching any Python project, before writing code.

## Find the toolchain
- Read `pyproject.toml` (and `uv.lock`, `poetry.lock`, `requirements*.txt`). Use the tool the project already uses: `uv run`, `poetry run`, or an activated virtualenv. Never `pip install` into the system interpreter.
- Note the supported Python version (`requires-python`) and do not use newer syntax.

## Code
- Type hints on public functions; `from __future__ import annotations` only if the project already uses it.
- Prefer `pathlib`, f-strings, dataclasses or pydantic models over ad-hoc dicts for structured data.
- Never use mutable default arguments (`def f(items=[])`); use `None` and create inside.
- Catch specific exceptions; never bare `except:`. Re-raise with `raise ... from error` to keep context.
- Use `logging`, not `print`, in library and service code.
- Avoid `subprocess` with `shell=True` on any input you did not write; pass an argument list.

## Tests
- pytest: plain `assert`, fixtures for setup, `tmp_path` for files, `monkeypatch` for env vars, `pytest.mark.parametrize` for tables of cases.
- Run the narrowest test first: `pytest tests/test_x.py::test_case -q`.

## Verify (use the project's configured tools)
```bash
ruff check . && ruff format --check .     # or flake8/black if that is what the repo uses
mypy src/                                  # or pyright
pytest -q
```
Report exactly which of these exist in the repo and which you ran.

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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