Versioning logo

Versioning

Community
zhaoxuya520
versioning

设计 API 版本管理和兼容变更策略时使用。适用于公开 API、SDK、长期维护项目。优先使用 Stripe 版本策略 + 兼容/不兼容变更分类 + 弃用流程。

Overview

Publisherzhaoxuya520
RepositoryAI-Fullstack-Delivery-Workflow
Skill nameversioning
Stars
56
Forks
18
Bundled files
2
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.

  • 2 bundled files

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

  • Open source

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

Installation

Install the Versioning 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/zhaoxuya520/AI-Fullstack-Delivery-Workflow/tree/master/workflows/api-designer/skills/versioning
  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/zhaoxuya520/AI-Fullstack-Delivery-Workflow.git /tmp/AI-Fullstack-Delivery-Workflow
mkdir -p .claude/skills
cp -r /tmp/AI-Fullstack-Delivery-Workflow/workflows/api-designer/skills/versioning .claude/skills/versioning
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Versioning 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 Versioning 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 Versioning 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.

API 版本管理

参考来源:Stripe API Versioning、Semver 思想

适用场景

  • 公开 API / 开放平台
  • 第三方 SDK 维护
  • 长期演进的 API
  • 需要平滑升级的产品

不适用场景

  • 内部 API(前后端紧耦合,可同步升级)
  • 短期项目
  • 早期 MVP

核心原则

text
1. 兼容变更优先
   能不升版本就不升

2. 不兼容变更必须升版本
   不能悄悄改

3. 老版本要有弃用期
   不能立即下线

4. 版本策略全 API 统一
   不要不同模块用不同方式

兼容变更(Compatible / Additive)

不需要升版本的变更:

text
✅ 新增可选字段(请求和响应)
✅ 新增端点
✅ 新增可选参数
✅ 新增错误码
✅ 新增枚举值(响应中,调用方应忽略未知值)
✅ 放宽校验(如:原 max=10 改为 max=20)
✅ 新增 HTTP 方法(如原只支持 GET,新增 POST)

不兼容变更(Breaking)

必须升版本的变更:

text
❌ 删除字段
❌ 删除端点
❌ 重命名字段
❌ 改字段类型(string → integer)
❌ 改字段语义(同名字段含义变了)
❌ 改必填规则(可选 → 必填)
❌ 改默认值
❌ 改枚举值含义(仅添加是兼容的,删除/重命名不兼容)
❌ 改错误响应结构
❌ 改 HTTP 状态码(200 → 201)
❌ 改鉴权方式
❌ 收紧校验(max=20 改为 max=10)
❌ 改分页风格(offset → cursor)

版本表达方式

1. URL 版本(最常见)

text
/api/v1/users
/api/v2/users

优点:
  ✅ 直观
  ✅ 缓存友好
  ✅ 易于路由

缺点:
  ❌ 升级时所有 URL 都变
  ❌ 一个端点的小变更也要全升

2. Header 版本

text
Accept: application/vnd.example.v2+json
或自定义:
X-API-Version: 2

优点:
  ✅ URL 干净
  ✅ 可按端点细粒度版本

缺点:
  ❌ 不直观
  ❌ 缓存配置复杂
  ❌ 浏览器测试不方便

3. 日期版本(Stripe 风格)

text
Stripe-Version: 2024-01-15

优点:
  ✅ 精确到日期
  ✅ 客户端可固定版本
  ✅ 升级路径清晰

缺点:
  ❌ 维护成本高(每个变更都是新版本)

4. 媒体类型版本

text
Accept: application/json; version=2

优点:
  ✅ 符合 REST 原则

缺点:
  ❌ 复杂
  ❌ 多数客户端不熟悉

选择建议

text
内部 API → 不需要版本(前后端同步)
公开 API(普通) → URL 版本 (/v1, /v2)
公开 API(精细) → 日期版本(Stripe 风格)
开放平台(成熟) → URL 版本 + 日期细化

弃用流程

text
1. 公告(Announce)
   - 提前 6~12 个月通告
   - 邮件 / 文档 / Changelog
   - 提供迁移指南

2. 标注(Deprecate)
   - 响应 Header:Sunset: <date>
   - 文档明确标注 deprecated
   - 提供新端点 / 新字段

3. 警告(Warn)
   - 响应 Header:Deprecation: <date>
   - 日志记录使用情况
   - 联系大客户

