readme-card
Trigger: readme card, svg card, project stats, repo badge, readme stats card, repo card, generate card. Generate a self-contained SVG stats card for any project README — language breakdown, file count, commits, license, last update. Dark/light mode aware. Zero external dependencies.
- License 许可
- Apache-2.0
- 最近更新
- 2026-08-26
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- readme-card
- license
- Apache-2.0
- metadata
- { "author": "gentleman-programming", "version": "1.0" }
- description
- Trigger: readme card, svg card, project stats, repo badge, readme stats card, repo card, generate card. Generate a self-contained SVG stats card for any project README — language breakdown, file count, commits, license, last update. Dark/light mode aware. Zero external dependencies.
02 资源文件 1
- 脚本assets/generate-card.sh7.9 KB
03 SKILL.md 正文
Concept
A lightweight SVG card that shows project stats at a glance — like GitHub's own stats cards but self-hosted, no API calls, no third-party services. Just bash + git.
The card:
- Shows top 5 languages with proportional bars
- Total files, total commits, last update date
- License badge
- Auto-adapts to dark/light mode via
prefers-color-scheme - Fits in a README with one line of Markdown
- Regenerates on every deploy (CI) or commit hook
Quick Start
# Generate card and save to assets/
bash skills/readme-card/assets/generate-card.sh > assets/card.svg
Then in your README:

Configuration
Set these env vars before running:
CARD_ACCENT="#6366f1" # accent color (default: indigo)
CARD_WIDTH=420 # card width in px (default: 420)
Example:
CARD_ACCENT="#06b6d4" bash skills/readme-card/assets/generate-card.sh > assets/card.svg
GitHub Actions Integration
Create .github/workflows/card.yml:
name: Update README Card
on:
push:
branches: [main]
jobs:
card:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for accurate commit count
- run: sudo apt-get install -y cloc jq 2>/dev/null || true
- name: Generate card
run: bash .github/scripts/generate-card.sh > assets/card.svg
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update readme stats card"
file_pattern: assets/card.svg
Pre-commit Hook (local)
Add to .git/hooks/pre-commit:
#!/bin/bash
bash .github/scripts/generate-card.sh > assets/card.svg
git add assets/card.svg
Then chmod +x .git/hooks/pre-commit.
Script Location
The generator script lives at skills/readme-card/assets/generate-card.sh in the skills directory. Copy it to your project:
cp skills/readme-card/assets/generate-card.sh .github/scripts/generate-card.sh
chmod +x .github/scripts/generate-card.sh
Requirements
| Tool | Required | Notes |
|---|---|---|
bash |
✅ | Standard on any *nix/macOS |
git |
✅ | Must run inside a git repo |
cloc |
⚠️ optional | Better language breakdown via lines of code |
jq |
⚠️ optional | Only needed if cloc is used |
Fallback: if cloc isn't available, the script counts files by extension from git ls-files.
Output
The SVG is a self-contained card:
┌──────────────────────────────────────┐
│ project-name MIT │
│ ─────────────────────────────────── │
│ TypeScript ████████████░░░ 12.4k │
│ CSS ██████░░░░░░░░░ 2.1k │
│ HTML ███░░░░░░░░░░░░ 5 │
│ │
│ 142 files · 1,247 commits │
│ updated │
│ 2024-03-15 │
└──────────────────────────────────────┘
- Responsive to dark/light mode
- ~1.2kB gzipped
- No external API calls, no tracking, no dependencies
Critical Rules
- The script MUST run inside a git repo — it uses
git rev-parseandgit ls-files - For accurate commit counts, use
fetch-depth: 0in GitHub Actions - If cloc is installed, results are more accurate (lines of code vs file count)
- The card auto-updates on every CI run — no manual maintenance
- Place the script somewhere stable in the project (
.github/scripts/orscripts/)
04 同仓库更多 Skills
zustand-5
Zustand 5 state management patterns. Trigger: When managing React state with Zustand.
zod-4
Zod 4 schema validation patterns. Trigger: When using Zod for validation - breaking changes from v3.
x-bookmark-quote-posts
Workflow para revisar bookmarks de X/Twitter y convertirlos en drafts de quote posts. Accede a la sección de bookmarks vía browser headless, extrae posts recientes, y genera drafts con voz personal del usuario. No publica ni muta X — solo genera contenido para revisión. Trigger: X bookmarks, Twitter bookmarks, quote posts, bookmark automation, crear quote posts, revisar bookmarks, growth content X.
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
work-unit-commits
Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.