plugins/patterns/skills/work-avoidance/SKILL.md
Skip work when outcomes won't change. Detect unchanged content, existing resources, and cached outputs to prevent unnecessary PRs, builds, and processing cycles.
npx skillsauth add adaptive-enforcement-lab/claude-skills work-avoidanceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Work avoidance detects when an operation isn't needed and skips it entirely. Unlike idempotency (which makes reruns safe), work avoidance prevents the run from happening at all.
flowchart LR
subgraph trigger[Trigger]
Event[Event Received]
end
subgraph detect[Detection]
Check{Work Needed?}
end
subgraph action[Action]
Skip[Skip]
Execute[Execute]
end
Event --> Check
Check -->|No| Skip
Check -->|Yes| Execute
%% Ghostty Hardcore Theme
style Event fill:#65d9ef,color:#1b1d1e
style Check fill:#fd971e,color:#1b1d1e
style Skip fill:#5e7175,color:#f8f8f3
style Execute fill:#a7e22e,color:#1b1d1e
Work avoidance is valuable when:
Work avoidance uses different techniques depending on what you're checking:
| Technique | Question | Best For | | --------- | -------- | -------- | | Content Hashing | "Is the content different?" | File comparisons, config sync | | Volatile Field Exclusion | "Did anything meaningful change?" | Version bumps, timestamps | | Existence Checks | "Does it already exist?" | Resource creation (PRs, branches) | | Cache-Based Skip | "Is the output already built?" | Build artifacts, dependencies | | Queue Cleanup | "Should queued work execute?" | Mutex-locked workflows |
See Techniques Overview for detailed comparisons and when to use each.
Both patterns make automation safe to rerun, but they optimize for different things:
| Concern | Idempotency | Work Avoidance | | ------- | ----------- | -------------- | | Focus | Safe re-execution | Skipping execution | | Question | "Can I run this again safely?" | "Should I run this at all?" | | Resource usage | Uses resources on rerun | Saves resources | | Implementation | Logic inside operation | Logic before operation |
Best practice: Apply work avoidance first, then ensure remaining operations are idempotent.
Skip work when the outcome won't change.
Detect Before Execute
Check if work is needed before starting it. Avoid creating PRs for unchanged content, running builds for unchanged code, or processing already-processed items.
Work avoidance detects when an operation isn't needed and skips it entirely. Unlike idempotency (which makes reruns safe), work avoidance prevents the run from happening at all.
See examples.md for detailed code examples.
Both patterns make automation safe to rerun, but they optimize for different things:
| Concern | Idempotency | Work Avoidance | | ------- | ----------- | -------------- | | Focus | Safe re-execution | Skipping execution | | Question | "Can I run this again safely?" | "Should I run this at all?" | | Resource usage | Uses resources on rerun | Saves resources | | Implementation | Logic inside operation | Logic before operation |
Best practice: Apply work avoidance first, then ensure remaining operations are idempotent.
Work avoidance uses different techniques depending on what you're checking:
| Technique | Question | Best For | | --------- | -------- | -------- | | Content Hashing | "Is the content different?" | File comparisons, config sync | | Volatile Field Exclusion | "Did anything meaningful change?" | Version bumps, timestamps | | Existence Checks | "Does it already exist?" | Resource creation (PRs, branches) | | Cache-Based Skip | "Is the output already built?" | Build artifacts, dependencies | | Queue Cleanup | "Should queued work execute?" | Mutex-locked workflows |
See Techniques Overview for detailed comparisons and when to use each.
Work avoidance is valuable when:
Common mistakes that undermine work avoidance:
See Anti-Patterns for details and fixes.
A file distribution workflow that skips version-only changes:
See examples.md for detailed code examples.
This applies Volatile Field Exclusion to avoid creating PRs for version-only changes.
Work avoidance detects when an operation isn't needed and skips it entirely. Unlike idempotency (which makes reruns safe), work avoidance prevents the run from happening at all.
See examples.md for detailed code examples.
Both patterns make automation safe to rerun, but they optimize for different things:
| Concern | Idempotency | Work Avoidance | | ------- | ----------- | -------------- | | Focus | Safe re-execution | Skipping execution | | Question | "Can I run this again safely?" | "Should I run this at all?" | | Resource usage | Uses resources on rerun | Saves resources | | Implementation | Logic inside operation | Logic before operation |
Best practice: Apply work avoidance first, then ensure remaining operations are idempotent.
Work avoidance uses different techniques depending on what you're checking:
| Technique | Question | Best For | | --------- | -------- | -------- | | Content Hashing | "Is the content different?" | File comparisons, config sync | | Volatile Field Exclusion | "Did anything meaningful change?" | Version bumps, timestamps | | Existence Checks | "Does it already exist?" | Resource creation (PRs, branches) | | Cache-Based Skip | "Is the output already built?" | Build artifacts, dependencies | | Queue Cleanup | "Should queued work execute?" | Mutex-locked workflows |
See Techniques Overview for detailed comparisons and when to use each.
Work avoidance is valuable when:
Common mistakes that undermine work avoidance:
See Anti-Patterns for details and fixes.
A file distribution workflow that skips version-only changes:
See examples.md for detailed code examples.
This applies Volatile Field Exclusion to avoid creating PRs for version-only changes.
See examples.md for code examples.
documentation
Workload Identity Federation implementation guide. GKE setup, IAM bindings, ServiceAccount configuration, migration from service account keys, and troubleshooting patterns.
development
Secure GitHub Actions trigger patterns for pull requests, forks, and reusable workflows. Preventing privilege escalation and code injection through trigger misconfiguration.
development
Structured framework for evaluating GitHub Actions security before adoption. Trust tiers, risk assessment checklist, and decision tree for action evaluation.
testing
Securely store GitHub App credentials across different environments. GitHub Actions secrets, external CI, Kubernetes, and automated rotation patterns.