kora-di-runtimelisted
Install: claude install-skill kora-projects/kora-skills
# Kora DI Runtime — Runtime Injection Behavior
> **Kora sub-skill — obey the [kora-v1 meta rules](../../SKILL.md) on every task:** **R0** ensure `.kora-agent/` docs+examples are cloned · **R1** read this sub-skill before writing code · **R2** Kora APIs only — no Spring/Micronaut/Quarkus, no invented annotations or config keys · **R3** journal any incorrect Kora usage. Add comments/Javadoc only if asked.
**Kora Version:** 1.x
**Focus:** Runtime DI — lifecycle, tags, collections, lazy dependencies, interception.
**Read this first when:**
- Marking components as `@Root` for automatic startup
- Implementing `Lifecycle` for init/release logic
- Disambiguating with `@Tag`, collecting with `All<T>`
- Using `ValueOf<T>` for lazy dependencies
- Wrapping components with `GraphInterceptor`
**References:** See `references/` for detailed guides on each topic.
---
## Quick Start
### @Root — Self-Starting Components
Only components that are dependencies of other components, or marked `@Root` (`ru.tinkoff.kora.common.annotation.Root`), are instantiated at runtime. `@Root` goes on a `@Component` class or on a `@KoraApp`/`@Module` factory method.
**When to use @Root:** HTTP/gRPC servers, Kafka consumers, cache warmers, schedulers, startup tasks — anything that must run even though nothing depends on it.
A self-starting worker:
```java
import ru.tinkoff.kora.application.graph.Lifecycle;
import ru.tinkoff.kora.common.Component;
import ru.tinkoff.kora.common.annotation.Root;
@Root
@C