Encapsulate Paired Ops
Developmentencapsulate-paired-opsEncapsulate Paired Ops is an Agent Skill for development 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 paired operations and fields that always appear together are encapsulated in a helper or nested struct.
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/encapsulate-paired-ops/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/encapsulate-paired-ops, 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: Encapsulate Paired Operations and Fields
Flag (operations): Two function calls that always appear together (e.g., subtractPendingResources + inadmissibleWorkloads.delete, or addPendingResources + inadmissibleWorkloads.insert).
Ask: Wrap them in a single helper so callers cannot forget one half. The invariant should be enforced by the API, not by convention.
Flag (fields): Two struct fields that must always be set and cleared together (e.g., inflight + inflightResources).
Ask: Encapsulate them in a nested struct so they are updated atomically. This eliminates the "what if field A is nil but field B is not" inconsistency.