Adding a Functional Endpoint

Generate Go endpoint boilerplate from service.yaml function signatures.

172|5|Updated Sep 9, 2022
One-click install
npx skills add https://github.com/microbus-io/fabric --skill adding-a-functional-endpoint
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Adding a Functional Endpoint
Source: https://github.com/microbus-io/fabric/tree/main/.claude/skills/microbus/add-function
Command: npx skills add https://github.com/microbus-io/fabric --skill adding-a-functional-endpoint

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating or modifying a functional endpoint of a microservice often requires manual boilerplate generation, correct Go signatures, and consistent testing scaffolds. This Skill automates the end-to-end process by guiding the user through signature-driven boilerplate creation and integration steps.

Core Features & Use Cases

  • Define in service.yaml: Add or update a functional endpoint's signature, description, and HTTP method as part of the service's API surface.
  • Generate Boilerplate Code: Produce the initial Go handler or RPC function, along with interface stubs and test scaffolds.
  • Move Implementation & Test: Relocate implementation when renaming functions and align associated tests.
  • Document & Version: Create documentation and trigger code versioning to keep the microservice evolvable.

Quick Start

Use the add-function skill to create a new endpoint MyNewFunction(primitiveParam string, customParam CustomType) (result string) by defining the signature in service.yaml, then run go generate to generate boilerplate and implement business logic.

Frequently Asked Questions about Adding a Functional Endpoint

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

FAQPage Schema
How do I generate boilerplate code for a new microservice endpoint in Go?

Generate boilerplate for a microservice endpoint by defining its Go function signature and HTTP method in service.yaml. Running go generate creates the initial handler, interface stubs, and testing scaffolds automatically to streamline the integration process.

What is the best way to manage functional endpoint creation and testing scaffolds?

Automating functional endpoint creation via signature-driven code generation ensures consistent testing scaffolds and Go handler boilerplate. It produces interface stubs and test coverage directly from service.yaml API definitions, maintaining codebase consistency.

How do I move implementation and tests when renaming a Go microservice function?

Use signature-driven automation to relocate existing business logic when renaming a Go microservice function. This process simultaneously aligns and moves associated testing scaffolds to match the new function name, ensuring implementation continuity.

Does adding a functional endpoint require manual code versioning and documentation?

Adding a functional endpoint does not require manual versioning because the workflow automates documentation creation and code versioning. It enforces AGENTS.md guidance to trigger these steps automatically, keeping the microservice consistently evolvable.

When do I need to define a functional endpoint in service.yaml?

Define a functional endpoint in service.yaml whenever adding or updating a microservice API surface. This definition drives the automated generation of Go boilerplate, type definitions, and testing scaffolds for that specific endpoint.