# New Python Project

> Scaffold a fresh Python project — folder, virtualenv, .gitignore, README, git init (use when the user wants to start a new Python project)

- Skill: `0pen-sourcer/new-python-project` (Agent Skill)
- Install (CLI): `npx skillmds@latest add 0pen-sourcer/new-python-project`
- Raw SKILL.md: https://api.skillmd.com/api/skills/0pen-sourcer/new-python-project/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: 0pen-Sourcer (https://skillmd.com/u/0pen-sourcer)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/0pen-sourcer/new-python-project

---


# New Python project

Set up a clean Python project so the user can start coding immediately.

## Inputs

Ask only if not given: the **project name** and **where** to create it (default: a `Projects` or `Code` folder under the user's home, or the current working directory).

## Steps

1. `create_directory` `<location>/<name>`.
2. `write_file` these into the project:
   - `README.md` — `# <name>` + a one-line placeholder.
   - `.gitignore` — Python defaults: `.venv/`, `__pycache__/`, `*.pyc`, `.env`, `dist/`, `build/`, `*.egg-info/`.
   - `requirements.txt` — empty (or the deps the user named).
   - `main.py` — `def main():\n    ...\n\n\nif __name__ == "__main__":\n    main()`
3. `run_command` in the project dir: create the venv — `python -m venv .venv`.
4. `run_command`: `git init` (only if git is available; if not, skip and mention it).
5. If the user named dependencies, write them to `requirements.txt` and `run_command` the venv pip install (`.venv\Scripts\python -m pip install -r requirements.txt`).
6. Report the path and the exact command to activate the venv (`.venv\Scripts\Activate.ps1` on PowerShell).

## Don't

- Don't overwrite an existing folder of the same name — if it exists, ask first.
- Don't install heavy deps the user didn't ask for.
- Keep it minimal; this is a starting point, not a framework.

