基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/jr2804/mcp-config-converter --skill python-guidelines命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | python-guidelines |
| description | Universal Python development guidelines and best practices |
| license | MIT |
| compatibility | opencode |
| metadata | {"related_coding_principles":"For general coding standards, use skill `coding-principles`","related_python_cli":"For CLI development patterns, use skill `python-cli`"} |
Provide universal Python development guidelines that apply across different Python projects and domains.
# 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
# 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
# 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
Use this skill when:
# 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
# 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")
# 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)
Works with: