sqlmodel-task-models

This skill should be used when defining a robust, type-safe, and async-compatible database schema for the Todo application using SQLModel, ensuring compatibility with Better Auth and optimized for PostgreSQL.

16 stars

Best use case

sqlmodel-task-models is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

This skill should be used when defining a robust, type-safe, and async-compatible database schema for the Todo application using SQLModel, ensuring compatibility with Better Auth and optimized for PostgreSQL.

Teams using sqlmodel-task-models should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/sqlmodel-task-models/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/sqlmodel-task-models/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/sqlmodel-task-models/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How sqlmodel-task-models Compares

Feature / Agentsqlmodel-task-modelsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

This skill should be used when defining a robust, type-safe, and async-compatible database schema for the Todo application using SQLModel, ensuring compatibility with Better Auth and optimized for PostgreSQL.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# SQLModel Task Models

This skill providing guidance on defining a robust database schema using SQLModel for the Todo application.

## Purpose
Defining a robust, type-safe, and async-compatible database schema for the Todo application using SQLModel, ensuring compatibility with Better Auth and optimized for PostgreSQL.

## Capabilities
- **User Model**: Schema aligned with Better Auth requirements.
- **Task Model**: Full CRUD capability with relational mapping to Users.
- **Relational Integrity**: Proper foreign key constraints and back-references.
- **Performance**: Strategic indexing on `user_id` and `completed` fields.
- **Safety**: Automated timestamp management (`created_at`, `updated_at`).

## Implementation Details

### Models Definition
```python
from sqlmodel import SQLModel, Field, Relationship
from typing import List, Optional
from datetime import datetime

class User(SQLModel, table=True):
    id: str = Field(primary_key=True)
    email: str = Field(unique=True, index=True)
    name: Optional[str] = None
    created_at: datetime = Field(default_factory=datetime.utcnow)
    tasks: List["Task"] = Relationship(back_populates="user")

class Task(SQLModel, table=True):
    id: Optional[int] = Field(default=None, primary_key=True)
    user_id: str = Field(foreign_key="user.id", index=True)
    title: str
    description: Optional[str] = None
    completed: bool = Field(default=False, index=True)
    created_at: datetime = Field(default_factory=datetime.utcnow)
    updated_at: datetime = Field(default_factory=datetime.utcnow)
    user: Optional[User] = Relationship(back_populates="tasks")
```

## Best Practices
- Using `table=True` for models that map to database tables.
- Explicitly defining indexes for fields used in `WHERE` clauses (e.g., `user_id`, `completed`).
- Using `datetime.utcnow` for consistent cross-region timestamping.
- Keeping `user_id` as a string to match Better Auth's UUID/ID format.

Related Skills

ios-foundation-models-diag

16
from diegosouzapw/awesome-omni-skill

Use when debugging Foundation Models issues — context exceeded, guardrail violations, slow generation, availability problems, unsupported language, or unexpected output. Systematic diagnostics with production crisis defense.

axiom-foundation-models

16
from diegosouzapw/awesome-omni-skill

Use when implementing on-device AI with Apple's Foundation Models framework — prevents context overflow, blocking UI, wrong model use cases, and manual JSON parsing when @Generable should be used. iOS 26+, macOS 26+, iPadOS 26+, axiom-visionOS 26+

avalonia-viewmodels-zafiro

16
from diegosouzapw/awesome-omni-skill

Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.

aidf-task-templates

16
from diegosouzapw/awesome-omni-skill

Task template definitions for AIDF. Provides structured templates for component, refactor, test, docs, architecture, and bugfix task types.

todo-task-planning

16
from diegosouzapw/awesome-omni-skill

Execute task planning based on the specified file and manage questions[/todo-task-planning file_path --pr --branch branch_name]

task-automation

16
from diegosouzapw/awesome-omni-skill

Execute development tasks from manifest, run parallel agents, verify builds, manage task pipeline. Use when user wants to run tasks, check task status, execute dev loop, or work through the backlog.

task-add

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "add a task", "create task", "new task", or "task to do X". Adds timestamped tasks to daily note log with optional due dates.

pixi-tasks

16
from diegosouzapw/awesome-omni-skill

Complex pixi task workflows and orchestration. Use when building task dependency chains, configuring caching with inputs/outputs, creating parameterized tasks, or setting up CI pipelines—e.g., "pixi task depends-on", "task caching for build automation", "multi-environment test matrices".

mise-tasks

16
from diegosouzapw/awesome-omni-skill

Orchestrate workflows with mise [tasks]. TRIGGERS - mise tasks, mise run, task runner, depends, depends_post, workflow automation, task dependencies.

defining-typescript-models

16
from diegosouzapw/awesome-omni-skill

Defines standard TypeScript interfaces for Appwrite Collections. Use when creating new models for Tours, Users, or Bookings to ensure full type safety.

pydantic-models-py

16
from diegosouzapw/awesome-omni-skill

Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants. Use when defining API request/response schemas, database models, or data validation ...

API Models

16
from diegosouzapw/awesome-omni-skill

Your approach to handling API models. Use this skill when working on files where API models comes into play.