plugins/patterns/skills/prerequisite-checks/SKILL.md
Consolidate all precondition validation into a dedicated gate phase. Check tools, permissions, state, and resources before executing deployment or automation tasks.
npx skillsauth add adaptive-enforcement-lab/claude-skills prerequisite-checksInstall 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.
Prerequisite checks are a structured approach to fail fast validation. Instead of scattering validation throughout code, you consolidate all precondition checks into a dedicated phase that runs before any work begins.
flowchart LR
subgraph prereq[Prerequisite Phase]
A[Check Tools]
B[Check Access]
C[Check State]
D[Check Resources]
end
subgraph gate[Gate]
G{All Pass?}
end
subgraph exec[Execution Phase]
E[Execute Operation]
end
A --> B --> C --> D --> G
G -->|Yes| E
G -->|No| F[Abort with Report]
%% Ghostty Hardcore Theme
style A fill:#65d9ef,color:#1b1d1e
style B fill:#65d9ef,color:#1b1d1e
style C fill:#65d9ef,color:#1b1d1e
style D fill:#65d9ef,color:#1b1d1e
style G fill:#fd971e,color:#1b1d1e
style E fill:#a7e22e,color:#1b1d1e
style F fill:#f92572,color:#1b1d1e
The key insight: check everything, then do everything.
| Category | What to Check | Example | Guide |
| ---------- | --------------- |---------| ------- |
| Environment | Required tools and variables | kubectl, $DATABASE_URL | Environment |
| Access | Permissions are granted | API tokens, RBAC roles | Permissions |
| State | System is in expected state | Resource exists, not locked | State |
| Input | Inputs are valid | Required fields, formats | Input |
| Dependencies | Dependencies are ready | Upstream jobs, services | Dependencies |
| Scenario | Apply Prerequisite Checks? | Reasoning | | ---------- | ---------------------------- | ----------- | | Kubernetes deployment | Yes | Check cluster access, namespace, resources | | GitHub Actions workflow | Yes | Check secrets, tools, permissions | | Database migration | Yes | Check connectivity, schema version, backup | | API request handling | Depends | Check inputs yes, runtime state no | | File processing | Depends | Check file exists yes, content format no |
Decision rule: Use prerequisite checks for validation you can do upfront, not validation that requires starting the operation.
See Implementation Patterns for:
| Pattern | How Prerequisite Checks Applies | | --------- | -------------------------------- | | Fail Fast | Prerequisite checks are structured fail-fast validation | | Graceful Degradation | Prerequisites determine if graceful degradation is even possible | | Idempotency | Check-before-act is a prerequisite pattern | | Work Avoidance | Prerequisites can include "work already done" checks |
See reference.md for additional techniques and detailed examples.
See examples.md for code examples.
See reference.md for complete documentation.
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.