From gopilot
Generate typed frontend SDK from the Go backend's OpenAPI spec. Produces validation schemas and remote functions for SvelteKit or Next.js. Use after adding or changing API endpoints.
npx claudepluginhub bishwas-py/gopilot --plugin gopilotThis skill uses the workspace's default tool permissions.
You are generating a typed frontend SDK from the Go backend's OpenAPI spec. This is the bridge between backend and frontend.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
You are generating a typed frontend SDK from the Go backend's OpenAPI spec. This is the bridge between backend and frontend.
frontend/svelte.config.js exists → SvelteKitfrontend/next.config.ts exists → Next.jsskills/_shared/svelte-patterns.mdskills/_shared/react-patterns.mdUse the gopilot-tools.fetch_openapi MCP tool to get the spec:
http://localhost:8080/openapi.json firstfrontend/openapi.jsonfrontend/openapi.json (cache)If the MCP tool is unavailable, read the spec manually via curl or fetch.
Use the gopilot-tools.generate_schemas MCP tool to produce frontend/src/_sdk/schemas.ts.
This file contains:
export const + export type per OpenAPI schemaimport * as v from "valibot";
export type CreateItemInputBody = v.InferOutput<typeof CreateItemInputBody>;
export const CreateItemInputBody = v.object({
title: v.pipe(v.string(), v.minLength(3), v.maxLength(200)),
description: v.optional(v.pipe(v.string(), v.maxLength(2000))),
});
import { z } from "zod";
export type CreateItemInputBody = z.infer<typeof CreateItemInputBody>;
export const CreateItemInputBody = z.object({
title: z.string().min(3).max(200),
description: z.string().max(2000).optional(),
});
Use the gopilot-tools.generate_remotes MCP tool to produce one file per API tag in frontend/src/_sdk/remotes/.
import { query, command } from "$app/server";
import * as v from "valibot";
import { goApi } from "$lib/server/go-client";
import type { ListItemsOutputBody, CreateItemInputBody } from "../schemas";
export const listItems = query(
v.optional(v.object({
search: v.optional(v.string()),
page: v.optional(v.number()),
per_page: v.optional(v.number()),
})),
async ({ search, page, per_page } = {}) => {
return goApi.get<ListItemsOutputBody>("/api/v1/items", {
params: { search, page, per_page },
});
}
);
export const createItem = command(
CreateItemInputBody,
async (body) => {
return goApi.post<Item>("/api/v1/items", body);
}
);
"use server";
import { z } from "zod";
import { goApi } from "@/lib/go-client";
import { CreateItemInputBody, type ListItemsOutputBody } from "../schemas";
export async function listItems(params?: {
search?: string;
page?: number;
per_page?: number;
}): Promise<ListItemsOutputBody> {
return goApi.get<ListItemsOutputBody>("/api/v1/items", { params });
}
export async function createItem(input: z.infer<typeof CreateItemInputBody>) {
const body = CreateItemInputBody.parse(input);
return goApi.post("/api/v1/items", body);
}
Create frontend/src/_sdk/remotes/index.ts:
export * from "./items.remote";
export * from "./bookings.remote";
// ... one export per tag
Create frontend/src/_sdk/index.ts:
export * from "./schemas";
export * from "./remotes";
Create frontend/src/_sdk/remotes/GUIDE.md — a table of all generated functions:
| Function | Method | Path | Tag |
|----------|--------|------|-----|
| listItems | GET | /api/v1/items | Items |
| createItem | POST | /api/v1/items | Items |
cd frontend && npx tsc --noEmit