non-json-content-types

non-json-content-types is a skill for Claude Code, Codex from trpc/trpc. It costs 75 tokens per session (1,609 once invoked), scanned A, original, MIT.

A guide to sending files and other non-JSON data through tRPC mutations. It covers FormData for form fields and files, as well as binary data such as streams, blobs, and byte arrays.

In plain words
What is it for?
Use it to accept HTML-style form submissions, upload files, or process binary request bodies. It covers the server parsers and the client link that chooses the correct request format.
Why use it?
JSON cannot represent file uploads directly. These patterns let a client route file or binary requests correctly while keeping ordinary JSON requests separate.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import type { AppRouter } from '../server/appRouter';.

Good fit Use it to accept HTML-style form submissions, upload files, or process binary request bodies. It covers the server parsers and the client link that chooses the correct request format.

Compare 6 skills from other repositories ↓
About the project

tRPC is a TypeScript framework for creating APIs whose clients receive end-to-end static typing for inputs, outputs, and errors without separate schemas or generated code. Developers use it to build and consume typed APIs in applications, including projects using React, Next.js, Express, and Fastify. The catalogue skills and rules provide guidance for AI coding agents working with tRPC.

trpc/trpc · 40,709 stars · on GitHub · trpc.io

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/trpc/trpc
agentmods
npx agentmods add skills/trpc/trpc/non-json-content-types

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for non-json-content-types

README.md
[![agentmods](https://agentmods.dev/badge/skills/trpc/trpc/non-json-content-types/github.svg)](https://agentmods.dev/skills/trpc/trpc/non-json-content-types)
Your own site
<a href="https://agentmods.dev/skills/trpc/trpc/non-json-content-types"><img src="https://agentmods.dev/badge/skills/trpc/trpc/non-json-content-types/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for non-json-content-types

Your own site · 80×15
<a href="https://agentmods.dev/skills/trpc/trpc/non-json-content-types"><img src="https://agentmods.dev/badge/skills/trpc/trpc/non-json-content-types.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,609 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Sonnet 5 · 6 Sept 2026 📄 Read the review Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.01609
Opus 5.5 $0.00030 $0.00644
Sonnet 5.5 $0.00015 $0.00322
Haiku 4.5 $0.00007 $0.00161

Measured 1mo ago against content hash a9b9b9f40060, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

non-json-content-types scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/server/skills/non-json-content-types/SKILL.md · 266 lines

How it starts

The opening of the file, as written. The whole thing — 266 lines — stays where its author put it; the contents beside it link to each section on GitHub.

tRPC -- Non-JSON Content Types

Setup

Server:

// server/trpc.ts
import { initTRPC } from '@trpc/server';

const t = initTRPC.create();

export const router = t.router;
export const publicProcedure = t.procedure;
// server/appRouter.ts
import { octetInputParser } from '@trpc/server/http';
import { z } from 'zod';
import { publicProcedure, router } from './trpc';

export const appRouter = router({
  uploadForm: publicProcedure
    .input(z.instanceof(FormData))
    .mutation(({ input }) => {
      const name = input.get('name');
      return { greeting: `Hello ${name}` };
    }),
  uploadFile: publicProcedure.input(octetInputParser).mutation(({ input }) => {
    // input is a ReadableStream
    return { valid: true };
  }),
});

export type AppRouter = typeof appRouter;

Client:

// client/index.ts
import {
  createTRPCClient,
  httpBatchLink,
  httpLink,
  isNonJsonSerializable,
  splitLink,
} from '@trpc/client';
import type { AppRouter } from '../server/appRouter';

const url = 'http://localhost:3000';

const trpc = createTRPCClient<AppRouter>({
  links: [
    splitLink({
      condition: (op) => isNonJsonSerializable(op.input),
      true: httpLink({ url }),
      false: httpBatchLink({ url }),
    }),
  ],
});

Core Patterns

FormData mutation

// server/appRouter.ts
import { z } from 'zod';
import { publicProcedure, router } from './trpc';

export const appRouter = router({
  createPost: publicProcedure
    .input(z.instanceof(FormData))
    .mutation(({ input }) => {
      const title = input.get('title') as string;
      const body = input.get('body') as string;
      return { id: '1', title, body };
    }),
});
// client usage
const form = new FormData();
form.append('title', 'Hello');
form.append('body', 'World');

const result = await trpc.createPost.mutate(form);

Binary file upload with octetInputParser

// server/appRouter.ts
import { octetInputParser } from '@trpc/server/http';
import { publicProcedure, router } from './trpc';

export const appRouter = router({
  upload: publicProcedure
    .input(octetInputParser)
    .mutation(async ({ input }) => {
      const reader = input.getReader();
      let totalBytes = 0;
      while (true) {
        const { done, value } = await reader.read();
        if (done) break;
        totalBytes += value.byteLength;
      }
      return { totalBytes };
    }),
});

Read the full file on GitHub · 266 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 266 lines · 75 tokens per session scan A a9b9b9f40060

Subscribe to this mod's changes

non-json-content-types is a skill published in the GitHub repository trpc/trpc (40,709 stars, last pushed today), licensed MIT. It adds 75 tokens to every session and 1,609 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

organization-best-practices

Configure multi-tenant organizations, manage members and invitations, define custom roles and permissions, set up teams, and implement RBAC using Better Auth's organization plugin. Use when users need org setup, team management, member roles, access control, or the Better Auth organization plugin.

krivoox/agent-stack-template · 61 tokens

frontend-engineer

!cat skills/shared/protocols/ux-protocol.md 2>/dev/null || true !cat skills/shared/protocols/input-validation.md 2>/dev/null || true !cat skills/shared/protocols/tool-efficiency.md 2>/dev/null || true !cat .production-grade.yaml 2>/dev/null || echo "No config — using defaults" !cat .forgewright/codebase-context.md…

buiphucminhtam/forgewright · 55 tokens

fullstack-engineer

Consolidated web engineering skill combining backend and frontend development. Implements backend services, APIs, business logic, and web frontends (React/Next.js). Includes clean architecture, TDD, error handling, and state management patterns. Combines: software-engineer + frontend-engineer.

buiphucminhtam/forgewright · 62 tokens

add-app-clip

Add an iOS App Clip target to an Expo app. Use when the user mentions App Clip, AASA, apple-app-site-association, appclips, smart app banner, or wants to ship a lightweight iOS Clip invoked from a URL.

ranbot-ai/awesome-skills · 54 tokens

api-rate-limit-handler

Implement bounded, idempotency-aware API throttling, backoff, and retry handling for 429 and transient 5xx responses.

ranbot-ai/awesome-skills · 32 tokens

better-auth-best-practices

Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email/password, OAuth, or plugin configuration.

krivoox/agent-stack-template · 61 tokens