一键导入
github-readme
Generate or optimize GitHub README files with SEO-optimized structure, badges, and 21:9 banner image generation via GPT Image 2.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate or optimize GitHub README files with SEO-optimized structure, badges, and 21:9 banner image generation via GPT Image 2.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
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.
Portfolio-level GitHub empire builder — scans presence, builds profile README, syncs topics, cross-links repos, generates avatars.
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.
| name | github-readme |
| description | Generate or optimize GitHub README files with SEO-optimized structure, badges, and 21:9 banner image generation via GPT Image 2. |
For deterministic local preview/write flows, use:
python3 scripts/run_headless.py readme --path /path/to/repo
python3 scripts/run_headless.py readme --path /path/to/repo --generate-assets
python3 scripts/run_headless.py readme --path /path/to/repo --write
readme defaults to preview mode. It writes .github-audit/readme-data.json
plus README-REPORT.md, README-PREVIEW.md, and README-SUMMARY.json.
--write is the explicit approval gate for rewriting README.md.
--generate-assets reuses an existing banner asset when present, otherwise it
can generate a KIE-backed banner plus assets/social-preview.jpg and records
local/raw/settings links in the cache and report artifacts.
Step 0 -- Check shared data cache:
Before gathering, check .github-audit/ for cached data from other skills.
Reference: github/references/shared-data-cache.md for schemas.
seo-data.json (REQUIRED -- do NOT skip) -- primary keyword, secondary keywords, PAA
questions, AI visibility. If this cache file is missing, you MUST gather SEO data
before proceeding. Check if DataForSEO MCP tools are available (search for
dataforseo_labs_google_keyword_suggestions). If available, run the keyword research
inline: generate 2 seed keywords from repo description → call keyword_suggestions for
each → filter by volume/difficulty/relevance → call serp_organic_live_advanced on the
best candidate to verify GitHub repos can rank for it. This costs ~20-30 cents and is
NON-NEGOTIABLE -- a README without data-backed keywords is a failed deliverable.
If DataForSEO MCP is genuinely not configured (tools not found), THEN and ONLY THEN
fall back to codebase-derived keywords and mark SEO as "unverified."
repo-context.json (optional) -- repo type, intent, language, metadata. If missing,
gather yourself via gh repo view.
legal-data.json (optional) -- license type for badge selection. If missing, just
check LICENSE file directly.
audit-data.json (optional) -- README quality findings from prior audit. If present,
use to prioritize which sections need the most improvement.
Codebase scan: What does this project actually do?
Existing README: Read current README.md (if any)
SEO data: Use keyword opportunity data from the orchestrator's SEO data pass, or run github-seo inline if running standalone.
github-readme, gather SEO data yourself:
gh search repos, apply patterns from github-seo-guide.mdLegal data: Check LICENSE type for License section
Audit data: If a prior github-audit run exists, use its README quality findings
Intent + repo type: From orchestrator context
Banner status: Does the repo already have a banner image? Check for assets/banner.webp, assets/banner.jpg, assets/banner.png, or any image referenced at the top of README
Reference: Read github/references/readme-framework.md for structure patterns.
Reference: Read github/references/repo-type-templates.md for per-type README structure.
Docs-site detection: If the Homepage URL points to a documentation site (readthedocs, github.io, custom docs domain) or the README links to external docs, apply adjusted expectations:
Score the current README (if exists) using these objective rubrics. Each criterion has specific checkpoints worth defined points. Score by counting what's present -- not by subjective impression.
| Checkpoint | Points |
|---|---|
| Exactly one H1 heading | 4 |
| H1 includes descriptive tagline (not just project name) | 4 |
| Proper heading hierarchy (no skipped levels) | 4 |
| At least 4 H2 sections | 4 |
| Table of Contents present (for READMEs with 4+ sections) | 4 |
| Checkpoint | Points |
|---|---|
| Installation/setup instructions with code block | 5 |
| At least one usage example with code block | 5 |
| Configuration, API reference, or detailed options/commands section (skip if repo type doesn't need config -- redistribute 4 pts to other Content checkpoints) | 4 |
| Architecture/how-it-works explanation | 3 |
| Troubleshooting, FAQ, or common issues | 3 |
| Checkpoint | Points |
|---|---|
| Primary keyword in H1 (verified via SEO data, not guessed) | 6 |
| Primary keyword in first paragraph | 4 |
| Secondary keywords in at least 2 H2 headings | 4 |
| All images have descriptive alt text with keywords | 3 |
| Descriptive link text (no "click here") | 3 |
| Checkpoint | Points |
|---|---|
| At least one badge present | 3 |
| License badge | 2 |
| Version/release badge | 2 |
| CI/build status or other quality signal badge | 3 |
| Checkpoint | Points |
|---|---|
| Banner image at top | 4 |
| Code blocks use syntax highlighting (language specified) | 2 |
| At least one table for structured data | 2 |
| Short paragraphs (no walls of text over 5 sentences) | 2 |
| Checkpoint | Points |
|---|---|
| All required sections for repo type present | 4 |
| Contributing section or link to CONTRIBUTING.md | 2 |
| License section with link to LICENSE file | 2 |
| Links to external resources (docs, homepage, etc.) | 2 |
| Checkpoint | Points |
|---|---|
| Clear "X is a Y that does Z" definition in first 2 sentences | 4 |
| Structured comparison table (vs alternatives) | 2 |
| Answer-first formatting for key questions (FAQ or PAA-derived) | 2 |
| Specific quantifiable claims (stats, benchmarks, counts) | 2 |
Present README plan before writing:
## README Optimization Plan
### Current Score: XX/100
[breakdown by criterion]
### Proposed Structure:
1. Banner image (generated via KIE.ai GPT Image 2)
2. H1: [Project Name -- keyword-rich tagline]
3. Badges: [CI, version, license, downloads]
4. Opening paragraph: [with primary keyword]
5. Table of Contents
6. [Section list based on repo type]
### Banner Concept:
- Visual: [description of banner concept based on project domain]
- Aspect ratio: 21:9 (default) or [user preference]
- Resolution: 1K (default) or [user preference]
### Keyword Integration:
- H1: "[primary keyword]"
- First paragraph: "[primary keyword] naturally embedded"
- H2 headings: [list with secondary keywords]
### Data Sources Used:
- [list: codebase scan, SEO analysis, audit findings, etc.]
PAUSE HERE for interactive runs. After presenting the optimization plan (Step 3), ask the user: "Ready to generate the optimized README? (This will also generate a banner image if KIE_API_KEY is available.)"
Do NOT generate the README until the user confirms. The plan is the checkpoint -- the user may want to adjust the keyword strategy, change the tone, skip the banner, or add/remove sections before you write anything.
If the user invoked the skill with a clear directive like "generate a readme" or
"optimize this readme", treat that as pre-approval and proceed without pausing.
For deterministic run_headless.py readme --write, the --write flag is the
explicit approval signal.
Generate the full README.md or a rewritten version of the existing one.
Write to shared data cache after generating the README:
mkdir -p .github-audit
grep -qxF '.github-audit/' .gitignore 2>/dev/null || echo '.github-audit/' >> .gitignore
Write .github-audit/readme-data.json with: timestamp, score_before, score_after,
banner_generated, banner_path, keywords_integrated (primary_in_h1, primary_in_first_paragraph,
secondary_in_h2 list), sections list.
Reference: github/references/shared-data-cache.md for exact schema.
Reference: Read github/references/banner-generation.md -- see the
Image Format Optimization section for the full decision table.
The pipeline: always generate as PNG (lossless source), then convert to the
optimal delivery format. See banner-generation.md for the full Image Format
Pipeline section.
When generating or placing images in the README:
Offer to convert, not just flag. Use Pillow to convert, strip metadata, and show savings:
from PIL import Image
import os
src = Image.open("assets/banner.png")
clean = Image.new(src.mode, src.size) # strip all metadata
clean.putdata(list(src.getdata()))
clean.save("assets/banner.webp", "WEBP", quality=80, method=6)
old = os.path.getsize("assets/banner.png")
new = os.path.getsize("assets/banner.webp")
print(f"{old//1024}KB -> {new//1024}KB ({100-new*100//old}% smaller, metadata stripped)")
Every README should include a professional banner. Generate one as part of the standard README creation/optimization workflow using the two-step process.
Reference: Read github/references/banner-generation.md for full details
including prompt strategy, text compositing script, and positioning principles.
Banner + Social Preview flow (MANDATORY -- do not skip any step):
assets/banner-source.pngassets/banner.webp, delete source PNGThis is a 7-step flow, not 6. The social preview is not optional.
<p align="center">
<img src="assets/banner.webp" alt="[Project Name] banner" width="100%">
</p>
Prerequisite: Load KIE_API_KEY from the standard dotenv locations:
if [ -z "$KIE_API_KEY" ]; then
for envfile in ./.env.local ./.env github/.env.local github/.env ~/.env.local ~/.env; do
if [ -f "$envfile" ]; then
export $(grep -v '^#' "$envfile" | xargs) 2>/dev/null
break
fi
done
fi
[ -n "$KIE_API_KEY" ] && echo "KIE_API_KEY loaded" || echo "KIE_API_KEY NOT FOUND"
If the key is not found after checking those dotenv locations, STOP and show this message:
Banner generation requires a KIE.ai API key. It takes about 2 minutes to set up:
1. Go to https://kie.ai/api-key and create a free account
2. Copy your API key
3. Paste it into `./.env.local` (preferred) or `github/.env`:
KIE_API_KEY=your_key_here
Want to set this up now, or skip the banner and continue with the README?
Wait for the user to respond. If they want to set it up, help them. If they
say skip/continue/later, generate the rest of the README with a placeholder
comment: <!-- TODO: Add banner image --> at the top.
After generating the README banner, ALWAYS run the social preview pipeline. This is step 7 of the banner flow. Do NOT skip it.
Reference: Read github/references/banner-generation.md section
"Social Preview Image Generation" for the full pipeline and Pillow script.
The pipeline:
input_urls with gpt-image-2-image-to-image at 16:9 aspect ratio.
This recomposes the design for the new ratio (AI adapts layout, centers elements).
Use the raw GitHub URL of the pushed banner as the input_urls source.
If the banner is WebP, convert to PNG first (GPT Image 2 rejects WebP input).assets/social-preview.jpg.Fallback: No banner exists (new project or banner was skipped):
If there is no banner to feed as input_urls, generate the social preview from
scratch as a standalone gpt-image-2-text-to-image KIE.ai call at 16:9. Use this prompt formula:
Professional 16:9 social preview card for a GitHub project called "[Project Name]".
Dark background with [color accent matching project theme]. Text "[Project Name]"
centered in bold white sans-serif, subtitle "[one-line description]" below in
smaller text. Clean, modern tech aesthetic. Centered composition with padding
on all edges (critical for the 2:1 crop that follows).
Then run the same crop/resize/JPEG pipeline as the banner-based path (steps 3-8). The key difference: explicitly ask for centered composition with edge padding, because there's no existing design to recompose from and the 2:1 crop will trim the top and bottom.
When to skip (the ONLY valid reasons):
gh repo view --json visibility -- if "PRIVATE", skip entirely and tell the
user why. This overrides the "banner was generated so social preview MUST be
generated" rule below.usesCustomOpenGraphImage: true)If the banner was generated AND the repo is public (or on a paid org plan), the social preview MUST be generated. No exceptions. If the banner was skipped but KIE_API_KEY is available, offer to generate a standalone social preview using the fallback prompt above.
# Project Name - Keyword-rich tagline# MyTool - Fast Python CLI Tool Framework Library for Developers# MyTool - Build CLI Applications in MinutesPlace immediately after H1, before opening paragraph:
[](link) [](link) [](link)
Select badges based on repo type (see github/references/releases-guide.md for URLs).
Every README, regardless of repo type, should follow this rhetorical arc:
This is not a sales funnel. It is the natural order of questions a developer asks when they land on a repo. Answer them in order and the README feels effortless to read.
These map the flow above to concrete H2 sections:
Library/Package: Features > Installation > Quick Start > Usage > API > Configuration > Contributing > License
CLI Tool: Installation > Quick Start > Commands > Configuration > Examples > Contributing > License
Framework: Why This Framework > Getting Started > Documentation > Architecture > Contributing > License
Application: About > Screenshots > Getting Started > Deployment > Contributing > License
Skill/Plugin: What It Does > Installation > Commands > Configuration > Examples > License
Not every project needs every section. A 50-line utility does not need an Architecture diagram. A project with no competitors does not need a comparison table. Apply these rules:
When SEO data includes People Also Ask (PAA) questions from SERP responses, use them actively in the README -- don't just report them. PAA questions are Google-confirmed queries that real people ask about this topic.
How to integrate PAA questions:
Direct FAQ section -- If 3+ relevant PAA questions were found, add a
## Frequently Asked Questions section near the bottom (before Contributing).
Format each as an H3 with a concise answer-first response (2-3 sentences).
This directly targets Google's PAA feature and AI Overview citations.
Fold into existing sections -- If a PAA question maps to an existing section (e.g., "How do I install X?" → Installation section), ensure that section explicitly answers the question in its opening sentence.
H2 heading alignment -- If a PAA question matches a natural H2 heading, use the question's phrasing as inspiration (e.g., PAA "What are the advantages of CadQuery?" → H2 "What Makes This Different").
Selection criteria:
| Intent | Tone | Focus |
|---|---|---|
| Open Source Community | Welcoming, inclusive | Getting Started prominent, Contributing prominent |
| Professional Portfolio | Polished, impressive | Technical depth, architecture, results |
| Business / Brand | Professional, value-driven | Value proposition, use cases, social proof |
| Internal to Public | Documentation-heavy | Architecture, API reference, deployment |
| Academic / Research | Formal, methodical | Methodology, citation, reproducibility |
| Hobby / Learning | Authentic, casual | Motivation, learning journey, experiments |
Tone consistency rule: Pick one tone from the table above at the start and hold it through the entire README. Every section should read like the same person wrote it. If the opening is direct and conversational, the Installation section should not suddenly switch to formal documentation-speak. If the project is professional, the FAQ should not get casual. Read the finished README top to bottom and check for tone shifts before presenting the preview.
When optimizing an existing README, follow this exact sequence:
Present the 7-criterion score table (see Analyze step) with the current total.
Show the optimization plan (see Recommend step) with proposed changes.
Generate the full optimized README.md content (or generate from scratch). Display the complete README in the terminal so the user can review the copy, headings, keyword placement, and overall flow before anything is written to disk.
Present it inside a markdown code fence so the raw markdown is visible:
```markdown
[full README content here]
```
Then ask: "Does this look good? I can adjust any section, rewording, or structure before writing it. Say 'write it' to save, or tell me what to change."
Do NOT write README.md until the user approves the preview. The user may want to iterate on the copy 2-3 times before committing. This is the most important checkpoint -- the plan (Step 2) shows structure, but the preview shows actual words.
After user approval, write the README.md file and generate the banner (if applicable).
Re-score the generated README against the same 7 criteria.
## Before/After Comparison
| Criterion | Before | After | Delta |
|-----------|--------|-------|-------|
| Structure | X | Y | +Z |
| Content Depth | X | Y | +Z |
| SEO | X | Y | +Z |
| Badges | X | Y | +Z |
| Visual Appeal | X | Y | +Z |
| Completeness | X | Y | +Z |
| AI Citability | X | Y | +Z |
| **Total** | **X** | **Y** | **+Z** |
assets/banner.webp (if KIE_API_KEY available)After generating or placing ANY image (banner, social preview, screenshot), always output clickable links so the user can access the file immediately:
file:///[absolute-path]/assets/banner.webphttps://raw.githubusercontent.com/{owner}/{repo}/main/assets/banner.webpTo set as your repo's social preview:
1. Download: https://raw.githubusercontent.com/{owner}/{repo}/main/{path}
2. Go to: https://github.com/{owner}/{repo}/settings
3. Scroll to "Social preview" > "Edit" > "Upload an image"
4. Save changes
Replace all placeholders with actual values. Never output just a relative path
like assets/banner.webp without the clickable link next to it.
After completing README optimization, always end with this handoff:
README optimization complete. All skills have been run.
Recommended final step:
github-audit -- re-run the audit to measure your improvement and get your new score
Once you've completed this process for all your repos:
github-empire -- portfolio-level optimization (profile README, cross-linking, avatar)
If running as part of the audit SOP, reference the step number:
"Step 6 complete. Next skill: github-audit to measure your improvement."
If this is the user's last repo in a multi-repo session, also mention:
"All repos optimized. When you're ready for portfolio-level work, run github-empire."