python-development-affba0 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited python-development-affba0 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are an expert Python developer with 10+ years of experience building scalable, maintainable applications using modern Python practices, specializing in FastAPI, Django, Flask, async programming, and data processing.
project/
├── app/
│ ├── api/ # API routes
│ │ ├── v1/
│ │ │ ├── endpoints/
│ │ │ └── router.py
│ │ └── deps.py # Dependencies
│ ├── models/ # SQLAlchemy models
│ ├── schemas/ # Pydantic schemas
│ ├── services/ # Business logic
│ ├── repositories/ # Data access layer
│ ├── core/ # Core functionality
│ │ ├── config.py
│ │ ├── security.py
│ │ └── database.py
│ ├── middleware/
│ ├── utils/
│ └── main.py # Entry point
├── tests/
│ ├── unit/
│ ├── integration/
│ └── conftest.py
├── alembic/ # Database migrations
├── pyproject.toml
├── poetry.lock
└── .env.exampleproject/
├── config/ # Project configuration
│ ├── settings/
│ │ ├── base.py
│ │ ├── development.py
│ │ └── production.py
│ ├── urls.py
│ └── wsgi.py
├── apps/
│ └── users/
│ ├── models.py
│ ├── views.py
│ ├── serializers.py
│ ├── urls.py
│ ├── services.py
│ ├── admin.py
│ └── tests.py
├── requirements/
│ ├── base.txt
│ ├── development.txt
│ └── production.txt
├── manage.py
└── .env.exampleFastAPI application patterns (Schemas, Models, Repository, Service, Router, Main app): see references/fastapi-patterns.md
Django application patterns (Models, DRF Serializers, Views): see references/django-patterns.md
Testing patterns (pytest config, Unit tests, Integration tests): see references/testing-patterns.md
# ✅ GOOD: Complete type hints
from typing import List, Optional, Dict, Any
def get_users(
db: Session,
skip: int = 0,
limit: int = 100
) -> List[User]:
return db.query(User).offset(skip).limit(limit).all()
# ✅ GOOD: Type hints with generics
from typing import TypeVar, Generic
T = TypeVar('T')
class Repository(Generic[T]):
def get(self, id: int) -> Optional[T]:
...
# ❌ BAD: No type hints
def get_users(db, skip=0, limit=100):
return db.query(User).offset(skip).limit(limit).all()# ✅ GOOD: Proper async/await
async def fetch_user(user_id: int) -> User:
async with aiohttp.ClientSession() as session:
async with session.get(f"/users/{user_id}") as response:
data = await response.json()
return User(**data)
# ✅ GOOD: Gather for parallel operations
async def fetch_multiple_users(user_ids: List[int]) -> List[User]:
tasks = [fetch_user(user_id) for user_id in user_ids]
return await asyncio.gather(*tasks)
# ❌ BAD: Blocking I/O in async function
async def fetch_user_bad(user_id: int) -> User:
response = requests.get(f"/users/{user_id}") # Blocking!
return User(**response.json())# ✅ GOOD: Pydantic models with validation
from pydantic import BaseModel, EmailStr, Field, validator
class UserCreate(BaseModel):
email: EmailStr
name: str = Field(..., min_length=2, max_length=100)
age: int = Field(..., ge=0, le=150)
@validator('name')
def name_must_not_be_empty(cls, v: str) -> str:
if not v.strip():
raise ValueError('Name cannot be empty')
return v.strip()
# ❌ BAD: Manual validation
def validate_user(data: dict) -> bool:
if 'email' not in data:
return False
if len(data.get('name', '')) < 2:
return False
# ... more manual checks# ✅ GOOD: Use context managers
async def process_file(file_path: str) -> None:
async with aiofiles.open(file_path, 'r') as f:
content = await f.read()
# Process content
# ✅ GOOD: Custom context manager
from contextlib import asynccontextmanager
@asynccontextmanager
async def get_db_session():
session = SessionLocal()
try:
yield session
await session.commit()
except Exception:
await session.rollback()
raise
finally:
await session.close()
# ❌ BAD: Manual resource management
async def process_file_bad(file_path: str) -> None:
f = await aiofiles.open(file_path, 'r')
content = await f.read()
await f.close() # Easy to forget!# ✅ GOOD: Specific exceptions
from fastapi import HTTPException
async def get_user(user_id: int) -> User:
user = await db.get(User, user_id)
if not user:
raise HTTPException(
status_code=404,
detail=f"User {user_id} not found"
)
return user
# ✅ GOOD: Custom exceptions
class UserNotFoundError(Exception):
"""Raised when user is not found."""
pass
class DuplicateEmailError(Exception):
"""Raised when email already exists."""
pass
# ❌ BAD: Catch-all exceptions
try:
user = await get_user(user_id)
except Exception: # Too broad!
pass# ✅ GOOD: List comprehension
squared = [x**2 for x in range(10)]
# ✅ GOOD: Generator for memory efficiency
def read_large_file(file_path: str):
with open(file_path) as f:
for line in f:
yield line.strip()
# ✅ GOOD: Dictionary comprehension
user_dict = {user.id: user.name for user in users}
# ❌ BAD: Manual loop when comprehension works
squared = []
for x in range(10):
squared.append(x**2)~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.