plugins/patterns/skills/efficiency-patterns/SKILL.md
Optimize automation with idempotency and work avoidance. Safe retries plus skipping unnecessary operations maximize efficiency in CI/CD and platform engineering.
npx skillsauth add adaptive-enforcement-lab/claude-skills efficiency-patternsInstall 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.
Efficiency patterns optimize what your automation does and whether it needs to do it.
| Pattern | When to Use | Strategy | | --------- | ------------- | ---------- | | Idempotency | Operations may be retried | Same input = same result | | Work Avoidance | Results can be cached | Skip if already done |
See the full implementation guide in the source documentation.
Efficiency patterns optimize what your automation does and whether it needs to do it.
| Pattern | When to Use | Strategy | | --------- | ------------- | ---------- | | Idempotency | Operations may be retried | Same input = same result | | Work Avoidance | Results can be cached | Skip if already done |
flowchart TD
A[Operation Request] --> B{Already done?}
B -->|Yes| C[Work Avoidance: Skip]
B -->|No| D{May be retried?}
D -->|Yes| E[Idempotency: Safe retry]
D -->|No| F[Execute normally]
%% Ghostty Hardcore Theme
style A fill:#65d9ef,color:#1b1d1e
style B fill:#fd971e,color:#1b1d1e
style C fill:#a7e22e,color:#1b1d1e
style D fill:#fd971e,color:#1b1d1e
style E fill:#a7e22e,color:#1b1d1e
style F fill:#9e6ffe,color:#1b1d1e
| Scenario | Pattern | Reasoning | | ---------- | --------- | ----------- | | Re-running same operation | Idempotency | Same result every time | | Resource already exists | Idempotency | Create-or-update safely | | Content unchanged | Work Avoidance | Skip unnecessary work | | Build artifact cached | Work Avoidance | Reuse previous results |
| Aspect | Idempotency | Work Avoidance | | -------- | ------------- | ---------------- | | Goal | Safe to retry | Avoid doing work | | Mechanism | Deterministic result | Change detection | | Trade-off | Complexity vs reliability | Cache invalidation vs speed |
Idempotency makes retries safe. Work avoidance makes retries unnecessary.
| Aspect | Idempotency | Work Avoidance | | -------- | ------------- | ---------------- | | Goal | Safe to retry | Avoid doing work | | Mechanism | Deterministic result | Change detection | | Trade-off | Complexity vs reliability | Cache invalidation vs speed |
Idempotency makes retries safe. Work avoidance makes retries unnecessary.
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.