segment

Segment Next.js App Router backends into isolated deployable units with CLI scaffolding.

52|Updated Jul 12, 2023
One-click install
npx skills add https://github.com/finom/vovk --skill segment-finom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: segment
Source: https://github.com/finom/vovk/tree/main/packages/claude-plugin/skills/segment
Command: npx skills add https://github.com/finom/vovk --skill segment-finom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Segments provide a way to slice a backend into isolated, deployable units. They own their own API path prefixes, per-segment runtime settings, and a dedicated Next.js route-handling file, enabling smaller, independently scalable backends within a single Vovk project.

Core Features & Use Cases

  • Define root, named, and static segments to control deployment boundaries, runtime, and routing scope.
  • Use the vovk new segment CLI to scaffold segments and wire route handlers with initSegment for clean separation of concerns.
  • Leverage static segments for pre-rendered endpoints and per-segment OpenAPI wiring, while dynamic handlers remain separate.

Quick Start

Create a new root segment with npx vovk new segment and wire it to your controllers using initSegment.

Frequently Asked Questions about segment

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

FAQPage Schema
How do I split a Next.js App Router backend into isolated deployable units?

You can split a Next.js App Router backend into isolated deployable units by defining segments that own their own API path prefixes, per-segment runtime settings, and dedicated route-handling files. This creates smaller, independently scalable backends within a single project.

How do I scaffold a new API segment in a Vovk project?

To scaffold a new API segment in a Vovk project, run the npx vovk new segment CLI command. This wires route handlers using initSegment to enforce clear separation of concerns and establish clean ownership boundaries.

Can I configure per-segment runtime settings and OpenAPI wiring in Next.js?

Yes, you can configure per-segment runtime settings and OpenAPI wiring in Next.js by leveraging static segments. These allow for pre-rendered endpoints while keeping dynamic handlers separate within the same backend architecture.

What is the best way to control routing scope and deployment boundaries for serverless backends?

The best way to control routing scope and deployment boundaries for serverless backends is to define root, named, and static segments. This approach maps distinct API paths to specific runtimes, improving maintainability and deployment efficiency.

When should I avoid using segments for multitenant backend architecture?

You should avoid using segments for multitenant backend architecture if your project does not use the Next.js App Router or Vovk. The segment approach specifically targets Next.js App Router projects requiring per-segment isolation and static endpoints.