Agent skill

Add Type

by microbus-io in microbus-io/fabric

TRIGGER when defining a domain type (struct) in a microservice's api package, or when adding validation rules or a Validate method to an existing api type.

Apache-2.0Auto-check passedBackend & APIs

Install Add Type

skills CLI
$ npx skills add microbus-io/fabric --skill add-type -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microbus-io/fabric add-type --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microbus-io/fabric.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/microbus/add-type .claude/skills/add-type && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-type
GitHub stars
172
Token cost
~1.3k tokens
SKILL.md length
572 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
Apache-2.0

At a glance

TRIGGER when defining a domain type (struct) in a microservice's api package, or when adding validation rules or a Validate method to an existing api type.

  • Works in 3 steps: json (required): camelCase name with the… → jsonschema_description (recommended): a… → dv8 (optional): validation directives,…
  • Defining a domain type (struct) in a microservices api package
  • SKILL.md covers File Placement and Ownership, Field Tags, Validation With dv8 Tags and Custom Validation: the…
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Add Type is an agent skill from microbus-io/fabric. TRIGGER when defining a domain type (struct) in a microservice's api package, or when adding validation rules or a Validate method to an existing api type. Referenced by add-function, add-config, add-outbound-event, and add-task.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Microservices. The repository describes itself as: Microbus is the only fabric where every agentic workflow runs on a true microservice substrate - giving your workflows security, scale, observability, and prompt-driven authoring. The licence is Apache-2.0.

When your agent uses it

  • Defining a domain type (struct) in a microservices api package
  • Adding validation rules
  • A Validate method to an existing api type

Example prompts

  • “/add-type”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. json (required): camelCase name with the omitzero option, e.g. json:"fooField,omitzero".
  2. jsonschema_description (recommended): a short description of the field. It enriches the OpenAPI
  3. dv8 (optional): validation directives, enforced automatically at the framework's trust boundary

What it can do on your machine

Read from SKILL.md and the folder at commit fb98098. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Type loads about 1.3k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 572 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microbus-io/fabric at commit fb98098, republished under its Apache-2.0 licence (© microbus-io). 572 words, ~1,255 tokens.

