connect-query
Build typed ConnectRPC data flows with Connect Query and Protobuf v2. Use for API calls, mutations, query hooks, transports, invalidation, or generated clients.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- connect-query
- paths
- [ "**/*_connectquery*", "**/*_pb*", "**/gen/**" ]
- description
- Build typed ConnectRPC data flows with Connect Query and Protobuf v2. Use for API calls, mutations, query hooks, transports, invalidation, or generated clients.
02 资源文件 4
- 参考文档REFERENCE.md4.9 KB
- 脚本scripts/_hook-lib.sh24 B
- 脚本scripts/connect-query-check.sh5.2 KB
- 参考文档SETUP.md3.4 KB
03 SKILL.md 正文
Run /read-the-damn-docs before current ConnectRPC/Connect Query/Protobuf API guidance.
Enforce
- In ConnectRPC files, ban raw TanStack
useQuery/useMutation; use Connect Query, exceptuseTransport/callUnaryMethod. invalidateQueries()needs a query key.- Prefer ConnectRPC transport over
axios/fetch. - Protobuf v2:
create(Schema), notnew Message();MessageShape/MessageInitShape, notPlainMessage/PartialMessage; no manual$typeName.
Escape: // allow: direct-query [reason].
Query discipline
- Define 2-3 semantic cache constants centrally;
Infinityonly when own invalidation is exclusive. QueryClient owns retry: retry network/5xx, never 4xx. - Hook
transform/selectreturns display-ready data and enforces page size; components do not parse. - Invalidate rather than refetch and always await it. Keys are service/method broad but cardinality-aware.
- Loader and hook use identical query keys; test parity to prevent double fetches.
- One hook per RPC; split multi-RPC pages. Mutation names end
Mutation, orWithToastwhen owning toasts. - Client protovalidate checks sent data, not server-validated responses.
- Proto optionals use
undefined, nevernull; unbounded lists use infinite query/load-more; polling usesrefetchInterval.
Editable query data: read writable derived state for local overrides and save/refetch handoff; keep server truth in the query cache.
Timestamp, Duration, Any, caches: REFERENCE.md. Install: SETUP.md.
04 同仓库更多 Skills
hill-climb
Optimize a defined outcome through bounded evaluation loops. Use for hill-climb requests or repeated improvement against an executable eval, benchmark, or visual comparison; not a one-pass review.
gestures
Build or fix web drag, swipe, sheet, reorder, and hold interactions: direct tracking, rubber banding, release velocity, momentum, snap points, and interruption. Not native React Native or Swift.
hill-climb
Optimize a defined outcome through bounded evaluation loops. Use for hill-climb requests or repeated improvement against an executable eval, benchmark, or visual comparison; not a one-pass review.
gestures
Build or fix web drag, swipe, sheet, reorder, and hold interactions: direct tracking, rubber banding, release velocity, momentum, snap points, and interruption. Not native React Native or Swift.
improve-animations
Audit existing web UI motion and prioritize concrete improvements or self-contained implementation plans. Use for a motion roadmap; animate owns implementation and diff review.
effect-ts
Use when setting up a repository that uses the Effect TypeScript library.