4. 下线(Sunset)
   - 到期下线
   - 老调用返回 410 Gone
   - 错误信息指向新版本

时间表示例:
  Day 0:发布 v2,v1 标 deprecated
  Day 90:v1 警告(响应 header)
  Day 180:v1 错误(部分非关键端点)
  Day 365:v1 完全下线

版本变更示例

示例 1:兼容变更(不升版)

text
旧 v1:
GET /users/{id}
{
  "id": "usr_001",
  "name": "张三"
}

新 v1(新增字段,兼容):
GET /users/{id}
{
  "id": "usr_001",
  "name": "张三",
  "email": "user@example.com",  ← 新增
  "phone": "+86138..."           ← 新增
}

老客户端忽略未知字段,不影响

示例 2:不兼容变更(必须升版)

text
旧 v1:
{
  "user_id": "usr_001",          ← 旧字段名
  "user_name": "张三"
}

新 v2:
{
  "id": "usr_001",               ← 重命名
  "name": "张三"
}

必须 /v2/users/{id}
v1 保留过渡期

版本变更评估模板

markdown
## 版本变更评估:[变更内容]

### 变更描述

[具体改了什么]

### 兼容性评估

- 变更类型:兼容 / 不兼容
- 受影响的字段/端点:
- 受影响的客户端:

### 兼容判断

- [ ] 是否新增字段(兼容)
- [ ] 是否新增端点(兼容)
- [ ] 是否删除字段(不兼容)
- [ ] 是否改字段类型(不兼容)
- [ ] 是否改语义(不兼容)
- [ ] 是否改必填(不兼容)

### 决策

- ✅ 兼容变更,无需升版
- ❌ 不兼容变更,需要 v2

### 如果升版

- 新版本号:v2
- 老版本弃用期:6 个月
- 迁移指南:[链接]
- 通知方式:邮件 + Changelog

OpenAPI 中的弃用标注

yaml
paths:
  /v1/users:
    get:
      summary: List users (deprecated)
      deprecated: true
      description: |
        This endpoint is deprecated and will be removed on 2026-12-31.
        Please use /v2/users instead.
        Migration guide: https://docs.example.com/migration/v2

工作流程

text
1. 评估变更是否兼容(用上方评估模板)
2. 如果兼容 → 直接修改,更新文档
3. 如果不兼容 → 决定升版策略
4. 创建新版本,老版本保留
5. 写迁移指南
6. 发布弃用公告
7. 监控老版本使用率
8. 到期下线

质量自检

text
□ 是否区分了兼容和不兼容变更
□ 兼容变更是否真的兼容(不要侥幸)
□ 不兼容变更是否升了版本
□ 弃用是否有充足时间(≥ 6 个月)
□ 是否有迁移指南
□ 是否在 OpenAPI 标注 deprecated
□ 是否监控老版本使用率

常见坑

  1. 侥幸不升版——"用户应该不会注意" → 客户端崩溃
  2. 删字段当兼容——以为没人用结果有人用
  3. 弃用期太短——3 周就下线 → 客户来不及升级
  4. 没有迁移指南——客户不知道怎么升
  5. 版本数量爆炸——每个变更都升版 → v1 v2 v3 ... v15
  6. 新老版本逻辑分叉太多——维护成本爆炸
  7. 不监控老版本——以为没人用其实大量调用

配套模板

  • templates/api-version-change-template.md — 变更评估 + 迁移指南 + 弃用公告模板

与其他 skill 的协作

text
上游:
  product-manager 的需求变更

平行:
  endpoint-design → 新版本端点设计
  request-response → 字段变更评估
  error-handling → 错误码版本兼容

下游:
  openapi-mock → 多版本 OpenAPI
  转交技术文档 → 迁移指南

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 Versioning AI skill do?

设计 API 版本管理和兼容变更策略时使用。适用于公开 API、SDK、长期维护项目。优先使用 Stripe 版本策略 + 兼容/不兼容变更分类 + 弃用流程。

Why use Versioning on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zhaoxuya520/AI-Fullstack-Delivery-Workflow/tree/master/workflows/api-designer/skills/versioning. 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 Versioning?

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 Versioning?

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

Is the Versioning AI skill free?

It is published on GitHub by zhaoxuya520. Check the repository for licensing terms. 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 👇