def _version_check(feature: str, version: dict[str, int]) -> str:
    """Create a version check subcommand chain based on a feature name and version dict."""

    if feature == "main":
        objective_prefix = "lepsen_core"
    else:
        objective_prefix = f"#lepsen_core.{feature}"
    return (
        f"if score {objective_prefix}.major load.status matches {version['major']} "
        + f"if score {objective_prefix}.minor load.status matches {version['minor']} "
        + f"if score {objective_prefix}.patch load.status matches {version['patch']}"
    )