Gh org chart

From jackchuka/skills · View interactive version

Gh org chart is an AI agent skill from the GitHub repository jackchuka/skills. Generate an interactive HTML org explorer from a GitHub organization. Surfaces team hierarchy, members, owned repos, and CODEOWNERS path attributions. Two stages: collect.sh writes a canonical JSON, render.py emits a self-contained HTML file. The JSON is the cache (mtime ≤ 24h skips re-collection) a

How to use this skill

Skill file

GitHub Org Chart

Produces two artifacts in ${TMPDIR:-/tmp}/gh-org-chart/:

Set OUT_DIR once at the start of every phase and reuse it:

OUT_DIR="${TMPDIR:-/tmp}/gh-org-chart"
mkdir -p "$OUT_DIR"

Arguments

Phase 1: Intake

  1. Resolve org: if provided as argument, use it. Otherwise ask:

> Which GitHub org should I chart?

  1. Verify auth: run gh auth status. Confirm read:org is in the scopes line. If not, instruct:

> gh auth refresh -s read:org

then re-run the skill.

Phase 2: Decide collect vs. reuse

  1. Locate $OUT_DIR/<org>-org.json.
  2. If --refresh was passed, or the file does not exist, or its mtime is older than 24h, run collect (Phase 3). Otherwise skip to Phase 4.

Freshness check:

```bash

JSON="$OUT_DIR/$ORG-org.json"

if [[ "$REFRESH" == "1" ]] || [[ ! -f "$JSON" ]] || \

[[ $(($(date +%s) - $(stat -f %m "$JSON" 2>/dev/null || stat -c %Y "$JSON"))) -gt 86400 ]]; then

NEEDS_COLLECT=1

fi

```

Phase 3: Collect

  1. Run the bundled collect script (handles zsh noclobber via rm -f):

```bash

rm -f "$OUT_DIR/$ORG-org.json"

"${CLAUDE_SKILL_DIR:-$HOME/.claude/skills/gh-org-chart}/scripts/collect.sh" \

"$ORG" $FLAGS > "$OUT_DIR/$ORG-org.json"

```

Where $FLAGS is built from --no-codeowners and --no-members if set. CODEOWNERS scanning is the long pole — expect ~1 API call per owned repo. Big orgs (200+ owned repos with rate limiting): consider --no-codeowners.

Phase 4: Render

  1. Run the renderer:

```bash

python3 "${CLAUDE_SKILL_DIR:-$HOME/.claude/skills/gh-org-chart}/scripts/render.py" \

"$OUT_DIR/$ORG-org.json"

```

This writes <org>-org.html next to the JSON (i.e. in $OUT_DIR).

  1. Open it (macOS):

```bash

open "$OUT_DIR/$ORG-org.html"

```

Other platforms: report the path so the user can open it themselves.

Phase 5: Report

  1. Summarize (set JSON="$OUT_DIR/$ORG-org.json"):

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.