Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

architect-python-uv-batch架构师 Python UV batch

Agent Skill

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

总安装

245

周安装

10

GitHub Stars

公开资料未说明

下载量

79
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ajrlewis/ai-skills --skill architect-python-uv-batch

简介

architect-python-uv-batch 用于非 API Python 项目的 CLI 和批处理任务架构搭建。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中进行数据处理、PDF 解析等自动化脚本开发。
  • 通过 GitHub 安装,使用 npx skills add 命令添加技能,集成 uv 包管理和 Docker 支持。
  • 安装前建议确认权限范围,注意是否会触发命令执行、文件读写或数据库访问操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Architect: Python + uv Batch

Use this skill for non-API Python projects that run as CLI or scheduled jobs, especially data/PDF processing pipelines. Docker is required by default for this runnable base architect skill. Only allow NO_DOCKER=yes when the user explicitly asks for a local-only exception.

Inputs

Collect these values:

  • PROJECT_NAME: kebab-case repo/folder name.
  • MODULE_NAME: snake_case import package.
  • PYTHON_VERSION: default 3.12.
  • USE_RAG: yes or no.
  • EMBED_PROVIDER: openai or sentence-transformers (default local sentence-transformers).
  • NO_DOCKER: default no. Set to yes only when user explicitly opts out of containerization.

Preflight Checks

Run before scaffolding:

command -v uv >/dev/null && uv --version || echo "uv-missing"
python3 --version
command -v docker >/dev/null && docker --version || echo "docker-missing"

Execution modes:

  • production-default: uv + docker available; emit and validate container artifacts.
  • local-no-docker: user explicitly sets NO_DOCKER=yes.
  • offline-smoke: uv missing and/or no network; scaffold file structure and stdlib smoke path, then record constraints in TEST_NOTES.md.

Production-default contract:

  • Must create Dockerfile, .dockerignore, and docker-compose.yml.
  • Must include CI image build check.
  • Must run at least one containerized smoke command in validation.

Scaffold Workflow

  1. Initialize project (production-default or local-no-docker):
uv init --package {{PROJECT_NAME}}
cd {{PROJECT_NAME}}

If offline-smoke mode is required, create equivalent structure manually and keep commands runnable via:

PYTHONPATH=src python3 -m {{MODULE_NAME}}.cli ingest-pdf
python3 -m unittest discover -s tests -v
  1. Add core dependencies:
uv add pydantic-settings typer rich pypdf pandas orjson
uv add -d pytest ruff mypy
  1. If USE_RAG=yes, add RAG dependencies:
uv add langchain-text-splitters chromadb
  • For local embeddings:
uv add sentence-transformers
  • For OpenAI embeddings:
uv add openai
  1. Create structure:
src/{{MODULE_NAME}}/
  cli.py
  core/config.py
  pipelines/pdf_ingest.py
  pipelines/normalize.py
  rag/chunk.py
  rag/embed.py
  rag/store.py
tests/
  test_ingest.py
data/inbox/
data/processed/

If NO_DOCKER=no, also create:

  • Dockerfile
  • .dockerignore
  • docker-compose.yml
  1. Wire command entrypoint in pyproject.toml:
[project.scripts]
{{PROJECT_NAME}} = "{{MODULE_NAME}}.cli:main"

Required Defaults

src/{{MODULE_NAME}}/core/config.py

from pydantic_settings import BaseSettings, SettingsConfigDict

class Settings(BaseSettings):
    model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
    environment: str = "development"
    inbox_dir: str = "data/inbox"
    processed_dir: str = "data/processed"
    embed_provider: str = "sentence-transformers"
    embed_model: str = "sentence-transformers/all-MiniLM-L6-v2"
    openai_api_key: str | None = None
    chroma_path: str = ".chroma"

settings = Settings()

src/{{MODULE_NAME}}/cli.py

import typer

from {{MODULE_NAME}}.pipelines.pdf_ingest import run_pdf_ingest

app = typer.Typer(no_args_is_help=True)

@app.command("ingest-pdf")
def ingest_pdf() -> None:
    run_pdf_ingest()

def main() -> None:
    app()

if __name__ == "__main__":
    main()

src/{{MODULE_NAME}}/pipelines/pdf_ingest.py

import hashlib
from pathlib import Path

from pypdf import PdfReader

from {{MODULE_NAME}}.core.config import settings

def run_pdf_ingest() -> None:
    inbox = Path(settings.inbox_dir)
    out = Path(settings.processed_dir)
    out.mkdir(parents=True, exist_ok=True)
    for pdf_path in inbox.glob("*.pdf"):
        text = "\n".join(page.extract_text() or "" for page in PdfReader(str(pdf_path)).pages)
        suffix = hashlib.sha1(str(pdf_path).encode("utf-8")).hexdigest()[:8]
        target = out / f"{pdf_path.name}.{suffix}.txt"
        target.write_text(text, encoding="utf-8")

