cloud-common

fractary's avatarfrom fractary

Shared utilities for faber-cloud plugin - configuration loading, pattern resolution, auto-discovery

⭐1stars🔀0forks📁View on GitHub🕐Updated Dec 15, 2025

When & Why to Use This Skill

Cloud Common is a foundational utility skill designed for the faber-cloud plugin ecosystem. It streamlines cloud infrastructure management by providing robust configuration loading, dynamic pattern resolution for resource naming, and intelligent auto-discovery of project metadata. By centralizing core logic for AWS profiles, environment variables, and IaC tool settings, it ensures consistency and reduces manual overhead across all infrastructure and operations tasks.

Use Cases

  • Standardizing configuration management across multiple cloud agents to ensure consistent project settings and environment variables.
  • Automating the migration and upgrade of legacy DevOps configuration files to the modern standard without manual intervention.
  • Resolving complex naming patterns for AWS resources and IAM policies using dynamic placeholders like project name, environment, and namespace.
  • Performing automatic discovery of cloud providers, IaC tools, and project metadata directly from Git repositories and local environments.
  • Providing a unified interface for infrastructure scripts to access validated AWS profiles and resource prefixes across different deployment stages.
namecloud-common
descriptionShared utilities for faber-cloud plugin - configuration loading, pattern resolution, auto-discovery
modelclaude-haiku-4-5
allowed-toolsBash, Read

Cloud Common

Shared utilities used across all faber-cloud skills.

Purpose

This skill provides:

  • Configuration loading from .fractary/plugins/faber-cloud/config.json (in project working directory)
  • Backward compatibility with faber-cloud.json and devops.json (deprecated)
  • Pattern substitution ({project}, {environment}, etc.)
  • Auto-discovery fallbacks when config is missing
  • Validation and error handling

CRITICAL: Always load config from the project working directory, NOT the plugin installation directory.

Configuration Loading

Primary config file: .fractary/plugins/faber-cloud/config.json (relative to project root / current working directory)

Common Mistake: Do NOT look in ~/.claude/plugins/marketplaces/fractary/plugins/faber-cloud/ - that's the plugin installation directory, not the project config location.

Automatic migration (seamless upgrade):

  • If config.json exists: use it (current standard)
  • If faber-cloud.json exists: automatically rename to config.json
  • If devops.json exists: show warning to migrate manually

Migration is automatic and preserves all configuration settings.

Components

scripts/config-loader.sh

Core configuration management:

Main Functions:

  • load_faber_cloud_config() - Load configuration from file or auto-discover (with backward compatibility)
  • resolve_pattern(pattern, environment) - Substitute placeholders in patterns
  • get_aws_profile(environment) - Get AWS profile for environment
  • get_config_value(key) - Get specific config value
  • show_config() - Display current configuration

Usage:

# Source the loader
source "${SKILL_DIR}/../cloud-common/scripts/config-loader.sh"

# Load configuration (checks config.json, auto-migrates from faber-cloud.json if needed)
load_faber_cloud_config

# Use configuration variables
echo "Project: $PROJECT_NAME"
echo "Provider: $PROVIDER"
echo "IaC Tool: $IAC_TOOL"

# Resolve patterns
USER_NAME=$(resolve_pattern "$USER_NAME_PATTERN" "test")
# Result: corthuxa-core-test-deploy

# Get AWS profile
AWS_PROFILE=$(get_aws_profile "test")
# Result: corthuxa-core-test-deploy

Exported Variables:

  • PROJECT_NAME - Project name
  • NAMESPACE - Project namespace
  • ORGANIZATION - Organization name
  • PROVIDER - Cloud provider (aws, gcp, azure)
  • IAC_TOOL - IaC tool (terraform, pulumi, cdk)
  • AWS_REGION - AWS region
  • TERRAFORM_DIR - Terraform directory path
  • IAM_POLICIES_DIR - IAM policies directory path
  • PROFILE_DISCOVER, PROFILE_TEST, PROFILE_PROD - AWS profiles
  • USER_NAME_PATTERN, POLICY_NAME_PATTERN - IAM naming patterns
  • RESOURCE_PREFIX - Resource naming prefix

templates/faber-cloud.json.template

Template for generating .fractary/plugins/faber-cloud/config.json:

  • Placeholders: {{PROJECT_NAME}}, {{NAMESPACE}}, etc.
  • Used by /fractary-faber-cloud:init command
  • Includes sensible defaults
  • Template filename remains faber-cloud.json.template for compatibility, generates config.json

Auto-Discovery

When configuration file doesn't exist, auto-discovers:

  • Project name from Git repository
  • Organization from Git remote
  • AWS account ID from credentials
  • Provider and IaC tool from installed tools

Pattern Substitution

Supported placeholders:

  • {project} - Project name
  • {namespace} - Project namespace
  • {organization} - Organization name
  • {environment} - Current environment (test, prod, etc.)
  • {prefix} - Resource prefix

Example:

Pattern: "{prefix}-{environment}-bucket"
Result: "corthuxa-test-bucket"

Configuration Schema

See /docs/specs/fractary-faber-cloud-plugin-spec.md for complete schema.

Used By

Infrastructure Skills:

  • infra-architect
  • infra-engineer
  • infra-validator
  • infra-previewer
  • infra-deployer
  • infra-permission-manager
  • infra-tester
  • infra-debugger

Operations Skills:

  • ops-monitor
  • ops-investigator
  • ops-responder
  • ops-auditor

Handler Skills:

  • handler-hosting-aws
  • handler-iac-terraform

Note: Previously used by deprecated agents (devops-deployer, devops-debugger, devops-permissions) - now superseded by Phase 1-4 architecture. See .archive/pre-phase-architecture/ for historical reference.