Install any skill in seconds. Free to start, no credit card required.
Get Started Free →webiny/webiny-dependency-injection
The universal createImplementation DI pattern and all injectable services.
Passed 21 of 22 test cases with the skill, and 5 of 22 without it.
and 26 more in the full report
17 fixed4 passed either way0 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 17 test cases the skill fixed. Same model, same prompt, with and without the skill.
In a scoped request execution, we need to create a container context that inherits global registrations but allows temporary overrides. Which container method creates this isolated context?
| Checked | Without skill | With skill |
|---|---|---|
| Invokes container.createChildContainer() | Missed | Passed |
The instructions your model reads when the skill loads.
Every Webiny extension type uses the same DI pattern: define a class implementing *.Interface, declare dependencies in the constructor, and export via *.createImplementation({ implementation, dependencies }). The DI container automatically provides the required services, ensures type safety, and validates at compile time. This pattern is the connective tissue across all extension types -- API, Admin, CLI, and Infrastructure.
This skill applies to both extension developers (working in extensions/) and core developers (working in packages/). The DI pattern is universal — only the import paths differ.
Extensions (extensions/) | Core (packages/) | |
|---|---|---|
createAbstraction | from "webiny/api" or from "webiny/admin" | from "@webiny/feature/api" or from "@webiny/feature/admin" |
createFeature | from "webiny/api" or from "webiny/admin" | from "@webiny/feature/api" or from "@webiny/feature/admin" |
| Factory imports | from "webiny/api/graphql", from "webiny/api/cms/model", etc. | Direct package paths: from "@webiny/handler-graphql/...", from "@webiny/api-headless-cms/..." |
| Catalog paths | Use the Import: path | Use the Source: path |
Detect which context you're in by checking the file path: extensions/ → extension mode, packages/ → core mode. The dependencies array, constructor injection, scoping rules, and all other patterns are identical in both contexts.
import { SomeFactory } from "webiny/some/path";
import { Logger, BuildParams } from "webiny/api";
class MyImplementation implements SomeFactory.Interface {
constructor(
private logger: Logger.Interface,
private buildParams: BuildParams.Interface
) {}
execute(/* factory-specific params */) {
this.logger.info("Doing something...");
// buildParams.get() returns T | null — always account for null.
const value = this.buildParams.get<string>("MY_PARAM");
}
}
export default SomeFactory.createImplementation({
implementation: MyImplementation,
test cases passed, vs 5 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.