Cc Api Contract Safety logo

Cc Api Contract Safety

CommunityPopular
doccker
cc-api-contract-safety

前后端接口契约安全规范,适用于接口新增或调整、联调、列表分页异常与临时兼容治理;用于避免响应结构漂移被前端兼容长期掩盖。

Overview

Publisherdoccker
Repositorycc-use-exp
Skill namecc-api-contract-safety
Stars
1.1K
Forks
116
Bundled files
1
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 doccker on GitHub. Read the source before you install it.

Installation

Install the Cc Api Contract Safety 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/doccker/cc-use-exp/tree/main/.codex/skills/cc-api-contract-safety
  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/doccker/cc-use-exp.git /tmp/cc-use-exp
mkdir -p .claude/skills
cp -r /tmp/cc-use-exp/.codex/skills/cc-api-contract-safety .claude/skills/cc-api-contract-safety
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cc Api Contract Safety 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 Cc Api Contract Safety 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 Cc Api Contract Safety 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.

接口契约安全规范

触发场景

  • 新增或调整 HTTP/JSON 接口
  • 前后端联调
  • 列表页、分页、筛选项、状态枚举或详情页异常
  • 前端开始兼容多种 response shape
  • 后端某些接口没有走项目统一成功响应 helper

核心原则

  • 先看真实接口输入输出,再下结论,不根据前端类型或旧记忆推测
  • 能修后端契约根因时,优先统一后端;前端兼容只作为短期过渡
  • 列表、详情、选项或枚举接口应遵守同一套成功响应格式
  • 分页结构必须明确约定,不长期混用数组和分页对象
  • 临时兼容可以保留,但必须写清退出条件和移除时机

检查清单

1. 成功响应包装

  • 列表接口是否走项目统一成功响应 helper
  • 详情接口是否也走同一成功响应格式
  • 状态选项、枚举、筛选项接口是否仍在返回裸数组或其他特例结构
  • 错误响应是否与项目现有模式一致

2. 列表与分页结构

  • 前端当前期望的是数组、分页对象还是统一包裹后的 data
  • 后端真实返回是否与该期望一致
  • page、pageSize、total、items 或等价字段是否完整且命名一致
  • 页码基准是否一致,例如从 0 开始还是从 1 开始

3. 筛选项与枚举来源

  • 筛选项接口返回的数据是否来自真实日志或真实状态字段
  • “筛选项为空”是否真的是无数据,而不是契约失配
  • 枚举值是否与列表数据里的真实值一致
  • 前端回退生成选项时,是否已标注为短期兜底而非长期正式来源

4. 字段映射与调用链

  • 前端使用的字段名来自真实接口返回,而不是本地类型猜测
  • 列表、详情、筛选接口引用的是同一业务字段语义
  • 若存在中间转换层,转换前后字段语义是否保持一致

5. 临时兼容治理

  • 当前兼容分支是为了解什么具体问题
  • 兼容分支的退出条件是什么
  • 后端统一后是否有计划删掉双格式兼容
  • 输出里是否明确区分“根因修复”和“短期兜底”

6. 验证

  • 直接查看真实接口响应或服务端日志,而不是只看前端表现
  • 验证列表、详情、筛选项三个入口是否都一致
  • 验证空态、非空态和异常态下的契约表现
  • 若保留兼容分支,验证其不会掩盖新的契约错误

常见反模式

  • 看到页面能打开,就接受前端长期兼容数组和分页对象两种格式
  • 只修列表接口,不修详情接口和状态选项接口
  • 看到筛选项为空,就先从当前页数据回填,但不追查后端契约
  • 在没有证据的情况下根据类型定义猜测字段名或返回结构

输出要求

  • 明确区分症状、当前契约、期望契约、根因修复、临时兼容和退出条件
  • 若证据来自日志、抓包或直接接口返回,要明确写出依据
  • 若仍保留兼容逻辑,要说明为什么这次不立即删除

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 Cc Api Contract Safety AI skill do?

前后端接口契约安全规范,适用于接口新增或调整、联调、列表分页异常与临时兼容治理;用于避免响应结构漂移被前端兼容长期掩盖。

Why use Cc Api Contract Safety on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/doccker/cc-use-exp/tree/main/.codex/skills/cc-api-contract-safety. 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 Cc Api Contract Safety?

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 Cc Api Contract Safety?

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

Is the Cc Api Contract Safety AI skill free?

It is published on GitHub by doccker. 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 👇