Frontend context auditor

From fritzprix/libr-agent · View interactive version

Frontend context auditor is an AI agent skill from the GitHub repository fritzprix/libr-agent. Audit React Context usage, detect prop drilling, verify compound component patterns. Use when reviewing frontend code for proper Context consumption, checking AgentChatContext/AgentSessionContext usage, or enforcing compound component patterns.

How to use this skill

Skill file

Frontend Context Auditor

Audit React frontend code for proper Context usage and compound component patterns.

Audit Checklist

Context Providers

Compound Components

Type Safety

Styling

Audit Commands

# Find prop drilling (props passed through 2+ levels)
grep -r "props\." src/features/ | grep -v "interface\|type\|//" | head -50

# Find Context usage
grep -r "AgentChatContext\|AgentSessionContext\|SettingsContext" src/ | head -50

# Find compound component patterns
grep -r "Chat\.\|Header\|Messages\|Input" src/features/ | head -50

# Check for any types
grep -r ": any" src/ | head -20

Refactoring Guidelines

When prop drilling is detected:

  1. Extract shared state to a Context provider
  2. Move provider to appropriate level in component tree
  3. Consume Context in leaf components via useContext

When compound patterns are missing:

  1. Split large components into FeatureName.SubComponent files
  2. Extract shared state to FeatureName.Context.tsx
  3. Wrap sub-components with provider in parent
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.