Learn how to use gating requirements to ensure Agent Skills run only when dependencies are met.
Gating requirements allow skills to declare:
- Required binary executables
- Required environment variables
- Required configuration values
- Compatible operating systems
LinX checks these requirements before allowing skill execution, preventing errors and providing clear feedback.
## Usage
```bash
docker build -t myapp .
**Problem**: Fails with "docker: command not found" if Docker isn't installed.
### With Gating
```yaml
metadata: {"requires": {"bins": ["docker"]}}
Benefit: LinX shows "Requirements not met: docker not found" before execution.
Add requirements in the metadata field of SKILL.md frontmatter:
---
name: my-skill
description: My skill description
metadata: {
"requires": {
"bins": ["binary1", "binary2"],
"env": ["VAR1", "VAR2"],
"config": ["path.to.value"]
},
"os": ["darwin", "linux"]
}
---{"requires": {"bins": ["curl", "jq", "python3"]}}LinX checks if each binary exists on the system PATH using which (Unix) or where (Windows).
{"requires": {"bins": ["curl"]}}Checks for curl command.
{"requires": {"bins": ["docker", "docker-compose", "kubectl"]}}All three must be available.
{"requires": {"bins": ["python3", "node"]}}Note: LinX only checks existence, not versions. Document version requirements in instructions.
// Web/API
{"requires": {"bins": ["curl", "wget", "httpie"]}}
// Data Processing
{"requires": {"bins": ["jq", "yq", "xmllint"]}}
// Development
{"requires": {"bins": ["git", "npm", "python3", "node"]}}
// DevOps
{"requires": {"bins": ["docker", "kubectl", "terraform", "ansible"]}}
// System
{"requires": {"bins": ["ssh", "scp", "rsync"]}}{"requires": {"env": ["API_KEY", "SECRET_TOKEN"]}}LinX checks if each environment variable is set (non-empty value).
{"requires": {"env": ["OPENAI_API_KEY", "ANTHROPIC_API_KEY"]}}{"requires": {"env": ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_REGION"]}}{"requires": {"env": ["APP_ENV", "DATABASE_URL", "REDIS_URL"]}}## Prerequisites
Set required environment variables:
```bash
export API_KEY="your_api_key_here"
export SECRET_TOKEN="your_secret_token"Check they're set:
echo $API_KEY
echo $SECRET_TOKEN
#### Provide Examples
```markdown
## Configuration
### Option 1: Export Directly
```bash
export GITHUB_TOKEN="ghp_xxxxxxxxxxxx"
Create .env:
GITHUB_TOKEN=ghp_xxxxxxxxxxxx
Load it:
source .env
## Configuration Requirements
### Syntax
```json
{"requires": {"config": ["api.enabled", "features.weather"]}}
LinX checks config.yaml for these dot-notation paths and verifies they're truthy.
{"requires": {"config": ["features.weather", "features.maps"]}}Checks config.yaml:
features:
weather: true
maps: true{"requires": {"config": ["api.enabled", "api.base_url"]}}Checks:
api:
enabled: true
base_url: "https://api.example.com"{"requires": {"config": ["services.external.weather.enabled"]}}Checks:
services:
external:
weather:
enabled: trueThese values are considered truthy:
true(boolean)- Non-empty strings
- Non-zero numbers
- Non-empty arrays/objects
These are falsy:
false(boolean)null- Empty string
"" - Zero
0 - Empty array
[] - Empty object
{}
{"os": ["darwin", "linux"]}"darwin"- macOS"linux"- Linux"win32"- Windows
{"os": ["darwin", "linux"]}Skill works on macOS and Linux, not Windows.
{"os": ["darwin"]}Skill requires macOS-specific features.
{"os": ["darwin", "linux", "win32"]}Or omit os field entirely for cross-platform skills.
Document platform differences:
## Installation
### macOS
```bash
brew install toolsudo apt-get install toolchoco install tool
## Complete Examples
### Example 1: Docker Deployment Skill
```yaml
---
name: docker-deploy
description: Deploy applications using Docker
metadata: {
"emoji": "🐳",
"requires": {
"bins": ["docker", "docker-compose"],
"env": ["DOCKER_REGISTRY", "DEPLOY_TOKEN"],
"config": ["docker.enabled"]
},
"os": ["darwin", "linux"]
}
---
Requirements:
- Docker and Docker Compose installed
- Registry credentials in environment
- Docker feature enabled in config
- Running on macOS or Linux
---
name: aws-s3-sync
description: Sync files to AWS S3
metadata: {
"emoji": "☁️",
"requires": {
"bins": ["aws"],
"env": ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_REGION"]
}
}
---Requirements:
- AWS CLI installed
- AWS credentials configured
- Works on all platforms (no OS restriction)
---
name: data-analysis
description: Analyze CSV data with Python
metadata: {
"emoji": "📊",
"requires": {
"bins": ["python3", "pip"],
"env": ["DATA_SOURCE_URL"]
}
}
---Requirements:
- Python 3 and pip installed
- Data source URL configured
- Cross-platform compatible
Skills show gating status:
✅ All requirements met
✓ curl found
✓ jq found
✓ API_KEY set
✓ api.enabled = true
✓ Compatible with darwin
⚠️ Requirements not met
✗ docker not found
✓ kubectl found
✗ KUBE_CONFIG not set
✓ Compatible with darwin
Agent skill cards display:
- Required binaries
- Required environment variables
- Eligibility status
- Warning if requirements not met
Before uploading, verify requirements:
# Check binaries
which curl
which jq
which docker
# Check environment variables
echo $API_KEY
echo $SECRET_TOKEN
# Check config (if using LinX config)
cat config.yaml | grep -A 5 "api:"Use dry run mode to test without executing:
- Upload skill
- Click "Test"
- Enable "Dry Run"
- Enter test input
- View parsed commands (no execution)
Error: "docker not found"
Solutions:
-
Install the binary:
# macOS brew install docker # Linux sudo apt-get install docker.io
-
Add to PATH:
export PATH="/path/to/binary:$PATH"
-
Verify:
which docker
Error: "API_KEY not set"
Solutions:
-
Set the variable:
export API_KEY="your_key_here"
-
Add to shell profile:
echo 'export API_KEY="your_key_here"' >> ~/.bashrc source ~/.bashrc
-
Verify:
echo $API_KEY
Error: "api.enabled not found in config"
Solutions:
-
Check config file exists:
ls config.yaml
-
Add the value:
api: enabled: true
-
Verify:
cat config.yaml | grep -A 2 "api:"
Error: "Skill not compatible with win32"
Solutions:
- Use a compatible OS (macOS or Linux)
- Use WSL (Windows Subsystem for Linux) on Windows
- Contact skill author for Windows support
Only require what's absolutely necessary:
// Good - minimal
{"requires": {"bins": ["curl"]}}
// Avoid - excessive
{"requires": {"bins": ["curl", "wget", "httpie", "aria2"]}}Always document how to install requirements:
## Prerequisites
Install required tools:
```bash
# macOS
brew install curl jq
# Linux
sudo apt-get install curl jqSet environment variables:
export API_KEY="your_key_here"
### 3. Graceful Degradation
Consider optional features:
```markdown
## Optional: Enhanced Output
For pretty-printed JSON, install jq:
```bash
brew install jq
Then use:
curl "https://api.example.com/data" | jq '.'Without jq, raw JSON is still returned.
### 4. Clear Error Messages
In instructions, explain what happens if requirements aren't met:
```markdown
## Troubleshooting
### "docker: command not found"
Docker is not installed. Install it:
- macOS: Download from docker.com
- Linux: `sudo apt-get install docker.io`