This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
CanI.TF is a static website comparing features between OpenTofu and Terraform. It exposes both an HTML comparison table and a JSON API at /tools.json.
Adding or updating features requires two steps:
- Edit
tools/tools.yaml— this is the source of truth (feature-centric: each feature lists per-tool data under atools:map) - Run
go run main.goto validate and regeneratedata/tools.jsonandstatic/tools.json
To preview the site locally:
hugo server --buildDrafts --disableFastRenderHugo version is pinned via .tool-versions (hugo 0.135.0). Install with asdf install.
tools/tools.yaml— YAML source of truth. Feature-centric: a top-leveltools:map holds metadata per tool, and a top-levelfeatures:list holds each feature with per-tool data under atools:map. Omitting a tool key means that tool doesn't support the feature.main.go— readstools/tools.yaml, defines the JSON schema, validates the data, and writesdata/tools.json+static/tools.json.data/tools.json— consumed by Hugo templates at build time.static/tools.json— served directly as the public API.layouts/— Hugo templates._default/baseof.htmlis the shell;index.htmlrenders the comparison table by iterating the tools data.
Each tool entry has: version, versionURL, license, licenseURL, registry, and features[]. Each feature has name (required), and optional version, url, and featureRequestURL. Feature names are matched by string equality across tools to build the comparison table — a feature present in one tool but not the other renders as -. A featureRequestURL with no version renders as a ? link.
Pushing to main triggers .github/workflows/hugo.yml, which builds with Hugo and deploys to GitHub Pages automatically.