ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
ICU message format internationalization for React — FormattedMessage, useIntl, defineMessages, and the FormatJS extraction workflow. Load when a project imports react-intl.
$ npx -y skills add agents-inc/skills --skill web-i18n-react-intl --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/web-i18n-react-intlContext preview
The summary Claude sees to decide when to auto-load this skill.
ICU message format internationalization for React — FormattedMessage, useIntl, defineMessages, and the FormatJS extraction workflow. Load when a project imports react-intl.
name: web-i18n-react-intl description: ICU message format internationalization for React — FormattedMessage, useIntl, defineMessages, and the FormatJS extraction workflow. Load when a project imports react-intl.
> **Quick Guide:** `FormattedMessage` renders translated text in JSX, `useIntl` returns strings for > attributes and programmatic use, and `defineMessages` produces descriptors the FormatJS CLI can > extract. `IntlProvider` supplies the context, and its `onError` is what separates a missing > translation from a real failure. Every `plural` and `select` needs an `other` branch. Version > boundary: v7.x runs on React 16.6 through 19; v8 and later require React 19.
**Detailed Resources:**
---
[examples/core.md](examples/core.md).
component, or a comparison — `useIntl().formatMessage()`. Also in [examples/core.md](examples/core.md).
`@formatjs/intl`, optionally re-supplied through `RawIntlProvider`. In [examples/core.md](examples/core.md).
---
<critical_requirements>
**Wrap the tree in `IntlProvider` with `locale`, `messages` and `defaultLocale`.** Every `FormattedMessage` and `useIntl` call reads that context, and `defaultLocale` is what a missing translation falls back to instead of surfacing the raw ID.
**Give every `plural` and `select` an `other` branch.** ICU requires it, and a message without one throws when formatted rather than when authored.
**Match the major version to the React version in the project.** v7.x covers React 16.6 through 19; v8 and later dropped everything before React 19.
</critical_requirements>
---
**Auto-detection:** react-intl, FormatJS, FormattedMessage, useIntl, IntlProvider, RawIntlProvider, defineMessages, defineMessage, createIntl, formatMessage, FormattedDate, FormattedNumber, FormattedRelativeTime, ICU message format
**Applies to:**
**Handled elsewhere:**
settles nothing about detection, routing or storage
do that better than a client-side provider, and this skill does not compete with it
between is not this skill's concern
---
<philosophy>
ICU Message Format is the point: it is what translation vendors already speak, so a message written in it moves through a professional workflow without a conversion step. Everything else follows. Formatting is delegated to the browser's own `Intl` APIs rather than reimplemented, which is why locale-specific behaviour is correct for locales nobody tested. And the API is deliberately doubled — a component for JSX and a hook for strings — because a `ReactNode` cannot be put in an attribute.
</philosophy>
---
<patterns>
`onError` is where a missing translation is separated from a real failure, and `defaultRichTextElements` gives `<b>`, `<i>` and `<br>` one definition for the whole app.
<IntlProvider
locale={locale}
defaultLocale={DEFAULT_LOCALE}
messages={messages}
defaultRichTextElements={DEFAULT_RICH_TEXT_ELEMENTS}
onError={(err) => {
if (err.code === "MISSING_TRANSLATION") return;
throw err;
}}
>
{children}
</IntlProvider>Full code: [examples/core.md](examples/core.md)
For text rendered directly in JSX, including messages carrying ICU syntax.
<FormattedMessage
id="greeting.unread"
defaultMessage="{count, plural, =0 {No messages} one {# message} other {# messages}}"
values={{ count: unreadCount }}
/>It returns a `ReactNode`, so an attribute — `placeholder`, `aria-label`, `title` — needs Pattern 3 instead.
Full code: [examples/core.md](examples/core.md)
For any context that needs a string: attributes, document titles, third-party props, or a value the code then compares.
const intl = useIntl();
const placeholder = intl.formatMessage({
id: "search.placeholder",
defaultMessage: "Search products...",
});Full code: [examples/core.md](examples/core.md)
Descriptors the CLI can find statically. `description` is the only channel a translator has for context.
export const productMessages = defineMessages({
reviewCount: {
id: "product.reviewCount",
defaultMessage:
"{count, plural, =0 {No reviews} one {# review} other {# reviews}}",
description: "Number of product reThe official skills marketplace for Agents Inc. 150+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Repo: agents-inc/skills
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking, virtual keys, and production…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client patterns
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning, deployments, and training
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling, embeddings, image generation,…