본문으로 건너뛰기
cccskills
무료GitHub에 공개

python-project-creator

Creates Python projects with proper structure, virtual environments, and dependency management. Use when users request to create a new Python project, set up a Python development environment, or initialize a Python application with standard tooling.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(4)

  • SKILL.md5.7 KB
  • assets/example_asset.txt865 B
  • references/api_reference.md973 B
  • scripts/example.py603 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Python Project Creator

Critical Corrections

Use 'uv' instead of 'pip'

  • ✗ Don't: pip install, pip freeze
  • ✓ Do: uv pip install, uv pip freeze (uv is faster and more modern)

Always use pytest, never unittest

  • ✗ Don't: unittest framework
  • ✓ Do: pytest for all testing needs

Overview

This skill creates well-structured Python projects with best practices for dependency management, testing, and code organization. It sets up virtual environments, installs dependencies, and configures common development tools.

Project Creation Workflow

1. Understand Requirements

Ask the user about:

  • Project name and purpose
  • Type: CLI tool, web app, library, data science project
  • Dependencies: Required packages
  • Testing: Testing framework preference (pytest, unittest)

2. Create Project Structure

Standard Python project structure:

project-name/
├── src/
│   └── project_name/
│       ├── __init__.py
│       └── main.py
├── tests/
│   ├── __init__.py
│   └── test_main.py
├── .gitignore
├── README.md
├── requirements.txt
└── setup.py (optional, for libraries)

3. Virtual Environment Setup

Create and activate virtual environment:

# Create virtual environment
python3 -m venv venv

# Activate (instructions for user)
# macOS/Linux: source venv/bin/activate
# Windows: venv\Scripts\activate

4. Install Dependencies

Install packages using uv:

uv pip install <package-name>
uv pip freeze > requirements.txt

For development dependencies:

uv pip install pytest black flake8 mypy

5. Initialize Git

git init
git add .
git commit -m "Initial commit: project setup"

Project Types

CLI Application

  • Use argparse or click for command-line arguments
  • Include main.py with proper entry point
  • Add if __name__ == "__main__": guard

Web Application

  • Flask: Lightweight, good for small APIs
  • FastAPI: Modern, async, auto-documentation
  • Django: Full-featured, batteries included

Library/Package

  • Include setup.py for packaging
  • Follow semantic versioning
  • Add comprehensive docstrings

Data Science

  • Include notebooks/ directory for Jupyter notebooks
  • Add data/ directory (with .gitignore)
  • Common packages: pandas, numpy, matplotlib, scikit-learn

Testing Setup

pytest (Required)

Always use pytest for testing:

uv pip install pytest pytest-cov

Example test file:

# tests/test_main.py
import pytest
from src.project_name.main import my_function

def test_my_function():
    assert my_function(2, 3) == 5

Run tests:

pytest
pytest --cov=src  # with coverage

Code Quality Tools

Black (Code Formatter)

uv pip install black
black src/ tests/

Flake8 (Linter)

uv pip install flake8
flake8 src/ tests/

mypy (Type Checker)

uv pip install mypy
mypy src/

Common Patterns

Entry Point Pattern

# src/project_name/main.py

def main():
    """Main application entry point."""
    print("Hello, World!")

if __name__ == "__main__":
    main()

Configuration Pattern

# src/project_name/config.py

import os
from pathlib import Path

# Project root directory
PROJECT_ROOT = Path(__file__).parent.parent.parent

# Load environment variables
DEBUG = os.getenv("DEBUG", "False") == "True"

Error Handling Pattern

class ProjectError(Exception):
    """Base exception for this project."""
    pass

class ConfigError(ProjectError):
    """Configuration-related errors."""
    pass

.gitignore Template

# Virtual environment
venv/
env/
.venv/

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
*.egg-info/
dist/
build/

# IDE
.vscode/
.idea/
*.swp
*.swo

# Environment
.env
.env.local

# Testing
.pytest_cache/
.coverage
htmlcov/

# OS
.DS_Store
Thumbs.db

Best Practices

Dependency Management

  • Pin exact versions in production: package==1.2.3
  • Use ranges for libraries: package>=1.2,<2.0
  • Separate dev dependencies from production
  • Keep requirements.txt minimal

Project Structure

  • Use src/ layout to avoid import issues
  • Keep tests separate from source code
  • One module per file, clear naming
  • Flat is better than nested (within reason)

Documentation

  • Write clear README.md with setup instructions
  • Add docstrings to all public functions/classes
  • Include usage examples in README
  • Document environment variables

Version Control

  • Initialize git from the start
  • Write meaningful commit messages
  • Create .gitignore before first commit
  • Never commit secrets or credentials

Quick Start Examples

Minimal CLI Tool

mkdir my-cli-tool && cd my-cli-tool
python3 -m venv venv
source venv/bin/activate
uv pip install click
# Create main.py, tests, etc.

FastAPI Web Service

mkdir my-api && cd my-api
python3 -m venv venv
source venv/bin/activate
uv pip install fastapi uvicorn
# Create app structure

Data Science Project

mkdir my-analysis && cd my-analysis
python3 -m venv venv
source venv/bin/activate
uv pip install pandas numpy matplotlib jupyter
# Create notebooks/, data/, src/

Resources

This skill includes examples in the bundled directories:

scripts/

  • example.py - Template Python script with best practices

references/

  • api_reference.md - Common library documentation references

assets/

  • Project templates and boilerplate code

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

reflect

무료

Analyzes conversation transcripts to extract user corrections, patterns, and preferences, then proposes skill improvements. Use this skill when users provide corrections, express preferences about code style, or when patterns emerge from successful approaches. Can be triggered manually with /reflect or automatically at session end when enabled.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

haddock-development/claude-reflect-system3832026년 1월 17일 업데이트

haddock-development의 스킬 모두 보기

이 스킬의 문제 신고