What problem does it solve?
SGLang's three largest classes (Scheduler, TokenizerManager, ModelRunner) tend to grow into unmaintainable god classes, and downstream forks are forced to copy entire __init__ bodies that rot against upstream. This Skill defines the code style rules that keep these classes as thin orchestrators and their constructors overridable.
Core Features & Use Cases
- Frozen-code enforcement: Defines which files (e.g.
model_runner.py) must remain orchestration-only, with explicit allowed statement types (construct, wire, delegate, coordinate) and rules for where domain logic must live instead.
__init__ orchestration style: Prescribes splitting constructors into init_<thing> / maybe_init_<thing> helpers so subclasses and downstream forks can override exactly one concern.
- Coupling guidance: Requires passing narrow keyword arguments and returning frozen structs instead of passing or mutating the god object.
- Use Case: When modifying
Scheduler, TokenizerManager, or ModelRunner — or reviewing a PR that touches them — apply these rules to decide whether new logic belongs inline, in an init_* helper, or in a new collaborator module.
Quick Start
Review my changes to python/sglang/srt/model_executor/model_runner.py against the large-class-style conventions and tell me what to extract into collaborators.