Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Cc Api Contract Safety

ASecurity

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

1,035 stars
0 votes
0 copies
0 views
Added 5/28/2026
ai-agentsapi

Works with

api

Security Analysis

A100/100

Scanned 5/28/2026

Install to Claude Code

$npx -y skills add doccker/cc-use-exp --skill cc-api-contract-safety --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cc Api Contract Safety?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Cc Api Contract Safety
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/doccker-cc-api-contract-safety/badge)](https://www.skillsdirectory.com/skills/doccker-cc-api-contract-safety)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: cc-api-contract-safety
description: 前后端接口契约安全规范,适用于接口新增或调整、联调、列表分页异常与临时兼容治理;用于避免响应结构漂移被前端兼容长期掩盖。
---

# 接口契约安全规范

## 触发场景

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

## 核心原则

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

## 检查清单

### 1. 成功响应包装

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

### 2. 列表与分页结构

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

### 3. 筛选项与枚举来源

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

### 4. 字段映射与调用链

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

### 5. 临时兼容治理

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

### 6. 验证

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

## 常见反模式

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

## 输出要求

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

Attribution

docckerdoccker
View sourceMore from doccker →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman

Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.

1023331 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

686011 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

651 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →