Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Pattern Extraction

БесплатноБез исполняемых скриптовНе проверен

Detect and extract patterns from codebases for template generation

TheLobbiот TheLobbi★ 22 звезды на GitHub

Об этом скилле

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 Pattern Extraction

Extract patterns from:

  • Resource definitions and relationships
  • Environment-specific configurations
  • Naming conventions and tagging strategies
  • Security policies and compliance rules
  • Network topologies and architectures
  • Deployment strategies and workflows

3. Variable Identification

Intelligent detection of:

  • Hardcoded Values: Strings, numbers, booleans that should be variables
  • Repeated Values: Values appearing multiple times across files
  • Environment Indicators: dev, staging, prod patterns
  • Naming Patterns: Prefixes, suffixes, delimiters
  • Secret Patterns: API keys, passwords, tokens (flag for security)
  • Configuration Schemas: Type inference from usage

4. Structure Analysis

Analyze:

  • File organization and directory structure
  • Module boundaries and dependencies
  • Resource hierarchies and relationships
  • Configuration inheritance patterns
  • Composition and reuse strategies
  • Template inclusion patterns

Pattern Detection Matrix

Pattern Type Indicators Extraction Method Output Format
Environment Values dev, staging, prod in names Context-aware regex {{ environment }}
Resource Names Repeated prefixes/suffixes Token analysis {{ project_name }}-{{ resource_type }}
Region/Location us-east-1, westeurope Cloud provider patterns {{ region }}
Version Numbers Semantic versioning patterns Regex + validation {{ version }}
Port Numbers Common service ports Port range analysis {{ port }}
Size/Scale Instance types, node counts Capacity patterns {{ instance_size }}
CIDR Blocks IP address ranges Network pattern analysis {{ cidr_block }}
Tags/Labels Key-value metadata Metadata extraction {{ tags }}
Secret References Vault paths, secret names Secret pattern detection {{ secret_ref }} (secure)
Feature Flags Boolean toggles Conditional analysis {{ enable_feature }}

Variable Inference Rules

Before/After Transformation Examples

Example 1: Resource Names

Before:

resource "aws_instance" "web_server" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t3.medium"

  tags = {
    Name        = "myapp-web-server-prod"
    Environment = "production"
    Project     = "myapp"
  }
}

After:

resource "aws_instance" "web_server" {
  ami           = "{{ ami_id }}"
  instance_type = "{{ instance_type }}"

  tags = {
    Name        = "{{ project_name }}-web-server-{{ environment }}"
    Environment = "{{ environment }}"
    Project     = "{{ project_name }}"
  }
}

Extracted Variables:

variables:
  ami_id:
    type: string
    description: "AMI ID for the EC2 instance"
    default: "ami-0c55b159cbfafe1f0"
    pattern: "^ami-[a-f0-9]{17}$"

  instance_type:
    type: string
    description: "EC2 instance type"
    default: "t3.medium"
    allowed_values: ["t3.micro", "t3.small", "t3.medium", "t3.large"]

  project_name:
    type: string
    description: "Project identifier used in resource naming"
    default: "myapp"
    pattern: "^[a-z][a-z0-9-]{2,30}$"

  environment:
    type: string
    description: "Deployment environment"
    default: "production"
    allowed_values: ["dev", "staging", "production"]

Example 2: Kubernetes Deployment

Before:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: production
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
        version: "1.21.0"
    spec:
      containers:
      - name: nginx
        image: nginx:1
Полный SKILL.md на GitHub

Установить Pattern Extraction в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Pattern Extraction?

Detect and extract patterns from codebases for template generation

Как установить скилл Pattern Extraction?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Pattern Extraction запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Pattern Extraction с