repo-maintainer
Skill0 starsChanged 4 months agoMITView on GitHub
Use when cleaning up, organizing, merging, archiving, renaming, standardizing, or refactoring GitHub repositories and local codebases. Triggers on phrases like "整理github仓库", "整理代码", "合并仓库", "归档项目", "统一README", "仓库重命名", and "repo cleanup".
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
4 other projects use a version of this.
Adopted by
Most recently taken up by
- Wolfe-Jam/faf-skillstheir own version, first seen Nov 13, 2026
- freanocank/repo-maintainerword for word, first seen Oct 25, 2026
- BaoBao1996121/crazy-harnesstheir own version, first seen Oct 20, 2026
- duolahypercho/codex-routertheir own version, first seen Oct 8, 2026
Other versions4 projects use a version of this.
Word for word · 1
- freanocank/repo-maintainer★ 0100% same
Edited · 0
None found.
Wrote their own version · 3
- duolahypercho/codex-router★ 4ksame name
- Wolfe-Jam/faf-skills★ 4same name
- BaoBao1996121/crazy-harness★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 17 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
17
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 16
Use the authenticated GitHub CLI session for every remote GitHub operation:
- Very specific: line 24
Do not request, retrieve, accept, print, or pass a separate access token.
- Distinctive: line 28
Every repository — new or old, active or archived — must have these four foundation documents.
- Distinctive: line 49
Check for each repo:
- Distinctive: line 91
When 2+ repos are variants of the same system (different backends, engines, adapters):
- Very specific: line 94
Create a new clean repo (no history).
- Distinctive: line 106
Keep repos independent. Add submodules in parent.
- Distinctive: line 109
Do not merge. Add cross-links in READMEs.
- Distinctive: line 111
If history contains secrets: Always create a new clean repo and copy current snapshot (via zip download + re-commit).
- Distinctive: line 118
All lowercase, hyphens only
- Very specific: line 120
Remove redundant words (based-on, design-and-development)
- Very specific: line 121
Add outdated suffix to archived repos if not already present
- Distinctive: line 127
After remote structure is clean, refactor code inside repos:
- Distinctive: line 135
When the user downloads code locally, makes heavy changes (file renames, variable renames, structural rewrites), and needs to push back to …
- Distinctive: line 226
If the rewrite is so radical it is essentially a new project:
- Very specific: line 227
Create a new repo with gh repo create OWNER/REPO --description "..." (never omit the description)
- Distinctive: line 251
If user already mixed everything in working tree:
- Distinctive: line 281
After pushing, verify Git correctly tracked renames:
- Distinctive: line 285
If history is broken (shows file as brand new), the rename and content change were committed together.
- Very specific: line 289
GitHub authentication: Always use gh auth status and the existing GitHub CLI credential store.
- Very specific: line 290
Expired login: If gh auth status fails, stop remote operations and instruct the user to run gh auth login.
- Distinctive: line 292
Public secret history: If a public repo ever committed API keys, deleting the repo is the only way to purge history from GitHub.
- Distinctive: line 293
Archived public repos with secrets: If deletion is unacceptable, at minimum remove the repo from public visibility (make private) or delete …
- Very specific: line 305
When using Invoke-RestMethod in PowerShell with JSON bodies containing backticks or triple backticks, prefer Python scripts for content …
- Very specific: line 316
Create repo (never omit description):
- Distinctive: line 321
Create or update foundation files:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Repository Maintainer
Systematic workflow for transforming fragmented GitHub profiles into clean, maintainable, professional repositories.
Overview
Execute cleanup in 6 phases. Skip phases not applicable. Always get user confirmation on destructive actions (deletion, renaming, merging).
Authentication (Required)
Use the authenticated GitHub CLI session for every remote GitHub operation:
gh auth status
# If authentication is missing or expired:
gh auth loginDo not request, retrieve, accept, print, or pass a separate access token. Use gh repo, gh api, and normal authenticated git commands. If gh auth status fails, stop remote work and report the login gap.
Core Principles (Non-Negotiable)
Every repository — new or old, active or archived — must have these four foundation documents. Do not consider a cleanup complete until all four are verified.
| Document | Rule | Why |
| LICENSE | Every public repo gets a LICENSE. Default to MIT unless user specifies otherwise. | Without a license, code is "all rights reserved" by default. Nobody can legally use it. |
| README.md | Must exist with at least: project name, one-sentence description, and usage/install instructions if applicable. | The first thing every visitor sees. An empty or missing README signals abandonment. |
| .gitignore | Must match the primary language (Python/PHP/Node/etc.). Never commit build artifacts, cache, env files, or IDE configs. | Prevents accidental leakage of secrets and keeps diffs readable. |
| GitHub Description | The description field must never be empty. One sentence, plain English (or matching repo language). | Appears in search results, profile pins, and social cards. |
If a repo is missing any of the four, fixing it takes priority over merging, renaming, or refactoring.
Phase 1: Scan & Diagnose
Fetch the complete owned-repository list through GitHub CLI:
gh api --paginate "user/repos?per_page=100&affiliation=owner" --jq '.[]'
# Or generate the bundled cleanup report for the authenticated user:
python scripts/repo_analyzer.pyCheck for each repo:
- Missing
LICENSE,.gitignore,README.md - Empty
descriptionfield - Naming inconsistencies (mixed case, overly long names)
- Obvious duplicates or series (e.g.,
project,project-v2,project-mineru) - Names containing
outdated,deprecated,old,test
Phase 2: Standardize Foundation Files
For every active repo, ensure minimum file set exists:
| File | Rule |
LICENSE | Default to MIT unless user specifies otherwise |
.gitignore | Match primary language (Python/PHP/Node) |
README.md | Must exist; rewrite if only placeholder |
| GitHub Description | One-sentence summary via GitHub CLI |
Bulk update with the bundled GitHub CLI-backed script:
python scripts/bulk_file_updater.py repo1,repo2 allCritical: PowerShell here-strings corrupt triple-backtick code blocks in Markdown. Use Python scripts for bulk README generation to avoid ` → ``` escaping failures.
Phase 3: Handle Outdated Repos
Decision tree:
| Condition | Action |
Name contains outdated / deprecated / old | Archive or delete |
| Superseded by newer repo | Archive + README successor link |
| Public repo history contains leaked secrets (API keys) | Delete (archive leaves history intact) |
| Private repo contains keys, passwords, private config, or personal data | User may ignore leakage rules; treat as acceptable private state unless they ask to sanitize |
| Useful as reference but unmaintained | Archive |
Archived repos are read-only. To modify one, run gh repo unarchive OWNER/REPO --yes, make the changes, then run gh repo archive OWNER/REPO --yes.
Phase 4: Merge Related Repositories
When 2+ repos are variants of the same system (different backends, engines, adapters):
Option A — Monorepo (Recommended)
Create a new clean repo (no history). Place each variant in engines/{name}/ subdirectory.
project-suite/
├── main.py # default engine
├── engines/
│ ├── babeldoc/
│ └── mineru/
└── README.mdPreserve each engine's entry point and config. Update root README to explain switching.
Option B — Git Submodule Keep repos independent. Add submodules in parent. Use when history preservation matters more than simplicity.
Option C — Keep Independent + Link Do not merge. Add cross-links in READMEs. Use when variants have diverged significantly.
If history contains secrets: Always create a new clean repo and copy current snapshot (via zip download + re-commit). Do not use git merge or git submodule as history leaks will persist.
Phase 5: Rename Repositories
Rename with gh repo rename NEW-NAME --repo OWNER/OLD-NAME --yes.
Guidelines:
- All lowercase, hyphens only
- Max 3-4 words
- Remove redundant words (
based-on,design-and-development) - Add
outdatedsuffix to archived repos if not already present
GitHub automatically redirects old URLs for a period, but bookmarks and scripts may break. Confirm with user before renaming starred/forked repos.
Phase 6: Code-Level Refactoring
After remote structure is clean, refactor code inside repos:
- Unified terminology — Replace hardcoded brand names with generic terms (
GPTProcessor→LLMProcessor) while preserving actual API model IDs (gpt-4,gpt-5). - File renaming — Clone the repository, use
git mv, commit, and push through the authenticated Git/GitHub CLI setup. - Directory reorganization — Use
engines/,variants/, orcore/+adapters/patterns for multi-flavor projects.
Pushing Large Local Refactors to Remote
When the user downloads code locally, makes heavy changes (file renames, variable renames, structural rewrites), and needs to push back to the remote repo.
Pre-Push Secret Scan (MANDATORY)
推送前必须先扫描 secret 泄露,有任何发现立即报告,禁止继续 push。
Private repo exception: 如果目标仓库确认是 private,可以无视 key、密码、私有配置、个人信息以及其他敏感信息泄露规则。扫描可以作为提醒,但命中不阻断 push、不要求删库重建、不要求替换为环境变量,除非用户明确要求清理或计划改成 public。
扫描模式(两道都要跑——只跑 token 正则会漏掉明文密码):
① 高熵 token / API key:
grep -rn "sk-[A-Za-z0-9]\{20,\}\|ghp_[A-Za-z0-9]\{36\}\|ghu_\|github_pat_\|Bearer [A-Za-z0-9+/=]\{40,\}" \
--include="*.py" --include="*.js" --include="*.ts" --include="*.yaml" \
--include="*.env" --include="*.json" --include="*.bat" --include="*.sh" \
--exclude-dir=".git" .② 明文密码 / 凭证 helper(token 正则抓不到;实战曾漏掉 askpass.sh 里一行 echo "<sudo密码>",随 init commit 推上了 GitHub):
git ls-files -z | xargs -0 grep -nIE "password|passwd|密码|SUDO_ASKPASS|sshpass|^[[:space:]]*echo[[:space:]]+[\"'][^\"']{6,}[\"']" 2>/dev/null \
| grep -vE "\.md:|getenv|getpass|placeholder|example"
# 并人工核对孤立的 askpass.sh / *_secret* / .pgpass / .npmrc 类文件——它们整文件就是凭证Public repo 任一道命中即按下方强制流程处理。Private repo 命中只需提醒用户,不作为阻断条件。注意扫的是 git ls-files(已跟踪集),.gitignore 挡掉的不算泄露,但已 commit 的文件即使现在 gitignore 也仍在历史里。
报告格式:
[LEAK] scripts/eval.py:15 — sk-xxxx (硬编码 fallback)
[LEAK] ui/ui_backend.py:33 — sk-xxxx (hardcoded default)发现泄露后强制流程:
- 立即告知用户哪个文件哪一行
- 替换为环境变量(
os.getenv("API_KEY")无默认值) - 如已 push 到 remote:告知用户,获得明确确认后删库重建(git history 无法通过 force push 彻底清除)
- 用户撤销对应服务商的 key
Pre-Push Checklist
推送前必须执行:
git status确认无以下情况:
- Untracked files — 未跟踪的新文件(常见遗漏:docs/, scripts/, config 模板)
- Changes not staged — 修改未 add
- Changes to be committed 中包含不应上传的文件(密钥、个人数据、临时脚本)
未确认前,禁止直接 push。
Decision Tree
| Situation | Recommended Action |
Local repo has no .git (downloaded zip / copied files) | See Scenario A below |
Local is git clone with history, remote unchanged | Normal git add → commit → push |
Local is git clone, remote has new commits | git pull --rebase or merge, resolve conflicts, push |
Local is git clone, changes are massive renames + rewrites | See Scenario B below |
| Want to preserve remote history but replace all code | See Scenario C below |
Scenario A: Local Has No Git History
Most common when user downloads zip, edits extensively, then wants to sync back.
Option A1 — Force Push (Personal / Solo Projects)
# In local project folder
git init
git add .
git commit -m "refactor: major rewrite"
git remote add origin https://github.com/OWNER/REPO.git
git branch -M main
git push -u origin main --force⚠️ Destroys remote history. Only use when user confirms remote history is disposable.
Option A2 — Preserve Remote History (Recommended for Valuable Repos)
git clone https://github.com/OWNER/REPO.git temp-repo
cp -r temp-repo/.git ./your-local-project/
cd your-local-project
git add .
git commit -m "refactor: major rewrite"
git pushThis keeps all prior commits and appends the refactor as a single new commit.
Option A3 — New Clean Repo If the rewrite is so radical it is essentially a new project:
- Create a new repo with
gh repo create OWNER/REPO --description "..."(never omit the description) - Push local code there
- Archive old repo with successor link in README
Scenario B: Massive Renames + Rewrites in a Cloned Repo
Critical rule: never mix file renames and content changes in the same commit. Git will treat it as "delete old file + create new file" and lose history linkage.
Step-by-step commit strategy:
# Step 1: Rename only
git mv old_module.py new_module.py
git mv old_utils/ new_utils/
git commit -m "refactor: rename modules"
# Step 2: Variable/class renames
git add .
git commit -m "refactor: rename variables and classes"
# Step 3: Logic changes
git add .
git commit -m "feat: update core logic"If user already mixed everything in working tree:
# Stash current changes, replay in stages
git stash push -m "mixed refactor"
# Restore renames only (use git mv or manual mv + git add)
git mv old_file new_file
git commit -m "refactor: rename files"
# Restore content changes
git stash pop
# Resolve conflicts if any, then commitScenario C: Replace All Code but Keep History
Useful when user wants to start fresh code but keep stars/issues/URL.
git checkout --orphan fresh-start
git rm -rf .
# Copy new local code here
git add .
git commit -m "init: clean rewrite"
git branch -D main
git branch -m main
git push -u origin main --forceChecking Rename Detection
After pushing, verify Git correctly tracked renames:
git log --follow -- new_file.pyIf history is broken (shows file as brand new), the rename and content change were committed together.
Security & Compliance
- GitHub authentication: Always use
gh auth statusand the existing GitHub CLI credential store. Never request a standalone PAT or passgh auth tokenoutput to a script, environment variable, command argument, file, or chat. - Expired login: If
gh auth statusfails, stop remote operations and instruct the user to rungh auth login; do not fall back to a remembered or manually supplied token. - Private repo exception: If a repo is private, the agent may ignore key leaks, passwords, private config, personal data, and other sensitive-info leakage rules. Do not block push, force sanitization, or recommend deletion solely because private history contains secrets unless the user asks or the repo may become public.
- Public secret history: If a public repo ever committed API keys, deleting the repo is the only way to purge history from GitHub. Force-pushing sanitized history does not guarantee removal from GitHub's backup systems.
- Archived public repos with secrets: If deletion is unacceptable, at minimum remove the repo from public visibility (make private) or delete and recreate empty with clean code.
Technical Reference
Encoding Traps (Windows)
PowerShell defaults to CP1252 for stdout, destroying Chinese characters and Markdown code blocks. Always reconfigure:
import sys
sys.stdout.reconfigure(encoding='utf-8')When using Invoke-RestMethod in PowerShell with JSON bodies containing backticks or triple backticks, prefer Python scripts for content generation to avoid JSON serialization mangling ``` into `.
GitHub CLI Patterns
Validate authentication and resolve the current account:
gh auth status
gh api user --jq .loginCreate repo (never omit description):
gh repo create OWNER/repo-name --private --description "One-sentence summary."Create or update foundation files:
python scripts/bulk_file_updater.py repo1,repo2 all --owner OWNERArchive/unarchive:
gh repo archive OWNER/REPO --yes
gh repo unarchive OWNER/REPO --yesRename repo:
gh repo rename NEW-NAME --repo OWNER/OLD-NAME --yesDelete repo:
gh repo delete OWNER/REPO --yesBulk Download Without Clone
Download a repository snapshot through GitHub CLI to avoid slow git clone over unstable networks:
gh api repos/OWNER/REPO/zipball/main > REPO.zipBundled Resources
scripts/repo_analyzer.py— Scan repositories using the current GitHub CLI loginscripts/bulk_file_updater.py— Batch create/update LICENSE, .gitignore, README, and descriptions viagh api
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.

