# ztc1522021381/github-repo-publish architecture

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

- Interactive diagram: https://gitdiagram.com/ztc1522021381/github-repo-publish
- Repository: https://github.com/ztc1522021381/github-repo-publish

## Overview

github-repo-publish is an Agent Skill and small Python CLI for auditing and publishing a local Git repository to GitHub, including restricted-network fallback and server-side verification. The documented workflow is audit, check credentials and reachability, create a repository if needed, push through a selected transport, then verify remote state. The CLI implementation is partly sampled; capability nodes share its source path, while links not supported by the excerpts or README are omitted.

Main entry points: [`scripts/gh_repo.py`](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py) (Command-line tool), [`SKILL.md`](https://github.com/ztc1522021381/github-repo-publish/blob/main/SKILL.md) (Publishing instructions), [`references/sandbox-git-pitfalls.md`](https://github.com/ztc1522021381/github-repo-publish/blob/main/references/sandbox-git-pitfalls.md) (Network pitfalls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guidance["Skill guidance"]
  node_skill["Publishing instructions<br/>[SKILL.md]"]
  node_pitfalls["Network pitfalls"]
end

subgraph group_cli["Publishing CLI"]
  node_cli["Command-line tool<br/>[gh_repo.py]"]
  node_audit["Content audit<br/>[gh_repo.py]"]
  node_check["Credential and channel check<br/>[gh_repo.py]"]
  node_create["Repository creation<br/>[gh_repo.py]"]
  node_push["Push orchestration<br/>[gh_repo.py]"]
  node_gitpush["Git push channel<br/>[gh_repo.py]"]
  node_datapush["Git Data API channel<br/>[gh_repo.py]"]
  node_verify["Remote verification<br/>[gh_repo.py]"]
end

subgraph group_external["External systems"]
  node_localrepo[("Local Git repository")]
  node_gcm["Git credential manager"]
  node_github["GitHub API and Git"]
end

node_user(("User or agent"))

node_user -->|"reads guidance"| node_skill
node_user -->|"runs commands"| node_cli
node_skill -.->|"references"| node_pitfalls
node_cli -->|"dispatches"| node_audit
node_cli -->|"dispatches"| node_check
node_cli -->|"dispatches"| node_create
node_cli -->|"dispatches"| node_push
node_cli -->|"dispatches"| node_verify
node_check -->|"gets token"| node_gcm
node_check -->|"probes API and hosts"| node_github
node_create -->|"gets token"| node_gcm
node_create -->|"creates repository"| node_github
node_push -->|"reads HEAD and files"| node_localrepo
node_push -->|"gets token"| node_gcm
node_push -->|"checks remote state"| node_github
node_push -->|"selects channel"| node_gitpush
node_push -->|"selects or falls back"| node_datapush
node_gitpush -->|"pushes HEAD"| node_localrepo
node_gitpush -->|"sends Git push"| node_github
node_datapush -->|"reads Git objects"| node_localrepo
node_datapush -->|"uploads objects and updates ref"| node_github
node_verify -->|"reads HEAD and tree"| node_localrepo
node_verify -->|"gets token"| node_gcm
node_verify -->|"reads ref and tree"| node_github

click node_skill "https://github.com/ztc1522021381/github-repo-publish/blob/main/SKILL.md"
click node_pitfalls "https://github.com/ztc1522021381/github-repo-publish/blob/main/references/sandbox-git-pitfalls.md"
click node_cli "https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py"
click node_audit "https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py"
click node_check "https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py"
click node_create "https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py"
click node_push "https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py"
click node_gitpush "https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py"
click node_datapush "https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py"
click node_verify "https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py"

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_skill,node_pitfalls,node_user toneBlue
class node_cli,node_audit,node_check,node_create,node_push,node_gitpush,node_datapush,node_verify toneAmber
class node_localrepo,node_gcm,node_github toneMint
```

## Components

### Skill guidance

- [Publishing instructions](https://github.com/ztc1522021381/github-repo-publish/blob/main/SKILL.md): `SKILL.md`
- [Network pitfalls](https://github.com/ztc1522021381/github-repo-publish/blob/main/references/sandbox-git-pitfalls.md): `references/sandbox-git-pitfalls.md`

### Publishing CLI

- [Command-line tool](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py): `scripts/gh_repo.py`
- [Content audit](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py): `scripts/gh_repo.py`
- [Credential and channel check](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py): `scripts/gh_repo.py`
- [Repository creation](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py): `scripts/gh_repo.py`
- [Push orchestration](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py): `scripts/gh_repo.py`
- [Git push channel](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py): `scripts/gh_repo.py`
- [Git Data API channel](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py): `scripts/gh_repo.py`
- [Remote verification](https://github.com/ztc1522021381/github-repo-publish/blob/main/scripts/gh_repo.py): `scripts/gh_repo.py`

### External systems

- **Local Git repository**
- **Git credential manager**
- **GitHub API and Git**

### Other components

- **User or agent**

## Connections

- User or agent → Publishing instructions: reads guidance
- User or agent → Command-line tool: runs commands
- Publishing instructions → Network pitfalls: references
- Command-line tool → Content audit: dispatches
- Command-line tool → Credential and channel check: dispatches
- Command-line tool → Repository creation: dispatches
- Command-line tool → Push orchestration: dispatches
- Command-line tool → Remote verification: dispatches
- Credential and channel check → Git credential manager: gets token
- Credential and channel check → GitHub API and Git: probes API and hosts
- Repository creation → Git credential manager: gets token
- Repository creation → GitHub API and Git: creates repository
- Push orchestration → Local Git repository: reads HEAD and files
- Push orchestration → Git credential manager: gets token
- Push orchestration → GitHub API and Git: checks remote state
- Push orchestration → Git push channel: selects channel
- Push orchestration → Git Data API channel: selects or falls back
- Git push channel → Local Git repository: pushes HEAD
- Git push channel → GitHub API and Git: sends Git push
- Git Data API channel → Local Git repository: reads Git objects
- Git Data API channel → GitHub API and Git: uploads objects and updates ref
- Remote verification → Local Git repository: reads HEAD and tree
- Remote verification → Git credential manager: gets token
- Remote verification → GitHub API and Git: reads ref and tree
