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

python-skillsPython skills 测试

Agent Skill

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

总安装

1,272

周安装

53

GitHub Stars

821

下载量

424
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/llama-farm/llamafarm --skill python-skills

简介

提供 Python 技能图谱与学习路径参考。

  • 可梳理核心知识点与进阶方向建议。python-skills 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 适合开发者规划个人能力提升计划。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 安装方式:通过 GitHub 仓库使用 npx 命令添加。
  • 路径建议通用性强,需根据实际岗位调整重点。

SKILL.md

Python Skills for LlamaFarm

Shared Python best practices and code review checklists for all Python components in the LlamaFarm monorepo.

Applicable Components

ComponentPathPythonKey Dependencies
Serverserver/3.12+FastAPI, Celery, Pydantic, structlog
RAGrag/3.11+LlamaIndex, ChromaDB, Celery
Universal Runtimeruntimes/universal/3.11+PyTorch, transformers, FastAPI
Configconfig/3.11+Pydantic, JSONSchema
Commoncommon/3.10+HuggingFace Hub

Quick Reference

TopicFileKey Points
Patternspatterns.mdDataclasses, Pydantic, comprehensions, imports
Asyncasync.mdasync/await, asyncio, concurrent execution
Typingtyping.mdType hints, generics, protocols, Pydantic
Testingtesting.mdPytest fixtures, mocking, async tests
Errorserror-handling.mdCustom exceptions, logging, context managers
Securitysecurity.mdPath traversal, injection, secrets, deserialization

Code Style

LlamaFarm uses ruff with shared configuration in ruff.toml:

line-length = 88
target-version = "py311"
select = ["E", "F", "I", "B", "UP", "SIM"]

Key rules:

  • E, F: Core pyflakes and pycodestyle
  • I: Import sorting (isort)
  • B: Bugbear (common pitfalls)
  • UP: Upgrade syntax to modern Python
  • SIM: Simplify code patterns

Architecture Patterns

Settings with pydantic-settings

from pydantic_settings import BaseSettings

class Settings(BaseSettings, env_file=".env"):
    LOG_LEVEL: str = "INFO"
    HOST: str = "0.0.0.0"
    PORT: int = 14345

settings = Settings()  # Singleton at module level

Structured Logging with structlog

from core.logging import FastAPIStructLogger  # Server
from core.logging import RAGStructLogger      # RAG
from core.logging import UniversalRuntimeLogger  # Runtime

logger = FastAPIStructLogger(__name__)
logger.info("Operation completed", extra={"count": 10, "duration_ms": 150})

Abstract Base Classes for Extensibility

from abc import ABC, abstractmethod

class Component(ABC):
    def __init__(self, name: str, config: dict[str, Any] | None = None):
        self.name = name or self.__class__.__name__
        self.config = config or {}

    @abstractmethod
    def process(self, documents: list[Document]) -> ProcessingResult:
        pass

Dataclasses for Internal Data

from dataclasses import dataclass, field

@dataclass
class Document:
    content: str
    metadata: dict[str, Any] = field(default_factory=dict)
    id: str = field(default_factory=lambda: str(uuid.uuid4()))

Pydantic Models for API Boundaries

from pydantic import BaseModel, Field, ConfigDict

class EmbeddingRequest(BaseModel):
    model: str
    input: str | list[str]
    encoding_format: Literal["float", "base64"] | None = "float"

    model_config = ConfigDict(str_strip_whitespace=True)

Directory Structure

Each Python component follows this structure:

component/
├── pyproject.toml     # UV-managed dependencies
├── core/              # Core functionality
│   ├── __init__.py
│   ├── settings.py    # Pydantic Settings
│   └── logging.py     # structlog setup
├── services/          # Business logic (server)
├── models/            # ML models (runtime)
├── tasks/             # Celery tasks (rag)
├── utils/             # Utility functions
└── tests/
    ├── conftest.py    # Shared fixtures
    └── test_*.py

Review Checklist Summary

When reviewing Python code in LlamaFarm:

  1. Patterns (Medium priority)

- Modern Python syntax (3.10+ type hints) - Dataclass vs Pydantic used appropriately - No mutable default arguments

  1. Async (High priority)

- No blocking calls in async functions - Proper asyncio.Lock usage - Cancellation handled correctly

  1. Typing (Medium priority)

- Complete return type hints - Generic types parameterized - Pydantic v2 patterns

  1. Testing (Medium priority)

- Fixtures properly scoped - Async tests use pytest-asyncio - Mocks cleaned up

  1. Errors (High priority)

- Custom exceptions with context - Structured logging with extra dict - Proper exception chaining

  1. Security (Critical priority)

- Path traversal prevention - Input sanitization - Safe deserialization

See individual topic files for detailed checklists with grep patterns.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

30.32%
按下载量换算129

Codex

21.68%
按下载量换算92

windsurf

19.56%
按下载量换算83

OpenCode

12.61%
按下载量换算53

Antigravity

7.79%
按下载量换算33

trae

3.38%
按下载量换算14

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills