Agent skill · software engineering · jeremylongshore
glean-sdk-patterns
Apply production-ready Glean API patterns with typed clients, batch
Why this skill is useful
Adds production-ready Glean API patterns with typed clients, batch indexing, and error handling scripts that enhance integration capabilities.
What it needs
Requires glean account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Glean SDK Patterns Overview Production-ready patterns for the Glean enterprise search platform. Glean uses POST-based REST endpoints for both search and indexing. Search queries go to the Client API while document ingestion uses the Indexing API. A structured client centralizes token management, enforces batch pagination for bulk indexing, and provides typed responses for search results. Singleton Client Error Wrapper Request Builder Response Types Testing Utilities Error Handling Pattern When to Use Example --------- ------------- --------- safeCall wrapper All search and index calls Structured error with operation context Retry on 429 Bulk indexing pipelines 3s delay before retry Batch pagination Indexing > 100 documents bulkIndex with batch tracking Auth validation Client init Fail fast on missing GLEANAPIKEY Prerequisites A typed client boundary, secret-manager-backed configuration, and a sandbox base URL allowlist. Contract fixtures containing fictional data plus an explicit error and retry budget. A policy that unknown ACL, destination, or response shape fails closed rather than falling back to a broad client. Instructions 1. Construct clients from environment-specific, scoped configuration and reject missing or production-unsafe destinations. 2. Centralize request validation, bounded response parsing, redacted telemetry, and idempotency keys in the client boundary. 3. Model authorization and partial failure explicitly; never convert a denied result into an empty success or retry writes without a key. 4. Test client behavior against fixtures for malformed payloads, rate limits, deny-by-default ACLs, and rollback of a failed submission. Output Produce a client-contract receipt showing SDK revision, target environment, request/response schema revisions, fixture results, error classification, observability fields, and rollback behavior. Do not log credentials, query text, or document bodies. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/glean-sdk-patterns