cloud-provider-detector
# Cloud Provider Detection Skill
What this skill does
# Cloud Provider Detection Skill
**Auto-detect AWS, GCP, or Azure usage with 95%+ accuracy using multi-signal analysis.**
## Quick Start
```javascript
const { detectCloudProvider } = require('./detect-cloud-provider.js');
// Auto-detect cloud provider
const result = await detectCloudProvider('/path/to/project');
if (result.detected) {
console.log(`Detected: ${result.name}`);
console.log(`Confidence: ${(result.confidence * 100).toFixed(1)}%`);
console.log(`Signals: ${result.signal_count}`);
}
// Manual override
const awsResult = await detectCloudProvider('/path/to/project', {
provider: 'aws'
});
```
## Detection Signals
### Signal Types (Weighted)
1. **Terraform** (weight: 0.5) - Highest priority
- Provider declarations: `provider "aws"`, `provider "google"`, `provider "azurerm"`
- Resource types: `aws_vpc`, `google_compute_instance`, `azurerm_storage_account`
2. **Package Manifests** (weight: 0.3)
- **NPM**: `@aws-sdk/`, `@google-cloud/`, `@azure/`
- **Python**: `boto3`, `google-cloud-*`, `azure-*`
3. **Config Files** (weight: 0.3)
- `.aws/config`, `.gcloud/`, `.azure/`
- `cloudformation.yml`, `cloudbuild.yaml`, `azuredeploy.json`
4. **CLI Scripts** (weight: 0.2)
- `aws configure`, `gcloud compute`, `az vm`
- Command patterns in `.sh` files
5. **Docker** (weight: 0.2)
- Base images: `FROM public.ecr.aws`, `FROM gcr.io`, `FROM mcr.microsoft.com`
### Confidence Scoring
```
Base Score = Σ(detected_signals × signal_weight) / Σ(all_signal_weights)
Multi-Signal Boost:
if (signal_count >= 3) {
confidence += 0.2 // Up to maximum of 1.0
}
Detection Threshold: ≥0.7 (70%)
```
## CLI Usage
```bash
# Detect in current directory
node detect-cloud-provider.js
# Detect in specific project
node detect-cloud-provider.js /path/to/project
# Manual override
node detect-cloud-provider.js /path/to/project --provider aws
# Custom confidence threshold
node detect-cloud-provider.js /path/to/project --min-confidence 0.8
# Exit codes:
# 0 = Provider detected
# 1 = No provider detected
# 2 = Error occurred
```
## Response Format
```json
{
"detected": true,
"provider": "aws",
"name": "Amazon Web Services (AWS)",
"confidence": 0.95,
"signals": {
"terraform": true,
"npm": true,
"python": false,
"cli": true,
"docker": true,
"config": true
},
"signal_count": 5,
"all_results": [
{
"provider": "aws",
"name": "Amazon Web Services (AWS)",
"confidence": 0.95,
"signals": {...},
"signal_count": 5
},
{
"provider": "gcp",
"name": "Google Cloud Platform (GCP)",
"confidence": 0.12,
"signals": {...},
"signal_count": 1
}
]
}
```
## Integration Examples
### infrastructure-specialist Agent
```yaml
# In agent YAML behavior section:
**Cloud Provider Detection**:
- **Auto-detect**: Run `node skills/cloud-provider-detector/detect-cloud-provider.js`
at task start to identify AWS/GCP/Azure usage
- **Load Skills**: If AWS detected (≥70% confidence), load AWS cloud skill
- **Multi-cloud**: If multiple providers detected, load all relevant skills
- **Manual Override**: Accept `--cloud-provider` flag to bypass detection
```
### Example Workflow
```javascript
// 1. Detect cloud provider
const detection = await detectCloudProvider(projectPath);
// 2. Load appropriate skill
if (detection.detected) {
if (detection.provider === 'aws') {
await loadSkill('skills/aws-cloud/SKILL.md');
} else if (detection.provider === 'gcp') {
await loadSkill('skills/gcp-cloud/SKILL.md');
} else if (detection.provider === 'azure') {
await loadSkill('skills/azure-cloud/SKILL.md');
}
}
// 3. Execute infrastructure tasks with cloud-specific knowledge
```
## Detection Patterns
### AWS Indicators
- Terraform: `aws_vpc`, `aws_s3_bucket`, `aws_lambda_function`
- NPM: `@aws-sdk/client-s3`, `aws-cdk-lib`
- Python: `boto3`, `botocore`
- CLI: `aws configure`, `aws s3 sync`
- Docker: `FROM public.ecr.aws/lambda/nodejs`
### GCP Indicators
- Terraform: `google_compute_instance`, `google_storage_bucket`
- NPM: `@google-cloud/storage`, `googleapis`
- Python: `google-cloud-storage`, `google-api-python-client`
- CLI: `gcloud compute`, `gsutil cp`
- Docker: `FROM gcr.io/google-appengine/nodejs`
### Azure Indicators
- Terraform: `azurerm_virtual_machine`, `azurerm_storage_account`
- NPM: `@azure/storage-blob`, `azure-functions-core-tools`
- Python: `azure-storage-blob`, `msrestazure`
- CLI: `az vm create`, `az storage account`
- Docker: `FROM mcr.microsoft.com/azure-functions/node`
## Performance
- **Detection Time**: <100ms for typical projects
- **Accuracy**: ≥95% on projects with clear cloud provider usage
- **File Scanning**: Optimized with glob patterns and ignore lists
- **Memory**: Low memory footprint with streaming file reads
## Error Handling
```javascript
try {
const result = await detectCloudProvider(projectPath);
} catch (error) {
if (error.code === 'ENOENT') {
console.error('Project directory not found');
} else if (error.message.includes('patterns.json')) {
console.error('Detection patterns file missing or invalid');
} else {
console.error('Detection failed:', error.message);
}
}
```
## Common Issues
**Low Confidence Scores (<0.7)**:
- Project may use multiple cloud providers (check all_results)
- Limited cloud-specific patterns (consider manual override)
- Infrastructure as code not in Terraform (update detection patterns)
**False Positives**:
- Reduce minimum confidence threshold
- Check which signals were detected
- Review pattern matches in source files
**No Detection**:
- Ensure project path is correct
- Check that cloud provider files are not in ignored directories
- Verify patterns.json includes expected indicators
## Customization
### Adding New Providers
Edit `cloud-provider-patterns.json`:
```json
{
"providers": {
"digitalocean": {
"name": "DigitalOcean",
"confidence_boost": 0.3,
"detection_signals": {
"terraform": {
"weight": 0.5,
"patterns": ["provider \"digitalocean\"", "digitalocean_droplet"]
}
}
}
}
}
```
### Adjusting Detection Rules
```json
{
"detection_rules": {
"minimum_confidence": 0.6, // Lower = more permissive
"multi_signal_boost": 0.3, // Higher = favor multi-signal
"minimum_signals_for_boost": 2 // Lower = boost earlier
}
}
```
## Best Practices
1. **Run Early**: Detect cloud provider at task start for optimal skill loading
2. **Check Confidence**: Log confidence scores to monitor detection accuracy
3. **Manual Override**: Provide `--provider` flag for edge cases
4. **Multi-Cloud**: Handle projects using multiple cloud providers gracefully
5. **Cache Results**: Cache detection results per session to avoid re-scanning
## Dependencies
- **Node.js**: ≥18.0.0 required for glob and fs.promises
- **NPM Package**: `glob` for file pattern matching
Install with:
```bash
npm install glob
```
## File Size
- **SKILL.md**: ~8KB (quick reference)
- **detect-cloud-provider.js**: ~12KB (implementation)
- **cloud-provider-patterns.json**: ~6KB (detection rules)
- **Total**: ~26KB for complete cloud provider detection system
## Version
- **Version**: 1.0.0
- **Last Updated**: October 2025
- **Maintainer**: Fortium Infrastructure Team
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.