datadog/create-component
Create a new Fx component using the modern def/fx/impl pattern (NOT legacy)
npx skills add https://github.com/DataDog/datadog-agent --skill create-component
Create a new Fx component following the modern (new-style) pattern with separate def/, fx/, and impl/ sub-packages.
IMPORTANT: NEVER use the legacy pattern (single-directory with fx.Provide directly). Always use the new-style pattern described below.
$ARGUMENTS to determine:<bundle>/<component-name>: e.g., core/remoteflags means bundle=core, component=remoteflags--team <team-name>: optional team ownership tag (default: ask the user)--with-params: include a Params struct in the def package--with-lifecycle: include compdef.Lifecycle in the Requires struct--with-mock: also generate a mock/ sub-package// team: comment)comp/ using the def/fx/impl pattern (e.g. comp/core/remoteagentregistry/). Read:def/component.go — interface definition with // team: commentfx/fx.go — Module() with fxutil.ProvideComponentConstructorimpl/<name>.go — Requires/Provides structs, NewComponent constructorcomp/<bundle>/<component>/: comp/<bundle>/<component>/
├── def/
│ ├── go.mod
│ ├── component.go # Interface definition + team tag
│ └── params.go # (optional) Params struct
├── fx/
│ ├── go.mod
│ └── fx.go # Module() function
└── impl/
├── go.mod
└── <component>.go # Requires, Provides, NewComponent()
def/component.go: Package name = component name, include // team: comment, only interfacesfx/fx.go: Use fxutil.ProvideComponentConstructor (NEVER raw fx.Provide), returns fxutil.Moduleimpl/<component>.go: Plain Go constructor func NewComponent(deps Requires) (Provides, error), no fx.In/fx.Out/compdef.In/compdef.Out embedding in Requires/Provides, unexported implementation typego.mod files: Use v0.0.0 for inter-module dependencies, match Go version from root go.modmodules.yml — add entries for def, fx, and impl (use default or used_by_otel: true).dda inv create-module --path=comp/<bundle>/<component>/def (and for fx, impl) or manually add to modules.yml and run dda inv tidy.Module() to the relevant comp/<bundle>/bundle.go. dda inv lint-components lint-fxutil-oneshot-test github.lint-codeowner
Fix any errors and re-run until clean.
DO: def/fx/impl sub-packages, fxutil.ProvideComponentConstructor, plain Go constructor, plain Requires/Provides structs, thin def package.
DON'T: Single directory, fx.Provide(newComponent), fx.In/fx.Out embedding, implementation in def package.
/create-component core/myfeature --team agent-runtimes --with-lifecycle/create-component metadata/hostinfo --team agent-metrics --with-paramsTake datadog/create-component from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.