Back to Skills

myfy-patterns

verified

Core myfy patterns and conventions for building applications. Use when working with myfy.core, Application, WebModule, DataModule, FrontendModule, TasksModule, UserModule, CliModule, AuthModule, RateLimitModule, or @route decorators.

View on GitHub

Marketplace

myfy-plugins

psincraian/myfy

Plugin

myfy

frameworks

Repository

psincraian/myfy
83stars

plugins/claude-code/skills/myfy-patterns/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/psincraian/myfy/blob/main/plugins/claude-code/skills/myfy-patterns/SKILL.md -a claude-code --skill myfy-patterns

Installation paths:

Claude
.claude/skills/myfy-patterns/
Powered by add-skill CLI

Instructions

# myfy Framework Patterns

You are assisting a developer building an application with the myfy Python framework.

## Core Principles

1. **Opinionated, not rigid** - Strong defaults, full configurability
2. **Modular by design** - Features are modules (web, data, tasks, frontend)
3. **Type-safe DI** - Constructor injection with compile-time validation
4. **Async-native** - Built on ASGI and AnyIO with contextvars
5. **Zero-config defaults** - Convention over configuration

## Imports

Always import from the public API:

```python
# Core
from myfy.core import Application, provider, SINGLETON, REQUEST, TASK
from myfy.core import BaseSettings, BaseModule

# Web
from myfy.web import WebModule, route, Query, abort, errors
from myfy.web import Authenticated, Anonymous, AuthModule
from myfy.web.ratelimit import RateLimitModule, rate_limit

# Data
from myfy.data import DataModule, AsyncSession

# Tasks
from myfy.tasks import TasksModule, task, TaskContext

# Frontend
from myfy.frontend import FrontendModule, render_template

# User
from myfy.user import UserModule

# CLI Commands
from myfy.commands import CliModule, cli
```

## Application Structure

```python
from myfy.core import Application
from myfy.web import WebModule, route
from myfy.data import DataModule

app = Application(
    settings_class=AppSettings,  # Optional custom settings
    auto_discover=False,          # Disable auto-discovery for explicit control
)

# Add modules in dependency order
app.add_module(DataModule())
app.add_module(WebModule())
```

## Module Categories

| Module | Package | Purpose |
|--------|---------|---------|
| WebModule | myfy-web | HTTP routing, ASGI, FastAPI-like decorators |
| DataModule | myfy-data | SQLAlchemy async, migrations, sessions |
| FrontendModule | myfy-frontend | Jinja2, Tailwind 4, DaisyUI 5, Vite |
| TasksModule | myfy-tasks | Background jobs, SQL-based task queue |
| UserModule | myfy-user | Auth, OAuth, user management |
| CliModule | myfy-commands | Custom CLI c

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3930 chars