# Patternizer

> AI assistance for Patternizer — a CLI tool that bootstraps Git repositories containing Helm charts into ready-to-use Validated Patterns for OpenShift. Use when initializing, upgrading, or working with Validated Patterns.

- Skill: `tosin2013/patternizer` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add tosin2013/patternizer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tosin2013/patternizer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- License: Apache-2.0
- Author: tosin2013 (https://skillmd.com/u/tosin2013)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tosin2013/patternizer

---


# Patternizer Skill

## When to Use

- Initializing a new Validated Pattern from a Git repository with Helm charts
- Upgrading an existing Validated Pattern to the latest common structure
- Understanding the generated scaffolding files (values-global.yaml, pattern.sh, Makefile)
- Configuring secrets management for Validated Patterns
- Working with the `pattern.sh` utility script
- Troubleshooting pattern initialization or upgrade issues

## Instructions

- Read `references/REFERENCE.md` when you need the Patternizer CLI reference, container image details, or upstream links
- Read `references/README.md` for the full upstream README including generated file descriptions and contributing workflow
- Patternizer runs as a container via Podman or Docker — no local Go installation required

## Gotchas

- `patternizer init` overwrites existing files without warning — always run in a clean directory or commit first
- The generated `Makefile` includes `common/Makefile` from the VP framework — this include must exist or `make` will fail silently
- `values-secret.yaml.template` is the template; `values-secret.yaml` with real credentials must NEVER be committed to git
- Container images referenced in Helm charts must be accessible from the target OpenShift cluster — air-gapped clusters need mirrored images
- After `patternizer init`, run `make` immediately to verify the scaffolding is valid before making any changes
- `deploy.sh` and `teardown.sh` are safe to commit — they contain no secrets
- The `deploy.sh` pre-check for `values-secret.yaml` is a `vp-deploy-test` submission-blocking requirement — a pattern that deploys without this check fails the non-interactive install test

## Quick Start

```bash
# Navigate to your repository with Helm charts
cd my-pattern-repo

# Initialize as a Validated Pattern
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" \
  quay.io/validatedpatterns/patternizer init

# Initialize with secrets management
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" \
  quay.io/validatedpatterns/patternizer init --with-secrets
```

## Key Commands

```bash
# Initialize a new pattern (no secrets)
patternizer init

# Initialize with secrets support (adds Vault + External Secrets Operator)
patternizer init --with-secrets

# Upgrade existing pattern to latest common structure
patternizer upgrade

# Upgrade and replace Makefile
patternizer upgrade --replace-makefile
```

All commands are typically run via the container image:
```bash
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" \
  quay.io/validatedpatterns/patternizer <command>
```

## Independent Deployment Scripts

Every Validated Pattern project should have standalone shell scripts that wrap `pattern.sh` commands. These scripts live in the pattern repo root, are committed to git (they contain no secrets), and serve as the single entry point for deploying and tearing down the pattern.

### When activating this section

Before generating any script, check whether one already exists:

```bash
ls deploy.sh teardown.sh
```

If the scripts exist, use them instead of raw `pattern.sh` commands. If they do not exist, generate them from the templates below.

After generating:
```bash
chmod +x deploy.sh teardown.sh
git add deploy.sh teardown.sh
git commit -m "feat: add independent deploy and teardown scripts"
```

### `deploy.sh`

```bash
#!/usr/bin/env bash
# deploy.sh — generated by patternizer skill
set -euo pipefail

PATTERN_ROOT="${PATTERN_ROOT:-$(cd "$(dirname "$0")" && pwd)}"
cd "$PATTERN_ROOT"

if [ ! -f values-secret.yaml ]; then
  echo "ERROR: values-secret.yaml not found."
  echo "Copy values-secret.yaml.template, populate it, and place it in the pattern root."
  echo "Do NOT commit values-secret.yaml to git."
  exit 1
fi

echo "==> Installing Validated Pattern ..."
./pattern.sh make install
echo "==> Install complete. Run vp-deploy-validator to confirm ArgoCD convergence."
```

### `teardown.sh`

```bash
#!/usr/bin/env bash
# teardown.sh — generated by patternizer skill
set -euo pipefail

PATTERN_ROOT="${PATTERN_ROOT:-$(cd "$(dirname "$0")" && pwd)}"
cd "$PATTERN_ROOT"

read -rp "This will uninstall the pattern and remove all ArgoCD Applications. Continue? [y/N] " confirm
[[ "$confirm" =~ ^[Yy]$ ]] || exit 0

echo "==> Uninstalling Validated Pattern ..."
./pattern.sh make uninstall
echo "==> Uninstall complete."
```

## Generated Files

Running `patternizer init` creates:

| File | Purpose |
|------|---------|
| `values-global.yaml` | Global pattern configuration |
| `values-<cluster_group>.yaml` | Cluster group-specific values |
| `pattern.sh` | Utility script for install, upgrade operations |
| `Makefile` | Simple Makefile including Makefile-common |
| `Makefile-common` | Core Makefile with pattern-related targets |
| `ansible.cfg` | Ansible configuration for pattern.sh |

With `--with-secrets`, additionally:
- `values-secret.yaml.template` — template for defining secrets
- Updates `values-global.yaml` to enable secret loading

## Workflow

```bash
# 1. Clone or create your pattern repo
git clone https://github.com/your-org/your-pattern.git
cd your-pattern && git checkout -b initialize-pattern

# 2. Initialize with Patternizer
podman run --pull=newer -v "$PWD:$PWD:z" -w "$PWD" \
  quay.io/validatedpatterns/patternizer init

# 3. Review and commit
git add . && git commit -m 'initialize pattern using patternizer'
git push -u origin initialize-pattern

# 4. Install the pattern on OpenShift
export KUBECONFIG=/path/to/cluster/kubeconfig
./pattern.sh make install
```

## Best Practices

- Use the container image rather than building from source
- See [Validated Patterns documentation](https://validatedpatterns.io/) for pattern design guidance

