# kaotypr/tembiter architecture

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

- Interactive diagram: https://gitdiagram.com/kaotypr/tembiter
- Repository: https://github.com/kaotypr/tembiter

## Overview

Tembiter is a setup CLI and a project-template convention: users initialize a project from a tagged template, connect an existing project, or install a packaged agent skill. The installed `tembiter-sync` skill supports a later, separate agent-led workflow for reviewing template changes in a worktree; the CLI itself does not perform updates. Source excerpts establish the CLI dispatch and core setup operations, while the later sync and optional PR behavior is documented in the README, so its internal implementation is not inferred here.

Main entry points: [`src/cli.ts`](https://github.com/kaotypr/tembiter/blob/main/src/cli.ts) (CLI dispatcher), [`src/commands/init.ts`](https://github.com/kaotypr/tembiter/blob/main/src/commands/init.ts) (Initialize project), [`src/commands/adopt.ts`](https://github.com/kaotypr/tembiter/blob/main/src/commands/adopt.ts) (Adopt project), [`src/commands/skill-install.ts`](https://github.com/kaotypr/tembiter/blob/main/src/commands/skill-install.ts) (Install skill)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI interaction"]
  node_cli["CLI dispatcher<br/>[cli.ts]"]
  node_picker["Setup picker<br/>[picker.ts]"]
  node_prompt["Prompt interface<br/>[prompt.ts]"]
  node_initsetup["Init setup page<br/>[init-setup.ts]"]
end

subgraph group_setup["Project setup"]
  node_init["Initialize project<br/>[init.ts]"]
  node_adopt["Adopt project<br/>[adopt.ts]"]
  node_install["Install skill<br/>[skill-install.ts]"]
  node_git["Git runner<br/>[git.ts]"]
end

subgraph group_format["Project format"]
  node_gitignore["Sync ignore rule<br/>[gitignore.ts]"]
  node_config["Tembiter config<br/>[config.ts]"]
end

subgraph group_agent["Agent updates"]
  node_catalog["Skill catalog<br/>[catalog.ts]"]
  node_skillfiles["Packaged skill<br/>[SKILL.md]"]
  node_worktree["Sync worktree"]
  node_pullrequest["MR or PR"]
end

node_user(("User"))
node_template["Template repository"]
node_project["Project repository"]
node_agent(("AI agent"))
node_gitservice["Git host"]

node_user -->|"runs setup"| node_cli
node_cli -->|"offers commands"| node_picker
node_cli -->|"prompts flags"| node_prompt
node_cli -->|"collects init inputs"| node_initsetup
node_cli -->|"dispatches init"| node_init
node_cli -->|"dispatches adopt"| node_adopt
node_cli -->|"dispatches install"| node_install
node_init -->|"runs git operations"| node_git
node_init -->|"archives tagged files"| node_template
node_init -->|"writes project config"| node_config
node_init -->|"adds sync ignore"| node_gitignore
node_init -->|"creates and commits"| node_project
node_adopt -->|"checks and commits"| node_git
node_adopt -->|"reads tags and history"| node_template
node_adopt -->|"writes project config"| node_config
node_adopt -->|"adds sync ignore"| node_gitignore
node_adopt -->|"updates setup files"| node_project
node_git -->|"invokes git"| node_gitservice
node_install -->|"resolves skill"| node_catalog
node_install -->|"checks project kind"| node_config
node_install -->|"copies packaged files"| node_skillfiles
node_install -->|"writes skill and link"| node_project
node_agent -->|"follows installed skill"| node_skillfiles
node_agent -->|"compares template changes"| node_template
node_agent -->|"creates and reviews"| node_worktree
node_agent -->|"refreshes in worktree"| node_config
node_agent -->|"creates worktree branch"| node_gitservice
node_agent -.->|"may open"| node_pullrequest
node_pullrequest -.->|"submits branch"| node_gitservice

click node_cli "https://github.com/kaotypr/tembiter/blob/main/src/cli.ts"
click node_picker "https://github.com/kaotypr/tembiter/blob/main/src/ui/picker.ts"
click node_prompt "https://github.com/kaotypr/tembiter/blob/main/src/ui/prompt.ts"
click node_initsetup "https://github.com/kaotypr/tembiter/blob/main/src/ui/init-setup.ts"
click node_init "https://github.com/kaotypr/tembiter/blob/main/src/commands/init.ts"
click node_adopt "https://github.com/kaotypr/tembiter/blob/main/src/commands/adopt.ts"
click node_install "https://github.com/kaotypr/tembiter/blob/main/src/commands/skill-install.ts"
click node_git "https://github.com/kaotypr/tembiter/blob/main/src/git.ts"
click node_gitignore "https://github.com/kaotypr/tembiter/blob/main/src/format/gitignore.ts"
click node_config "https://github.com/kaotypr/tembiter/blob/main/src/format/config.ts"
click node_catalog "https://github.com/kaotypr/tembiter/blob/main/src/skills/catalog.ts"
click node_skillfiles "https://github.com/kaotypr/tembiter/blob/main/skills/tembiter-sync/SKILL.md"

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_cli,node_picker,node_prompt,node_initsetup,node_user toneBlue
class node_init,node_adopt,node_install,node_git toneAmber
class node_gitignore,node_config toneMint
class node_catalog,node_skillfiles,node_worktree,node_pullrequest toneRose
class node_template,node_project,node_agent,node_gitservice toneIndigo
```

## Components

### CLI interaction

- [CLI dispatcher](https://github.com/kaotypr/tembiter/blob/main/src/cli.ts): `src/cli.ts`
- [Setup picker](https://github.com/kaotypr/tembiter/blob/main/src/ui/picker.ts): `src/ui/picker.ts`
- [Prompt interface](https://github.com/kaotypr/tembiter/blob/main/src/ui/prompt.ts): `src/ui/prompt.ts`
- [Init setup page](https://github.com/kaotypr/tembiter/blob/main/src/ui/init-setup.ts): `src/ui/init-setup.ts`

### Project setup

- [Initialize project](https://github.com/kaotypr/tembiter/blob/main/src/commands/init.ts): `src/commands/init.ts`
- [Adopt project](https://github.com/kaotypr/tembiter/blob/main/src/commands/adopt.ts): `src/commands/adopt.ts`
- [Install skill](https://github.com/kaotypr/tembiter/blob/main/src/commands/skill-install.ts): `src/commands/skill-install.ts`
- [Git runner](https://github.com/kaotypr/tembiter/blob/main/src/git.ts): `src/git.ts`

### Project format

- [Sync ignore rule](https://github.com/kaotypr/tembiter/blob/main/src/format/gitignore.ts): `src/format/gitignore.ts`
- [Tembiter config](https://github.com/kaotypr/tembiter/blob/main/src/format/config.ts): `src/format/config.ts`

### Agent updates

- [Skill catalog](https://github.com/kaotypr/tembiter/blob/main/src/skills/catalog.ts): `src/skills/catalog.ts`
- [Packaged skill](https://github.com/kaotypr/tembiter/blob/main/skills/tembiter-sync/SKILL.md): `skills/tembiter-sync/SKILL.md`
- **Sync worktree**
- **MR or PR**

### Other components

- **User**
- **Template repository**
- **Project repository**
- **AI agent**
- **Git host**

## Connections

- User → CLI dispatcher: runs setup
- CLI dispatcher → Setup picker: offers commands
- CLI dispatcher → Prompt interface: prompts flags
- CLI dispatcher → Init setup page: collects init inputs
- CLI dispatcher → Initialize project: dispatches init
- CLI dispatcher → Adopt project: dispatches adopt
- CLI dispatcher → Install skill: dispatches install
- Initialize project → Git runner: runs git operations
- Initialize project → Template repository: archives tagged files
- Initialize project → Tembiter config: writes project config
- Initialize project → Sync ignore rule: adds sync ignore
- Initialize project → Project repository: creates and commits
- Adopt project → Git runner: checks and commits
- Adopt project → Template repository: reads tags and history
- Adopt project → Tembiter config: writes project config
- Adopt project → Sync ignore rule: adds sync ignore
- Adopt project → Project repository: updates setup files
- Git runner → Git host: invokes git
- Install skill → Skill catalog: resolves skill
- Install skill → Tembiter config: checks project kind
- Install skill → Packaged skill: copies packaged files
- Install skill → Project repository: writes skill and link
- AI agent → Packaged skill: follows installed skill
- AI agent → Template repository: compares template changes
- AI agent → Sync worktree: creates and reviews
- AI agent → Tembiter config: refreshes in worktree
- AI agent → Git host: creates worktree branch
- AI agent → MR or PR: may open
- MR or PR → Git host: submits branch
