Skip to content

feat(bugfix): add React Query patterns to prevent incomplete implementations#50

Open
ambient-code[bot] wants to merge 1 commit intomainfrom
bugfix/add-react-query-patterns
Open

feat(bugfix): add React Query patterns to prevent incomplete implementations#50
ambient-code[bot] wants to merge 1 commit intomainfrom
bugfix/add-react-query-patterns

Conversation

@ambient-code
Copy link

@ambient-code ambient-code bot commented Feb 25, 2026

Summary

Adds comprehensive React Query usage patterns to the bugfix workflow to prevent incomplete implementations, specifically addressing gaps identified in session-1771963475.

Session

This improvement was generated from feedback loop session:

  • Namespace: ambient-platform-and-workflow-feedback-loop-running
  • Session: session-1772031578

Problem

During session-1771963475, the agent implemented polling logic for a React Query hook with pagination but missed critical implementation details:

  1. Missing pattern: No pattern for "Polling with Pagination" existed
  2. Incomplete guidance: Pattern didn't cover refetchInterval + placeholderData: keepPreviousData interaction
  3. Incomplete terminal states: 'Error' phase was omitted from terminal state checks
  4. Stale data issue: Polling decisions were based on previous page data during transitions

Changes

New Files

  • .claude/patterns/react-query-usage.md: Comprehensive React Query patterns including:
    • 7 proven patterns (Basic Query, Mutations, Dependent Queries, Infinite Queries, Polling, Polling with Pagination, Optimistic Updates)
    • Pattern 6: Polling with Pagination - addresses the specific gap identified
    • Complete terminal session phases list (Stopped, Completed, Failed, Error)
    • Detailed explanation of refetchInterval + placeholderData interaction
    • Common pitfalls section with examples
    • When to use each pattern decision table

Updated Files

  • .claude/skills/fix/SKILL.md: Added "Technology-Specific Patterns" section directing agents to check .claude/patterns/ before implementing fixes
  • .claude/skills/diagnose/SKILL.md: Updated Step 7 and Best Practices to reference patterns during diagnosis

Impact

Future agents working on React Query bugs will:

  • Have proven patterns to reference instead of implementing from scratch
  • Understand the critical interaction between polling and pagination
  • Know the complete list of terminal session phases
  • Avoid common pitfalls documented in the patterns file

Testing

  • Validated JSON syntax remains valid
  • Verified markdown linting compliance
  • Confirmed pattern file structure follows established conventions

… patterns

Addresses feedback from session-1771963475 where agent implemented incomplete
React Query polling logic due to missing pattern guidance.

Changes:
- Add .claude/patterns/react-query-usage.md with 7 comprehensive patterns
- Pattern 6 "Polling with Pagination" addresses the specific gap identified
- Includes guidance on refetchInterval + placeholderData interaction
- Documents complete terminal session phases (Stopped, Completed, Failed, Error)
- Update fix skill to reference patterns before implementing fixes
- Update diagnose skill to check patterns during root cause analysis

Prevents future incidents where agents miss critical implementation details
when working with React Query pagination and polling.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants