# yldio/cinzel architecture

> Architecture diagram of the GitHub repository yldio/cinzel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yldio/cinzel
- Repository: https://github.com/yldio/cinzel

## Overview

cinzel converts GitHub Actions and GitLab CI/CD pipelines between YAML and HCL, preserving comments and platform-specific structure. The main workflow is a user invoking a provider command to parse HCL into YAML or unparse YAML into HCL; diff checks whether generated YAML has drifted. Separate capabilities include AI-assisted HCL generation and pinning action versions. The graph uses README-documented conversion flows and sampled command wiring; unsampled provider internals are represented at their exact source paths without asserting their internal call sequence.

Main entry points: [`internal/command/command.go`](https://github.com/yldio/cinzel/blob/main/internal/command/command.go) (CLI commands), [`cinzel.go`](https://github.com/yldio/cinzel/blob/main/cinzel.go) (Executable), [`internal/command/assist.go`](https://github.com/yldio/cinzel/blob/main/internal/command/assist.go) (AI assist), [`provider/diff.go`](https://github.com/yldio/cinzel/blob/main/provider/diff.go) (Pipeline diff)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_entry["Executable<br/>[cinzel.go]"]
  node_commands["CLI commands<br/>[command.go]"]
  node_diff["Pipeline diff<br/>[diff.go]"]
end

subgraph group_github["GitHub Actions"]
  node_gh["GitHub provider<br/>[github.go]"]
  node_ghparse["Workflow parse<br/>[parse_workflow.go]"]
  node_ghstep["Step decode<br/>[stepdecode.go]"]
  node_ghunparse["Workflow unparse"]
end

subgraph group_gitlab["GitLab CI/CD"]
  node_gl["GitLab provider<br/>[gitlab.go]"]
  node_glparse["Pipeline parse<br/>[parse_pipeline.go]"]
  node_glunparse["Pipeline unparse"]
  node_glyaml["YAML emission<br/>[pipeline_yaml.go]"]
end

subgraph group_shared["Shared conversion"]
  node_hcl["HCL parser<br/>[hclparser.go]"]
  node_yamldoc["YAML encoder<br/>[encode.go]"]
  node_fsutil["File utilities<br/>[fsutil.go]"]
end

subgraph group_assist["Assist and pinning"]
  node_assistcmd["AI assist<br/>[assist.go]"]
  node_ai["AI providers<br/>[provider.go]"]
  node_pin["Version pinning<br/>[pin.go]"]
  node_upgrade["Pin upgrade<br/>[upgrade.go]"]
end

node_user(("User"))

node_user -->|"invokes"| node_entry
node_entry -->|"starts"| node_commands
node_entry -->|"registers"| node_gh
node_entry -->|"registers"| node_gl
node_commands -->|"dispatches parse/unparse"| node_gh
node_commands -->|"dispatches parse/unparse"| node_gl
node_user -->|"requests conversion"| node_ghparse
node_ghparse -->|"decodes steps"| node_ghstep
node_user -->|"requests conversion"| node_ghunparse
node_user -->|"requests conversion"| node_glparse
node_user -->|"requests conversion"| node_glunparse
node_glunparse -->|"emits YAML"| node_glyaml
node_commands -->|"offers diff"| node_diff
node_diff -->|"compares files"| node_fsutil
node_assistcmd -->|"requests generation"| node_ai
node_assistcmd -->|"uses pinning"| node_pin
node_commands -->|"offers upgrade"| node_upgrade
node_upgrade -->|"uses pinning"| node_pin

click node_entry "https://github.com/yldio/cinzel/blob/main/cinzel.go"
click node_commands "https://github.com/yldio/cinzel/blob/main/internal/command/command.go"
click node_diff "https://github.com/yldio/cinzel/blob/main/provider/diff.go"
click node_gh "https://github.com/yldio/cinzel/blob/main/provider/github/github.go"
click node_ghparse "https://github.com/yldio/cinzel/blob/main/provider/github/parse_workflow.go"
click node_ghstep "https://github.com/yldio/cinzel/blob/main/provider/github/step/stepdecode.go"
click node_ghunparse "https://github.com/yldio/cinzel/blob/main/provider/github/unparse_workflow.go"
click node_gl "https://github.com/yldio/cinzel/blob/main/provider/gitlab/gitlab.go"
click node_glparse "https://github.com/yldio/cinzel/blob/main/provider/gitlab/parse_pipeline.go"
click node_glunparse "https://github.com/yldio/cinzel/blob/main/provider/gitlab/unparse_pipeline.go"
click node_glyaml "https://github.com/yldio/cinzel/blob/main/provider/gitlab/pipeline_yaml.go"
click node_hcl "https://github.com/yldio/cinzel/blob/main/internal/hclparser/hclparser.go"
click node_yamldoc "https://github.com/yldio/cinzel/blob/main/internal/yamldoc/encode.go"
click node_fsutil "https://github.com/yldio/cinzel/blob/main/internal/fsutil/fsutil.go"
click node_assistcmd "https://github.com/yldio/cinzel/blob/main/internal/command/assist.go"
click node_ai "https://github.com/yldio/cinzel/blob/main/internal/ai/provider.go"
click node_pin "https://github.com/yldio/cinzel/blob/main/internal/pin/pin.go"
click node_upgrade "https://github.com/yldio/cinzel/blob/main/internal/command/upgrade.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_commands,node_diff,node_user toneBlue
class node_gh,node_ghparse,node_ghstep,node_ghunparse toneAmber
class node_gl,node_glparse,node_glunparse,node_glyaml toneMint
class node_hcl,node_yamldoc,node_fsutil toneRose
class node_assistcmd,node_ai,node_pin,node_upgrade toneIndigo
```

## Components

### CLI workflows

- [Executable](https://github.com/yldio/cinzel/blob/main/cinzel.go): `cinzel.go`
- [CLI commands](https://github.com/yldio/cinzel/blob/main/internal/command/command.go): `internal/command/command.go`
- [Pipeline diff](https://github.com/yldio/cinzel/blob/main/provider/diff.go): `provider/diff.go`

### GitHub Actions

- [GitHub provider](https://github.com/yldio/cinzel/blob/main/provider/github/github.go): `provider/github/github.go`
- [Workflow parse](https://github.com/yldio/cinzel/blob/main/provider/github/parse_workflow.go): `provider/github/parse_workflow.go`
- [Step decode](https://github.com/yldio/cinzel/blob/main/provider/github/step/stepdecode.go): `provider/github/step/stepdecode.go`
- [Workflow unparse](https://github.com/yldio/cinzel/blob/main/provider/github/unparse_workflow.go): `provider/github/unparse_workflow.go`

### GitLab CI/CD

- [GitLab provider](https://github.com/yldio/cinzel/blob/main/provider/gitlab/gitlab.go): `provider/gitlab/gitlab.go`
- [Pipeline parse](https://github.com/yldio/cinzel/blob/main/provider/gitlab/parse_pipeline.go): `provider/gitlab/parse_pipeline.go`
- [Pipeline unparse](https://github.com/yldio/cinzel/blob/main/provider/gitlab/unparse_pipeline.go): `provider/gitlab/unparse_pipeline.go`
- [YAML emission](https://github.com/yldio/cinzel/blob/main/provider/gitlab/pipeline_yaml.go): `provider/gitlab/pipeline_yaml.go`

### Shared conversion

- [HCL parser](https://github.com/yldio/cinzel/blob/main/internal/hclparser/hclparser.go): `internal/hclparser/hclparser.go`
- [YAML encoder](https://github.com/yldio/cinzel/blob/main/internal/yamldoc/encode.go): `internal/yamldoc/encode.go`
- [File utilities](https://github.com/yldio/cinzel/blob/main/internal/fsutil/fsutil.go): `internal/fsutil/fsutil.go`

### Assist and pinning

- [AI assist](https://github.com/yldio/cinzel/blob/main/internal/command/assist.go): `internal/command/assist.go`
- [AI providers](https://github.com/yldio/cinzel/blob/main/internal/ai/provider.go): `internal/ai/provider.go`
- [Version pinning](https://github.com/yldio/cinzel/blob/main/internal/pin/pin.go): `internal/pin/pin.go`
- [Pin upgrade](https://github.com/yldio/cinzel/blob/main/internal/command/upgrade.go): `internal/command/upgrade.go`

### Other components

- **User**

## Connections

- User → Executable: invokes
- Executable → CLI commands: starts (evidence: `cinzel.go`)
- Executable → GitHub provider: registers (evidence: `cinzel.go`)
- Executable → GitLab provider: registers (evidence: `cinzel.go`)
- CLI commands → GitHub provider: dispatches parse/unparse (evidence: `internal/command/command.go`)
- CLI commands → GitLab provider: dispatches parse/unparse (evidence: `internal/command/command.go`)
- User → Workflow parse: requests conversion
- Workflow parse → Step decode: decodes steps (evidence: `provider/github/parse_workflow.go`)
- User → Workflow unparse: requests conversion
- User → Pipeline parse: requests conversion
- User → Pipeline unparse: requests conversion
- Pipeline unparse → YAML emission: emits YAML (evidence: `provider/gitlab/unparse_pipeline.go`)
- CLI commands → Pipeline diff: offers diff
- Pipeline diff → File utilities: compares files (evidence: `provider/diff.go`)
- AI assist → AI providers: requests generation (evidence: `internal/command/assist.go`)
- AI assist → Version pinning: uses pinning (evidence: `internal/command/assist.go`)
- CLI commands → Pin upgrade: offers upgrade
- Pin upgrade → Version pinning: uses pinning (evidence: `internal/command/upgrade.go`)
