wibaek

python-starter

0
0
# Install this skill:
npx skills add wibaek/skills --skill "python-starter"

Install specific skill from multi-skill repository

# Description

Automatically configures formatter and linter settings when initializing Python projects. Installs ruff by default and uses pyproject.toml for configuration. Detects or asks the user about venv/poetry/uv environments and installs as dev dependencies. Optionally configures pre-commit and ty. Suggests VSCode workspace settings when using VSCode. Use this skill when starting Python projects ("Start a Python project", "Create a FastAPI project", "Create a data analysis Python project", etc.).

# SKILL.md


name: python-starter
description: Automatically configures formatter and linter settings when initializing Python projects. Installs ruff by default and uses pyproject.toml for configuration. Detects or asks the user about venv/poetry/uv environments and installs as dev dependencies. Optionally configures pre-commit and ty. Suggests VSCode workspace settings when using VSCode. Use this skill when starting Python projects ("Start a Python project", "Create a FastAPI project", "Create a data analysis Python project", etc.).


Python Starter

Automatically configures formatter and linter when initializing Python projects.

Workflow

  1. Environment Detection and Selection
  2. Use UV if uv.lock file exists or uv command is available
  3. Use Poetry if [tool.poetry] section exists in pyproject.toml
  4. If no environment is configured, recommend uv
  5. Otherwise use venv
  6. Ask the user if uncertain

  7. Install ruff

  8. Install ruff as dev dependency based on selected environment
  9. Use commands (avoid writing code directly)
  10. Reference: environment-setup.md

  11. Configure pyproject.toml

  12. Create pyproject.toml if it doesn't exist
  13. Add ruff configuration (see pyproject-toml-examples.md for default settings)
  14. Template: assets/pyproject.toml.template

  15. Install pytest

  16. Install pytest as dev dependency based on selected environment
  17. Use commands (avoid writing code directly)

  18. Type Checking Setup (Optional)

  19. Ask the user if they want ty setup
  20. Install ty as dev dependency if needed
  21. Add ty configuration to pyproject.toml
  22. Reference: pyproject-toml-examples.md

  23. Pre-commit Setup (Optional)

  24. Ask the user if they want pre-commit setup
  25. Install pre-commit and create .pre-commit-config.yaml if needed
  26. Reference: pre-commit-setup.md
  27. Template: assets/.pre-commit-config.yaml.template

  28. VSCode Settings Suggestion

  29. Suggest creating .vscode/settings.json when using VSCode
  30. Include ruff and ty (if configured) settings
  31. Reference: vscode-settings.md
  32. Template: assets/.vscode-settings.json.template

  33. Create .gitignore

  34. Create .gitignore if it doesn't exist
  35. Include common Python ignores for virtual environments, cache files, build artifacts, IDE files, and OS files
  36. Template: assets/.gitignore.template

Principles

  • Command-first: Use commands whenever possible instead of writing code directly
  • Use pyproject.toml: Store all configuration in pyproject.toml
  • Dev dependencies: Install ruff, pytest, ty, and pre-commit as dev dependencies
  • User confirmation: Confirm with user for environment selection, ty, and pre-commit before proceeding

References

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.