claudegoodies
Command

blueprint

From davila7

Create organized Flask blueprints for modular application structure.

Install

/blueprint

Facts

Status
Actively maintained
Last commit

Source preview

The instructions Claude Code reads when this command runs.

# Flask Blueprint Generator

Create organized Flask blueprints for modular application structure.

## Usage

```bash
# Create a new blueprint
flask create-blueprint users
flask create-blueprint api/v1
```

## Blueprint Structure

Generates a complete blueprint with:
- Routes and view functions
- Error handlers
- Template folder structure
- Static file organization

## Example Blueprint

```python
# app/blueprints/users/__init__.py
from flask import Blueprint

users_bp = Blueprint(
    'users',
    __name__,
    url_prefix='/users',
    template_folder='templates',
    static_folder='static'
)

from . import routes, models

# app/blueprints/users/routes.py
from flask import render_template, request, redirect, url_for, flash
from . import users_bp
from .models import User
from .forms import UserForm

@users_bp.route('/')
def index():
    """List all users."""
    users = User.query.all()
    return render_template('users/index.html', users=users)

@users_bp.route('/create', methods=['GET', 'POST'])
def create():
    """Create a new user."""
    form = UserForm()
    if form.validate_on_submit():
        user = User(
            username=form.username.data,
            email=form.email.data
        )
        user.save()
        flash('User created successfully!', 'success')
        return redirect(url_for('users.index'))
    return render_template('users/create.html', form=form)

View full source on GitHub →

Other slash commands