This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a **GitLab CI/CD reusable template** for Terraform/OpenTofu infrastructure-as-code pipelines. It is part of the [to-be-continuous](https://to-be-continuous.gitlab.io/doc/) ecosystem. The template provides multi-environment deployment (review, integration, staging, production) with integrated security scanning, linting, cost estimation, and cloud provider authentication (AWS, GCP, Vault).
-`templates/gitlab-ci-terraform.yml` — **The main template** (~1,900 lines). This is the core of the project: a GitLab CI spec-based template defining all pipeline jobs, variables, and embedded shell scripts.
Tests use [BATS](https://github.com/bats-core/bats-core)(Bash Automated Testing System). In CI, they run via the `to-be-continuous/bash` component. Locally, with BATS installed:
```bash
bats test/
```
The test helper (`test/terraform-scripts.bash`) extracts shell functions from `templates/gitlab-ci-terraform.yml` (between `BEGSCRIPT`/`ENDSCRIPT` markers) and mocks the `terraform` CLI.
### Linting
Shell scripts are linted with **shellcheck** (via the bash CI component). The CI also validates the template YAML structure using `to-be-continuous/tools/gitlab-ci` and `to-be-continuous/kicker` validation templates.
### Local CI Testing
A `.devcontainer` setup is available with `gitlab-ci-local` for running the pipeline locally. Configuration is in `.gitlab-ci-local/`.
## Architecture
### Template Design
The main template uses GitLab's **spec/inputs system** with 150+ configurable inputs.
Cloud provider variants (AWS, GCP, Vault) are thin wrappers that add provider-specific authentication setup (OIDC, Workload Identity Federation, etc.) and include the main template.
## Git Conventions
-**Branch:**`main` (default), was previously `master`
-**Commits:**[Conventional Commits](https://www.conventionalcommits.org/) format, required for semantic-release
-**DCO:** All commits must be signed off (`git commit -s`)
-**Versioning:** Automated via semantic-release (`.releaserc.yml`)