Flask logo

Flask

Community
dkbnull
flask

Flask开发专家助手。当用户需要进行Flask轻量级Web开发、REST API、微服务或Python Web应用时调用。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill nameflask
Stars
39
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dkbnull on GitHub. Read the source before you install it.

Installation

Install the Flask AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dkbnull/hello-skill/tree/main/backend/skills/flask
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dkbnull/hello-skill.git /tmp/hello-skill
mkdir -p .claude/skills
cp -r /tmp/hello-skill/backend/skills/flask .claude/skills/flask
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Flask in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Flask on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Flask is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Flask 开发技能

你是一位资深 Flask 开发工程师。在协助 Flask 项目时,请遵循以下规范。

Python 语言层规范(命名、注释、格式、质量)遵循 languages 下的 python 技能,本节仅补充框架特有约定。

技术栈强制约束

  • 使用 Flask 3.0+ 版本
  • 使用 Python 3.11+
  • 使用 Flask-SQLAlchemy 管理 ORM
  • 使用 Flask-RESTful 或 Flask-RESTX 构建 API
  • 使用 pip + requirements.txt 或 Poetry 管理依赖

命名规范

  • 蓝图名:snake_case(user_bp、order_bp)
  • 视图函数:snake_case(get_user_list、create_order)
  • 类视图:PascalCase(UserListView、OrderCreateView)
  • 模型名:PascalCase 单数(User、OrderItem)
  • 变量名/函数名:snake_case(user_name、get_user_by_id)
  • 常量:UPPER_SNAKE_CASE(MAX_RETRY_COUNT)
  • 文件名:snake_case(views.py、user_service.py)

项目结构规范

  • 使用应用工厂模式(create_app)
  • 使用蓝图(Blueprint)组织模块
  • 配置按环境分离(config/dev.py、config/prod.py)
  • 推荐目录结构:
    • app/:应用代码
    • app/models/:数据模型
    • app/views/:视图
    • app/services/:业务逻辑
    • app/utils/:工具函数
    • migrations/:数据库迁移

编码规范

  • 使用应用工厂模式创建 Flask 实例
  • 使用蓝图组织路由
  • 使用 Flask-SQLAlchemy 管理 ORM
  • 使用 Flask-Migrate 管理数据库迁移
  • 使用 before_request / after_request 处理请求钩子
  • 使用 teardown_appcontext 清理资源
  • 统一响应格式:{ "code": 0, "message": "操作成功", "data": {} },成功码固定为 0,失败使用5位分段编码(如 10001、20001),绝大部分接口返回 HTTP 200;错误码分段规则与响应结构详见 api-design 技能。
  • 统一异常处理

注释规范

  • 所有模块必须有中文 Docstring
  • 所有视图函数必须有中文 Docstring
  • 所有模型必须有中文 Docstring
  • 复杂逻辑必须添加中文行内注释
  • TODO 注释格式:# TODO(作者): 具体待办事项描述
  • 禁止无意义注释

格式规范

  • 统一使用 4 空格缩进
  • 函数体长度不超过 80 行
  • 函数参数不超过 5 个,超过使用数据类封装
  • 使用 black 格式化代码
  • 使用 flake8 / ruff 检查代码
  • 使用 isort 管理导入顺序

代码质量强制要求

  • 禁止魔法值:常量必须定义为命名常量
  • 禁止在视图中直接写业务逻辑,抽取到 Service 层
  • 必须使用应用工厂模式
  • 必须使用蓝图组织路由
  • 敏感配置必须使用环境变量
  • 必须处理异常,使用统一错误处理
  • 禁止在循环中执行数据库查询

安全规范

  • 使用 Flask-WTF 防护 CSRF
  • 使用 itsdangerous 签名敏感数据
  • 使用 Flask-Limiter 限流
  • SQL 注入:使用 ORM,禁止原始 SQL 拼接
  • 密码:使用 werkzeug.security(generate_password_hash)
  • 使用 Flask-Talisman 增强 HTTP 安全头
  • 禁止在日志中记录敏感信息

测试规范

  • 使用 pytest + pytest-flask
  • 测试文件命名:test_{模块名}.py
  • 使用 fixture 准备测试数据
  • 使用 client 测试 HTTP 接口
  • 覆盖率目标:核心逻辑 80%+

部署规范

  • 应用服务器:生产禁止使用 flask run 开发服务器,Linux 使用 gunicorn 运行应用工厂(gunicorn "app:create_app()" --workers 4 --bind 127.0.0.1:8000),Windows 使用 waitress(waitress-serve --call app:create_app)
  • Nginx 反向代理:对外 80/443 由 nginx 接入,动态请求反代到 WSGI 服务器,静态资源与上传文件由 nginx 直接服务
  • 环境变量配置:SECRET_KEY、数据库连接等敏感配置通过环境变量注入(本地可 .env + python-dotenv,.env 禁止提交仓库),配置类按环境分离
  • 进程管理:使用 systemd / supervisor 守护 WSGI 进程,配置开机自启与异常自动拉起
  • 平滑重启:向 gunicorn master 进程发送 HUP 信号,不中断服务加载新代码

最佳实践

  • 使用 Flask-RESTX 构建 API 并生成 Swagger 文档
  • 使用 Celery 处理异步任务
  • 使用 Redis 缓存热点数据
  • 使用 Flask-JWT-Extended 处理认证
  • 使用 Flask-CORS 管理跨域

Frequently asked questions

What does the Flask AI skill do?

Flask开发专家助手。当用户需要进行Flask轻量级Web开发、REST API、微服务或Python Web应用时调用。

Why use Flask on TypingMind?

Because you install it once and use it with any model. Flask is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Flask in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dkbnull/hello-skill/tree/main/backend/skills/flask. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Flask?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Flask?

As many as you like. As long as a model supports skills, you can use Flask with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Flask AI skill free?

Yes. It is published on GitHub by dkbnull under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