setup-connect-query

Enforce ConnectRPC usage rules and protobuf v2 discipline via a PostToolUse hook.

3|1|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/malinskibeniamin/skills --skill setup-connect-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-connect-query
Source: https://github.com/malinskibeniamin/skills/tree/main/setup-connect-query
Command: npx skills add https://github.com/malinskibeniamin/skills --skill setup-connect-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Enforce ConnectRPC usage rules and protobuf v2 discipline across codebases to prevent unsafe patterns, promote type safety, and ensure consistent transport.

Core Features & Use Cases

  • Enforces banning raw useQuery/useMutation from @tanstack/react-query when ConnectRPC patterns are in use, with allowances for useTransport/callUnaryMethod.
  • Bans invalidateQueries() with empty args to require a specific queryKey scope.
  • Warns on axios or fetch usage to steer teams toward ConnectRPC transport.
  • Enforces protobuf v2 norms: ban new Message(), ban PlainMessage/PartialMessage, ban manual $typeName literals.
  • Provides an Escape hatch via // allow: direct-query [reason], and points to SETUP.md/REFERENCE.md for deeper guidance.
  • Intended for setup-time enforcement and code-review guardrails to lock in patterns before deployment.

Quick Start

Configure Claude to run the connect-query-check.sh PostToolUse hook during edits and writes.

Frequently Asked Questions about setup-connect-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce ConnectRPC patterns and ban raw useQuery in my codebase?

You can enforce ConnectRPC patterns by running a PostToolUse hook that checks code changes and bans raw useQuery/useMutation, requiring useTransport or callUnaryMethod instead.

How do I prevent unsafe protobuf v2 initialization like new Message()?

To prevent unsafe protobuf v2 initialization, configure a static analysis hook that bans new Message(), PlainMessage, PartialMessage, and manual $typeName literals across generated and pb files.

Can I use axios or fetch alongside ConnectRPC transport without warnings?

No, axios or fetch usage triggers warnings to steer your team toward consistent ConnectRPC transport, though you can bypass specific checks using an // allow: direct-query [reason] escape hatch.

How do I stop empty invalidateQueries calls in TanStack React Query?

You can stop empty invalidateQueries calls by applying a code-check hook that flags invalidateQueries() without arguments, forcing developers to provide a specific queryKey scope.

Does this ConnectRPC enforcement tool require any external dependencies?

No, this ConnectRPC enforcement tool has zero external dependencies and operates via a standalone shell script integrated as a PostToolUse hook during setup and code edits.