scaffold-server-patterns

Document Fastify plugin, ESM, and Drizzle ORM patterns for UE coordination servers.

2|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/buchananwill/ue-claude-scaffold --skill scaffold-server-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-server-patterns
Source: https://github.com/buchananwill/ue-claude-scaffold/tree/main/skills/scaffold-server-patterns
Command: npx skills add https://github.com/buchananwill/ue-claude-scaffold --skill scaffold-server-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Skill codifies and shares the domain knowledge and architectural patterns used by the ue-claude-scaffold coordination server, including Fastify plugin conventions, ESM import patterns, Drizzle ORM integration, and route architecture, to accelerate consistent implementation.

Core Features & Use Cases

  • Fastify plugin pattern: Each route module exports a FastifyPluginAsync default export and accepts { config } in its options.
  • ESM import convention: All imports use .js extensions, even when the source is TypeScript.
  • Database integration: Drizzle ORM with PG Lite for development and node-postgres for production, including migrations and typed queries.
  • Agent and project identification: The coordination server uses headers like X-Agent-Name and X-Project-Id to scope requests and maintain audit trails.
  • Error handling: Integrated with @fastify/sensible for standardized HTTP errors and replies.

Quick Start

Review the scaffold server patterns and apply the Fastify plugin conventions, ESM import rules, and Drizzle ORM usage to implement or extend the coordination server in your UE project.

Frequently Asked Questions about scaffold-server-patterns

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

FAQPage Schema
How do I structure Fastify route modules with TypeScript and ESM imports?

Fastify route modules should export a FastifyPluginAsync default export and accept { config } in options. ESM imports must use .js extensions even when importing TypeScript source files.

How does Drizzle ORM integrate with Fastify for development and production databases?

Drizzle ORM integrates with Fastify by using PG Lite for development environments and node-postgres for production. This setup includes database migrations and typed queries for consistent data access.

Can I use @fastify/sensible for standardized HTTP error handling in a plugin architecture?

Yes, @fastify/sensible integrates with the Fastify plugin pattern to provide standardized HTTP errors and replies across modular route components, ensuring consistent error behavior.

What is the best way to scope Fastify requests by agent and project identity?

Scoping Fastify requests by agent and project identity uses headers like X-Agent-Name and X-Project-Id to maintain audit trails and enforce request boundaries across modular components.

Why do my ESM imports fail in a TypeScript Fastify server project?

ESM imports fail in TypeScript Fastify servers when .js extensions are omitted. All imports must use .js extensions in the source code even though the actual files are TypeScript.

Does the scaffold server pattern require specific dependencies for Fastify and Drizzle ORM?

Yes, the scaffold server pattern requires Fastify, @fastify/sensible, and Drizzle ORM to enforce consistent plugin behavior, standardized errors, and typed database queries.