api-patterns

Scaffold consistent MCP and AI SDK API components with Zod schemas.

25|6|Updated Sep 23, 2025
One-click install
npx skills add https://github.com/youdotcom-oss/dx-toolkit --skill api-patterns-youdotcom-oss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-patterns
Source: https://github.com/youdotcom-oss/dx-toolkit/tree/main/.agents/skills/api-patterns
Command: npx skills add https://github.com/youdotcom-oss/dx-toolkit --skill api-patterns-youdotcom-oss

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterns and guidelines for building foundation API components across You.com DX Toolkit, ensuring consistency between CLI tooling, Zod schemas, utilities, and type definitions.

Core Features & Use Cases

  • Foundation patterns for CLI commands, schemas, utilities, and public exports that speed up contribution to MCP and AI SDK packages.
  • Clear guidance on architecture, workflow, and best practices for developing new API endpoints and utilities.
  • Use Case: A developer adds a new API endpoint following the schema-first design and exports to main library.

Quick Start

Follow the development guide to adopt API patterns in your package.

Frequently Asked Questions about api-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold consistent API patterns for MCP and AI SDK packages?

Consistent API patterns for MCP and AI SDKs are achieved through schema-first design and modular exports, ensuring type-safe CLI tooling and shared utilities across multiple packages.

What is schema-first design for foundation API components?

Schema-first design for foundation API components defines Zod schemas before implementation, ensuring type-safe utilities and consistent public exports across CLI commands and MCP integrations.

How do I add a new API endpoint following foundation patterns?

To add a new API endpoint following foundation patterns, define Zod schemas first, implement the endpoint logic, and export it through the modular public exports system in your package.

Do I need Bun to use foundation API patterns for MCP?

Yes, adopting these foundation API patterns requires a Bun-based runtime environment to execute CLI tooling and manage modular exports across your MCP and AI SDK packages.

How do Zod schemas work with CLI commands in AI SDK packages?

Zod schemas validate inputs for CLI commands in AI SDK packages by enforcing type-safe boundaries, ensuring that shared utilities and data structures remain consistent across multiple packages.

What's the best way to structure modular exports for foundation utilities?

The best way to structure modular exports for foundation utilities is to follow schema-first design principles, separating CLI tooling, Zod schemas, and type definitions into distinct modular export paths.