agentleFS
VercelKnown publishervercel-labs/json-render/skills/chat/SKILL.md

chat

Skill19k starsChanged 14 days agoApache-2.0View on GitHub

Chat SDK renderer for json-render that turns JSON specs into native chat cards (Block Kit on Slack, Adaptive Cards on Teams, and the card format of other Chat SDK adapters). Use when working with @json-render/chat, building bots that post rich messages with tables, charts, fields, or buttons, streaming a generated card into a chat thread, or when the user mentions Chat SDK, Slack Block Kit, or Teams Adaptive Cards together with json-render.

8 other projects use a version of this.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Most recently taken up by

Who's talking about vercel-labs/json-render

The biggest 5 of 90 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 90

Talked about on GitHub, YouTube, Bluesky, Hacker News and the web (90 times).

On GitHub · 50

45 more on GitHub

On YouTube · 20

15 more on YouTube

On Bluesky · 17

12 more on Bluesky

On Hacker News · 2

On the web · 1

The file

Files
SKILL.md

@json-render/chat

Renders json-render specs as Chat SDK CardElement objects. Each Chat SDK adapter converts the card to its platform format.

Quick start

import { defineCatalog } from "@json-render/core";
import {
  schema,
  standardComponentDefinitions,
  streamCard,
} from "@json-render/chat";
import { streamText } from "ai";

const catalog = defineCatalog(schema, {
  components: standardComponentDefinitions,
});

chat.onNewMention(async (thread, message) => {
  const result = streamText({
    model: "anthropic/claude-haiku-4.5",
    system: catalog.prompt(),
    prompt: message.text,
  });
  await streamCard(thread, result.textStream);
});

streamCard(target, textStream, options) posts the card once the root exists, edits it every updateIntervalMs (default 500) as elements arrive, and finishes with a validated card. toCard(spec, options) converts a complete spec. toPartialCard(spec) returns a best-effort card for a streaming spec, or null before the root exists.

Spec structure

Same flat tree as other renderers: root plus elements, with optional state. The root must be a Card. An inner Card renders as a titled section, because chat cards cannot nest.

Standard components: Card, Section, Text (markdown), Fields with Field, Table, Chart (pie with segments, or bar, line, area with categories and series[].values), Divider, Image, and Actions with Button and LinkButton.

{
  "root": "card",
  "elements": {
    "card": {
      "type": "Card",
      "props": { "title": "Weekly deploys" },
      "children": ["kpis", "chart"]
    },
    "kpis": { "type": "Fields", "props": {}, "children": ["total"] },
    "total": {
      "type": "Field",
      "props": { "label": "Deploys", "value": "985" },
      "children": []
    },
    "chart": {
      "type": "Chart",
      "props": {
        "title": "Deploys per day",
        "chart": {
          "type": "bar",
          "categories": ["Mon", "Tue"],
          "series": [{ "name": "Deploys", "values": [180, 210] }]
        }
      },
      "children": []
    }
  }
}

State, repeat, and visibility

$state, $item, $index, and $template resolve against spec.state. visible conditions drop elements. repeat renders an element's children once per item. A repeated Table expands its rows as a template, and object rows map to headers by key name. $bindState and $bindItem have no effect because posted messages have no inputs. Expansion stops at maxElements (default 1000 elements and table rows); toCard throws past it.

Validation and limits

toCard throws CardSpecError with an issues array (one entry per problem). Send the issues back to the model to repair the spec. Pass limits to reject specs that a platform would degrade, for example { tables: 1, charts: 2 } for Slack. Available limits: tables, charts, fields, tableRows, tableColumns, chartTitle, chartLabel, chartSeries, chartPoints.

Runtime

The renderer imports chat for types only, so it runs in the browser and on the server. Convert a card for a specific platform with the adapter, for example cardToSlackBlocks from @chat-adapter/slack/blocks or cardToAdaptiveCard from @chat-adapter/teams/cards.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.