Skip to main content
jg-packages

Search

    TypeScript packages for coding agents

    Give your coding agenttested code to build on.

    Errors, HTTP requests, storage, files, processes, and more, as small packages that share one set of conventions. Each ships its full API reference, so your agent writes less code and you review less of it.

    View all 28 packages

    The packages

    One job each, one set of conventions.

    Each one does one job, with the same error handling, naming, and docs as the others. Pick the ones you need; siblings depend on each other only where it saves you code.

    Browsers and Node.js

    Typechecked against both runtimes, so they use only the globals both have.

    • Coded errors for every jg package: an Exception with a stable code and JSON data, message extraction, code checks, and test assertions.
      v1.7.1Universal
    • jg-api-response

      API envelopes

      Build and recognise the success, data, and error envelope that services exchange over HTTP, with errors as a code, a message, and data.
      v1.2.0Universal
    • jg-utilities

      Utilities

      Validations, formatters and relative times, media type detection, secure and name-based IDs, cursors, and collection, async, and environment helpers.
      v1.8.0Universal
    • jg-bignumber

      Decimal math

      Exact decimal math on bignumber.js: rounding modes, formatting, and financial calculations such as percentage changes.
      v1.5.0Universal
    • jg-fetch

      HTTP requests

      A fetch wrapper that never throws: timeouts, retries that honour Retry-After, response size caps, and API envelopes.
      v0.5.2Universal
    • jg-env

      Environment

      Strict environment variable readers for process.env or import.meta.env, plus secret files, with errors that name the key and never the value.
      v0.3.1Universal
    • jg-site

      Site metadata

      Structured data, llms.txt files, and theme preferences for websites, as small functions that run in browsers and Node.js.
      v0.1.0Universal

    Browsers and workers

    For pages and service workers, and safe to import during server rendering.

    • jg-storage

      Browser storage

      Typed key-value stores over localStorage, sessionStorage, IndexedDB, and memory, for pages and workers alike.
      v1.2.0Browser
    • jg-sw

      Service workers

      A generated caching worker with a Vite plugin and CLI, plus registration, updates that reload once, and app installation.
      v1.6.1BrowserNode.js
    • jg-clipboard

      Clipboard

      Copy and read text, HTML, and images on the browser clipboard, with support detection and coded errors that say why the browser refused.
      v0.3.2Browser
    • jg-react

      React hooks

      React hooks for online status, page visibility, breakpoints, viewport proximity, clamped text, new builds, and theme colors, each safe in a server render.
      v0.7.0Browser
    • TanStack Query with safe defaults, opt-in IndexedDB persistence, polled first pages, and a sign-out clear that waits for the cache to finish restoring.
      v0.7.0Browser
    • jg-react-router

      React Router

      React Router helpers: a page outlet that restores focus and scroll, dialogs kept in the URL or closed on navigation, and pages whose code fails to load.
      v0.5.0Browser

    Node.js

    For servers, command-line tools, and build scripts.

    • jg-fs

      Filesystem

      Node.js files and paths: atomic writes, bounded reads, streamed SHA-256 for files, and verified installs that preserve existing files.
      v1.8.0Node.js
    • jg-process

      Child processes

      Run interactive foreground commands or capture output without a shell, with timeouts, cancellation and process-tree cleanup for captured runs.
      v1.8.0Node.js
    • jg-postgres

      PostgreSQL

      node-postgres helpers: transactions that report an unknown commit, advisory locks, SQLSTATE checks, cursor pages, and ordered lists.
      v0.7.0Node.js
    • A read-through cache that keeps working when Redis fails, and fail-closed one-time claims and single-use values, on node-redis.
      v0.4.0Node.js
    • jg-nestjs

      NestJS

      NestJS for HTTP APIs: an ApiException, a filter and an interceptor for the jg-api-response envelope, schema validation, CORS, and app bootstrap.
      v0.5.1Node.js
    • jg-crypto

      Crypto

      Hashing, random bytes and digits, HMAC signatures with constant-time verification, and authenticator app codes, for Node.js.
      v0.3.0Node.js
    • Git commands for Node.js that never prompt or inherit Git environment variables, with time and output limits, typed reads, and remote URL parsing.
      v0.5.0Node.js
    • Checks for Node.js scripts that Docker is local before using it, plus Compose service and container reads with loopback-only ports.
      v0.3.0Node.js
    • jg-github

      GitHub

      GitHub App authentication for Node.js: app tokens, scoped installation tokens, webhook signatures, and rate-limit retry times.
      v0.2.1Node.js
    • jg-playwright

      Browser tests

      Playwright helpers for end-to-end tests: horizontal overflow, loaded assets, motion, accessibility scans, secrets, and a fake microphone.
      v0.2.0Node.js
    • Machine-wide named locks for Node.js scripts, agents, and apps: waits, a status of every holder, explicit recovery, and a CLI.
      v1.0.0Node.js
    • jg-render

      HTML to PNG

      Render prepared HTML to exact PNGs in offline Chromium, with verified fonts and images, transparency, and a caller-owned layout check.
      v1.0.0Node.js
    • jg-site-checks

      Static site checks

      Verify built static sites from an explicit page inventory, with exact canonical URLs, links, fragments, sitemaps, robots.txt, and llms.txt.
      v1.0.0Node.js
    • jg-package-check

      Packed package checks

      Inspect npm tarballs without extraction, then check an installed package’s public exports in disposable npm or pnpm consumers.
      v1.0.0Node.js
    • jg-publishing-guides

      Publishing guides

      Create offline HTML and plain-text publishing guides with reviewed copy, ordered files, and English or Spanish controls.
      v1.0.1Node.js

    Why agents use them

    Code your agent doesn't have to write.

    Agents write code faster than anyone can review it. Each package replaces code an agent would otherwise generate with code that's already tested, documented, and consistent with the rest.

    • Less code to generate and review

      Your agent imports a tested function instead of writing a new one, so there’s less code to generate, review, and maintain.

    • One error model, server to client

      Every failure is an Exception with a stable code and JSON data. APIs send it in one envelope and jg-fetch reads it back, so code checks codes, not messages.

    • Docs inside each package

      Every package ships its full API reference as API.md, and every export has TSDoc, so an agent reads the docs of the installed version from node_modules.

    • Examples that are checked

      Every example in the docs typechecks against the published package, and the ones without I/O run on every release, with their stated results asserted.

    • Tested as you install them

      Each release is packed and installed into a new project before it ships, and browser code is tested in Chromium, Firefox, and WebKit.

    • One set of conventions

      The same names, units in option names, ESM with types, and nothing running at import. An agent that knows one package knows how the others work.

    Set up your agent

    Two steps to put your agent on them.

    The policy tells your agent to prefer these packages, and the skill tells it which one fits each task. Both live in jg-skills, so they stay current as the packages change.

    1. Step 1

      Add the policy to your AGENTS.md

      A short ## jg-packages section that tells your agent to prefer these packages and to check the installed version's API.md before using an export. jg-skills keeps it current.

    2. Step 2

      Install the skill

      It tells your agent which package fits a task, even before the package is installed.

      Terminal
      npx skills add jesusgraterol/jg-skills --skill jg-packages -y

    Docs for agents

    Docs your coding agent can read.

    The same READMEs and API references you read here, as Markdown: inside each package, and on this site.

    • node_modules/<package>/API.md

      The full API reference of the installed version, shipped in every package, so it reads offline.

    • node_modules/<package>/RECIPES.md

      App-side patterns for the package, such as an API exception or a typed client, typechecked on every release.

    • /llms.txt

      An index of the packages in the llmstxt.org format, with a link to each package’s Markdown.

    • /llms-full.txt

      Every package’s README, API reference, and recipes in one file, for loading into a context window.

    • /packages/<name>/index.md

      The Markdown version of each page: a package’s README and its full API reference.

    • Accept: text/markdown

      Request any page with this header to get its Markdown instead of HTML.

    The source and the release process are on GitHub (opens in a new tab).