API Patterns
Developmentapi-patternsAPI Patterns is an Agent Skill for development published in the redpanda-data/console repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Connect Query patterns for API calls. Use when working with mutations, queries, or data fetching.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/redpanda-data/console/blob/HEAD/frontend/.claude/skills/api-patterns/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/api-patterns, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
API Patterns
Make API calls with Connect Query and handle responses properly.
Activation Conditions
- Making API calls
- Using Connect Query hooks
- Cache invalidation
- Mutations and optimistic updates
- Toast notifications for errors
Quick Reference
| Action | Rule |
|---|---|
| Fetch data | use-connect-query.md |
| After mutation | api-invalidate-cache.md |
| Handle errors | api-toast-errors.md (use formatToastErrorMessage in onError) |
| Protobuf files | protobuf-no-edit.md |
Key Locations
| Location | Purpose |
|---|---|
/src/react-query/ | Connect Query hooks |
/src/protogen/ | Generated protos (DO NOT EDIT) |
Regenerate protos: task proto:generate (from repo root)
Rules
See rules/ directory for detailed guidance on queries, mutations, cache invalidation, and error handling.