Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

add-microservice

БесплатноБез исполняемых скриптовНе проверен

TRIGGER when user asks to create, scaffold, or initialize a new microservice.

microbus-ioот microbus-io★ 173 звезды на GitHub12 установок в других каталогах

Об этом скилле

CRITICAL: Do NOT explore or analyze other microservices unless explicitly instructed to do so. The instructions in this skill are self-contained to this microservice.

CRITICAL: A microservice's hand-written source is myserviceapi/definition.go (the API spec) and service.go (the handler logic), plus the resource and test files. Run cmd/genservice to produce the rest.

Workflow

Copy this checklist and track your progress:

Creating a new microservice:
- [ ] Step 1: Determine the name and description
- [ ] Step 2: Create a directory structure
- [ ] Step 3: Prepare coding agent files
- [ ] Step 4: Prepare definition.go
- [ ] Step 5: Prepare embed.go
- [ ] Step 6: Prepare service.go
- [ ] Step 7: Prepare service_test.go
- [ ] Step 8: Generate the boilerplate
- [ ] Step 9: Add to main app
- [ ] Step 10: Propose features

Step 1: Determine the Name and Description

Determine the name of the microservice. Use only letters a through z and A through Z. The templates in this skill use myservice, myserviceapi, MyService and TestMyService as placeholders that are based on the name of the microservice.

Follow the name-microservice skill to choose a name and hostname that fit the project's domain hierarchy. The name describes what the microservice does and becomes the leading segment of the hostname, which the Hostname constant is set to in Step 4.

Determine a Go-style description for the microservice in the form MyService is X.

Step 2: Create a Directory Structure

Each microservice must be placed in a separate directory. Create a new directory for the new microservice. Use the name of the microservice in lowercase as the name of the new directory name.

In smaller projects, place the new directory under the root directory of the project. In larger projects, consider using a nested directory structure to group similar microservices together.

mkdir -p myservice

Create two subdirectories.

  • The first should be a concatenation of the microservice directory and the suffix api
  • The second subdirectory should be named resources
mkdir -p myservice/myserviceapi
mkdir -p myservice/resources

The directory structure should look like this.

myproject/
└── myservice/
    ├── myserviceapi/
    └── resources/

IMPORTANT: File names in the following steps are relative to the new myservice directory, unless indicated otherwise.

The hand-written file preparation steps (4-7) can be performed in parallel; the generator step (8) must follow them.

Step 3: Prepare Coding Agent Files

Create CLAUDE.md with the hostname as an H1 heading:

# my.service.hostname

**CRITICAL**: This directory is a Microbus microservice. Before performing any task, check for pertinent skills in `.claude/skills/` and its subdirectories. Follow the workflow of the most relevant skill.

Create PROMPTS.md with the prompt used to create this microservice. Rephrase the language to include context that was not made explicit in the original prompt. The intent is to maintain an auditable trail of the prompts, and to allow a future agent to reproduce the functionality of the microservice from these prompts.

Save the prompt as follows.

## Prompt title

Prompt comes here...

Step 4: Prepare definition.go

Create myserviceapi/definition.go with the content of the template definition.go located in the directory of this skill. This is the single source of truth for the microservice's API: the add-feature skills append define.* vars (and their In/Out structs) here, and cmd/genservice projects everything else from it.

  • The Hostname constant holds the hostname in which this microservice will be addressable. Set it to the hostname chosen via the name-microservice skill in Step 1 (e.g. myservice.path.some.myproject)
  • Name is the decorative PascalCase name of the microservice (it cannot be derived from the lowercase directory)
  • Version is a generation counter bumped on each regeneration (not a semantic version); leave it at 1 for a new microservice
  • Description is the Go-style description from Step 1
  • The define import is pre-added with a var _ = define.None guard so the file compiles before any feature exists and the add-feature skills can append a define.* var without managing imports. Leave the guard in place

Step 5: Prepare embed.go

Create resources/embed.go with the following content verbatim.

package resources

import "embed"

//go:embed *
var FS embed.FS

Step 6: Prepare service.go

Create service.go with the content of the template service.go located in the directory of this skill.

  • Match the package name to the directory name
  • Set the comment of the type definition of Service to describe this particular microservice. The provided value is a template. Do not copy it verbatim

Step 7: Prepare service_test.go

Create service_test.go with the content of

Полный SKILL.md на GitHub

Установить add-microservice в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

definition.goservice.goservice_test.go

FAQ

Что делает скилл add-microservice?

TRIGGER when user asks to create, scaffold, or initialize a new microservice.

Как установить скилл add-microservice?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл add-microservice запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить add-microservice с