create-component
SkillAI & modelsThis skill lets your AI create new Fx components for the Datadog Agent codebase. It sets up the starting files a component needs, using the modern def, fx, and impl pattern rather than the legacy approach.
Available today. Use it from your connected AI after setup.
No other account needed.
Add the skill, then ask your AI to create a new Fx component and tell it what the component should do.
Then ask your AI: use the create-component skill
What your AI can do with it
- Create a new Fx component in the Datadog Agent codebase
- Generate the def, fx, and impl packages a component needs
- Follow the modern def/fx/impl pattern instead of the legacy one
- Set up the starting structure so new components match the current codebase style
What this skill tells your AI
The instructions your AI receives, as published by datadog/datadog-agent in .agents/skills/create-component/SKILL.md and read by ahel’s review.
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.
Instructions
-
Parse
$ARGUMENTSto determine:<bundle>/<component-name>: e.g.,core/remoteflagsmeans bundle=core, component=remoteflags--team <team-name>: optional team ownership tag (default: ask the user)--with-params: include aParamsstruct in the def package--with-lifecycle: includecompdef.Lifecyclein the Requires struct--with-mock: also generate amock/sub-package
-
Ask the user (if not provided via arguments):
- What is the component's interface? (what methods should it expose?)
- Which team owns it? (for the
// team:comment) - Does it need lifecycle hooks (start/stop)?
- Does it need a Params struct?
- What are its dependencies (other components it requires)?
-
Read reference examples before writing any code. Find a recent component under
comp/using thedef/fx/implpattern (e.g.comp/core/remoteagentregistry/). Read:def/component.go— interface definition with// team:commentfx/fx.go— Module() withfxutil.ProvideComponentConstructorimpl/<name>.go— Requires/Provides structs, NewComponent constructor
-
Create the directory structure under
comp/<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() -
Create each file following the patterns from the reference. Key rules:
def/component.go: Package name = component name, include// team:comment, only interfacesfx/fx.go: Usefxutil.ProvideComponentConstructor(NEVER rawfx.Provide), returnsfxutil.Moduleimpl/<component>.go: Plain Go constructorfunc NewComponent(deps Requires) (Provides, error), nofx.In/fx.Out/compdef.In/compdef.Outembedding in Requires/Provides, unexported implementation typego.modfiles: Usev0.0.0for inter-module dependencies, match Go version from rootgo.mod
-
Register the modules in
modules.yml— add entries fordef,fx, andimpl(usedefaultorused_by_otel: true). -
Run
dda inv create-module --path=comp/<bundle>/<component>/def(and forfx,impl) or manually add tomodules.ymland rundda inv tidy. -
Wire into a bundle if appropriate — add the component's
Module()to the relevantcomp/<bundle>/bundle.go. -
Validate:
dda inv lint-components lint-fxutil-oneshot-test github.lint-codeownerFix any errors and re-run until clean.
Critical Rules (New-Style vs Legacy)
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.
Usage
/create-component core/myfeature --team agent-runtimes --with-lifecycle/create-component metadata/hostinfo --team agent-metrics --with-params
Signals
- GitHub stars
- 4k
- Forks
- 1k
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
create-component- Source
- github.com/datadog/datadog-agent