# keito4/config architecture

> Architecture diagram of the GitHub repository keito4/config, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/keito4/config
- Repository: https://github.com/keito4/config

## Overview

##### Project type and purpose
- This is neither a traditional web application nor a microservice suite, but an opinionated “Config Repository” for managing and standardizing a developer’s local environment. It centralizes dotfiles, package manifests, credential templates, VS Code settings, and automation scripts into one monorepo. Its goal is to let anyone (or any machine) reproduce a consistent dev setup—across macOS, Linux, and containerized DevContainers—via simple commands.

##### File structure
- Top-level directories by concern:
- `.claude/` – custom agents and CLI commands for code review and analysis (internal tooling)
- `.devcontainer/` – Dockerfile and settings to run the entire repository in a containerized dev environment
- `brew/` – Brewfile manifests (macOS/Linux/NoDependency/Categorized) and lock files for reproducible Homebrew installs
- `credentials/` – 1Password CLI integration: templates (.env), scripts to fetch/clean credentials
- `dot/` – “dotfiles” (Zsh profile, .peco, RuboCop) that live in the user’s home directory
- `git/` – Modular Git configuration, including .gitignore and platform-specific gitconfig.d/ files
- `npm/` – NPM global package JSON (global.json)
- `script/` – Bash scripts to import/export settings, manage credentials, manage Brew dependencies, bump versions
- `supabase/` – Supabase CLI snapshots and docs
- `vscode/` – VS Code extensions list and install docs
- Config files at root: `.env.example`, Makefile (orchestration of common workflows), GitHub Actions workflows, Husky git hooks, semantic-release config, etc.

##### README for additional insights
- Defines usage: `import.sh`, `export.sh`, `commit_changes.sh`, `make credentials`, `make version-patch`, etc.
- Emphasizes OS-specific flows (macOS vs Linux vs DevContainer)
- Highlights security best-practices: no hardcoded secrets, 1Password CLI, strict file perms
- Automates release via semantic-release and GitHub Actions.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Developer Environment" 
        DEV["Developer Machine\n(macOS/Linux/DevContainer)"]:::local
    end

    subgraph "Config Repo (Monorepo)"
        subgraph "Dotfiles Module"
            Dotfiles["dot/"]:::repo
            ZshConfig[".zsh/"]:::repo
        end
        subgraph "Package Manifests"
            Brew["brew/"]:::repo
            Npm["npm/global.json"]:::repo
        end
        subgraph "Editor Settings"
            VSCode["vscode/"]:::repo
        end
        subgraph "Credential Manager"
            Credentials["credentials/"]:::repo
            CredScript["script/credentials.sh"]:::repo
        end
        subgraph "Git Config Module"
            GitCfg["git/"]:::repo
        end
        subgraph "Supabase Config"
            Supa["supabase/"]:::repo
        end
        subgraph "Automation Scripts"
            Imp["script/import.sh"]:::repo
            Exp["script/export.sh"]:::repo
            BrewDeps["script/brew-deps.sh"]:::repo
            CommitCh["script/commit_changes.sh"]:::repo
            Vers["script/version.sh"]:::repo
            Make["Makefile"]:::repo
        end
        subgraph "CI/CD"
            WF[".github/workflows/"]:::cicd
            Husky[".husky/"]:::cicd
            Release[".releaserc.json"]:::cicd
            CommitLint["commitlint.config.js"]:::cicd
        end
        subgraph "Custom Agents"
            Agents[".claude/"]:::repo
        end
        subgraph "DevContainer Configuration"
            Dc[".devcontainer/"]:::repo
        end
    end

    subgraph "External Tools/Services"
        Homebrew["Homebrew CLI"]:::ext
        Op["1Password CLI"]:::ext
        NpmCLI["npm CLI"]:::ext
        VSCodeCLI["VS Code CLI"]:::ext
        GitCLI["Git"]:::ext
        Docker["Docker"]:::ext
        SupaCLI["Supabase CLI"]:::ext
        GitHubActions["GitHub Actions"]:::ext
        Semantic["semantic-release"]:::ext
    end

    DEV -->|"import.sh → copy dotfiles"| Dotfiles
    DEV -->|"import.sh → apply Zsh configs"| ZshConfig
    DEV -->|"brew bundle → install packages"| Brew
    DEV -->|"npm install -g"| Npm
    DEV -->|"install extensions"| VSCode
    DEV -->|"run credentials.sh"| Credentials
    Credentials -->|"templates → generate .env"| Credentials
    DEV -->|"git init & hooks"| GitCfg
    DEV -->|"docker build"| Dc
    DEV -->|"invoke CI on commit"| WF
    WF -->|"trigger semantic-release"| Semantic
    DEV -.->|"export.sh → snapshot"| Exp
    Exp -->|"update manifests"| Dotfiles
    DEV --> SupaCLI
    SupaCLI -->|"snapshot"| Supa
    DEV --> Homebrew
    DEV --> Op
    DEV --> NpmCLI
    DEV --> VSCodeCLI
    DEV --> GitCLI
    GitCLI -->|"husky hooks"| Husky

    click Dotfiles "https://github.com/keito4/config/tree/main/dot/"
    click ZshConfig "https://github.com/keito4/config/tree/main/.zsh/"
    click Brew "https://github.com/keito4/config/tree/main/brew/"
    click Npm "https://github.com/keito4/config/blob/main/npm/global.json"
    click VSCode "https://github.com/keito4/config/tree/main/vscode/"
    click Credentials "https://github.com/keito4/config/tree/main/credentials/"
    click CredScript "https://github.com/keito4/config/blob/main/script/credentials.sh"
    click GitCfg "https://github.com/keito4/config/tree/main/git/"
    click Supa "https://github.com/keito4/config/tree/main/supabase/"
    click Imp "https://github.com/keito4/config/blob/main/script/import.sh"
    click Exp "https://github.com/keito4/config/blob/main/script/export.sh"
    click BrewDeps "https://github.com/keito4/config/blob/main/script/brew-deps.sh"
    click CommitCh "https://github.com/keito4/config/blob/main/script/commit_changes.sh"
    click Vers "https://github.com/keito4/config/blob/main/script/version.sh"
    click Make "https://github.com/keito4/config/tree/main/Makefile"
    click WF "https://github.com/keito4/config/tree/main/.github/workflows/"
    click Husky "https://github.com/keito4/config/tree/main/.husky/"
    click Release "https://github.com/keito4/config/blob/main/.releaserc.json"
    click CommitLint "https://github.com/keito4/config/blob/main/commitlint.config.js"
    click Agents "https://github.com/keito4/config/tree/main/.claude/"
    click Dc "https://github.com/keito4/config/tree/main/.devcontainer/"

    classDef local fill:#ADD8E6,stroke:#000
    classDef repo fill:#90EE90,stroke:#000
    classDef ext fill:#FFA500,stroke:#000
    classDef cicd fill:#DDA0DD,stroke:#000
```
