Agent skill
work-avoidance-techniques
Layer work avoidance checks from existence to content to semantic comparison. Each technique catches different skip scenarios for maximum automation efficiency.
Install this agent skill to your Project
npx add-skill https://github.com/adaptive-enforcement-lab/claude-skills/tree/main/plugins/patterns/skills/work-avoidance-techniques
SKILL.md
Work Avoidance Techniques
When to Use This Skill
Each technique answers a specific question:
| 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 |
Implementation
See the full implementation guide in the source documentation.
Techniques
Overview
Each technique answers a specific question:
| 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 |
Combining Techniques
Techniques can be layered for maximum efficiency:
flowchart TD
subgraph layer1[Layer 1: Existence]
Exists{Resource exists?}
end
subgraph layer2[Layer 2: Content]
Hash{Content hash matches?}
end
subgraph layer3[Layer 3: Semantic]
Volatile{Only volatile fields changed?}
end
subgraph action[Action]
Skip[Skip]
Execute[Execute]
end
Exists -->|Yes| Hash
Exists -->|No| Execute
Hash -->|Yes| Skip
Hash -->|No| Volatile
Volatile -->|Yes| Skip
Volatile -->|No| Execute
%% Ghostty Hardcore Theme
style Exists fill:#65d9ef,color:#1b1d1e
style Hash fill:#fd971e,color:#1b1d1e
style Volatile fill:#9e6ffe,color:#1b1d1e
style Skip fill:#5e7175,color:#f8f8f3
style Execute fill:#a7e22e,color:#1b1d1e
Choosing a Technique
| Scenario | Recommended Technique |
|---|---|
| File distribution with version bumps | Volatile Field Exclusion |
| OCI image rebuilds | Content Hashing |
| PR/branch creation | Existence Checks |
| Dependency installation | Cache-Based Skip |
| API state synchronization | Content Hashing |
| Generated file deployment | Volatile Field Exclusion |
| Idempotent workflows with mutex locks | Queue Cleanup |
Related
- Work Avoidance Overview - Pattern introduction
- Anti-Patterns - Common mistakes to avoid
Anti-Patterns to Avoid
Techniques for detecting when work can be safely skipped.
Layer Your Checks
Start with cheap checks (existence), then content hashes, then semantic comparison. Each layer catches different scenarios.
Overview
Each technique answers a specific question:
| 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 |
Combining Techniques
Techniques can be layered for maximum efficiency:
See examples.md for detailed code examples.
Choosing a Technique
| Scenario | Recommended Technique |
|---|---|
| File distribution with version bumps | Volatile Field Exclusion |
| OCI image rebuilds | Content Hashing |
| PR/branch creation | Existence Checks |
| Dependency installation | Cache-Based Skip |
| API state synchronization | Content Hashing |
| Generated file deployment | Volatile Field Exclusion |
| Idempotent workflows with mutex locks | Queue Cleanup |
Related
- Work Avoidance Overview - Pattern introduction
- Anti-Patterns - Common mistakes to avoid
Overview
Each technique answers a specific question:
| 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 |
Combining Techniques
Techniques can be layered for maximum efficiency:
See examples.md for detailed code examples.
Choosing a Technique
| Scenario | Recommended Technique |
|---|---|
| File distribution with version bumps | Volatile Field Exclusion |
| OCI image rebuilds | Content Hashing |
| PR/branch creation | Existence Checks |
| Dependency installation | Cache-Based Skip |
| API state synchronization | Content Hashing |
| Generated file deployment | Volatile Field Exclusion |
| Idempotent workflows with mutex locks | Queue Cleanup |
Related
- Work Avoidance Overview - Pattern introduction
- Anti-Patterns - Common mistakes to avoid
Related Patterns
- Work Avoidance Overview
- Anti-Patterns
References
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
github-token-permissions-overview
Understanding GITHUB_TOKEN scope, default permissions, and implementing least-privilege principle for GitHub Actions workflows.
secure
Find and fix security issues before they become incidents. Vulnerability scanning, SBOM generation, supply chain security, and secure authentication workflows.
complete-workflow-examples
Copy-paste hardened CI/CD workflows with SHA-pinned actions, minimal GITHUB_TOKEN permissions, OIDC authentication, and comprehensive security scanning for GitHub Actions.
ephemeral-runner-patterns
Disposable runner patterns for GitHub Actions. Container-based, VM-based, and ARC deployment strategies with complete state isolation between jobs.
action-pinning-overview
Why pinning GitHub Actions to SHA-256 commits matters for supply chain security. Attack vectors from unpinned actions and comparison of tag vs SHA pinning.
github-actions-security-patterns-hub
Complete security patterns for GitHub Actions covering action pinning, GITHUB_TOKEN permissions, third-party action risks, secret management, and runner security.
Didn't find tool you were looking for?