Pattern Extraction
Detect and extract patterns from codebases for template generation
npx skills add majiayu000/claude-skill-registry --skill pattern-extraction-lobbi-docs-claude-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Detect and extract patterns from codebases for template generation, including identifying configuration patterns, hardcoded values, naming conventions, and structure to support template metadata and variable schemas.
How it works
The skill provides a framework to: automatically identify IaC frameworks, cloud providers, service types, configuration formats, build systems, and CI/CD platforms; extract patterns from resource definitions, environment-specific configurations, naming and tagging strategies, security policies, network topologies, and deployment workflows; perform intelligent detection of hardcoded values, repeated values, environment indicators, naming patterns, secret patterns, and configuration schemas; analyze file organization, module boundaries, resource hierarchies, and template inclusion patterns. It uses a decision tree to classify patterns (e.g., environment values, resource names, region, version numbers, ports, sizes, CIDR blocks, tags, secret references, feature flags) and outputs variables and templates accordingly. Examples illustrate how inputs are transformed into templates and extracted variables.
When to use it
Use pattern extraction when you need to:
- Analyze existing infrastructure to create reusable templates
- Convert hardcoded values into configurable template variables
- Identify configuration patterns across multiple similar files
- Detect technology stacks and their conventions
- Extract naming conventions and structural patterns
- Generate template metadata from existing code
- Create variable schemas from inferred types and constraints
What it can touch
The skill mentions touching resource definitions, environment configurations, naming conventions, tagging strategies, security policies, network topologies, deployment workflows, and extracted variables in YAML/JSON-like outputs. It references outputs such as:
- Template outputs like HCL blocks, YAML, or JSON structures
- Extracted variables with types, defaults, and constraints
- Example variables include ami_id, instance_type, project_name, environment, app_name, namespace, replica_count, app_version, container_image, container_port, memory_request, memory_limit, cpu_request, cpu_limit, storage_account_name, location, sku_name, access_tier, min_tls_version, https_only, allow_public_access, environment, cost_center, project_name
Caveats
The material outlines risk areas such as security-sensitive patterns (secret_ref) and environment-related constraints. It also notes allowed values and patterns for variables (e.g., environments like dev, staging, production; version formats; region lists). License and provenance are given as MIT for the skill and it is released under that license.
# Pattern Extraction Skill ## When to Use This Skill Use pattern extraction when you need to: - **Analyze existing infrastructure** to create reusable templates - **Convert hardcoded values** into configurable template variables - **Identify configuration patterns** across multiple similar files - **Detect technology stacks** and their conventions - **Extract naming conventions** and structural patterns - **Generate template metadata** from existing code - **Create variable schemas** from inferred types and constraints Perfect for: - Converting existing IaC to templates - Building template libraries from production code - Standardizing infrastructure patterns - Automating template generation - Identifying refactoring opportunities ## Core Capabilities ### 1. Technology Stack Detection Automatically identify: - **IaC Frameworks**: Terraform, Pulumi, CloudFormation, ARM, Bicep - **Cloud Providers**: AWS, Azure, GCP, multi-cloud patterns - **Service Types**: Kubernetes, Docker, serverless, containers - **Configuration Formats**: YAML, JSON, HCL, TOML - **Build Systems**: Helm, Kustomize, Jsonnet - **CI/CD Platforms**: GitHub Actions, GitLab CI, Jenkins, Harness ### 2. Configuration Pa
- When to Use This Skill
- Core Capabilities
- 1. Technology Stack Detection
- 2. Configuration Pattern Extraction
- 3. Variable Identification
- 4. Structure Analysis
- Pattern Detection Matrix
- Variable Inference Rules
- Before/After Transformation Examples
- Decision Tree
- Examples
- Example 1: Extract Terraform AWS Pattern
- Example 2: Extract Kubernetes Pattern
- Example 3: Multi-File Pattern Extraction
extract patterns from ./terraform/aws/ec2-instances.tf extract patterns from ./k8s/deployments/ --type kubernetes extract patterns from ./infrastructure/ --recursive --consolidate Start small extract patterns from ./terraform/main.tf Validate and adjust review template ./templates/main.tf.tmpl Scale up extract patterns from ./terraform/ --recursive Extract initial patterns
What does the Pattern Extraction skill do?
Detect and extract patterns from codebases for template generation
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill pattern-extraction-lobbi-docs-claude-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
