Skip to content

Adding Capabilities

The simplest way to add capabilities to an existing project:

Terminal window
verikt add redis
  1. Validates the capability exists and checks for conflicts
  2. Auto-resolves transitive dependencies
  3. Renders new files (skipping any that already exist)
  4. Updates your verikt.yaml
  5. Regenerates AI agent context via verikt guide
Terminal window
verikt add kafka-consumer observability redis

Some capabilities require others. verikt resolves these automatically:

Terminal window
verikt add bff
# Output:
# Adding capabilities:
# + http-api (auto-dependency)
# + bff

If a capability conflicts with one already installed, verikt will stop and tell you:

Terminal window
verikt add grpc
# Error: capability "grpc" conflicts with "http-api"

You can also include capabilities when creating a new project:

Terminal window
verikt new my-service \
--language go \
--arch hexagonal \
--cap platform,bootstrap,http-api,mysql,redis,docker

Or use the interactive wizard to explore all capabilities with descriptions and smart suggestions:

Terminal window
verikt new my-service --language go

Each capability provides:

  1. Template files — Source files rendered into your project
  2. Partials — Code snippets that wire into bootstrap.go
  3. Config fields — Struct fields added to config/config.go
  4. Manifest — Metadata about requirements, suggestions, and conflicts
capabilities/mysql/
├── capability.yaml # name, requires, suggests, conflicts
├── files/
│ └── adapter/mysqlrepo/
│ └── connection.go.tmpl # Connection pooling setup
└── _partials/
├── main_imports.go.tmpl # import "github.com/org/svc/adapter/mysqlrepo"
├── main_init.go.tmpl # db, err := mysqlrepo.NewConnection(...)
└── main_shutdown.go.tmpl # app.OnShutdown("mysql", ...)

Before adding a capability, check its capability.yaml for:

  • requires — Other capabilities that must be present (auto-resolved by verikt add)
  • suggests — Recommended companions
  • conflicts — Capabilities that can’t coexist
# Example: auth-jwt requires http-api
name: auth-jwt
requires:
- http-api
suggests: []
conflicts: []

If you prefer to add capabilities by hand:

  1. Add the source files

    Look at the capability’s files/ directory for what to create. For example, adding Redis means creating adapter/redisrepo/connection.go.

  2. Update config

    Add the capability’s config struct and fields to config/config.go:

    type RedisConfig struct {
    Addr string `yaml:"addr"`
    Password string `yaml:"password"`
    DB int `yaml:"db"`
    }
  3. Wire into bootstrap

    Add initialization and shutdown code to internal/bootstrap/bootstrap.go.

  4. Update verikt.yaml

    Add the capability to your project’s capability list:

    capabilities:
    - platform
    - bootstrap
    - http-api
    - mysql
    - redis # Added
  5. Regenerate guide

    Terminal window
    verikt guide --target claude