Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计异常

python-project-templatePython project template 搜索

Agent Skill

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

总安装

499

周安装

20

GitHub Stars

8

下载量

162
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:python-project-template(Python project template 搜索)
来源仓库:https://github.com/vamseeachanta/workspace-hub
仓库路径:skills/python-project-template
安装命令:
npx skills add https://github.com/vamseeachanta/workspace-hub --skill python-project-template
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vamseeachanta/workspace-hub --skill python-project-template

简介

提供经过验证的 Python 项目模板和最佳实践集合。

  • 适用于遵循特定行业标准或合规要求的开发项目。
  • 包含安全配置、日志规范和监控埋点的预设方案。
  • 使用时需根据实际业务需求裁剪无关组件。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • python-project-template 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Python Project Template

Generate standardized Python project structure compliant with workspace-hub standards.

Quick Start

# Create new project
/python-project-template my-project

# Create with specific type
/python-project-template my-project --type library

# Create in specific directory
/python-project-template my-project --path /path/to/projects

When to Use

USE when:

  • Starting a new Python project
  • Adding a new repository to workspace-hub
  • Standardizing an existing project
  • Creating reusable modules

DON'T USE when:

  • Project already has proper structure
  • Non-Python projects
  • One-off scripts (use scripts/ directory instead)

Prerequisites

  • Python 3.9+
  • UV package manager installed
  • Git initialized in parent directory

Overview

Creates a complete Python project with:

  1. pyproject.toml - Modern Python packaging configuration
  2. UV environment - Fast dependency management
  3. Test structure - pytest with fixtures and coverage
  4. Source layout - Modular src/ organization
  5. Documentation - README, CLAUDE.md,.agent-os/
  6. Quality tools - ruff, black, mypy configuration

Project Structure Generated

my-project/
├── pyproject.toml          # Project configuration
├── README.md               # Project documentation
├── CLAUDE.md               # AI agent instructions
├── .gitignore              # Git ignore patterns
├── .python-version         # Python version
├── src/
│   └── my_project/
│       ├── __init__.py     # Package init
│       └── core.py         # Core module
├── tests/
│   ├── __init__.py
│   ├── conftest.py         # pytest fixtures
│   └── test_core.py        # Example test
├── config/
│   └── settings.yaml       # Configuration
├── scripts/
│   └── run.sh              # Execution script
├── docs/
│   └── README.md           # Documentation index
├── data/
│   ├── raw/                # Raw data
│   └── processed/          # Processed data
├── reports/                # Generated reports
└── .agent-os/
    └── product/
        ├── mission.md      # Project mission
        └── tech-stack.md   # Technology stack

Core Templates

1. pyproject.toml

[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "{{project_name}}"
version = "0.1.0"
description = "{{description}}"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.9"
authors = [
    {name = "{{author}}", email = "{{email}}"}
]
keywords = ["{{keywords}}"]
classifiers = [
    "Development Status :: 3 - Alpha",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
]

dependencies = [
    "pandas>=2.0.0",
    "numpy>=1.24.0",
    "pyyaml>=6.0",
    "plotly>=5.15.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=7.4.0",
    "pytest-cov>=4.1.0",
    "ruff>=0.1.0",
    "black>=23.0.0",
    "mypy>=1.5.0",
]

[tool.setuptools.packages.find]
where = ["src"]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --cov=src --cov-report=term-missing --cov-fail-under=80"
markers = [
    "unit: Unit tests",
    "integration: Integration tests",
    "slow: Slow tests",
]

[tool.ruff]
line-length = 100
target-version = "py39"
select = ["E", "F", "I", "N", "W", "UP"]

[tool.black]
line-length = 100
target-version = ["py39"]

[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true

2. conftest.py

"""
ABOUTME: Pytest configuration and fixtures for {{project_name}}
ABOUTME: Provides shared fixtures and test utilities
"""

import sys
from pathlib import Path

import pytest

# Add src to path for imports
src_path = Path(__file__).parent.parent / "src"
if str(src_path) not in sys.path:
    sys.path.insert(0, str(src_path))

@pytest.fixture
def sample_data():
    """Provide sample test data."""
    return {
        "name": "test",
        "value": 42,
        "items": [1, 2, 3],
    }

@pytest.fixture
def temp_config(tmp_path):
    """Create temporary configuration file."""
    config_file = tmp_path / "config.yaml"
    config_file.write_text("""
settings:
  debug: true
  output_dir: ./output
""")
    return config_file

@pytest.fixture(scope="session")
def project_root():
    """Return project root directory."""
    return Path(__file__).parent.parent

3. CLAUDE.md Template

# Claude Code - {{project_name}}

> AI agent instructions for {{project_name}}

## Project Overview

{{description}}

## Critical Rules

1. **TDD Mandatory**: Write tests before implementation
2. **UV Environment**: Always use UV for dependency management
3. **File Organization**: Follow workspace-hub standards

## File Organization

**NEVER save to root. Use:**
- `/src` - Source code
- `/tests` - Test files
- `/docs` - Documentation
- `/config` - Configuration
- `/scripts` - Utility scripts
- `/data` - Data files
- `/reports` - Generated reports

## Key Commands

Setup environment

uv venv && source .venv/bin/activate uv pip install -e ".[dev]"

Run tests

pytest

Format code

black src tests ruff check src tests --fix

Type check

mypy src


## Documentation References

- @README.md - Project overview
- @.agent-os/product/mission.md - Project mission
- @docs/README.md - Documentation index

4. Core Module Template

"""
ABOUTME: Core module for {{project_name}}
ABOUTME: Provides main functionality and utilities
"""

import logging
from pathlib import Path
from typing import Any, Dict, Optional

import yaml

logger = logging.getLogger(__name__)

def load_config(config_path: Path) -> Dict[str, Any]:
    """
    Load configuration from YAML file.

    Args:
        config_path: Path to configuration file

    Returns:
        Configuration dictionary

    Raises:
        FileNotFoundError: If config file doesn't exist
        yaml.YAMLError: If YAML parsing fails
    """
    if not config_path.exists():
        raise FileNotFoundError(f"Config file not found: {config_path}")

    with open(config_path) as f:
        config = yaml.safe_load(f)

    logger.info(f"Loaded configuration from {config_path}")
    return config

def process_data(data: Dict[str, Any], config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
    """
    Process data according to configuration.

    Args:
        data: Input data dictionary
        config: Optional configuration

    Returns:
        Processed data dictionary
    """
    config = config or {}
    result = data.copy()

    # Add processing logic here
    logger.debug(f"Processing data with config: {config}")

    return result

class {{ProjectClass}}:
    """Main class for {{project_name}} functionality."""

    def __init__(self, config_path: Optional[Path] = None):
        """
        Initialize {{ProjectClass}}.

        Args:
            config_path: Optional path to configuration file
        """
        self.config = {}
        if config_path:
            self.config = load_config(config_path)

        self._setup_logging()

    def _setup_logging(self):
        """Configure logging for the class."""
        logging.basicConfig(
            level=self.config.get("log_level", "INFO"),
            format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
        )

    def run(self, data: Dict[str, Any]) -> Dict[str, Any]:
        """
        Execute main processing.

        Args:
            data: Input data

        Returns:
            Processed results
        """
        logger.info("Starting processing")
        result = process_data(data, self.config)
        logger.info("Processing complete")
        return result

Usage Examples

Example 1: Create Basic Project

# Invoke skill
/python-project-template my-analysis-tool

# Result: Complete project structure created
# - pyproject.toml configured
# - src/my_analysis_tool/ with core module
# - tests/ with conftest.py and example test
# - UV environment ready

Example 2: Create Library Project

# Create library project
/python-project-template my-library --type library

# Additional features:
# - Package publishing configuration
# - Documentation with Sphinx
# - API reference structure

Example 3: Create Data Pipeline Project

# Create data pipeline project
/python-project-template data-pipeline --type pipeline

# Additional features:
# - data/raw/ and data/processed/ directories
# - reports/ for output
# - scripts/ with execution templates

Execution Checklist

Project Creation:

  • Create directory structure
  • Generate pyproject.toml
  • Create src/ module structure
  • Setup tests/ with conftest.py
  • Generate CLAUDE.md
  • Create.agent-os/ structure
  • Initialize git repository
  • Create UV environment
  • Install dependencies
  • Run initial tests

Post-Creation:

  • Update project description
  • Add project-specific dependencies
  • Configure CI/CD (optional)
  • Run repo-readiness check

Error Handling

Directory Exists

Error: Directory 'my-project' already exists

Options:
1. Use different name
2. Use --force to overwrite
3. Use --update to add missing files

UV Not Installed

Error: UV package manager not found

Install UV:
curl -LsSf https://astral.sh/uv/install.sh | sh

Best Practices

  1. Use descriptive project names - kebab-case for directories, snake_case for Python
  2. Update dependencies - Keep pyproject.toml current
  3. Run tests early - Verify setup with pytest immediately
  4. Configure IDE - Use generated configs for VS Code/PyCharm
  5. Document as you go - Keep README.md updated

Integration Points

With repo-readiness

# After project creation
/repo-readiness

# Verifies:
# - CLAUDE.md present
# - .agent-os/ configured
# - Tests passing
# - Environment setup

With agent-os-framework

# Enhance with full agent-os
/agent-os-framework my-project

# Adds:
# - Complete .agent-os/ structure
# - Mission and roadmap templates
# - Decision log

Related Skills

References


Version History

  • 1.0.0 (2026-01-14): Initial release - standardized Python project generation with pyproject.toml, UV support, pytest configuration, and workspace-hub compliance

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

25.59%
按下载量换算41

windsurf

23.02%
按下载量换算37

trae

17.19%
按下载量换算28

OpenCode

12.06%
按下载量换算20

Cursor

6.92%
按下载量换算11

Codex

3.23%
按下载量换算5

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills