Push Guards To Callees
Testing & Qualitypush-guards-to-calleesPush Guards To Callees is an Agent Skill for testing & quality published in the kubernetes-sigs/kueue repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Review that repeated guards at multiple call sites are moved inside the callee instead.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/kubernetes-sigs/kueue/blob/HEAD/cmd/experimental/skills/reviewer/push-guards-to-callees/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/push-guards-to-callees, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Skill: Push Guards into Callees, Not Callers
Flag: The same conditional guard appears at multiple call sites before the same function:
// repeated at 3+ places in workload_controller.go
if !concurrentadmission.IsParent(w) {
r.queues.AddOrUpdateWorkload(w)
}
Ask: Move the guard inside the callee so callers don't need to know about the special case:
func (m *Manager) AddOrUpdateWorkload(w *kueue.Workload) {
if features.Enabled(features.ConcurrentAdmission) && concurrentadmission.IsParent(w) {
return
}
// ... existing logic
}
// call sites are now clean — guard cannot be accidentally omitted
r.queues.AddOrUpdateWorkload(w)
Exception: if the guard is load-bearing at the call site because it avoids constructing expensive arguments, keep it there and document why explicitly.