madDegen commited on
Commit
61cc7e2
Β·
verified Β·
1 Parent(s): 7068ce3

add org-audit skill

Browse files
plugin/skills/github-org-audit/SKILL.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: github-org-audit
3
+ description: >
4
+ This skill should be used when the user asks to "audit my repos", "clean up the org", "which
5
+ repos are stale", "what open PRs do we have", "find exposed secrets", "repo health check",
6
+ "triage the org", "which repos are missing READMEs", or wants a cross-repository sweep of an
7
+ organization or account. Also triggers on "org audit", "repo inventory", "dead repos", and
8
+ "security sweep".
9
+ metadata:
10
+ version: "0.1.0"
11
+ ---
12
+
13
+ # Org-Wide Repo Audit
14
+
15
+ Sweep every repository under an owner and return a ranked, actionable cleanup list β€” not a data dump.
16
+
17
+ ## Inventory first
18
+
19
+ `search_repositories` with `org:<org>` or `user:<login>`, `minimal_output: false`, `perPage: 100`, paginating until exhausted. Owner-qualified queries work; bare keyword queries do not. Add `fork:true` to include forks β€” omitting it silently drops them.
20
+
21
+ Record per repo: name, private/public, default branch, `updated_at`, `pushed_at`, open issues count, archived flag, fork flag, stars.
22
+
23
+ State the total count found. If it is far below what the user expects, the token's scope is the cause β€” a read-only OAuth app sees only public personal repos. Say that instead of reporting a clean bill of health on an incomplete set.
24
+
25
+ ## Audit dimensions
26
+
27
+ Run these in parallel across the inventory. For an org with 50+ repos, fan out with subagents by repo batch rather than serially.
28
+
29
+ **Staleness** β€” `pushed_at` older than 180 days and not archived. These should be archived or deleted; an unarchived dead repo still shows up in searches and dependency graphs.
30
+
31
+ **Abandoned work** β€” open PRs older than 30 days (`list_pull_requests` state `open`, sorted by created), and branches with no PR whose last commit is older than 90 days. Both are merge-conflict debt accruing interest.
32
+
33
+ **Secret exposure** β€” `run_secret_scanning` where available. Additionally `search_code` across the owner for high-signal patterns: `ghp_`, `github_pat_`, `hf_`, `sk-`, `AKIA`, `PRIVATE KEY`, `SUPABASE_SERVICE_ROLE`, `.env` files committed to the tree. A hit here outranks every other finding in this audit.
34
+
35
+ **Dependency risk** β€” Dependabot alerts by severity (`dependabot` toolset). Report Critical and High only; Moderate and Low are noise at org scale.
36
+
37
+ **Code scanning** β€” open code-scanning alerts, Critical and High only.
38
+
39
+ **Hygiene** β€” missing README, missing LICENSE, missing description, no topics, no default branch protection on repos with more than one contributor, `.github/workflows` present but last run failed.
40
+
41
+ **Duplication** β€” near-identical repo names or descriptions (forks of the same upstream, `-copy`, `-old`, `-backup`, hash-suffixed names). These are usually accidental and safe to consolidate.
42
+
43
+ ## Ranking
44
+
45
+ Order the output by expected cost of inaction, not by severity label:
46
+
47
+ 1. Exposed live credential β€” rotate immediately, named repo and file path.
48
+ 2. Critical dependency or code-scanning alert on a repo that is actually deployed.
49
+ 3. Missing branch protection on a production repo.
50
+ 4. Open PR older than 90 days on an active repo.
51
+ 5. Stale/dead repo to archive.
52
+ 6. Cosmetic hygiene gaps, batched into one line.
53
+
54
+ A finding without a named repo and a next action does not belong in the output.
55
+
56
+ ## Output format
57
+
58
+ A table for the ranked findings, then a short "batch actions" section listing the fixes that can be applied in bulk (archive these 12, add README to these 8). Offer to execute the batch β€” do not execute it unprompted. Archiving is not reversible from this session.
59
+
60
+ Close with the count of repos scanned versus the count the token could see, so the coverage gap is explicit.
61
+
62
+ ## Cost discipline
63
+
64
+ An org sweep can consume enormous context. Keep `minimal_output: true` on every search that is not the initial inventory, cap `perPage` at 100, never read file contents during the sweep β€” search only β€” and summarize per repo to a single row before moving on. If the owner has more than 100 repos, confirm scope with the user before starting.