Cursor rule
.cursor/rules/external-apis.mdcWhen calling external APIs
Cursor rules
Quality
54/100
Scores the file, not the repository.Length
217 words
7 headings · 2 code blocksRepository
0
— · pushed 9 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# External API Client Guidelines89These guidelines ensure consistent, reliable, and maintainable API clients.1011## Core Principles1213- We return None on API errors (don't raise exceptions)14- We use type hints consistently15- We document methods with helpful docstrings (skip redundant Args/Returns)16- We use appropriate logging levels17- We let exceptions bubble up unless we're truly handling them1819## Method Pattern2021```python22def get_something(self, param: str) -> dict | None:23 """Fetch something from the API.2425 Returns None if the API returns no data or encounters an error.26 """27 logger.info(f"Fetching something for {param}")2829 response = self.request("/endpoint", params={"key": param})30 if not response:31 logger.warning(f"No data returned for {param}")32 return None3334 return response["data"]35```3637## Error Handling3839We let the base HTTP client handle HTTP/network errors. We only use try/except for40specific scenarios with actual handling. We validate response structure before access.4142## Validation Pattern4344```python45response = self.request("/endpoint", params={"key": value})46if not response or "data" not in response:47 logger.warning(f"No data returned for {value}")48 return None49```5051## Response Processing5253We validate response structure before access, convert to standard types (Decimal for54financial data), clean and normalize data, and return None for errors (not empty dicts).5556## Testing5758We mock all external calls in unit tests, use @pytest.mark.flaky for live API tests, and59test both success and error cases.60
Also in Light-Brands/planetary-party-html
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Light-Brands/planetary-party-html.cursor/rules/ruff-linting.mdc · 0 | Cursor rules | lint-format | 43/100 | 3 days ago | |
| Light-Brands/planetary-party-html.claude/agents/CLAUDE.md · 0 | CLAUDE.md | testlint-formatagent-behaviour | 53/100 | 3 days ago | |
| Light-Brands/planetary-party-html.claude/skills/CLAUDE.md · 0 | CLAUDE.md | lint-formatagent-behaviour | 49/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/git-commit-message.mdc · 0 | Cursor rules | archgitdeployment | 58/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/autonomous-development-workflow.mdc · 0 | Cursor rules | testlint-formatgitagent-behaviour | 73/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/code-review-standards.mdc · 0 | Cursor rules | testtypestesting-strategygit+2 | 48/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/code-style-and-zen-of-python.mdc · 0 | Cursor rules | lint-formatstyledocs | 62/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/fixing-github-actions-builds.mdc · 0 | Cursor rules | setupbuilddo-notagent-behaviour | 81/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/git-interaction.mdc · 0 | Cursor rules | testlint-formatstylearch+4 | 88/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/git-worktree-task.mdc · 0 | Cursor rules | lint-formatgitagent-behaviour | 38/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/heart-centered-ai-philosophy.mdc · 0 | Cursor rules | no sections | 30/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/naming-stuff.mdc · 0 | Cursor rules | style | 43/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/prompt-engineering.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 57/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/trust-and-decision-making.mdc · 0 | Cursor rules | no sections | 48/100 | 3 days ago | |
| Light-Brands/planetary-party-html.cursor/rules/user-facing-language.mdc · 0 | Cursor rules | lint-formatstylearch | 66/100 | 3 days ago | |
| Light-Brands/planetary-party-htmlAGENTS.md · 0 | AGENTS.md | buildteststylearch+4 | 99/100 | 3 days ago |
Diff against .cursor/rules/ruff-linting.mdc Diff against .claude/agents/CLAUDE.md Diff against .claude/skills/CLAUDE.md Diff against .cursor/rules/git-commit-message.mdc Diff against .cursor/rules/autonomous-development-workflow.mdc Diff against .cursor/rules/code-review-standards.mdc Diff against .cursor/rules/code-style-and-zen-of-python.mdc Diff against .cursor/rules/fixing-github-actions-builds.mdc Diff against .cursor/rules/git-interaction.mdc Diff against .cursor/rules/git-worktree-task.mdc Diff against .cursor/rules/heart-centered-ai-philosophy.mdc Diff against .cursor/rules/naming-stuff.mdc Diff against .cursor/rules/prompt-engineering.mdc Diff against .cursor/rules/trust-and-decision-making.mdc Diff against .cursor/rules/user-facing-language.mdc Diff against AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago |
