agentsclimarketplace

Python project setup

Skill ThiagoPanini/aidriven/.claude/skills/python-project-setup

πŸ”© A Python CLI tool for getting and installing AI development resources into software projects.

Install
npx -y skills add ThiagoPanini/aidriven --skill python-project-setup

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Configure modern Python development tooling for any Python project β€” library, backend, CLI, or otherwise. Invoke this skill whenever a user wants to set up or improve Python tooling, configure pyproject.toml, add pre-commit hooks, set up linting or formatting, configure a type checker or test runner, or any request like "set up my Python project", "configure Python tooling", "add pre-commit to my project", "set up ruff and mypy", or "bootstrap Python dev tools". This skill works on both empty repositories and existing projects with partial configuration. It produces ONLY configuration files β€” no source code, no test logic.

SKILL.md

14.6 KB, as published. Nobody here has run it

Python Project Setup

Configure modern Python development tooling for any Python project. This skill works on both new (empty) repositories and existing projects that already have code and partial configuration. It creates and updates configuration files only β€” never source code or test logic.

Read references/tools-catalog.md for all supported tool options and their pyproject.toml config snippets. Read references/pre-commit-catalog.md for all pre-commit hook configurations.

Mission

Set up, modernize, or complete the local development tooling for a Python project. The skill is scoped exclusively to developer experience tooling: package management, linting, formatting, type checking, testing, coverage, pre-commit hooks, and security scanning. It does not touch documentation, CI/CD, GitHub Actions, publishing, release automation, or repository hosting.

Supported Project Types

TypeDescriptionDefault adjustments
libraryDistributable Python package (PyPI)build_backend = hatchling, versioning = hatch-vcs
backendWeb API / server (FastAPI, Django, Flask)build_backend = none, versioning = none
cliCommand-line toolbuild_backend = hatchling if published, none otherwise
data-scienceNotebooks, data pipelinesbuild_backend = none, versioning = none
scriptsUtility scripts, automationbuild_backend = none, versioning = none

The project type influences defaults only. All tool categories work the same regardless of type.


Phase 0 β€” Repository Analysis

Before asking the user anything, explore the current state of the repository. Use your file reading tools to gather the following information:

  1. Existing configuration files β€” check which of these exist:

    • pyproject.toml / setup.py / setup.cfg
    • .pre-commit-config.yaml
    • .python-version
    • .gitignore
    • .editorconfig
    • requirements.txt / requirements-dev.txt / requirements*.txt
    • Pipfile / poetry.lock / uv.lock / pdm.lock
  2. Project structure β€” identify the layout:

    • Does src/<name>/ exist? (src layout)
    • Does a flat <name>/ package directory exist at the root?
    • Are there tests/ or test/ directories?
  3. Currently configured tools β€” if pyproject.toml exists, read it and identify:

    • Which [tool.*] sections are already present (ruff, mypy, pytest, etc.)
    • The [build-system] backend in use, if any
    • The declared requires-python version
    • Package manager in use (inferred from lock files or tool sections)
  4. Project type signals β€” look for:

    • Framework imports or dependencies (fastapi, django, flask, click, typer, etc.) suggesting a backend, CLI, or other project type rather than a distributable library
    • Presence of a [project] table with name, version, etc.

After analysis, present a concise summary to the user:

Project scan complete

  • Found: pyproject.toml with ruff and pytest configured, uv.lock (uv), Python 3.12
  • Missing: mypy, pre-commit, .editorconfig
  • Project type looks like: backend web app (fastapi detected)

I'll focus on adding the missing tooling. Continue?

If the repository appears to be empty or brand new, note that and proceed to gather context.


Phase 1 β€” Gather Context

Based on the Phase 0 analysis, ask only for information that could not be determined automatically. Keep it concise β€” you can ask all at once. Do not re-ask for things already found.

  1. Project name β€” the distribution name (e.g. my-project). Skip if already in pyproject.toml.
  2. Package name β€” the importable Python name (e.g. my_project). Skip if determinable from the project structure. Defaults to project name with hyphens replaced by underscores.
  3. Python version β€” minimum supported version. Skip if found in .python-version or requires-python. Default: 3.11.
  4. Author name and email β€” for pyproject.toml. Skip if already present. Use YOUR NAME / [email protected] as placeholders if the user wants to skip.
  5. Project type β€” optional signal to adjust defaults. Examples: library, backend, cli, data-science, scripts. If unsure or irrelevant, skip β€” the tooling works the same.
  6. Tool selections β€” see the table below. Show what is already configured and only ask about what is missing or what the user may want to change.

