$npx -y skills add DNYoussef/context-cascade --skill api-docs/*============================================================================*/ /* API-DOCS SKILL :: VERILINGUA x VERIX EDITION */ /*============================================================================*/
| 1 | /*============================================================================*/ |
| 2 | /* API-DOCS SKILL :: VERILINGUA x VERIX EDITION */ |
| 3 | /*============================================================================*/ |
| 4 | |
| 5 | --- |
| 6 | name: api-docs |
| 7 | version: 1.0.0 |
| 8 | description: | |
| 9 | [assert|neutral] Generate and maintain comprehensive API documentation using OpenAPI 3.0, Swagger UI, and GraphQL Playground. Use when documenting REST APIs, GraphQL services, or creating API reference materials. Ensu [ground:given] [conf:0.95] [state:confirmed] |
| 10 | category: delivery |
| 11 | tags: |
| 12 | - delivery |
| 13 | - development |
| 14 | - workflow |
| 15 | author: ruv |
| 16 | cognitive_frame: |
| 17 | primary: aspectual |
| 18 | goal_analysis: |
| 19 | first_order: "Execute api-docs workflow" |
| 20 | second_order: "Ensure quality and consistency" |
| 21 | third_order: "Enable systematic delivery processes" |
| 22 | --- |
| 23 | |
| 24 | /*----------------------------------------------------------------------------*/ |
| 25 | /* S0 META-IDENTITY */ |
| 26 | /*----------------------------------------------------------------------------*/ |
| 27 | |
| 28 | [define|neutral] SKILL := { |
| 29 | name: "api-docs", |
| 30 | category: "delivery", |
| 31 | version: "1.0.0", |
| 32 | layer: L1 |
| 33 | } [ground:given] [conf:1.0] [state:confirmed] |
| 34 | |
| 35 | /*----------------------------------------------------------------------------*/ |
| 36 | /* S1 COGNITIVE FRAME */ |
| 37 | /*----------------------------------------------------------------------------*/ |
| 38 | |
| 39 | [define|neutral] COGNITIVE_FRAME := { |
| 40 | frame: "Aspectual", |
| 41 | source: "Russian", |
| 42 | force: "Complete or ongoing?" |
| 43 | } [ground:cognitive-science] [conf:0.92] [state:confirmed] |
| 44 | |
| 45 | ## Kanitsal Cerceve (Evidential Frame Activation) |
| 46 | Kaynak dogrulama modu etkin. |
| 47 | |
| 48 | /*----------------------------------------------------------------------------*/ |
| 49 | /* S2 TRIGGER CONDITIONS */ |
| 50 | /*----------------------------------------------------------------------------*/ |
| 51 | |
| 52 | [define|neutral] TRIGGER_POSITIVE := { |
| 53 | keywords: ["api-docs", "delivery", "workflow"], |
| 54 | context: "user needs api-docs capability" |
| 55 | } [ground:given] [conf:1.0] [state:confirmed] |
| 56 | |
| 57 | /*----------------------------------------------------------------------------*/ |
| 58 | /* S3 CORE CONTENT */ |
| 59 | /*----------------------------------------------------------------------------*/ |
| 60 | |
| 61 | # API Documentation Generator (Gold Tier) |
| 62 | |
| 63 | ## Kanitsal Cerceve (Evidential Frame Activation) |
| 64 | Kaynak dogrulama modu etkin. |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | ## When to Use This Skill |
| 70 | |
| 71 | - **API Development**: Building or documenting REST APIs, GraphQL APIs, or other web services |
| 72 | - **API Versioning**: Managing multiple API versions or migration strategies |
| 73 | - **Developer Experience**: Creating interactive documentation for API consumers |
| 74 | - **OpenAPI/Swagger**: Generating or maintaining OpenAPI specifications |
| 75 | - **Integration Work**: Helping external teams understand and use your APIs |
| 76 | |
| 77 | ## When NOT to Use This Skill |
| 78 | |
| 79 | - **Non-API Documentation**: General code documentation, user manuals, or internal wikis |
| 80 | - **No API Surface**: Pure frontend apps, CLI tools, or embedded systems without APIs |
| 81 | - **Legacy Systems**: APIs without code access or with undocumented proprietary protocols |
| 82 | - **Incompatible Stacks**: Non-HTTP protocols (MQTT, gRPC) requiring specialized tooling |
| 83 | |
| 84 | ## Success Criteria |
| 85 | |
| 86 | - [ ] API endpoints fully documented with request/response schemas |
| 87 | - [ ] Authentication and authorization flows clearly explained |
| 88 | - [ ] Interactive API explorer (Swagger UI/GraphQL Playground) functional |
| 89 | - [ ] Error codes and handling strategies documented |
| 90 | - [ ] Rate limiting and usage guidelines specified |
| 91 | - [ ] Code examples provided for common use cases |
| 92 | - [ ] Versioning strategy documented if applicable |
| 93 | |
| 94 | ## Edge Cases to Handle |
| 95 | |
| 96 | - **Missing Type Annotations**: Infer schemas from runtime behavior or database models |
| 97 | - **Dynamic Routes**: Document parameterized endpoints and path variables |
| 98 | - **Nested Resources**: Handle complex resource hierarchies and relationships |
| 99 | - **File Uploads**: Document multipart/form-data and binary payloads |
| 100 | - **Webhooks**: Document callback URLs and event payloads |
| 101 | - **Deprecated Endpoints**: Mark sunset dates and migration paths |
| 102 | |
| 103 | ## Guardrails |
| 104 | |
| 105 | - **NEVER** expose internal implementation details or security vulnerabilities in public docs |
| 106 | - **ALWAYS** validate generated specs against OpenAPI/GraphQL schema validators |
| 107 | - **NEVER** ship documentation without testing example requests |
| 108 | - **ALWAYS** include authentication requirements for protected endpoints |
| 109 | - **NEVER** assume default values - explicitly document all parameters |
| 110 | - **ALWAYS** document error responses, not just success cases |
| 111 | |
| 112 | ## Evidence-Based Validation |
| 113 | |
| 114 | - [ ] Run generated OpenAPI spec through swagger-cli validate |
| 115 | - [ ] Test all documented endpoints with actual HTTP requests |
| 116 | - [ ] Verify GraphQL schema with graphql-schema-linter |
| 117 | - [ ] Check accessibility of interactive docs with axe-core |
| 118 | - [ ] Validate examples compile and execute |