add-config
БесплатноБез исполняемых скриптовНе проверенTRIGGER when user asks to add or modify a configuration property or setting, or to make a value configurable.
Об этом скилле
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 config property is declared as a define.Config var in myserviceapi/definition.go; its callback, if any, is implemented in service.go. Add the declaration and run cmd/genservice.
CRITICAL: Keep the // MARKER: MyConfig comment on the define.Config var.
Workflow
Copy this checklist and track your progress:
Creating or modifying a configuration property:
- [ ] Step 1: Read local CLAUDE.md file
- [ ] Step 2: Determine the type
- [ ] Step 3: Determine the properties
- [ ] Step 4: Declare the config in definition.go
- [ ] Step 5: Generate the boilerplate
- [ ] Step 6: Implement the callback
- [ ] Step 7: Use the config
- [ ] Step 8: Test the callback
- [ ] Step 9: Add to config file
- [ ] Step 10: Housekeeping
Step 1: Read Local CLAUDE.md File
Read the local CLAUDE.md file in the microservice's directory. It contains microservice-specific instructions that should take precedence over global instructions.
Step 2: Determine the Type
Determine the type of the configuration property.
A scalar config is one of string, int, bool, float64, or time.Duration. These are stored and converted natively.
A config may also be a structured (JSON) value: a struct, a slice ([]int), a map (map[string]bool), or any JSON-serializable composite (including slices/maps of structs). Its value is stored as JSON text; the generated getter unmarshals it into the typed value and the setter marshals it back. Reach for a structured config when the knob is a list, a set, or a group of related fields rather than a single scalar.
Step 3: Determine the Properties
Determine the properties of the configuration property:
- Description: explains the purpose of the property. It becomes the godoc on the
define.Configvar and starts with the property name - Default value: an optional default, always written as a string (it flows through the same validate-and-convert path as a configured value)
- Validation: an optional validation rule (see below)
- Secret: whether the value is a secret that should not be logged
- Callback: whether
OnChangedMyConfigshould fire when the value changes, for example to reopen a connection to an external resource
Validation rules can be any of the following:
strfollowed by a regexp:str ^[a-zA-Z0-9]+$boolintfollowed by an open, closed or mixed interval:int [0,60]floatfollowed by an open, closed or mixed interval:float [0.0,1.0)durfollowed by an open, closed or mixed interval of Go durations:dur (0s,24h]setfollowed by a pipe-separated list of values:set Red|Green|Blueurlemailjson
Step 4: Declare the Config in definition.go
Append the define.Config var to myserviceapi/definition.go. The godoc is the description from Step 3.
/*
MyConfig is X.
*/
var MyConfig = define.Config{ // MARKER: MyConfig
Value: int(0),
Default: "1",
Validation: "int (1,100]",
Secret: true,
Callback: true,
}
Valueis a type carrier declaring the property's type:string(""),int(0),bool(false),float64(0), ortime.Duration(0). The generator reads its type, never the value- For a
time.Durationconfig, add the"time"import todefinition.go Defaultis the optional default as a string; omit when there is noneValidationis the optional rule from Step 3; omit when there is noneSecret: truemarks a value that is never logged; omit when falseCallback: truemakesOnChangedMyConfigfire on change; omit when false
For a structured (JSON) config, the Value carrier is a composite literal of the type, and Validation is json:
// RetryPolicy is the structured value of the Retry config.
type RetryPolicy struct {
MaxRetries int `json:"maxRetries,omitzero"`
Backoff string `json:"backoff,omitzero"`
}
/*
Retry configures how failed operations are retried.
*/
var Retry = define.Config{ // MARKER: Retry
Value: RetryPolicy{},
Default: `{"maxRetries":3,"backoff":"1s"}`,
Validation: "json",
}
- The
Valuecarrier may be a struct (RetryPolicy{}), a slice ([]int{}), a map (map[string]bool{}), or a slice/map of structs ([]RetryPolicy{}) - Set
Validation: "json"so the stored value is checked as valid JSON; when present,Defaultis the JSON text of the value (e.g.[80,443]for a[]int,{"beta":true}for amap[string]bool) - Define any new struct type in the api package, in a separate file beside
definition.go(e.g.myserviceapi/retrypolicy.go), following theadd-typeskill. It must live in the api package, not the service package, so the generated getter/setter (which live in the service package) and tests can name it. The type'sdv8validation tags and optional pureValidate
Установить add-config в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл add-config?
TRIGGER when user asks to add or modify a configuration property or setting, or to make a value configurable.
Как установить скилл add-config?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-config запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic