gh-org-chart
Skill15 starsChanged 9 days agoMITView on GitHub
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) and is hand-editable. Triggers: "org chart", "team chart", "visualize github org", "who owns this repo", "github team hierarchy", "/gh-org-chart"
In this repository31 other files it gives its agents.
- claude-permissions-auditSkill
- claude-skill-orchestration-auditSkill
- claude-skill-prereq-auditSkill
- claude-skill-spec-auditSkill
- dev-cli-consistency-auditSkill
- dev-code-qualitySkill
- dev-new-toolSkill
- dev-software-designSkill
- gh-dep-pr-triageSkill
- gh-issue-reportSkill
- gh-oss-go-bumpSkill
- gh-oss-release-prepSkill
- gh-oss-releaseSkill
- gh-review-triageSkill
- git-conventional-commitSkill
- gws-meeting-schedulerSkill
- p-activity-digestSkill
- p-blog-post-miningSkill
- p-blog-writerSkill
- p-clipboard-copySkill
- p-daily-reflectionSkill
- p-daily-reportSkill
- p-daily-standupSkill
- p-ego-searchSkill
- p-md-to-slidesSkill
- p-meeting-prepSkill
- p-news-briefingSkill
- project-namerSkill
- p-slack-triageSkill
- p-violentmonkey-userscript-syncSkill
- restaurant-searchSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Resolve org: if provided as argument, use it.
- Very specific: line 49
Verify auth: run gh auth status. Confirm read:org is in the scopes line.
- Very specific: line 56
If --refresh was passed, or the file does not exist, or its mtime is older than 24h, run collect (Phase 3).
- Very specific: line 70
Run the bundled collect script (handles zsh noclobber via rm -f):
- Very specific: line 111
CODEOWNERS attribution: only @<org>/<team-slug> owners produce attributions.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Org Chart
Produces two artifacts in ${TMPDIR:-/tmp}/gh-org-chart/:
<org>-org.json— canonical data: teams, members (with role), repos (witharchivedflag and permission), CODEOWNERS paths. Cache + hand-editable source of truth.<org>-org.html— single self-contained interactive explorer rendered from the JSON. Opens viafile://, works offline.
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
/gh-org-chart— prompt for org./gh-org-chart <org>— render-if-fresh: if<org>-org.jsonexists andmtimeis within 24h, re-render from it. Otherwise collect, then render./gh-org-chart <org> --refresh— force re-collect./gh-org-chart <org> --no-codeowners— skip CODEOWNERS scan (faster on big orgs)./gh-org-chart <org> --no-members— drop members from collection and output.
Phase 1: Intake
- Resolve org: if provided as argument, use it. Otherwise ask:
Which GitHub org should I chart?
- Verify auth: run
gh auth status. Confirmread:orgis in the scopes line. If not, instruct:gh auth refresh -s read:orgthen re-run the skill.
Phase 2: Decide collect vs. reuse
- Locate
$OUT_DIR/<org>-org.json. If
--refreshwas 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:
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
Run the bundled collect script (handles zsh
noclobberviarm -f):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
$FLAGSis built from--no-codeownersand--no-membersif 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
Run the renderer:
python3 "${CLAUDE_SKILL_DIR:-$HOME/.claude/skills/gh-org-chart}/scripts/render.py" \ "$OUT_DIR/$ORG-org.json"This writes
<org>-org.htmlnext to the JSON (i.e. in$OUT_DIR).Open it (macOS):
open "$OUT_DIR/$ORG-org.html"Other platforms: report the path so the user can open it themselves.
Phase 5: Report
- Summarize (set
JSON="$OUT_DIR/$ORG-org.json"):- Teams:
jq '.teams | length' "$JSON" - Owned repos (admin or maintain):
jq '[.teams[].repos[] | select(.permission == "admin" or .permission == "maintain") | .name] | unique | length' "$JSON" - CODEOWNERS path attributions:
jq '[.teams[].repos[].codeowner_paths // [] | length] | add // 0' "$JSON" - Member entries:
jq '[.teams[].members[]] | length' "$JSON"(omit if--no-members). - Whether the JSON was freshly collected or reused from cache.
- Teams:
Notes
- Hand-editing the JSON: edits survive across
/gh-org-chart <org>runs because the freshness check reuses the file. Use--refreshwhen you want collection to overwrite your edits. - CODEOWNERS attribution: only
@<org>/<team-slug>owners produce attributions. Individual user owners (@alice) and external orgs (@other-org/team-x) are intentionally ignored — this is a team-ownership view. - No reporting lines: GitHub teams reflect permission grouping, not management hierarchy. Manager → report relationships need a different data source (HRIS).
- Performance: CODEOWNERS scan is restricted to owned repos (permission ≥ maintain) to keep API calls bounded. Collecting roles adds one
?role=maintainercall per team. - Data shape (for hand-editing / jq):
membersis[{login, role}]whereroleis"maintainer"or"member"; each repo carriespermissionand anarchivedflag.--no-membersleavesmembersempty.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