Tool Selection Table

CategoryDefaultAlternatives
package_manageruvpip, poetry, pdm, hatch
build_backendhatchling (library) / none (app)setuptools, flit-core, poetry-core, pdm-backend, none
linterruffflake8, pylint, none
formatterruffblack, autopep8, none
import_sorternone (ruff's I rule covers it)isort
static_type_checkermypypyright, basedpyright, none
test_runnerpytestunittest, none
coveragepytest-covcoverage, none
versioninghatch-vcs (library) / none (app)bump2version, commitizen, manual, none
security_scanningnonebandit, safety

Notes on project type defaults:

  • For distributable libraries/packages: build_backend = hatchling, versioning = hatch-vcs
  • For backend/app/CLI projects not distributed via PyPI: build_backend = none, versioning = none (or manual); pyproject.toml still serves as a tool config hub

If the user says "just use the defaults" or provides no selections, apply the defaults above based on the inferred project type.


Phase 2 β€” Resolve and Confirm

Before modifying any files, summarize what will be created or updated and ask the user to confirm. Distinguish clearly between new files, files that will be updated, and files already present with no changes needed. Example:

I'll configure your project with:

  • uv Β· ruff (lint + format) Β· mypy Β· pytest + pytest-cov
  • pre-commit with ruff, mypy, and hygiene hooks

New files: .python-version, .editorconfig, .pre-commit-config.yaml Update: pyproject.toml (add mypy and coverage sections) Already present, no change: .gitignore, ruff config in pyproject.toml

Ready to proceed?

Only proceed after confirmation (or if the user says "just do it").


Phase 3 β€” Create and Update Files

Work through the files below. For each file: check whether it already exists. If it exists with real content, update or merge rather than overwrite β€” add missing sections, update stale versions, and preserve existing configuration unless the user explicitly asks to replace it.

File Update Strategy

For every file the skill touches, apply one of these actions and report it in the final summary:

ActionWhen to use
CreateFile does not exist. Generate from scratch.
UpdateFile exists but is missing sections or has outdated config. Merge new content.
PreserveFile exists and its content is already correct. Leave untouched.
SkipFile is irrelevant to the selected tools or project type. Do not create.

Idempotency rule: Running the skill twice with the same inputs must produce the same result. Never duplicate sections, hooks, or dependencies. Always check before appending.

3.1 Directory Scaffolding

Only create these if they are missing and relevant:

  • src/<package_name>/ β€” only for library/package projects with src layout; add .gitkeep
  • tests/ β€” add .gitkeep if the directory does not exist

Never create .py files β€” only .gitkeep placeholders. Do not create docs/ or any documentation directory.

3.2 pyproject.toml

This is the primary configuration hub. If it already exists, read it fully first and only add or update the sections relevant to selected tools. Never remove existing sections unless the user explicitly requests it.

[build-system] β€” include only when build_backend != none. See references/tools-catalog.md Β§ Build Backends.

[project] β€” if absent, create with:

[project]
name = "<project-name>"
description = "<description>"
readme = "README.md"
license = { text = "MIT" }
authors = [{ name = "<author>", email = "<email>" }]
requires-python = ">= <python-version>"
dynamic = ["version"]   # omit if versioning = manual or none; add version = "0.1.0" instead
dependencies = []

If [project] already exists, only add missing fields β€” do not overwrite existing ones.

[tool.*] sections β€” append one per selected tool that is not already configured. Pull exact snippets from references/tools-catalog.md. Key rules:

  • linter: ruff and formatter: ruff β†’ single [tool.ruff] block covering both
  • import_sorter: none when linter: ruff β€” the I rule handles it; ensure known-first-party is set in [tool.ruff.lint.isort]
  • import_sorter: isort when ruff is not selected β†’ add [tool.isort] block and isort dev dep
  • versioning: hatch-vcs β†’ affects [build-system] and adds [tool.hatch.version]
  • package_manager: uv β†’ add [tool.uv] with dev-dependencies group

[project.optional-dependencies] β€” add dev group when package_manager is not uv:

[project.optional-dependencies]
dev = []  # list dev deps here

If a [tool.*] section for a selected tool already exists, do not add a duplicate β€” instead verify it is reasonably configured and note any recommended updates to the user.

3.3 .python-version

Single line: the minimum Python version (e.g. 3.11). Create if missing. Skip if already present with a valid version.

3.4 .gitignore

Copy content from assets/gitignore-python.txt verbatim if .gitignore does not exist. If .gitignore already exists, append only the lines that are missing from it.

3.5 .editorconfig

Copy content from assets/editorconfig.txt verbatim. Skip if already present.

3.6 .pre-commit-config.yaml

Always create or update this file. Pre-commit is part of every setup regardless of other selections.

If the file does not exist, create it starting with the base hygiene hooks:

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-toml
      - id: check-json
      - id: check-merge-conflict
      - id: check-added-large-files
      - id: detect-private-key
      - id: mixed-line-ending

If the file already exists, check which hooks are already present and only add the missing ones. Do not duplicate repos or hooks.

Then append tool-specific hooks from references/pre-commit-catalog.md for:

  • linter (if not none and not already present)
  • formatter (if not none and different from linter, and not already present)
  • static_type_checker (if not none and not already present)
  • security_scanning (if not none and not already present)
  • versioning: commitizen β†’ append commitizen hook for commit-msg stage

Phase 4 β€” Validation Checklist

After all files are created or updated, verify:

  • pyproject.toml is valid TOML (mentally parse for syntax errors)
  • [build-system] block is present and matches selected backend (only when build_backend != none)
  • No duplicate [tool.*] sections introduced
  • .pre-commit-config.yaml is present and has at minimum the base hygiene hooks
  • .gitignore exists
  • .editorconfig exists
  • .python-version exists with the correct version
  • No .py files were created
  • No invented/fabricated metadata β€” only placeholders where info was missing
  • Existing file content was preserved and only extended, not replaced
  • Running the skill again with the same inputs would produce no additional changes (idempotent)

Phase 5 β€” Final Summary and Next Steps

Summary Format

Present the results in this format:

Setup complete

FileActionDetails
pyproject.tomlUpdatedAdded [tool.mypy], [tool.coverage.*]
.pre-commit-config.yamlCreatedHygiene + ruff + mypy hooks
.editorconfigCreatedStandard Python config
.python-versionCreated3.12
.gitignorePreservedAlready complete
tests/PreservedAlready exists

Next Steps

After completing setup, tell the user what to do next. Tailor to their tool selections. Example for uv + ruff + mypy + pytest:

# Install pre-commit and activate hooks
uv tool install pre-commit
pre-commit install

# Install project dependencies
uv sync

# Run all pre-commit hooks on existing files
pre-commit run --all-files

# Verify lint and type check pass
uv run ruff check .
uv run mypy src/

# Run tests
uv run pytest

Also remind them to:

  1. Replace any placeholder values in pyproject.toml (name, author, email, description)
  2. Review the known-first-party setting in [tool.ruff.lint.isort] to match their package name
  3. Adjust fail_under in [tool.coverage.report] as test coverage grows

Important Rules

  • Never create .py files β€” only .gitkeep for placeholder directories.
  • Never invent project metadata. Use explicit placeholders like <project-name>, YOUR NAME.
  • Preserve existing configuration β€” update and extend, never blindly overwrite.
  • Always create or update .pre-commit-config.yaml.
  • Prefer pyproject.toml over separate config files (setup.cfg, tox.ini, .flake8, mypy.ini).
  • When the user selects ruff for both linter and formatter, configure both in a single [tool.ruff] block.
  • When unsure about a user's tool selection, default to the table in Phase 1.
  • Do not create documentation files, CI workflows, GitHub community health files, publishing configs, or any file unrelated to local development tooling.
  • Do not assume the project is a library β€” always check or ask for the project type.
  • Do not expand scope beyond the tool categories listed in the Tool Selection Table.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.