tests/test_ingest.py (import-safe for unittest discover)

from pathlib import Path
import sys

ROOT = Path(__file__).resolve().parents[1]
SRC = ROOT / "src"
if str(SRC) not in sys.path:
    sys.path.insert(0, str(SRC))

from {{MODULE_NAME}}.pipelines.pdf_ingest import run_pdf_ingest

Dockerfile (NO_DOCKER=no)

FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS build
WORKDIR /app
COPY pyproject.toml uv.lock ./
COPY src ./src
RUN uv sync --frozen --no-dev
COPY data ./data

FROM python:3.12-slim AS run
WORKDIR /workspace
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN useradd --create-home --shell /bin/bash app
COPY --from=build /app/.venv /app/.venv
COPY --from=build /app /workspace
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/workspace/src"
RUN chown -R app:app /workspace
USER app
CMD ["python", "-m", "{{MODULE_NAME}}.cli", "ingest-pdf"]

.dockerignore (NO_DOCKER=no)

.git
.venv
__pycache__
.pytest_cache
.mypy_cache
.ruff_cache
data/processed

docker-compose.yml (NO_DOCKER=no)

services:
  app:
    build: .
    environment:
      INBOX_DIR: /workspace/data/inbox
      PROCESSED_DIR: /workspace/data/processed
    volumes:
      - ./data:/workspace/data
    command: ["python", "-m", "{{MODULE_NAME}}.cli", "ingest-pdf"]

Do not add a ports: block by default for batch workers. They are one-shot or background jobs, not HTTP services; use volumes and explicit commands instead.

CI + Quality

Create .github/workflows/ci.yml:

name: ci
on:
  push:
  pull_request:

jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - uses: astral-sh/setup-uv@v5
      - run: uv sync --frozen --dev
      - run: uv run ruff check .
      - run: uv run ruff check . --select D
      - run: uv run mypy src
      - run: uv run pytest -q
      - uses: docker/setup-buildx-action@v3
      - uses: docker/build-push-action@v6
        with:
          context: .
          push: false
          tags: {{PROJECT_NAME}}:ci
          cache-from: type=gha
          cache-to: type=gha,mode=max

Guardrails

  • Documentation contract for generated code:

- Python: write module docstrings and docstrings for public classes, methods, and functions. - Next.js/TypeScript: write JSDoc for exported components, hooks, utilities, and route handlers. - Add concise rationale comments only for non-obvious logic, invariants, or safety constraints. - Apply this contract even when using template snippets below; expand templates as needed.

  • Keep batch jobs idempotent; output paths must be safe to re-run.
  • Make output names collision-safe across formats and paths (include extension and a stable suffix/hash).
  • Never commit secrets; use .env and environment variables.
  • Keep processing logic pure where possible, IO at pipeline edges.
  • If RAG is optional, keep rag/* modules decoupled from non-RAG pipelines.
  • Treat NO_DOCKER=yes as an explicit exception, not a default path.
  • Ensure tests can run via plain python3 -m unittest discover -s tests -v without requiring PYTHONPATH for imports.
  • Ensure uv.lock is committed before Docker build; the Dockerfile copies it explicitly for deterministic uv sync --frozen installs.
  • Ensure any runtime output directories under /workspace are writable by the non-root app user.

Validation Checklist

  • Confirm generated code includes required docstrings/JSDoc and rationale comments for non-obvious logic.
uv run ruff check .
uv run ruff check . --select D
uv run mypy src
uv run pytest -q
uv run {{PROJECT_NAME}} ingest-pdf
test -f uv.lock
docker build -t {{PROJECT_NAME}}:local .
docker compose run --rm app

local-no-docker (NO_DOCKER=yes):

uv run ruff check .
uv run ruff check . --select D
uv run mypy src
uv run pytest -q
uv run {{PROJECT_NAME}} ingest-pdf

Fallback (offline-smoke):

PYTHONPATH=src python3 -m {{MODULE_NAME}}.cli ingest-pdf
python3 -m unittest discover -s tests -v

Decision Justification Rule

  • Every non-trivial decision must include a concrete justification.
  • Capture the alternatives considered and why they were rejected.
  • State tradeoffs and residual risks for the chosen option.
  • If justification is missing, treat the task as incomplete and surface it as a blocker.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.35%
按下载量换算28

Claude

29.23%
按下载量换算23

Cursor

18.93%
按下载量换算15

Gemini CLI

9.63%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills