Skip to content
Back to skills

Python

ASecurity

Build, review, and refactor Python backend services. Use for tasks like FastAPI/Flask service setup, API design, request/response schemas, database access (PostgreSQL), migrations, background jobs, observability (logging/metrics/tracing), authentication, configuration, testing, and production hardening.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 28, 2026
databasespythonsqlfastapiflasktestingapidatabasebackendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 28, 2026

npx -y skills add muzhicaomingwang/ai-ideas --skill python --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/muzhicaomingwang-python/badge)](https://www.skillsdirectory.com/skills/muzhicaomingwang-python)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python
description: Build, review, and refactor Python backend services. Use for tasks like FastAPI/Flask service setup, API design, request/response schemas, database access (PostgreSQL), migrations, background jobs, observability (logging/metrics/tracing), authentication, configuration, testing, and production hardening.
---

# python

Use this skill for Python 后端服务开发与评审。

## Defaults (unless repo dictates otherwise)

- Framework: FastAPI (preferred) or follow existing
- Python: follow repo’s version; prefer modern typing
- API: JSON over HTTP, explicit schemas
- DB: PostgreSQL; prefer explicit migrations

## Service structure (recommended)

- `app/`
  - `main.py` (app factory, routers)
  - `api/` (routers, request/response models)
  - `core/` (config, logging, security)
  - `db/` (session/engine, repositories)
  - `models/` (ORM models if used)
  - `schemas/` (Pydantic models)
  - `services/` (business logic)
  - `integrations/` (3rd party clients)
  - `tests/`

## Workflow

1) Clarify contract
- Endpoints, auth requirements, error model, SLAs.
- Data ownership and persistence requirements.

2) API design
- Version paths (`/v1/...`) and consistent naming.
- Pydantic schemas: validate on input, shape output explicitly.
- Error responses: stable `code` + `message` + optional `details`.

3) Persistence
- Define schema and migrations (Alembic if used).
- Avoid leaking DB models into API; map to schemas.
- Use indexes for query paths; ensure safe defaults and constraints.

4) Security
- Keep secrets in env vars; never in code.
- AuthN/AuthZ: token validation, scopes/roles.
- Input validation, rate limiting (if relevant), safe logging (no PII).

5) Observability
- Structured logs with request IDs.
- Metrics for latency, error rate, DB timings; tracing if available.

6) Testing
- Unit tests for business logic.
- API tests for endpoints (happy path + errors).
- Deterministic fixtures; avoid flaky time/network dependencies.

## Output expectations when making changes

- Prefer small, incremental diffs.
- Update schemas/migrations/tests together.
- Document new env vars and run steps.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.