Back to list
jr2804

python-guidelines

by jr2804

This project converts MCP server configurations from any format into the one for your coding agent of choice - just by using any available LLM!

2🍴 0📅 Jan 21, 2026

SKILL.md


Python Guidelines

What I Do

Provide universal Python development guidelines that apply across different Python projects and domains.

Universal Python Best Practices

Project Structure

# Universal Python project structure
project/
├── src/                  # Main source code
│   └── package/          # Importable package
├── tests/                # Test suite
├── docs/                 # Documentation
├── scripts/              # Utility scripts
├── pyproject.toml        # Project configuration
├── README.md             # Project overview
└── .gitignore            # Version control ignore

Dependency Management

# Universal Python dependency management
# Use uv for all package operations
uv add package-name          # Add production dependency
uv add package-name --dev    # Add development dependency
uv remove package-name       # Remove dependency
uv sync --all-extras -U     # Update all dependencies

Type Hints and Annotations

# Universal type hint patterns
from typing import List, Dict, Optional, Union

# Function with complete type annotations
def process_data(
    input_data: List[Dict[str, Union[int, str]]],
    config: Optional[Dict[str, str]] = None
) -> Dict[str, List[float]]:
    """Process data with type-safe operations"""
    # Implementation with type-checked operations
    return processed_results

When to Use Me

Use this skill when:

  • Setting up new Python projects
  • Standardizing Python development across teams
  • Creating reusable Python patterns
  • Implementing maintainable Python code

Universal Python Examples

Import Organization

# Universal import structure
# 1. Standard library imports
import os
import sys
from pathlib import Path

# 2. Third-party imports
import numpy as np
import pandas as pd

# 3. Local application imports
from .utils import helpers
from .core import processors

Error Handling Patterns

# Universal Python error handling
class DataValidationError(Exception):
    """Custom exception for data validation issues"""
    pass

def validate_input(data: dict) -> None:
    """Validate input data with specific error messages"""
    if not data:
        raise DataValidationError("Input data cannot be empty")
    if "required_field" not in data:
        raise DataValidationError("Missing required field: required_field")

Testing Patterns

# Universal Python testing structure
import pytest
from hypothesis import given, strategies as st

class TestDataProcessor:
    """Test suite for data processor"""

    @pytest.fixture
    def sample_data(self):
        """Provide sample data for testing"""
        return {"input": [1, 2, 3], "expected": [2, 4, 6]}

    def test_process_data(self, sample_data):
        """Test data processing with sample input"""
        result = process_data(sample_data["input"])
        assert result == sample_data["expected"]

    @given(st.lists(st.integers()))
    def test_process_data_properties(self, input_list):
        """Property-based testing for data processor"""
        result = process_data(input_list)
        assert len(result) == len(input_list)
        assert all(isinstance(x, int) for x in result)

Best Practices

  1. Consistency: Apply same patterns across all Python projects
  2. Type Safety: Use complete type annotations
  3. Testing: Implement comprehensive test coverage
  4. Documentation: Use Google-style docstrings

Compatibility

Works with:

  • Python 3.8+ projects
  • Any Python application type
  • Cross-project standardization
  • Organizational Python guidelines

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon