用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill openapi-critical-rules命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
LLM token logprobs and calibration. Per-decision confidence, ECE, Brier, reliability diagrams, low-confidence triage.
Analyze LLM token logprobs and calibration. Use for per-decision confidence, ECE, Brier scores, reliability diagrams, and low-confidence triage.
回顾最近 N 天的 Claude Code 使用记录——扫描原始会话数据,按主题分组汇总"我都做了什么",并从个人操作系统视角输出模式、风险与增删建议。当用户说 /recap、"看看我这几天做了什么"、"回顾一下我最近的会话"、"这两天我用 claude 干了啥"、"活动回顾" 时使用。
基于 SOC 职业分类
正在显示 SKILL.md
| name | openapi-critical-rules |
| description | The 12 critical OpenAPI rules that cause immediate task failure if violated |
These 12 rules cause IMMEDIATE TASK FAILURE if violated.
FORBIDDEN at root level in api.yml:
servers: - NO server configuration at rootsecurity: - NO security at rootsecuritySchemes: - Belongs in components only# ❌ WRONG
servers:
- url: https://api.example.com
security:
- bearerAuth: []
# ✅ CORRECT - Clean root, security in components
openapi: 3.0.0
info:
title: Service API
paths:
...
components:
securitySchemes:
...
WHY: Root-level servers and security conflict with hub's connection management.
MANDATORY: Singular nouns for tags and schemas
# ✅ CORRECT
tags:
- name: user
- name: organization
- name: webhook
components:
schemas:
User:
...
Organization:
...
# ❌ WRONG
tags:
- name: users # NO - use singular
- name: orgs # NO - use full word
WHY: Consistent naming convention across all modules.
MANDATORY: ALL operations from product analysis MUST be in API spec
Process:
Validation:
# Count operations in api.yml
yq eval '.paths.*.* | select(has("operationId")) | .operationId' api.yml | wc -l
# Compare with product analysis count
IF MISMATCH: Add missing operations or document why excluded.
RULE: If 2+ operations use same parameter → Move to components
# ✅ CORRECT - Reusable parameter
components:
parameters:
userId:
name: userId
in: path
required: true
schema:
type: string
paths:
/users/{userId}:
get:
parameters:
- $ref: '#/components/parameters/userId'
/users/{userId}/profile:
get:
parameters:
- $ref: '#/components/parameters/userId'
# ❌ WRONG - Duplicate definition
paths:
/users/{userId}:
get:
parameters:
- name: userId
in: path
required: true
schema:
type: string
/users/{userId}/profile:
get:
parameters:
- name: userId
in: path
required: true
schema:
type:
WHY: DRY principle, consistency, easier updates.
MANDATORY: ALL properties in camelCase
# ✅ CORRECT
User:
properties:
userId:
type: string
firstName:
type: string
createdAt:
type: string
format: date-time
# ❌ WRONG
User:
properties:
user_id: # NO - snake_case
type: string
first_name: # NO - snake_case
type: string
created-at: # NO - kebab-case
type: string
Validation:
# Check for snake_case (should return nothing)
grep "_" api.yml | grep -v "x-" | grep -v "#"
WHY: TypeScript/JavaScript convention, generated code uses camelCase.
MANDATORY: Sorting parameters use these exact names
# ✅ CORRECT
parameters:
- name: orderBy
in: query
schema:
type: string
enum: [name, createdAt, updatedAt]
- name: orderDir
in: query
schema:
type: string
enum: [asc, desc]
default: asc
# ❌ WRONG
parameters:
- name: sortBy # NO - use orderBy
- name: sortField # NO - use orderBy
- name: direction # NO - use orderDir
- name: order # NO - use orderDir
WHY: Framework expects these exact parameter names.
MANDATORY: Path parameters use descriptive names
# ✅ CORRECT
/users/{userId}
/organizations/{organizationId}
/webhooks/{webhookId}
# ❌ WRONG
/users/{id} # NO - not descriptive enough
/organizations/{org} # NO - use full word
/webhooks/{wid} # NO - no abbreviations
WHY: Clear, self-documenting paths. Prevents parameter conflicts.
MANDATORY: Use this order for resource identification:
id (UUID, integer, string ID)name (if unique identifier)# ✅ CORRECT - Using id (preferred)
/users/{userId}
# ✅ ACCEPTABLE - Using name (if no id)
/templates/{templateName}
# ❌ WRONG - Using non-unique field
/users/{email} # Email can change, not stable ID
WHY: Stable identifiers for API operations.
MANDATORY: Tags are singular nouns matching resource name
# ✅ CORRECT
paths:
/users:
get:
tags:
- user # Singular
/users/{userId}:
get:
tags:
- user # Singular
# ❌ WRONG
paths:
/users:
get:
tags:
- users # NO - use singular
- Users # NO - lowercase
WHY: Consistent tag naming, generates clean Producer class names.
PATTERN:
operationId: Full descriptive ID (getUser, listUsers, createUser)x-method-name: Actual TypeScript method name (must match operationId pattern)# ✅ CORRECT
paths:
/users/{userId}:
get:
operationId: getUser
x-method-name: getUser
summary: Retrieve user by ID
/users:
get:
operationId: listUsers
x-method-name: listUsers
summary: Retrieve list of users
# ❌ WRONG
paths:
/users/{userId}:
get:
operationId: describeUser # NO - use 'get'
x-method-name: get_user # NO - camelCase
VERBS:
get - Retrieve single resourcelist - Retrieve collectionsearch - Query with filterscreate - Create new resourceupdate - Modify existing resourcedelete - Remove resourceWHY: Consistent method naming, proper TypeScript generation.
MANDATORY: Use core pagination parameter for token-based paging
# ✅ CORRECT
paths:
/users:
get:
parameters:
- $ref: './node_modules/@zerobias-org/types-core/schema/pageTokenParam.yml'
- name: pageSize
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
# ❌ WRONG
parameters:
- name: nextToken # NO - use pageTokenParam
- name: cursor # NO - use pageTokenParam
- name: continuationToken # NO - use pageTokenParam
WHY: Framework expects standard pageToken parameter name.
MANDATORY: ONLY success responses in API specification
# ✅ CORRECT
responses:
'200':
description: User retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/User'
# ❌ WRONG
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'401': # NO - remove all error responses
description: Unauthorized
'404': # NO - remove all error responses
description: Not found
'500': # NO - remove all error responses
description: Server error
Validation:
# Should return nothing
grep -E "'40[0-9]'|'50[0-9]'" api.yml
WHY: Framework handles errors automatically. Error responses in spec cause generation issues.
| Rule # | Topic | Violation = Immediate Failure |
|---|---|---|
| 1 | Root Level Restrictions | ✅ Yes |
| 2 | Resource Naming | ✅ Yes |
| 3 | Operation Coverage | ✅ Yes |
| 4 | Parameter Reuse | ✅ Yes |
| 5 | Property Naming (camelCase) | ✅ Yes |
| 6 | Parameter Naming (orderBy/orderDir) | ✅ Yes |
| 7 | Path Parameters (descriptive) | ✅ Yes |
| 8 | Resource Identifier Priority | ✅ Yes |
| 9 | Tags (singular) | ✅ Yes |
| 10 | Method Naming (operationId) | ✅ Yes |
| 11 | Pagination (pageTokenParam) | ✅ Yes |
| 12 | Response Codes (200/201 only) | ✅ Yes |
Before proceeding past Gate 1, verify ALL 12 rules:
#!/bin/bash
# validate-12-rules.sh
FAILED=0
# Rule 5: Check camelCase
if grep "_" api.yml | grep -v "x-" | grep -v "#" > /dev/null 2>&1; then
echo "❌ Rule 5 FAILED: snake_case found in properties"
FAILED=1
fi
# Rule 10: Check for 'describe'
if grep -E "describe[A-Z]" api.yml > /dev/null 2>&1; then
echo "❌ Rule 10 FAILED: 'describe' prefix found"
FAILED=1
fi
# Rule 12: Check for error responses
if grep -E "'40[0-9]'|'50[0-9]'" api.yml > /dev/null 2>&1; then
echo "❌ Rule 12 FAILED: Error responses found"
FAILED=1
fi
if [ $FAILED -eq 0 ]; then
echo "✅ Critical rules validation passed"
else
echo "🚨 FIX ISSUES BEFORE PROCEEDING"
exit 1
fi