flask-route
From davila7
Create Flask routes with proper structure and error handling.
Install
/flask-routeFacts
- Repository
- davila7/claude-code-templates
- Status
- Actively maintained
- Last commit
Source preview
The instructions Claude Code reads when this command runs.
# Flask Route Generator
Create Flask routes with proper structure and error handling.
## Purpose
This command helps you quickly create Flask routes with validation, error handling, and best practices.
## Usage
```
/flask-route
```
## What this command does
1. **Creates route functions** with proper decorators
2. **Adds request validation** and error handling
3. **Includes JSON responses** and status codes
4. **Implements authentication** if needed
5. **Follows Flask conventions** and best practices
## Example Output
```python
# routes.py or app.py
from flask import Flask, request, jsonify, abort
from flask_sqlalchemy import SQLAlchemy
from werkzeug.exceptions import BadRequest
app = Flask(__name__)
@app.route('/users', methods=['GET'])
def get_users():
"""Get all users with optional pagination."""
try:
page = request.args.get('page', 1, type=int)
per_page = request.args.get('per_page', 10, type=int)
users = User.query.paginate(
page=page,
per_page=per_page,
error_out=False
)
return jsonify({
'users': [user.to_dict() for user in users.items],
'total': users.total,
'pages': users.pages,
'current_page': page
}), 200
except Exception as e:
return jsonify({'error': 'Failed to fetch users'}), 50View full source on GitHub →Other slash commands
feature-development
★ 229,918Workflow command scaffold for feature-development in everything-claude-code.
affaan-mupdated 14d agoMITdatabase-migration
★ 229,918Workflow command scaffold for database-migration in everything-claude-code.
affaan-mupdated 14d agoMITadd-language-rules
★ 229,918Workflow command scaffold for add-language-rules in everything-claude-code.
affaan-mupdated 14d agoMITcommit-push-pr
★ 137,934Commit, push, and open a PR
anthropicsupdated 13d agodedupe
★ 137,934Find duplicate GitHub issues
anthropicsupdated 13d agotriage-issue
★ 137,934Triage GitHub issues by analyzing and applying labels
anthropicsupdated 13d ago