# Online Resource Scheduling

Design deterministic online scheduling policies from current observations.

- Repository: https://github.com/benchflow-ai/skillsbench (1888 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-10-24
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add benchflow-ai/skillsbench --skill online-resource-scheduling -g -a claude-code -y`
Codex: `npx skills add benchflow-ai/skillsbench --skill online-resource-scheduling -g -a codex -y`
Cursor: `npx skills add benchflow-ai/skillsbench --skill online-resource-scheduling -g -a cursor -y`
Gemini CLI: `npx skills add benchflow-ai/skillsbench --skill online-resource-scheduling -g -a gemini-cli -y`

## Description

Design deterministic online scheduling policies from current observations. Use when assigning arriving work to limited resources without seeing future requests.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Online Resource Scheduling

Use this skill to build online schedulers that make deterministic decisions from the current observation only.

## Core Workflow

Convert each observation into a temporary state, rank pending work, score feasible actions by weighted marginal cost, update the temporary state immediately, then replay the final action list before returning it.

```text
actions = []
temporary_state = copy_resources(observation)

for item in ranked_pending_items(observation):
  candidates = enumerate_feasible_actions(item, temporary_state)
  if not candidates:
    actions.append(defer_or_reject(item))
    continue

  scored = []
  for action in candidates:
    deltas = estimate_objective_deltas(action, temporary_state)
    score = sum(weights[k] * deltas[k] for k in deltas)
    scored.append((score, stable_tie_break(action), action))

  chosen = min(scored)[-1]
  actions.append(chosen)
  apply(chosen, temporary_state)

validate(actions, observation)
return actions
```

## Weighted Marginal Scoring

When a task provides objective weights, use them to compare feasible actions. Avoid fixed rules such as "always first-fit", "always minimize fragmentation", or "always use the tightest slot". Those can be wrong when another objective component has a larger weighted effect.

Suggested generic workflow:

1. Read visible objective weights.
2. For each pending item, enumerate feasible actions.
3. For each feasible action, estimate the change in each objective component.
4. Compute `weighted_marginal_score`.
5. Choose the feasible action with the lowest score.
6. Apply the action to temporary state before scoring later actions.

```text
weighted_marginal_score =
  weight_1 * delta_component_1
+ weight_2 * delta_component_2
+ weight_3 * delta_component_3
+ ...
+ deterministic_tie_break
```

The rest: https://github.com/benchflow-ai/skillsbench/blob/HEAD/tasks-extra/gpu-cluster-online-scheduling/environment/skills/online-resource-scheduling/SKILL.md
