Fastapi Dict Module Skill logo

Fastapi Dict Module Skill

Community
jiushiwon
fastapi-dict-module-skill

FastAPI 字典/配置模块技能。面向已有 FastAPI 项目,提供字典类型、字典项、系统配置、参数管理等能力的快速集成。触发词:"字典模块"、"配置模块"、"系统参数"、"字典管理"、"系统配置"、"dict module"、"config module"。

Overview

Publisherjiushiwon
Repositorywg-skills
Skill namefastapi-dict-module-skill
Stars
123
Forks
38
Bundled files
1
LicenseApache-2.0
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.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Fastapi Dict Module Skill 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/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/fastapi-dict-module-skill
  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/jiushiwon/wg-skills.git /tmp/wg-skills
mkdir -p .claude/skills
cp -r /tmp/wg-skills/vibeCoding/backend/python/fastapi-module/fastapi-dict-module-skill .claude/skills/fastapi-dict-module-skill
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Fastapi Dict Module Skill 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 Fastapi Dict Module Skill 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 Fastapi Dict Module Skill 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.

FastAPI Dict Module Skill

面向已有 FastAPI 项目的开发者,快速集成字典和配置管理能力。

能力清单

能力说明
字典类型字典分类管理
字典项字典数据 CRUD
系统配置系统参数配置
缓存字典数据缓存
接口RESTful API

触发场景

用户说"帮我加字典模块"或"加配置管理"时触发。

数据模型

字典类型表

python
from sqlalchemy import Column, BigInteger, String, Integer, DateTime, Boolean
from sqlalchemy.sql import func

class DictType(Base):
    __tablename__ = "wg_dict_type"
    
    id = Column(BigInteger, primary_key=True, autoincrement=True)
    name = Column(String(100), nullable=False, comment="字典名称")
    code = Column(String(50), nullable=False, unique=True, comment="字典编码")
    description = Column(String(500), comment="描述")
    status = Column(Integer, default=1, comment="状态:0禁用 1正常")
    created_at = Column(DateTime, server_default=func.now())
    updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
    deleted_at = Column(DateTime, nullable=True)

字典项表

python
class DictItem(Base):
    __tablename__ = "wg_dict_item"
    
    id = Column(BigInteger, primary_key=True, autoincrement=True)
    dict_type_id = Column(BigInteger, nullable=False, comment="字典类型ID")
    label = Column(String(100), nullable=False, comment="显示标签")
    value = Column(String(100), nullable=False, comment="值")
    sort = Column(Integer, default=0, comment="排序")
    status = Column(Integer, default=1, comment="状态")
    created_at = Column(DateTime, server_default=func.now())
    updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
    deleted_at = Column(DateTime, nullable=True)

系统配置表

python
class SysConfig(Base):
    __tablename__ = "wg_sys_config"
    
    id = Column(BigInteger, primary_key=True, autoincrement=True)
    config_key = Column(String(100), nullable=False, unique=True, comment="配置键")
    config_value = Column(String(500), comment="配置值")
    config_type = Column(String(20), default="string", comment="类型:string/int/json")
    description = Column(String(500), comment="描述")
    status = Column(Integer, default=1, comment="状态")
    created_at = Column(DateTime, server_default=func.now())
    updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())

API 接口

字典类型

方法路径说明
GET/api/dict/type/list字典类型列表
GET/api/dict/type/{id}字典类型详情
POST/api/dict/type新增字典类型
PUT/api/dict/type/{id}更新字典类型
DELETE/api/dict/type/{id}删除字典类型

字典项

方法路径说明
GET/api/dict/item/list字典项列表
GET/api/dict/item/{type_code}根据编码获取字典项
POST/api/dict/item新增字典项
PUT/api/dict/item/{id}更新字典项
DELETE/api/dict/item/{id}删除字典项

系统配置

方法路径说明
GET/api/config/list配置列表
GET/api/config/{key}获取配置
PUT/api/config/{key}更新配置

使用示例

获取字典数据

python
# 前端下拉框数据源
@app.get("/api/dict/item/{type_code}")
async def get_dict_items(type_code: str):
    # 从缓存或数据库获取
    items = await get_dict_by_code(type_code)
    return Success(data=[{"label": i.label, "value": i.value} for i in items])

使用字典数据

python
from fastapi import Depends

async def create_user(user: UserCreate, dict_svc: DictService = Depends()):
    # 获取性别字典
    genders = await dict_svc.get_items("gender")
    # ...

系统配置

python
# 读取配置
@app.get("/api/config/site-name")
async def get_site_name(config_svc: ConfigService = Depends()):
    value = await config_svc.get("site_name")
    return Success(data=value)

# 更新配置
@app.put("/api/config/site-name")
async def update_site_name(value: str, config_svc: ConfigService = Depends()):
    await config_svc.set("site_name", value)
    return Success()

缓存支持

python
from functools import lru_cache

@lru_cache(maxsize=100)
async def get_dict_cache(type_code: str) -> List[DictItem]:
    """字典数据缓存"""
    return await DictItem.filter(dict_type_code=type_code, status=1).all()

async def refresh_dict_cache(type_code: str):
    """刷新缓存"""
    get_dict_cache.cache_clear()

不做

  • 不负责前端页面(使用方自行实现)
  • 不处理敏感配置加密(业务层自行处理)
  • 不提供配置变更审计日志

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Fastapi Dict Module Skill AI skill do?

FastAPI 字典/配置模块技能。面向已有 FastAPI 项目,提供字典类型、字典项、系统配置、参数管理等能力的快速集成。触发词:"字典模块"、"配置模块"、"系统参数"、"字典管理"、"系统配置"、"dict module"、"config module"。

Why use Fastapi Dict Module Skill on TypingMind?

Because you install it once and use it with any model. Fastapi Dict Module Skill 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 Fastapi Dict Module Skill in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/python/fastapi-module/fastapi-dict-module-skill. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Fastapi Dict Module Skill?

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 Fastapi Dict Module Skill?

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

Is the Fastapi Dict Module Skill AI skill free?

Yes. It is published on GitHub by jiushiwon under the Apache-2.0 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 👇