name: gate-1-api-specification
description: Gate 1 validation: API specification quality checks
Gate 1: API Specification
STOP AND CHECK:
# No 'describe' operations
grep -E "describe[A-Z]" api.yml
# Must return nothing
# No error responses
grep -E "'40[0-9]'|'50[0-9]'" api.yml
# Must return nothing
# No snake_case in properties
grep "_" api.yml | grep -v "x-" | grep -v "#"
# Must return nothing
# No envelope/wrapper objects in responses
# Response should be direct $ref or array, not wrapped in {status, data, meta, response, result, caller, token, etc.}
yq eval '.paths.*.*.responses.*.content.*.schema | select(has("properties"))' api.yml
# Should only return schemas with business object properties, NOT envelope properties
# No connection context parameters in operations
grep -E "name: (apiKey|token|baseUrl|organizationId)" api.yml
# Must return nothing - these come from ConnectionProfile/State
# No nullable in API specification
grep "nullable:" api.yml
# Must return nothing - NEVER use nullable in api.yml
# Schema context separation check
# Find schemas referenced by other schemas (nested usage)
nested_schemas=$(yq eval '.components.schemas[] | .. | select(type == "string" and test("#/components/schemas/")) | capture("#/components/schemas/(?<schema>.+)").schema' api.yml | sort -u)
# Find schemas with their own endpoints (direct response usage)
endpoint_schemas=$(yq eval '.paths.*.*.responses.*.content.*.schema["$ref"]' api.yml | grep -o '[^/]*$' | sort -u)
# Schemas in BOTH lists need review
for schema in $nested_schemas; do
if echo "$endpoint_schemas" | grep -q "^${schema}$"; then
# Count properties in schema
prop_count=$(yq eval ".components.schemas.${schema}.properties | length" api.yml)
if [ "$prop_count" -gt 10 ]; then
echo "⚠️ WARNING: Schema '${schema}' used in BOTH nested and direct contexts with ${prop_count} properties"
echo " Consider creating '${schema}Summary' for nested usage"
fi
fi
done
PROCEED ONLY IF:
✅ Operation name uses get/list/search/create/update/delete
✅ Summary uses "Retrieve" for get/list operations
✅ Descriptions from vendor documentation included
✅ ONLY 200/201 responses (NO 4xx/5xx)
✅ All properties camelCase
✅ Nested objects use $ref
✅ Response schemas map directly to main business object (NO envelope: status/data/meta/response/result/caller/token)
✅ NO connection context parameters (apiKey, token, baseUrl, organizationId) in operation parameters
✅ NO nullable: true in any schema properties
✅ Schemas used in BOTH nested and direct contexts have been reviewed for separation (if >10 properties, consider Summary version)
IF FAILED: Fix API spec before proceeding to generation.
1---2name: gate-1-api-specification-23description: STOP AND CHECK:4---56---7name: gate-1-api-specification8description: Gate 1 validation: API specification quality checks9---1011### Gate 1: API Specification1213**STOP AND CHECK:**14```bash15# No 'describe' operations16grep -E "describe[A-Z]" api.yml17# Must return nothing1819# No error responses20grep -E "'40[0-9]'|'50[0-9]'" api.yml21# Must return nothing2223# No snake_case in properties24grep "_" api.yml | grep -v "x-" | grep -v "#"25# Must return nothing2627# No envelope/wrapper objects in responses28# Response should be direct $ref or array, not wrapped in {status, data, meta, response, result, caller, token, etc.}29yq eval '.paths.*.*.responses.*.content.*.schema | select(has("properties"))' api.yml30# Should only return schemas with business object properties, NOT envelope properties3132# No connection context parameters in operations33grep -E "name: (apiKey|token|baseUrl|organizationId)" api.yml34# Must return nothing - these come from ConnectionProfile/State3536# No nullable in API specification37grep "nullable:" api.yml38# Must return nothing - NEVER use nullable in api.yml3940# Schema context separation check41# Find schemas referenced by other schemas (nested usage)42nested_schemas=$(yq eval '.components.schemas[] | .. | select(type == "string" and test("#/components/schemas/")) | capture("#/components/schemas/(?<schema>.+)").schema' api.yml | sort -u)4344# Find schemas with their own endpoints (direct response usage)45endpoint_schemas=$(yq eval '.paths.*.*.responses.*.content.*.schema["$ref"]' api.yml | grep -o '[^/]*$' | sort -u)4647# Schemas in BOTH lists need review48for schema in $nested_schemas; do49 if echo "$endpoint_schemas" | grep -q "^${schema}$"; then50 # Count properties in schema51 prop_count=$(yq eval ".components.schemas.${schema}.properties | length" api.yml)52 if [ "$prop_count" -gt 10 ]; then53 echo "⚠️ WARNING: Schema '${schema}' used in BOTH nested and direct contexts with ${prop_count} properties"54 echo " Consider creating '${schema}Summary' for nested usage"55 fi56 fi57done58```5960**PROCEED ONLY IF:**61- ✅ Operation name uses get/list/search/create/update/delete62- ✅ Summary uses "Retrieve" for get/list operations63- ✅ Descriptions from vendor documentation included64- ✅ ONLY 200/201 responses (NO 4xx/5xx)65- ✅ All properties camelCase66- ✅ Nested objects use $ref67- ✅ Response schemas map directly to main business object (NO envelope: status/data/meta/response/result/caller/token)68- ✅ NO connection context parameters (apiKey, token, baseUrl, organizationId) in operation parameters69- ✅ NO `nullable: true` in any schema properties70- ✅ Schemas used in BOTH nested and direct contexts have been reviewed for separation (if >10 properties, consider Summary version)7172**IF FAILED:** Fix API spec before proceeding to generation.
Run npx skillmds@latest add majiayu000/gate-1-api-specification-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
STOP AND CHECK: It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
majiayu000 (@majiayu000) published this skill. Their other Agent Skills are listed on their SkillMD profile.