|
| 1 | +--- |
| 2 | +description: Cursor-specific rules for OpenAPI specifications and API documentation |
| 3 | +globs: ["apify-api/**/*.yaml", "apify-api/**/*.js"] |
| 4 | +alwaysApply: true |
| 5 | +--- |
| 6 | + |
| 7 | +# Cursor-Specific API Documentation Rules |
| 8 | + |
| 9 | +## Cursor OpenAPI Workflow |
| 10 | + |
| 11 | +### Using Cursor for OpenAPI Editing |
| 12 | + |
| 13 | +- Leverage Cursor's YAML syntax highlighting for OpenAPI files |
| 14 | +- Use Cursor's JSON schema validation for OpenAPI specifications |
| 15 | +- Use Cursor's autocomplete for OpenAPI keywords and properties |
| 16 | + |
| 17 | +### Cursor-Specific API Documentation Tasks |
| 18 | + |
| 19 | +- Use Cursor Chat to "validate this OpenAPI specification" |
| 20 | +- Ask "generate code examples for this endpoint" |
| 21 | +- Request "check for consistency across similar endpoints" |
| 22 | + |
| 23 | +## Cursor Code Sample Generation |
| 24 | + |
| 25 | +### Using Cmd+K for API References |
| 26 | + |
| 27 | +- Use `@apify-api/openapi/paths/**/*.yaml` to reference endpoint definitions |
| 28 | +- Use `@apify-api/openapi/components/schemas/**/*.yaml` to reference data models |
| 29 | +- Use `@AGENTS.md` to reference API documentation standards |
| 30 | + |
| 31 | +### Cursor-Specific Code Sample Workflow |
| 32 | + |
| 33 | +```yaml |
| 34 | +# When editing OpenAPI files in Cursor: |
| 35 | +# 1. Use Cursor's YAML validation |
| 36 | +# 2. Leverage autocomplete for OpenAPI keywords |
| 37 | +# 3. Use Cursor Chat to generate examples |
| 38 | +# 4. Use Cursor's search to find similar patterns |
| 39 | +``` |
| 40 | + |
| 41 | +## File-Specific Cursor Rules |
| 42 | + |
| 43 | +### For OpenAPI Specification Files (`apify-api/openapi/**/*.yaml`) |
| 44 | + |
| 45 | +- Use Cursor's YAML syntax highlighting and validation |
| 46 | +- Leverage Cursor's autocomplete for OpenAPI 3.0 keywords |
| 47 | +- Use Cursor's search to find similar endpoint patterns |
| 48 | +- Use Cursor Chat to validate OpenAPI compliance |
| 49 | + |
| 50 | +### For Generated Code Samples (`apify-api/openapi/code_samples/**/*.js`) |
| 51 | + |
| 52 | +- Use Cursor's JavaScript syntax highlighting |
| 53 | +- Leverage Cursor's autocomplete for JavaScript APIs |
| 54 | +- Use Cursor's search to find similar code patterns |
| 55 | +- Use Cursor Chat to improve code examples |
| 56 | + |
| 57 | +## Cursor Quality Assurance for APIs |
| 58 | + |
| 59 | +- Use Cursor's YAML validation for OpenAPI files |
| 60 | +- Leverage Cursor's search to ensure endpoint naming consistency |
| 61 | +- Use Cursor Chat to review API documentation completeness |
| 62 | +- Use Cursor's autocomplete to maintain OpenAPI specification standards |
0 commit comments