flaskapi
БесплатноБез исполняемых скриптовНе проверенFlask API development including blueprints, extensions, and REST patterns. Activate for Flask apps, Python web APIs, and lightweight API development.
от TheLobbi★ 22 звезды на GitHubОб этом скилле
Flask API Skill
Provides comprehensive Flask API development capabilities for the Golden Armada AI Agent Fleet Platform.
When to Use This Skill
Activate this skill when working with:
- Flask application development
- Blueprint organization
- Flask extensions
- REST API patterns
- Flask deployment
Application Structure
``` app/ ├── init.py # Application factory ├── config.py # Configuration ├── extensions.py # Flask extensions ├── models/ │ ├── init.py │ └── agent.py ├── api/ │ ├── init.py │ ├── agents.py # Agents blueprint │ └── tasks.py # Tasks blueprint ├── services/ │ ├── init.py │ └── agent_service.py └── utils/ └── validators.py ```
Application Factory
```python
app/init.py
from flask import Flask from app.config import Config from app.extensions import db, migrate, cors
def create_app(config_class=Config): app = Flask(name) app.config.from_object(config_class)
# Initialize extensions
db.init_app(app)
migrate.init_app(app, db)
cors.init_app(app)
# Register blueprints
from app.api.agents import agents_bp
from app.api.tasks import tasks_bp
app.register_blueprint(agents_bp, url_prefix='/api/v1/agents')
app.register_blueprint(tasks_bp, url_prefix='/api/v1/tasks')
# Register error handlers
register_error_handlers(app)
# Health check
@app.route('/health')
def health():
return {'status': 'healthy', 'service': 'golden-armada'}
return app
def register_error_handlers(app): @app.errorhandler(404) def not_found(error): return {'error': 'Not found'}, 404
@app.errorhandler(500)
def internal_error(error):
return {'error': 'Internal server error'}, 500
```
Configuration
```python
app/config.py
import os from datetime import timedelta
class Config: SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-secret-key') SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:///app.db') SQLALCHEMY_TRACK_MODIFICATIONS = False JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', 'jwt-secret') JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=1)
class DevelopmentConfig(Config): DEBUG = True
class ProductionConfig(Config): DEBUG = False
class TestingConfig(Config): TESTING = True SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:' ```
Extensions
```python
app/extensions.py
from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_cors import CORS from flask_jwt_extended import JWTManager
db = SQLAlchemy() migrate = Migrate() cors = CORS() jwt = JWTManager() ```
Models
```python
app/models/agent.py
from app.extensions import db from datetime import datetime import uuid
class Agent(db.Model): tablename = 'agents'
id = db.Column(db.String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
name = db.Column(db.String(100), nullable=False)
type = db.Column(db.String(50), nullable=False)
status = db.Column(db.String(20), default='idle')
config = db.Column(db.JSON, default={})
created_at = db.Column(db.DateTime, default=datetime.utcnow)
updated_at = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
tasks = db.relationship('Task', backref='agent', lazy='dynamic', cascade='all, delete-orphan')
def to_dict(self):
return {
'id': self.id,
'name': self.name,
'type': self.type,
'status': self.status,
'config': self.config,
'created_at': self.created_at.isoformat(),
'updated_at': self.updated_at.isoformat()
}
```
Blueprints (API Routes)
```python
app/api/agents.py
from flask import Blueprint, request, jsonify from app.models.agent import Agent from app.extensions import db from app.utils.validators import validate_agent_input
agents_bp = Blueprint('agents', name)
@agents_bp.route('/', methods=['GET']) def list_agents(): """List all agents with optional filtering.""" agent_type = request.args.get('type') status = request.args.get('status') page = request.args.get('page', 1, type=int) per_page = request.args.get('per_page', 10, type=int)
query = Agent.query
if agent_type:
query = query.filter(Agent.type == agent_type)
if status:
query = query.filter(Agent.status == status)
pagination = query.paginate(page=page, per_page=per_page)
return jsonify({
'agents': [agent.to_dict() for agent in pagination.items],
'total': pagination.total,
'pages': pagination.pages,
'current_page': page
})
@agents_bp.route('/
@agents_bp.route('/', methods=['POST']) def create_agent(): """Cr
Установить flaskapi в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteEditGlobGrepFAQ
Что делает скилл flaskapi?
Flask API development including blueprints, extensions, and REST patterns. Activate for Flask apps, Python web APIs, and lightweight API development.
Как установить скилл flaskapi?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл flaskapi запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic