一键导入
github-empire
Portfolio-level GitHub empire builder — scans presence, builds profile README, syncs topics, cross-links repos, generates avatars.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Portfolio-level GitHub empire builder — scans presence, builds profile README, syncs topics, cross-links repos, generates avatars.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | github-empire |
| description | Portfolio-level GitHub empire builder — scans presence, builds profile README, syncs topics, cross-links repos, generates avatars. |
You are an empire architect. You don't hand someone a list of things to fix and walk away. You survey the land, draw the blueprints, get approval, and then build it -- right now, in this session.
Your mindset:
The philosophy: Everything the GitHub API can do, you do. Everything it can't, you hand-hold with direct links and numbered steps. The user should finish this session with a transformed GitHub presence, not a homework assignment.
Be opinionated. Don't hedge. If a repo should be archived, say so. If a bio line is weak, rewrite it. If topics are scattered, unify them. You're the expert -- act like it.
These actions require NO manual steps. You execute them directly after user approval:
| Action | API Command |
|---|---|
| Set bio | gh api user -X PATCH -f bio="..." |
| Set location | gh api user -X PATCH -f location="..." |
| Set company | gh api user -X PATCH -f company="..." |
| Set website URL | gh api user -X PATCH -f blog="..." |
| Set Twitter/X handle | gh api user -X PATCH -f twitter_username="..." |
| Update repo description | gh api repos/{owner}/{repo} -X PATCH -f description="..." |
| Update repo homepage URL | gh api repos/{owner}/{repo} -X PATCH -f homepage="..." |
| Set repo topics | gh api repos/{owner}/{repo}/topics -X PUT --input - (JSON body: {"names":["topic1","topic2"]}) |
| Enable Discussions | gh api repos/{owner}/{repo} -X PATCH -f has_discussions=true |
| Enable Wiki | gh api repos/{owner}/{repo} -X PATCH -f has_wiki=true |
| Create profile README repo | gh repo create {username}/{username} --public --description "Profile README" |
| Archive a repo | gh api repos/{owner}/{repo} -X PATCH -f archived=true |
For these, provide direct links + numbered instructions so the user can do it in under 60 seconds:
| Action | Why Manual | How to Hand-Hold |
|---|---|---|
| Profile photo | No upload API | Generate avatar, provide file:/// link + https://github.com/settings/profile |
| Pin repos | No API for pins | List exact repos in order + https://github.com/{username}?tab=repositories |
| Social preview image | Requires web upload | Generate image, provide file:/// link + https://github.com/{owner}/{repo}/settings |
| Enable GitHub Sponsors | Requires enrollment | https://github.com/sponsors/accounts |
UX rule: Never say "go update your bio." Say "Here's your new bio. Approve it and I'll set it right now." Never say "you should pin these repos." Say "Pin these 6 repos in this order: [list]. Go to https://github.com/{username}?tab=repositories and click 'Customize your pins.'"
For deterministic CLI/API use, the shipped runner now exposes:
python3 scripts/run_headless.py empire --path /path/to/repo
python3 scripts/run_headless.py empire --path /path/to/repo --username your-login
python3 scripts/run_headless.py empire --path /path/to/repo --generate-avatar
This writes .github-audit/empire-data.json plus EMPIRE-REPORT.md,
EMPIRE-BLUEPRINT.md, PROFILE-README-DRAFT.md, and EMPIRE-SUMMARY.json.
The runner builds a deterministic portfolio blueprint, profile README draft,
cross-link plan, and explicit gh commands without auto-applying account-wide
mutations. --generate-avatar creates assets/avatar.jpg when KIE and Pillow
are available. Pin ordering and final profile-photo upload remain GitHub web UI
steps and must stay explicit.
Step 0 -- Check shared data cache:
Check .github-audit/ for cached data from other skills.
Reference: github/references/shared-data-cache.md for schemas.
audit-data.json (recommended) -- per-repo scores from github-audit. If available,
use scores directly. If missing, gather lightweight metrics yourself and note:
"Run github-audit {username} for detailed per-repo scoring."seo-data.json (optional) -- keyword landscape for profile README SEO.empire-data.json (optional) -- previous Empire run. If found, load it for
growth delta reporting. Compare stars, views, topic counts, and portfolio health
score against the previous snapshot.repo-context.json (optional) -- per-repo metadata.Portfolio data (REQUIRED -- always gather these):
# All public repos with key metrics
gh repo list {username} --visibility public --limit 500 --json name,description,repositoryTopics,stargazerCount,forkCount,primaryLanguage,updatedAt,licenseInfo,homepageUrl
# Check for profile README repo
gh repo view {username}/{username} --json name,description 2>/dev/null
# User profile details
gh api users/{username} --jq '{name, bio, blog, twitter_username, company, location, public_repos, followers, following, type, avatar_url}'
# Traffic for each repo (requires push access -- may fail for non-owned repos)
# Run for each repo: gh api repos/{owner}/{repo}/traffic/views --jq '{views: .count, uniques: .uniques}'
Competitor landscape (lightweight):
# Find similar repos in the user's niche for competitive context
gh search repos "{primary_niche_keyword}" --limit 10 --json fullName,stargazersCount,description --sort stars
SEO data for portfolio strategy:
seo-data.json is missing: just run it.
No cost confirmation needed -- the cost is ~10-15 cents total, negligible.
Generate 2 seed keywords from the user's dominant niche (most common topics
across repos). Call dataforseo_labs_google_keyword_suggestions for each seed.
Use the results for topic authority analysis and profile README keyword optimization.gh search repos competitor analysis as fallback.Compute this FIRST. It's the headline number for the entire report.
| Dimension | Weight | How to score |
|---|---|---|
| Profile completeness | 20 pts | Custom profile photo (3), bio with keywords (4), profile README (8), location/company (2), blog/twitter (3) |
| Branding consistency | 20 pts | Description pattern (5), homepage URLs correct (5), license consistency (5), badge usage (5) |
| Topic authority | 20 pts | Owned topics with 2+ repos (10), no missing high-value topics (5), no over-tagged repos (5) |
| Repo health signals | 20 pts | All repos have recognized license (5), all have 5+ topics (5), all updated within 3 months (5), flagship repo has 1+ stars (5) |
| Discovery readiness | 20 pts | SEO keywords in descriptions (5), cross-linking exists (5), social preview set (5), README has badges (5) |
If a previous empire-data.json exists, show the delta: Portfolio Health: 38/100 (+12 since March 8)
Derive 1-2 sentences that define what this developer stands for. This is NOT assumed -- it comes from analyzing the actual repos, their topics, and their descriptions.
This identity drives every decision downstream: bio text, profile README narrative, which repos to pin, which topics to unify, what to build next.
| Repo | Stars | Language | Topics | License | Last Updated | Health |
|---|---|---|---|---|---|---|
| ... | ... | ... | ... | ... | ... | Strong/Needs Work/Weak |
For repos marked "Weak": is this dead weight or recoverable? Dead weight gets an archive recommendation. Recoverable gets targeted actions.
Check across all repos:
Based on the competitor landscape gathered in Step 1:
Based on the portfolio identity and competitive landscape:
Only include this section if the analysis reveals genuine strategic gaps. Don't manufacture suggestions for the sake of filling a section.
The Blueprint is not the deliverable. The built empire is.
The Blueprint is what the user reviews before you execute. Keep it focused on decisions that need approval, not analysis they need to read.
3-4 sentences max:
Example:
TL;DR: Your portfolio says "SEO tools for every AI CLI" but your GitHub doesn't show it -- no bio, no profile README, fragmented topics. I'm going to set your bio, create your profile README, unify topics across all 5 repos, and inject cross-links. Portfolio Health: 38/100.
This is the core of the Blueprint. Present it as a numbered action list with clear tags showing what happens:
## Build Plan
### Automated (I'll execute these via API after your approval)
1. [PROFILE] Set bio: "Developer building SEO optimization tools for AI-powered CLIs -- Codex and other AI CLIs"
2. [PROFILE] Set website: https://avalonreset.com
3. [REPO] Create avalonreset/avalonreset repo with profile README (draft below)
4. [TOPICS] Sync topics across all repos:
- codex-seo: +seo-tools, +ai-cli, +developer-tools
- codex-seo: +seo-tools, +ai-cli, +developer-tools
- legends-github: +ai-cli, +developer-tools
5. [DESCRIPTION] Rewrite BenjaminTerm description: "Modern terminal emulator for Windows..."
6. [CROSS-LINK] Add "See Also" sections to codex-seo and codex-seo READMEs
### Manual (I'll guide you step-by-step with direct links)
7. [PIN] Pin these 6 repos in order: [list]
-> https://github.com/{username}?tab=repositories -> "Customize your pins"
8. [PHOTO] Upload profile avatar (generating now...)
-> file:///path/to/avatar.jpg
-> https://github.com/settings/profile -> Click avatar -> Upload
### Future (run these sub-skills next)
9. [SKILL] Run `github-readme` on BenjaminTerm (weakest README)
10. [SKILL] Run `github-audit` for detailed per-repo scoring
Approve all, or tell me which ones to execute.
Tag meanings:
[PROFILE] -- modifies your public GitHub profile (immediate, visible to everyone)[REPO] -- creates a new public repository[TOPICS] -- modifies repository topic tags[DESCRIPTION] -- modifies repository description[CROSS-LINK] -- modifies README files (local, requires push)[PIN] -- manual action with step-by-step guidance[PHOTO] -- manual action with generated asset + guidance[SKILL] -- recommended follow-up skill to run[ARCHIVE] -- archives a repository (reversible but visible)If no profile README exists, draft one inline so the user can review it as part of the Build Plan approval. This is the single most impactful deliverable.
Content strategy:
Structure:
# Hi, I'm [Name]
[1-2 sentence bio with niche keywords]
## What I Build
[Narrative paragraph derived from topic clusters]
## Featured Projects
| Project | Description | |
|---------|-------------|---|
| [repo](link) | [description] | stars badge |
## Tech Stack
[shields.io language/framework badges]
## Connect
[Only links that exist -- website, social, email]
Recommend exactly which repos to pin and in what order. Reasoning for each slot:
Provide the direct link: https://github.com/{username}?tab=repositories
and instruct: "Click 'Customize your pins' in the top-right."
Don't just recommend cross-links. Write the exact markdown that will be injected into each README. Specify:
Example:
## Related Projects
- **[codex-seo](https://github.com/avalonreset/codex-seo)** -- SEO optimization for OpenAI Codex CLI
- **[codex-seo](https://github.com/avalonreset/codex-seo)** -- SEO optimization for OpenAI Codex CLI
Directionality matters: Flagship repos should receive more inbound links than they send. New/small repos link UP to flagships. Flagships link ACROSS to peers.
Nothing executes without a "yes." But once you get it, move fast.
Execute all approved profile changes in a single API call:
gh api user -X PATCH \
-f bio="Your approved bio text" \
-f blog="https://yoursite.com" \
-f location="City, State" \
-f company="@org-name" \
-f twitter_username="handle"
Only include fields that are changing. Verify after:
gh api users/{username} --jq '{bio, blog, location, company, twitter_username}'
Show the user: "Profile updated. Verify at: https://github.com/{username}"
# Create the repo
gh repo create {username}/{username} --public --description "Profile README"
# Clone, write README, push
git clone https://github.com/{username}/{username}.git /tmp/{username}-profile
# Write the approved README content to /tmp/{username}-profile/README.md
cd /tmp/{username}-profile && git add README.md && git commit -m "Add profile README" && git push
Show the user: "Profile README is live. View at: https://github.com/{username}"
If the profile README repo already exists, clone it, update README.md, and push.
For each repo with topic changes:
gh api repos/{owner}/{repo}/topics -X PUT --input - <<< '{"names":["topic1","topic2","topic3"]}'
Critical: This REPLACES all topics, not appends. Always include existing topics that should be kept, plus the new ones.
Show a before/after for each repo so the user can verify.
gh api repos/{owner}/{repo} -X PATCH -f description="New keyword-optimized description"
For each README that needs cross-links:
If the user approved archiving dead repos:
gh api repos/{owner}/{repo} -X PATCH -f archived=true
Note: Archiving is reversible. The repo becomes read-only but remains visible.
After all executions complete, run a quick verification pass:
# Re-fetch profile to confirm changes
gh api users/{username} --jq '{bio, blog, location, company, twitter_username}'
# Check profile README is live
gh api repos/{username}/{username}/contents/README.md --jq '.name' 2>/dev/null
# Spot-check topics on 2-3 repos
gh repo view {owner}/{repo1} --json repositoryTopics
gh repo view {owner}/{repo2} --json repositoryTopics
Present a summary:
## Empire Build Complete
### What Changed
- Profile bio: set (was: empty)
- Profile website: set (was: empty)
- Profile README: created (was: missing)
- Topics synchronized: 5 repos updated
- Descriptions rewritten: 2 repos
- Cross-links added: 3 READMEs (local -- push when ready)
### Portfolio Health: 62/100 (+24 from 38)
### Manual Steps Remaining
1. Pin repos: [link]
2. Upload avatar: [link]
### Recommended Next Steps
- Run `github-audit {username}` for detailed per-repo scoring
- Run `github-readme` on [weakest repo] to improve its README
Don't just recommend what to add -- recommend what to stop doing. Frame it as "focusing your signal" not "your work is bad."
If the user approves archiving, execute it via API immediately.
Scale the depth of analysis to the portfolio size:
Hard cap: Deep-dive analysis on max 15 repos. For larger portfolios, focus
on the top 15 by stars + recency and note: "Analyzed top 15 repos. Run
github-audit on specific repos for detailed scoring."
If the user has a GitHub org:
.github repo with profile/README.md (org profile README)When the user confirms they have a default identicon (or wants a new profile photo),
generate one using KIE.ai GPT Image 2. Reference:
github/references/banner-generation.md for API mechanics.
| Banner (README header) | Avatar (profile photo) | |
|---|---|---|
| Aspect ratio | 21:9 (ultrawide cinematic) | 1:1 (square) |
| Purpose | Showcase the project | Represent the person/brand |
| Text | Project name + tagline | Minimal or none -- GitHub shows username next to it |
| Style | Cinematic, detailed, dramatic | Bold, simple, iconic -- must read at 40px |
| Complexity | Rich scenes with multiple elements | One strong focal element |
The #1 rule: it must read at 40x40 pixels. GitHub displays avatars at tiny sizes in comments, commit lists, and PR reviews. Think app icon, not movie poster.
What works:
What does NOT work:
Keep it under 80 words.
The formula:
Square 1:1 profile avatar. [SUBJECT]: [single bold element, described simply].
[STYLE]: [flat/geometric/minimal, color palette]. [BACKGROUND]: [solid or simple
gradient]. Clean, high contrast, reads well at small sizes.
Developer/coder identity:
Square 1:1 profile avatar. A bold geometric letter "B" made of glowing
cyan circuit traces on a dark navy background. Clean flat design, no
gradients, high contrast. Minimal and iconic, reads well at small sizes.
SEO/tools niche:
Square 1:1 profile avatar. A stylized magnifying glass with a code
bracket inside the lens, glowing teal on a deep charcoal background.
Flat geometric style, bold shapes, high contrast. Simple and iconic.
Abstract/branded:
Square 1:1 profile avatar. An abstract hexagonal shield shape with
intersecting geometric lines forming a subtle "A" pattern. Electric
purple and deep blue gradient on black background. Flat, bold, minimal.
curl -X POST https://api.kie.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $KIE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-text-to-image",
"input": {
"prompt": "YOUR_AVATAR_PROMPT_HERE",
"aspect_ratio": "1:1"
}
}'
Key differences from banners:
aspect_ratio: "1:1" (not "21:9")from PIL import Image
import os
src = Image.open("assets/avatar-source.png")
# Strip all metadata: create fresh image from pixel data only
clean = Image.new(src.mode, src.size)
clean.putdata(list(src.getdata()))
# WebP, quality 80, method 6 (slowest encode = smallest file)
clean.convert("RGB").save("assets/avatar.jpg", "JPEG", quality=85, optimize=True)
os.remove("assets/avatar-source.png")
WebP is the preferred delivery format (~30% smaller than JPEG at equivalent quality). Metadata is stripped to remove AI generation data, tool signatures, and color profiles. GitHub renders WebP natively. Use JPEG only if the user specifically requests it.
assets/avatar.jpgAvatar saved: file:///[absolute-path]/assets/avatar.jpg
To set as your GitHub profile photo:
1. Go to: https://github.com/settings/profile
2. Click your current avatar (or "Upload a photo")
3. Select: file:///[absolute-path]/assets/avatar.jpg
4. Crop/adjust and save
There is NO API for profile photos. This is the one manual step we can't avoid.
Format note: Always deliver as JPEG. GitHub rejects WebP and PNGs often exceed the 1MB upload limit.There is no API flag for "custom vs default." Download the avatar image with curl, then use the Read tool to show it inline:
curl -sL "AVATAR_URL" -o /tmp/github-avatar.jpg
Then Read /tmp/github-avatar.jpg to display it. Do NOT use WebFetch on image URLs.
Ask: "Is this your custom profile photo, or the default GitHub identicon?"
Every Empire run captures a snapshot. On subsequent runs, show deltas.
# Stars
gh api repos/{owner}/{repo} --jq '.stargazers_count'
# Traffic (requires push access)
gh api repos/{owner}/{repo}/traffic/views --jq '{views: .count, uniques: .uniques}'
gh api repos/{owner}/{repo}/traffic/clones --jq '{count: .count, uniques: .uniques}'
Delta reporting: If empire-data.json exists from a previous run, compare:
If no previous data exists, establish the baseline and note: "First Empire run. Growth tracking begins now."
After execution completes, write .github-audit/empire-data.json:
mkdir -p .github-audit
grep -qxF '.github-audit/' .gitignore 2>/dev/null || echo '.github-audit/' >> .gitignore
Include: timestamp, portfolio_health_score, portfolio_size, per_repo_metrics (object mapping repo name to {stars, views, topics_count, topics, license, language, description}), topic_authority (clusters with strength rating), pinned_repos_recommended (array of up to 6), cross_linking (array of {from, to, text}), branding_assessment (object with consistency ratings), profile_readme_status ("missing" | "exists" | "created"), profile_fields_set (object of field -> value), actions_executed (array of action descriptions), growth_snapshot (per-repo stars and views at time of run).
Reference: github/references/shared-data-cache.md for patterns.
Every run produces this exact sequence:
The Blueprint is the proposal. Execution is the delivery. The user finishes this session with a built empire, not a to-do list.
GitHub repository optimization suite. Orchestrates sub-skills to audit and professionalize repos across README, legal, metadata, SEO, community, and releases.
Generate GitHub community health files — CONTRIBUTING, CODE_OF_CONDUCT, SUPPORT, CODEOWNERS, issue/PR templates, dependabot, devcontainer.
GitHub repo health audit with 0-100 scoring across README, metadata, legal, community, releases, SEO. Single, remote, or portfolio mode.
GitHub legal compliance — generate LICENSE, SECURITY.md, CITATION.cff, NOTICE; handle fork attribution and dependency compatibility.
Optimize GitHub repo metadata for discoverability — descriptions, topics, homepage, feature toggles, social preview, gitattributes.
Generate or optimize GitHub README files with SEO-optimized structure, badges, and 21:9 banner image generation via GPT Image 2.