Download SKILL.mdSave it as .claude/skills/add-type/SKILL.md (or your agent's skills folder).
name
add-type
description
TRIGGER when defining a domain type (struct) in a microservice's api package, or when adding validation rules or a Validate method to an existing api type. Referenced by add-function, add-config, add-outbound-event, and add-task.

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.

A domain type is a struct declared in the microservice's api package (myserviceapi) and referenced by an endpoint signature, a structured config, or an event payload. This skill covers the anatomy of such a type: its file placement, its field tags, and its optional validation.

File Placement and Ownership

Place each type in a separate file in the myserviceapi directory, named after the type in lowercase, e.g. myserviceapi/mystruct.go. The type must live in the api package, not the service package, so that clients, the generated boilerplate, and tests can all name it.

If the type is owned by this microservice, define its struct explicitly. If it is owned by another microservice or package, define an alias to it instead and do not redefine its fields:

go
package myserviceapi

import (
	"github.com/path/to/thirdparty"
)

// ThirdPartyStruct is X.
type ThirdPartyStruct = thirdparty.ThirdPartyStruct

Field Tags

Every field of an owned type carries up to three tags:

  1. json (required): camelCase name with the omitzero option, e.g. json:"fooField,omitzero".
  2. jsonschema_description (recommended): a short description of the field. It enriches the OpenAPI document and improves LLM tool-calling accuracy. Use this dedicated tag, not the jsonschema:"description=..." subtag form, which truncates at the first comma.
  3. dv8 (optional): validation directives, enforced automatically at the framework's trust boundary (see Validation below).
go
package myserviceapi

// Person is a contact in the directory.
type Person struct {
	Name  string `json:"name,omitzero" jsonschema_description:"Name is the person's full name" dv8:"notzero,len<=64"`
	Email string `json:"email,omitzero" jsonschema_description:"Email is the person's email address" dv8:"trim,tolower,regexp ^.+@.+$"`
	Age   int    `json:"age,omitzero" jsonschema_description:"Age is the person's age in years" dv8:"val>=0,val<=120"`
}

Validation With dv8 Tags

The dv8 directives most commonly used (see its README for the full set):

  • notzero - requires a value that is not the type's zero value (non-nil for pointers, slices and maps; true for booleans)
  • len<=64, len>0 - length of a string (in runes), slice, or map
  • val>=0, val<=120 - value range for numeric, duration, and time fields
  • oneof S|M|L - one of a set of values
  • regexp ^[0-9]{5}$ - pattern match; a comma inside the pattern is escaped \\, (e.g. {2\\,5})
  • trim, tolower, toupper, default=x - normalizing directives that rewrite the value before checks run
  • each <directive> - applies a directive to the elements of a slice or the values of a map, e.g. each len>0
  • key <directive> - applies a directive to the keys of a map
Show full SKILL.md (227 more words)Show less

Where the tags are enforced:

  • In structs of functions and events: validated automatically after decoding, before the handler runs. An invalid payload is rejected 400 Bad Request; the handler never sees it.
  • Structured configs: a value that fails validation is rejected before it is committed; the getter returns the normalized value.
  • Out structs: tags are inert on output. Outputs are produced by trusted code and are not validated.
  • Direct Go calls: a handler calling another handler in-process bypasses the framework boundary. When such internal composition needs validation, call dv8.Validate(ctx, &v) explicitly.

A malformed directive (a typo, a misapplied rule) fails the microservice at startup, not at request time.

Custom Validation: the Validate Method

For cross-field invariants that tags cannot express, give the type a Validate method. The framework discovers and calls it automatically wherever the type is validated, including when nested inside another validated type:

go
// Validate errors when the person record is internally inconsistent.
func (p *Person) Validate(ctx context.Context) error {
	if p.Retired && p.Age < 50 {
		return errors.New("retirement age is 50")
	}
	return nil
}
  • The signature is Validate(ctx context.Context) error, or Validate() error when the context is not needed. A type can implement one or the other, never both.
  • The method must be a pure check of its fields: no I/O, no downstream calls, no state mutation. It runs on the startup path and on every config refresh, so a validator that calls out turns validation into a distributed dependency.
  • Validation runs after the tag directives, so normalized values (trimmed, defaulted) are what the method sees.

© microbus-io, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/microbus/add-type of microbus-io/fabric.

Open the folder on GitHubat commit fb98098

Compare with similar skills

Add Type next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Type compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Type this skillmicrobus-io/fabric172—~1.3kAutomated safety check: PassApache-2.0
Node Backend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15817 repos~4kAutomated safety check: PassAGPL-3.0
AWS Serverless Edazxkane/aws-skills3674 repos~3.2kAutomated safety check: PassMIT
Golang Proantoniopaya22/go-rest-template1723 repos~1.2kAutomated safety check: PassMIT
Dr Jskilljdubois/dr-jskill342—~4.6kAutomated safety check: NotesApache-2.0

Similar skills

  • Node Backend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Sets layered architecture and coding rules for Node.js, Express and TypeScript microservices, covering routes, controllers, services, repositories, Prisma, Sentry and Zod.

    10k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 17 repos~4k tokens
    Backend & APIsAuto-check passed
  • AWS Serverless Eda

    zxkane/aws-skills

    AWS serverless and event-driven architecture expert based on Well-Architected Framework.

    367 GitHub starsUsed in 4 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Golang Pro

    antoniopaya22/go-rest-template

    Implements concurrent Go patterns using goroutines and channels, designs and builds microservices with gRPC or REST, optimizes Go application performance with pprof, and enforces idiomatic Go with…

    172 GitHub starsUsed in 3 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Dr Jskill

    jdubois/dr-jskill

    Creates Java + Spring Boot projects: Web applications, full-stack apps with Vue.js or Angular or React or vanilla JS, PostgreSQL, REST APIs, and Docker.

    342 GitHub stars~4.6k tokensUpdated 8 days ago
    Backend & APIsAuto-check: notes
  • Hybrid Cloud Test Gen

    getsentry/sentry

    Official

    Generate hybrid cloud tests for the Sentry codebase. An agent skill from getsentry/sentry.

    45k GitHub stars~2.6k tokensUpdated today
    Backend & APIsAuto-check passed

More from microbus-io/fabric

All 33 skills in this repo
  • Add Config

    microbus-io/fabric

    TRIGGER when user asks to add or modify a configuration property or setting, or to make a value configurable.

    172 GitHub stars~2.3k tokensUpdated 10 days ago
    Auto-check passed
  • Add Function

    microbus-io/fabric

    TRIGGER when user asks to add, create, or modify an API endpoint, function, or RPC, or a route that accepts typed arguments and returns typed results.

    172 GitHub stars~2.4k tokensUpdated 10 days ago
    Auto-check passed
  • Add Inbound Event

    microbus-io/fabric

    TRIGGER when user asks to listen for, subscribe to, or handle an event emitted by another microservice.

    172 GitHub stars~1.4k tokensUpdated 10 days ago
    Auto-check passed
  • Add Metric

    microbus-io/fabric

    TRIGGER when user asks to add or modify a metric, counter, gauge, or histogram, or to track/measure an operation.

    172 GitHub stars~1.5k tokensUpdated 10 days ago
    Auto-check passed
  • Add Outbound Event

    microbus-io/fabric

    TRIGGER when user asks to fire, emit, or publish an event that other microservices can subscribe to.

    172 GitHub stars~1.7k tokensUpdated 10 days ago
    Auto-check passed
  • Add Python Function

    microbus-io/fabric

    TRIGGER when user asks to add a Python-backed function endpoint to an existing Python-backed microservice.

    172 GitHub stars~1.3k tokensUpdated 10 days ago
    Auto-check passed

Categories

Questions about Add Type

What does Add Type do?

TRIGGER when defining a domain type (struct) in a microservice's api package, or when adding validation rules or a Validate method to an existing api type. Add Type is an agent skill from microbus-io/fabric. TRIGGER when defining a domain type (struct) in a microservice's api package, or when adding validation rules or a Validate method to an existing api type.

When should I use Add Type?

Add Type fits situations like: defining a domain type (struct) in a microservices api package; adding validation rules; A Validate method to an existing api type.

How do I install Add Type in Claude Code?

Run `npx skills add microbus-io/fabric --skill add-type -a claude-code`. Or copy the skill folder (.claude/skills/microbus/add-type in microbus-io/fabric) into .claude/skills/add-type in your project. Claude Code loads it when a task matches its description.

How do I install Add Type in Codex?

Run `npx skills add microbus-io/fabric --skill add-type -a codex`. Or copy the skill folder (.claude/skills/microbus/add-type in microbus-io/fabric) into .agents/skills/add-type in your project. Codex loads it when a task matches its description.

Can I use Add Type in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microbus-io/fabric --skill add-type -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-type, .gemini/skills/add-type, .github/skills/add-type and .opencode/skills/add-type in your project.

What does Add Type need to run?

SKILL.md names no scripts, command-line tools or credentials: Add Type is instructions for the agent only.

Does Add Type access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Add Type safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Type use?

Add Type is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Type use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Type?

Skills that share tags, products or a category with Add Type: Node Backend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars), Nodejs Backend Patterns (ever-works/ever-works, 158 stars), AWS Serverless Eda (zxkane/aws-skills, 367 stars) and Golang Pro (antoniopaya22/go-rest-template, 172 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Type?

microbus-io (a GitHub organization) maintains it in microbus-io/fabric, which has 172 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on September 28, 2026.

Source: microbus-io/fabric on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.