Skip to content
SkillMixed2,412 tokens in use

embedded-agents-agent-sdk

Embed Claude agents in a Next.js app on the Claude Agent SDK: one askAgent wrapper, agents as directories, a layered tool boundary and live tests against the real model.

680 stars on the repository MIT Licensephuryn/product-engineering · app-stack/skills/embedded-agents-agent-sdk
claude plugin install app-stack@product-engineering
View source

Install command as written in the repository's README

Skill label

measured from its files

What installing embedded-agents-agent-sdk costs

44tokens idle
2,412tokens in use
6,694tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Mixed

Script-ledMixedModel-led

Scripts do part of the work and the model's judgement does the rest.

This describes the skill's structure, how much of it is scripts. It does not say how well it works. Scripts: examples/knowledge-agent.live.test.ts, examples/research-agent.live.test.ts, scripts/discover-mcp-tools.mjs, scripts/new-agent.mjs, templates/agent.test.ts, templates/agent.ts, templates/agents.live.test.ts, templates/route.ts.

Touches

shelldetectedwrites filesdetectedcredentialsdetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Good
  • Frontmatter8/15
  • Structure19/25
  • Examples3/15
  • Output15/15
  • Size15/15
  • Resources11/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Good
  • Writes files−8

    does this on the machine, and the frontmatter does not say so

    scripts/new-agent.mjs, line 23
  • Reads credentials−15

    does this on the machine, and the frontmatter does not say so

    templates/agent.test.ts, line 89

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity100
  • Maintenance100
  • Community44
  • Maturity4
  • Momentum40

This skill installs a wrapper, a streaming route and tests that run Claude agents inside a Next.js app through the Claude Agent SDK. It is for agents that need the Claude Code engine’s own file and shell tools, skills and MCP, or for products that already run the SDK.

An agent is a directory with an AGENTS.md, optional knowledge files, local skills and an MCP config. One function runs any agent, so no agent name appears in code. The skill also covers the chat UI contract, the tool boundary and what to settle before the agent leaves localhost.

What You Get

  • A wrapper, a route that lists and streams agents, a unit test for the contract and a live test for every agent
  • A script that creates an agent directory with its AGENTS.md, and optional knowledge and MCP files
  • A script that lists each MCP server’s tools next to the ones granted
  • Two finished example agents, copied only on request: a knowledge agent and a research agent
  • A playbook reference with the measurement behind each option

Common Use Cases

  • Adding a support or research agent to a Next.js product
  • Restricting an agent to a few MCP tools and its own knowledge files
  • Preparing an embedded agent for deployment on a long-lived Node host
  • Writing live tests that pin what an agent refuses or cites

What Makes It Unique

It is the second of two embedded-agent skills, and says when to pick it: only when the agent needs the Claude Code engine or the app already runs it. Its tool boundary has six measured layers, from an allowlist of built-in tools to turn and budget caps, and the live test suite stays out of the normal gate because it costs money.

Under The Hood

The skill is mostly instructions, with two Node scripts and TypeScript templates. The agent runs npm installs, copies template files into the app and runs new-agent.mjs, which writes a new agent directory. The discover script starts each MCP server from the agent’s config, which can reach the network with the agent’s secrets, reads the tool list and writes nothing. The wrapper starts the Claude Code engine as a subprocess with built-in file tools only on an allowlist, and the live tests call the real model.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers