Skip to content
Back to skills

Schemas

ASecurity

Pydantic v2 request/response schemas for RepoForge Web API. Trigger: when defining or validating schemas in apps/server/app/models/schemas.py

  • 5 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 26, 2026
ai-agentspythonbashapidatabase

Works with

  • api

Security analysis

A100/100

Scanned October 4, 2026

npx -y skills add JNZader/repoforge --skill schemas --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Schemas?

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

Security grade badge for Schemas
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jnzader-schemas/badge)](https://www.skillsdirectory.com/skills/jnzader-schemas)

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: add-schemas-endpoint
description: >
  Pydantic v2 request/response schemas for RepoForge Web API.
  Trigger: when defining or validating schemas in apps/server/app/models/schemas.py
license: Apache-2.0
metadata:
  author: repoforge
  version: "1.0"
complexity: low
token_estimate: 450
dependencies: []
related_skills: [auth, generate]
load_priority: high
---

<!-- L1:START -->
# add-schemas-endpoint

Pydantic v2 request/response schemas for RepoForge Web API.

**Trigger**: when defining or validating schemas in apps/server/app/models/schemas.py
<!-- L1:END -->

<!-- L2:START -->
## Quick Reference

| Task | Pattern |
|------|---------|
| Validate user input | `UserInfo` |
| Structure API responses | `UserResponse` |
<!-- L2:END -->

<!-- L3:START -->
## Critical Patterns (Detailed)

### Pattern: UserInfo Validation

Validates incoming user data with required fields and type coercion.

```python
// Real code using actual exported names from this module
from pydantic import BaseModel

class UserInfo(BaseModel):
    username: str
    email: str
    is_active: bool = True
```
### Pattern: UserResponse Structure

Structures API response with computed fields and serialization.

```python
// Real code using actual exported names from this module
from pydantic import BaseModel, Field

class UserResponse(BaseModel):
    id: int
    username: str
    email: str
    is_active: bool
    created_at: datetime.datetime = Field(default_factory=datetime.datetime.now)
```
## When to Use

- When defining request models for `/auth/validate` endpoint
- When structuring user data in API responses

## Commands

```bash
# Run the server with uvicorn
uvicorn apps.server.main:app --reload

# Apply database migrations
alembic upgrade head
```
## Anti-Patterns

### Don't: Omit required fields

<Why it's wrong.> Omitting required fields like `username` or `email` causes Pydantic validation errors at runtime, breaking API endpoints.

```python
// BAD
class BadUserInfo(BaseModel):
    # Missing required 'username' field
    email: str
```
<!-- L3:END -->

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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