/ai-native-toolkit:repostatefrom ai-native-toolkit
Generates a read-only org-wide repo state report for GitHub or GitLab: open PRs/MRs, CI status on default branch, security alerts/vulnerabilities, and branch protection. Reports no-access endpoints explicitly.
Ships in ai-native-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
reposync answers "do I have all the code locally and up to date?" repostate
answers the companion question: "across everything I can see, what needs
attention right now?" It is read-only - it never clones, pulls, or mutates
anything.
It reuses reposync's discovery so the team-union / org-repo-list logic lives in
exactly one place: repostate shells out to reposync --porcelain to get the
deduplicated repo list, then queries each repo's remote state over gh api
(GitHub) or glab api (GitLab, --provider gitlab).
| Signal | Source | Reported as |
|---|---|---|
| Open PRs | repos/{o}/{r}/pulls?state=open | count (drafts noted) |
| CI on default branch | latest completed run per workflow on the default branch | pass / fail (names the failing workflows) / none |
| Security alerts | Dependabot + code-scanning + secret-scanning, ?state=open | three counts, or n/a (no-access) |
| Branch protection | repos/{o}/{r}/branches/{default}/protection, then repos/{o}/{r}/branches/{default} on a 404 "Not Found" | protected / unprotected / unknown |
| Signal | Source (projects/{url-encoded path}/...) | Reported as |
|---|---|---|
| Open MRs | merge_requests?state=opened, every page | count (drafts noted) |
| Pipeline on default branch | pipelines?ref={default}, newest finished of the last 20 | success / failed / none / unknown / empty |
| Vulnerabilities | vulnerabilities, state detected or confirmed | count, or no-access |
| Branch protection | protected_branches (wildcards such as release/* honoured), then protected_branches/{default} | protected / unprotected / unknown / empty |
The table gains a Branch column naming each project's default branch, and the PRs column becomes MRs.
The pipeline mirrors the GitHub latest-completed rule: only success and
failed count as finished. running, pending, canceled, skipped and
manual pipelines are passed over, so a newer in-flight or cancelled pipeline
cannot hide a failure from Needs attention. A cancelled pipeline says nothing
about whether the code passes, which is why it is skipped like skipped and
manual. With no finished pipeline among the last 20 the column reads none.
A project with no commits (a null default branch, or empty_repo: true from
GitLab even when a branch name is set) is empty. Its Branch, Pipeline and
Protection cells read empty, no pipeline or protection call is made, and the
headline counts it. Emptiness alone does not put it under Needs attention:
pipeline and protection are not judged, but merge requests and vulnerabilities
are still queried, and open vulnerabilities GitLab kept from earlier scans
still list it. (reposync's discovery already skips projects listed as empty,
so this covers a project emptied between discovery and the query.)
no-access on vulnerabilities is the common case, not a fault: it means the
tier, the role, or the endpoint being unavailable on this GitLab version
(GitLab documents the REST projects/:id/vulnerabilities endpoint as
deprecated).
After the per-repo table, the report adds one section for settings that are set once for a whole org or group rather than per repository. It never changes the per-repo table, headline or Needs attention list.
| Field | GitHub (per org) | GitLab (per group) |
|---|---|---|
two_factor | orgs/{org} two_factor_requirement_enabled (owners only) | groups/{id} require_two_factor_authentication |
push_rules | org rulesets with target push; off unless one is active | groups/{id}/push_rule: the enabled rules (a paid tier) |
default_branch_protection | active org branch rulesets on ~DEFAULT_BRANCH (or ~ALL) of ~ALL repositories, read in full from orgs/{org}/rulesets/{id} | groups/{id} default_branch_protection, else default_branch_protection_defaults |
rulesets | orgs/{org}/rulesets: count, names and enforcement | always unknown: GitLab has no group rulesets |
On GitLab the section covers --group, or each group you belong to whose
parent group you do not belong to. A GitHub personal account has no org settings, so its four fields read
unknown (personal account: no org settings). If the GitLab group list
cannot be read, the section still appears, as one entry for the host with
every field unknown (group list unreadable). On GitLab,
default_branch_protection reads off only when developers can push and
force push is allowed; force push allowed with stricter push access is
appended as force push: allowed. The field names are the same on both providers.
On GitHub, push_rules reads off when no push ruleset is active; any
disabled or evaluate push rulesets are named after it, as in
off (not active: no-big-files (disabled)), and still count as off.
default_branch_protection matches rulesets by name targeting only: a
ruleset counts when conditions.repository_name.include contains ~ALL.
Exclusions (repository_name.exclude) are not evaluated, so ruleset: <name>
can overstate coverage, and a ruleset that reaches every repository through
repository_property or repository_id targeting is not counted, so the
field can read off while such a ruleset applies.
Every value is the setting's value, off, or unknown with the reason
(denied: no access or tier (HTTP 403), not found: no access, tier, or endpoint missing (HTTP 404), no access: readable by org owners only,
unreadable response). An unreadable value is never off: a non-owner on
GitHub reads two_factor: unknown, and on GitLab a 404 from push_rule
(which GitLab also answers when no rule is set) is unknown. The section's
own headline counts off and unknown separately, so an unreadable setting
is never counted as off.
GitHub teams for /fleet. The GitHub org fragment (settings/org.json in a
--keep-fragments capture) also carries teams, [{slug, parent, repos}],
from orgs/{org}/teams and each team's orgs/{org}/teams/{slug}/repos:
parent is the parent team's slug or null, repos the repository names.
fleet.py --settings reads it to place repositories in the units tree. It is
not a setting, so the report does not show it. The key is written only when
the team list and every team's repository list were read; an unreadable one
leaves it out (with a note on stderr), so an unread team list never reads as
no teams. A personal account has no teams, so its fragment has no teams key
and no note. GitHub's "List team repositories" docs do not say whether a child
team's list also holds the repositories it inherits from its parent (only
"Check team permissions" says inherited repositories are checked), so a repository a team lists with the same role as its parent
team is taken as inherited and kept on the parent only: each repository stays
with the most specific team that holds it directly. A child granted another
role keeps it; one granted directly with the parent's role cannot be told
apart from inheritance and stays on the parent. Team slugs are identities, and the fragment holds them in clear. In
/fleet's fleet-data.json, each team unit's key carries its slug
(ownership/acme/platform) in clear by default; --full also writes the
unit's name (the slug) and owners (@acme/platform), which counts-only output
drops. With --hash-paths or --hash-salt the slug is hashed with the unit
key and no name or owner is written.
Security-alert and branch-protection endpoints require admin on the repo. When
the caller is denied (403/404), repostate reports n/a (alerts) or
unknown (protection) - never a clean 0. Reporting "no access" as "no
problems" would be a dangerous lie, so the two are kept distinct. Only a 404
"Branch not protected" reads unprotected straight away: a token without admin
gets 404 "Not Found" on a protected branch too, so that answer asks the branch
read, which needs only read access. Its protection.enabled gives protected
or unprotected; a refused or silent branch read stays unknown. A repo whose
own metadata can't be read at all is listed as could not assess.
On GitLab the rule is stricter: any failed call (401, 403, 404, 500,
or a body that is not a list) is no-access or unknown. GitLab answers
404 for a resource the token cannot see, so a 404 never means
"unprotected" or "zero". The headline names how many projects had an
unreadable MR or vulnerability count, so a total of 0 is not read as clean.
The script lives next to this file. Claude Code writes this skill's directory into the script paths below when it loads the skill, so each path is already absolute:
# Org is derived from the directory you run in, exactly like reposync. To report
# on the "meridianhub" org, run from a directory named meridianhub:
cd ~/dev/github.com/meridianhub
bash "${CLAUDE_SKILL_DIR}/scripts/repostate.sh"
Override the org or target directory explicitly when they differ:
bash "${CLAUDE_SKILL_DIR}/scripts/repostate.sh" --org meridianhub --root ~/dev/github.com/meridianhub
On GitLab, name the host; --group narrows the run to one group's subtree:
bash "${CLAUDE_SKILL_DIR}/scripts/repostate.sh" --provider gitlab --host gitlab.example.com
bash "${CLAUDE_SKILL_DIR}/scripts/repostate.sh" --provider gitlab --host gitlab.example.com --group platform/backend
org-state-<org>-<date>.md in the root) for the
full per-repo table.| Flag | Effect |
|---|---|
--provider P | github (default) or gitlab |
--org NAME | GitHub: org or personal account to report on (default: basename of --root / cwd) |
--host HOST | GitLab: the host (default gitlab.com); a URL form such as https://gl.example.com/ is accepted |
--group PATH | GitLab: report on this group and its subgroups only |
--root DIR | Org root; also where the report file is written (default: cwd) |
--limit N | Only the first N repos (quick test against a large org) |
--quiet | Suppress the per-repo progress dots; keep the summary and file |
--no-file | Terminal only; do not write the markdown file |
--render-dir DIR | Skip discovery + querying and render a report from a directory of previously-collected per-repo JSON fragments (replay / testing); org or group settings fragments are read from its settings/ subdirectory |
--keep-fragments DIR | Live run: keep the per-repo fragments and the settings/ subdirectory in DIR (created if missing; must be empty) in exactly the layout --render-dir reads. See Capture and replay |
To keep a live run's data and re-render it later without any API call, capture
it with --keep-fragments, then replay it with --render-dir:
repostate.sh --org acme --keep-fragments ./acme-capture # live run, fragments kept
repostate.sh --org acme --render-dir ./acme-capture # same report, no API calls
Pass the same --org (GitHub) or --provider gitlab --host HOST [--group PATH]
(GitLab) to the replay: the report title and file name come from those flags,
not from the fragments. On the same day the replay prints the same per-repo
rows, headline and settings section as the live run, and writes the same
markdown file. The capture directory must be new or empty, because a replay
reads every *.json in it as a repository row; a stale fragment from an
earlier run would otherwise appear in the report. --keep-fragments cannot be
combined with --render-dir.
A capture writes a CAPTURE_COMPLETE marker file (not *.json, so it is never
read as a fragment) once every fragment is in place. A run that stops earlier
leaves no marker, and --render-dir on that directory prints a warning on
stderr that the report may be partial. Delete an interrupted capture and
capture again. A hand-written fragment directory has no marker either, so
replaying one shows the same warning; the report itself is unchanged.
--no-file): org-state-<org>-<YYYY-MM-DD>.md in the root,
with the full table and per-section detail. On GitLab <org> is the host,
plus the group with / written as - when --group is given.gh and jq on PATH, and gh auth status authenticated (the
same prerequisites as reposync; discovery is delegated to it). A GitLab run
never calls gh.GH_HOST or gh auth login --hostname
first, as with reposync.glab and jq on PATH, and glab auth status --hostname <host>
authenticated. reposync's preflight checks this first: an unauthenticated or
unreachable host exits non-zero with one error line naming the host, before
any API call.jq
separately (winget install jqlang.jq); Git Bash does not include it.
Installs and PATH notes: the Windows setup guide.jq 1.6 or later. An endpoint that answers with an empty or non-JSON body
reads as unreadable (unknown / no-access) on every jq version.--limit to sample.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
org-health-report, repo-audit, github, gitlab, security-alerts
npx claudepluginhub bjcoombs/ai-native-toolkit --plugin ai-native-toolkit21 skills in this plugin
/6hatsSix Thinking Hats Analysis/ab-equivalenceCompare two versions of an LLM-directed document - an original (teacher) and a candidate (student) - across a transfer set and return a per-case behavioural-equivalence verdict plus an efficiency signal. A transform-agnostic library capability other skills compose to gate a transform on behavioural sameness. TRIGGER when asked to A/B test two versions of a prompt / instruction / skill, to check whether a rewritten or compressed document still behaves the same as the original, to validate behavioural equivalence between two document versions, to gate a transform on no-regression, or when a skill needs the run-the-runner-on-both-versions-and-judge-equivalence capability./assessOther plugins' skills for the same job