Claude Skill

python-services

Python patterns for CLI tools, async concurrency, and backend services. Use when working with Python code, building CLI apps, FastAPI services, async with asyncio, background jobs, or configuring uv, ruff, ty, pytest, or pyproject.toml.

LLM Mart · 0 points · 1 views 0 listing impressions 0 install-command copies
Download iliaal-ai-skills-skills_python-services-6e16f4a.zip · 17 KB

Install

skills CLI npx skills add https://github.com/iliaal/ai-skills/tree/master/skills/python-services
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install iliaal-ai-skills@llmmart
Git git clone https://github.com/iliaal/ai-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole iliaal/ai-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Python Services & CLI

Working rules

  • Validate external inputs and responses at boundaries; preserve exception causes.
  • Keep missing results distinct from empty results. When an empty collection means success, require the response field instead of defaulting it to empty; an all-default model can validate {} as success. Test missing, misspelled, explicitly empty, and populated payloads through the real validation boundary.
  • Keep simple sequential work synchronous. Bound concurrent work, preserve cancellation, and keep task references.
  • Give network calls timeouts; retry only failures and operations whose semantics permit it.
  • Enforce job idempotency with atomic writes and database constraints.
  • Preserve published API behavior and shared migration history.
  • Match telemetry to an operational question and verify its output.

Discipline

  • Simplicity first: every change as simple as possible, impact minimal code
  • Only touch what's necessary; avoid introducing unrelated changes
  • No hacky workarounds: if a fix feels wrong, step back and implement the clean solution
  • Before adding a new abstraction, verify it appears in 3+ places. If not, inline it.
  • Verify: see Verify section below; pass all checks with zero warnings before declaring done

Verify

  • uv run pytest passes with zero failures
  • uv run ruff check . passes with zero warnings
  • uv run ty check . passes with zero errors
  • Coverage target: 80%+ (uv run pytest --cov; add --cov-report=html for a browsable report)

Task-specific references

Read the relevant reference before implementing or reviewing the matching behavior:

Existing specialized references, when the corresponding topic applies:

Files (ai-skills)
  • references
    • cli-tools.md 1.1 KB
      Loading…
    • concurrency-and-resilience.md 11.9 KB
      Loading…
    • fastapi.md 3.1 KB
      Loading…
    • service-boundaries.md 6.1 KB
      Loading…
    • tooling-and-tests.md 4.9 KB
      Loading…
  • SKILL.md 2.6 KB
    ---
    name: python-services
    class: language
    description: >-
      Python patterns for CLI tools, async concurrency, and backend services. Use
      when working with Python code, building CLI apps, FastAPI services,
      async with asyncio, background jobs, or configuring uv, ruff, ty, pytest, or
      pyproject.toml.
    paths:
      - "**/*.py"
      - "**/pyproject.toml"
      - "**/ruff.toml"
      - "**/uv.lock"
    ---
    
    # Python Services & CLI
    
    ## Working rules
    
    - Validate external inputs and responses at boundaries; preserve exception causes.
    - **Keep missing results distinct from empty results.** When an empty collection means success, require the response field instead of defaulting it to empty; an all-default model can validate `{}` as success. Test missing, misspelled, explicitly empty, and populated payloads through the real validation boundary.
    - Keep simple sequential work synchronous. Bound concurrent work, preserve cancellation, and keep task references.
    - Give network calls timeouts; retry only failures and operations whose semantics permit it.
    - Enforce job idempotency with atomic writes and database constraints.
    - Preserve published API behavior and shared migration history.
    - Match telemetry to an operational question and verify its output.
    
    ## Discipline
    
    - Simplicity first: every change as simple as possible, impact minimal code
    - Only touch what's necessary; avoid introducing unrelated changes
    - No hacky workarounds: if a fix feels wrong, step back and implement the clean solution
    - Before adding a new abstraction, verify it appears in 3+ places. If not, inline it.
    - Verify: see Verify section below; pass all checks with zero warnings before declaring done
    
    
    ## Verify
    
    - `uv run pytest` passes with zero failures
    - `uv run ruff check .` passes with zero warnings
    - `uv run ty check .` passes with zero errors
    - Coverage target: 80%+ (`uv run pytest --cov`; add `--cov-report=html` for a browsable report)
    
    ## Task-specific references
    
    Read the relevant reference before implementing or reviewing the matching behavior:
    
    - For packaging, environment configuration, CLI setup, or pytest behavior: [tooling-and-tests.md](./references/tooling-and-tests.md).
    - For asyncio, background jobs, retries, pooling, timeouts, or health checks: [concurrency-and-resilience.md](./references/concurrency-and-resilience.md).
    - For APIs, validation, errors, migrations, logging, metrics, or traces: [service-boundaries.md](./references/service-boundaries.md).
    
    Existing specialized references, when the corresponding topic applies:
    
    - [cli-tools.md](./references/cli-tools.md).
    - [fastapi.md](./references/fastapi.md).
    
  • SPEC.md 4.4 KB
    Loading…

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.