inspect-repository
Read and analyze the source of any repository on GitHub or on another forge this install serves (GitLab) — public or one this install has a token for — without a local checkout. The broker sends one revision's files; use it to answer questions about code, not to change it.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 126
- Forks
- 44
01 前言 Front Matter
- name
- inspect-repository
- description
- Read and analyze the source of any repository on GitHub or on another forge this install serves (GitLab) — public or one this install has a token for — without a local checkout. The broker sends one revision's files; use it to answer questions about code, not to change it.
02 资源文件 2
- 脚本scripts/inspect_repository.py15.5 KB
- 脚本scripts/test_inspect_repository.py4.2 KB
03 SKILL.md 正文
inspect-repository - Read a repository this pod has no checkout of
This pod has no git of its own and no .git anywhere it can write. To read
somebody else's code, ask the credential broker for a snapshot: the files of one
revision, sent back as a tar. What lands locally is source without a repository
around it: files you can open, grep and reason about, and no .git/config for
anything to execute out of.
The script is /opt/data/profiles/platform/skills/inspect-repository/scripts/inspect_repository.py. It prints one JSON
object on stdout.
When to Use
- Answering a question about code you do not have. "How does upstream implement this controller?", "which release added this flag?"
- Reading a dependency or an upstream project named in an issue, a design doc, or a user's question.
- Reading the GitOps repository or a context repository when you are not editing it.
- Tracing a diagnosis into a repository you do not write. The chart a
HelmReleaseinstalls, the module a Terraform root calls, a context repository on the preflight'sCONTEXT:line: read it here to name the file and line the fix belongs in (SOUL.md§3, item 8). The broker presents a context repository's read-only credential and no other.
When NOT to Use
- Changing a repository. Use submit-suggestion (a pull request against the GitOps repo) or fleet-audit (fixes for its own findings). A snapshot has no history and cannot be committed from.
- Reading a file the GitOps workflow already handed you.
fleet-auditgives you a leased clone andsubmit-suggestionpreparegives you the copy it cloned; read theirs rather than taking a second copy of the same repository.
Copy the tree
python3 /opt/data/profiles/platform/skills/inspect-repository/scripts/inspect_repository.py clone --repo kubernetes-sigs/kustomize
Copies into /opt/data/scratch/repos/<owner>__<name> unless --into names
somewhere else, and prints written, bytes, skipped, complete and sha,
the commit the copy was taken from. --ref names a branch or a tag; without
it, the copy is of the branch the broker pins the repository to, else the
remote's default branch.
A large repository is refused whole with SNAPSHOT_TOO_LARGE. Name the
part you need with --prefix, a directory or a file, and repeat with --force
into the same --into for each further part:
python3 /opt/data/profiles/platform/skills/inspect-repository/scripts/inspect_repository.py clone --repo kubernetes-sigs/kustomize --prefix api --into ./src
python3 /opt/data/profiles/platform/skills/inspect-repository/scripts/inspect_repository.py clone --repo kubernetes-sigs/kustomize --prefix kustomize/commands/build --into ./src --force
Compare the sha of each part. If they differ, the branch moved between the
copies; take every part again into an empty --into. --force replaces what
the new copy holds and never removes a file the new commit no longer has.
Rules
- Read a repository only through
clone. Do not download its files from the forge's raw, codeload or API hosts (raw.githubusercontent.com,api.github.com), withcurlor a script, and do not rungit clone. A direct download skips the install's host allowlist and the checksclonemakes on every file, and it can read a different revision than the one you report. Ifclonefails, report its error. - Never invent a path. Name a
--prefixthat the repository's layout, a README, or an earlier copy showed you. A prefix that names nothing at that commit giveswritten: 0andmissing; it is not proof that the code does not exist under another name. - Read
completeandskippedbefore you conclude anything.skippedlists what was not written, each with the reason:symlink, a symbolic link (the file it names is not copied; if it is in the repository, take it with its own--prefix), ornotAFile, a directory laid out as a bare repository. A copy of one--prefixis a copy of part of a repository: "the repository does not contain X" is not a claim it supports. - Do not run
gitagainst what lands. There is no repository there, on purpose. - Say which repository, ref and
shain anything you report. A snapshot is one commit on one branch.
Reference
| Flag | What it does |
|---|---|
--repo |
owner/name on GitHub, or <host>/<path> on another forge |
--ref |
Branch or tag to read |
--prefix |
Copy only this directory or file |
--into |
Destination directory; must be empty unless --force |
--force |
Write into a non-empty directory; replaces a file or link, refuses a file-directory clash |
--max-files/--max-bytes |
Refuse a copy over this many files or bytes; nothing is written |
--depth |
Accepted and not needed: a snapshot is always one revision |
--lease |
Directory mode only: the lease the leased checkout is taken under |
On an install with no broker, clone
reports "mode": "directory" and hands back a leased checkout on the shared
volume. Read the files in that checkout directly and do not commit in it.
04 同仓库更多 Skills
gke-workload-troubleshooting
Diagnoses GKE workload failures (CrashLoopBackOff, OOMKilled, ImagePullBackOff, Pending, etc.) via logs and events. Use when pods fail to start or crash repeatedly. Don't use for GKE cluster infrastructure provisioning, node pool creation, or non-Kubernetes Google Cloud services.
gke-workload-security
Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running security audits (`audit_cluster.sh`), enforcing Network Policies (default-deny and Dataplane V2 logging), isolating high-risk pods inside GKE Sandbox (`gVisor`), enforcing Pod Security Standards (`restricted` labeling) and pod securityContext, and mounting Secret Manager secrets via CSI (`SecretProviderClass`). Use when auditing workload security posture, isolating namespaces, applying pod security standards, or configuring network policies and secret volume mounts. Don't use for Workload Identity (use gke-workload-identity), cluster-wide control plane security, RBAC hardening, Binary Authorization, Shielded Nodes, or enabling platform-level GKE add-ons (use gke-platform-security instead).
gke-workload-scaling
Manages scaling for GKE workloads using HPA and VPA. Use when configuring Horizontal Pod Autoscaler (HPA), configuring Vertical Pod Autoscaler (VPA), or applying best practices for GKE workload autoscaling. Do not use for cluster-level autoscaling (Cluster Autoscaler), static cluster sizing, or configuring node-level machine styles directly.
gke-workload-identity
Configures and diagnoses Workload Identity Federation for GKE authentication failures for Pods (403 "iam.serviceAccounts.getAccessToken" / permission denied, "could not find default credentials", or GKE metadata server unreachable) by verifying cluster and node-pool Workload Identity configuration, the Kubernetes ServiceAccount (KSA) to IAM binding (direct principal binding and legacy Google ServiceAccount impersonation), target-resource IAM roles, and gke-metadata-server health. Use when setting up KSA/GSA bindings (`roles/iam.workloadIdentityUser`, `iam.gke.io/gcp-service-account`) or when a Pod cannot authenticate to Google Cloud APIs. Don't use for in-cluster Kubernetes RBAC errors (API-server authorization), general workload crashes (use gke-workload-troubleshooting), or Pod Security Standards and NetworkPolicies (use gke-workload-security).
gke-upgrades
Plans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades and maintenance operations for both Standard and Autopilot clusters. Produces upgrade plans, pre/post-upgrade checklists, maintenance runbooks with gcloud commands, release channel strategy, and troubleshooting guides. Handles node pool upgrade strategies (surge, blue-green), version compatibility, PDB management, and workload-specific concerns (stateful, GPU, operators). Use this skill whenever the user mentions GKE upgrades, Kubernetes version bumps, node pool maintenance, GKE patching, cluster version management, release channel selection, maintenance windows, surge upgrades, stuck upgrades, or any GKE lifecycle management task — even casual mentions like "we need to upgrade our clusters" or "plan our next GKE maintenance" or "our upgrade is stuck." Don't use for GKE cluster creation, application onboarding, general networking/routing setup, or security policy configurations (use gke-basics or relevant GKE skills instead).
gke-tpu-metrics-monitoring
Monitors and troubleshoots GKE TPU workloads, nodes, and node pools using GKE system metrics and PromQL. Use when monitoring TensorCore duty cycle, TPU memory, node readiness, multi-host TPU node pool availability, host maintenance or preemption interruptions, and calculating MTTR or MTBI metrics for GKE TPUs. Don't use for general non-TPU GKE workload monitoring or non-metric TPU debugging.