--- applyTo: '**' description: Mandatory Context7 usage for external library, framework, SDK, API, CLI, and cloud-service work. --- # Context7 Rules 1. Use Context7 before using any external library, framework, SDK, API, CLI, or cloud service. 2. Call `resolve-library-id` first. 3. Call `query-docs` with the resolved id second. 4. Base implementation on the returned docs. 5. Cite the library id or doc source in notes when it affects decisions. 6. Read the API key only from the `CONTEXT7_API_KEY` environment variable. 7. Never write the API key to any file. 8. Never put the API key in `.github/mcp.json`. 9. Never paste the API key into prompts, logs, memory, or telemetry. 10. If `CONTEXT7_API_KEY` is missing, stop library work. 11. Tell the user exactly: ```bash export CONTEXT7_API_KEY='' ``` 12. Resume library work only after the environment variable exists. 13. Continue non-library work when it does not depend on external docs.