Phase 1 — Detect
Run the detection script via the Bash tool:
uv run python skills/add-badges/scripts/detect.py <path>
Parse the JSON output. The script detects: repo info, languages, package managers, frameworks, CI/CD, infrastructure, code quality, testing, docs, license, release, security, community, developer tooling, databases, monorepo signals, and existing badges.
If the script fails (uv unavailable, Python missing, script error, invalid JSON), fall back to manual detection:
- Glob for manifest files (pyproject.toml, package.json, go.mod, Cargo.toml, etc.)
- Read
.git/config or run git remote get-url origin for owner/repo
- Glob
.github/workflows/*.yml for CI badge candidates
- Read LICENSE first line for SPDX type
- Check for Dockerfile, .pre-commit-config.yaml, codecov.yml, etc.
Phase 2 — Select
Read references/badge-catalog-core.md (always). Read references/badge-catalog-extended.md when detection reports any non-basic signals (any of: frameworks, infrastructure, code_quality linters/formatters/type_checkers, docs, release, security, monorepo, databases, developer_tooling, community).
Read references/style-guide.md for layout, ordering, and URL conventions.
Selection rules:
- Prefer dynamic endpoints over static — never hardcode version numbers, coverage %, download counts
- Include
?logo={slug}&logoColor={white|black} on every badge with a Simple Icons slug
- Match existing badge style if README already has badges (from
existing_badges.style); default to flat-square
- If platform is GitLab or Bitbucket, use shields.io platform paths (
/gitlab/..., /bitbucket/...)
--profile <name>: preset badge selection by maturity. new (3-5 badges: status, license, language), active (8-12: core + quality, code-style, frameworks), mature (12-18: core + all extended except developer-tooling), enterprise (15-20: ALL 16 categories including OpenSSF). Overrides --include/--exclude. No profile = auto-select based on detected features
- Target 8-15 badges; group by display super-groups: Status > Quality > Package > Tech Stack > Social
Display super-group → category mapping:
| Super-group |
Categories |
| Status |
status |
| Quality |
quality, code-style, security |
| Package |
package, license |
| Tech Stack |
language, frameworks, infrastructure, docs, release, databases, monorepo, developer-tooling |
| Social |
social, community |
- Deduplicate against existing badges by comparing badge URL service/metric paths
- For CI status: prefer native badge URL (e.g.,
github.com/{owner}/{repo}/actions/workflows/{file}/badge.svg) — works for private repos. For repos with 5+ workflows, prioritize CI/test workflows; let user select others in Phase 3
- If
repo.visibility is "private", skip badges marked requires: public-api and warn user. Prefer native URLs for CI and direct service URLs for coverage
- If existing badges reference dead services (from
existing_badges.dead_services), flag them and suggest catalog replacements
- Custom badge support: if user requests a badge not in the catalog (Discord server, sponsor, custom API), construct from shields.io static badge API or endpoint badge API (
/badge/dynamic/json?url=...&query=...). Ask for required params
- If user requests forthebadge.com-style decorative badges, use forthebadge.com API. Note: forthebadge is decorative only — no dynamic data. For dynamic badges in large bold style, use shields.io
?style=for-the-badge
Flag handling:
--include <categories>: only generate badges from named categories (comma-separated). Category names: status, quality, package, license, language, social, code-style, frameworks, infrastructure, docs, release, databases, monorepo, community, security, developer-tooling. Mutually exclusive with --exclude — error if both provided
--exclude <categories>: skip named categories. Same names as --include. Also accepts display group alias: tech-stack expands to language,frameworks,infrastructure,docs,release,databases,monorepo,developer-tooling. Mutually exclusive with --include
--style <style>: override badge style (flat, flat-square, plastic, for-the-badge, social)
--layout <layout>: badge arrangement — inline (default), centered, grouped, table, collapsible. collapsible wraps secondary groups (Tech Stack, Social) in <details><summary> elements — ideal for 15+ badges. See style-guide.md
--readme <path>: target a specific file instead of auto-detected README
--dark-mode: generate <picture> elements with <source media="(prefers-color-scheme: dark)"> for theme-aware badges on GitHub. Produce HTML instead of pure markdown
--dry-run: output proposed badge block and diff without modifying any file. Exit after preview
--yes: skip approval prompt before modifying files
--replace: replace content within markers AND consolidate scattered badges into the marker block
Phase 3 — Present
Show grouped preview with category headers. Render badges as actual [](link) markdown so the user can see them.
Diff indicators when updating existing badges:
[+] new badge being added
[=] existing badge being kept
[-] existing badge being removed
If scattered badges exist outside markers, show their locations and offer to consolidate into the marker block.
If user requests removal only (e.g., "remove social badges"), skip detection, read existing badge block, remove specified badges, present updated block.
Offer to reorder, add, or remove individual badges before finalizing. Accept natural language adjustments ("move stars before license", "drop the forks badge", "add a Discord badge").
Ask for approval before modifying files. Skip approval if --yes passed. Never skip prompts for missing required info (owner/repo, workflow file names, etc.) even with --yes.
If --dry-run, output the proposed block and exit without modifying files.
Phase 4 — Insert
Find existing <!-- BADGES:START --> / <!-- BADGES:END --> markers or create them.
Insert approved badges grouped by display super-group (Status, Quality, Package, Tech Stack, Social). Separate groups with a blank line. Add <!-- generated by add-badges YYYY-MM-DD --> comment inside the marker block.
Insertion point priority:
- Existing markers (replace content between them)
- After first
# Title heading
- Top of file if no heading found
If no README exists, create one with # {repo-name} heading then add badges.
If --dark-mode, wrap each badge in <picture> elements per style-guide.md.
--replace consolidates any scattered badges found outside markers into the marker block. Show user exactly what will be moved — nothing silently deleted.
Preserve any manual content outside markers.
After insertion, optionally run uv run python skills/add-badges/scripts/validate-badges.py <readme-path> via Bash to verify all badge URLs return valid responses. Report any broken or slow badges to the user.
Style Rules
Default style: flat-square. Match existing style if badges already present. Use for-the-badge for hero/landing sections. Use social style for star/follow count badges. Separate display groups with a blank line in the output.
Error Handling
- No git remote: prompt for
owner/repo. If user declines, generate only static language/framework/tooling badges (no remote-dependent badges)
- No manifest files: static-only badges
- RST/AsciiDoc README: use appropriate image syntax (see style-guide.md for format-specific syntax)
- Mixed existing styles: recommend standardizing, ask user which style
- Style-only change (
--style with no other changes): preserve current badge set, update style param only
- Private repo detected: skip
requires: public-api badges, prefer native badge URLs, warn user
- detect.py produces partial results: work with what is available, note missing sections
Tricky Icon Slugs
Common Simple Icons gotchas: gnubash not bash, nodedotjs not node, vuedotjs not vue, nextdotjs not next, .env is dotenv, springboot not spring-boot, flydotio not fly. Note: nuxt is now correct (was nuxtdotjs). For icons not in the catalog, use lowercase brand name; check simpleicons.org if unsure.
Golden Example
<!-- BADGES:START -->
<!-- generated by add-badges 2025-01-15 -->
[](https://github.com/{owner}/{repo}/actions)
[](https://pypi.org/project/{package}/)
[](https://github.com/{owner}/{repo}/blob/main/LICENSE)
[](https://scorecard.dev/viewer/?uri=github.com/{owner}/{repo})
<!-- BADGES:END -->
Reference File Index
| File |
Read When |
references/badge-catalog-core.md |
Always — provides base badge definitions for common categories |
references/badge-catalog-extended.md |
Detection reports non-basic signals (frameworks, infrastructure, linters, docs, etc.) |
references/style-guide.md |
Determining layout, ordering, URL conventions, and format-specific syntax |
Canonical Vocabulary
| Canonical Term |
Meaning |
| badge |
A shields.io (or similar) image element displaying project metadata |
| shield |
Synonym for badge; the rendered SVG from shields.io |
| style |
Visual variant: flat, flat-square, plastic, for-the-badge, social |
| super-group |
Display grouping: Status, Quality, Package, Tech Stack, Social |
| category |
Classification of a badge type (e.g., license, language, frameworks) |
| marker |
HTML comments (<!-- BADGES:START/END -->) delimiting the badge block |
| slug |
Simple Icons identifier used in ?logo= parameter (e.g., gnubash) |
| profile |
Preset badge selection by project maturity: new, active, mature, enterprise |
| dynamic badge |
Badge that fetches live data from an endpoint (version, coverage, downloads) |
| static badge |
Badge with hardcoded text — avoid when a dynamic alternative exists |
Critical Rules
Non-negotiable constraints for every badge operation:
- Never hardcode dynamic values. Always use shields.io dynamic endpoints for versions, coverage, and download counts.
- Always include logo parameters. Every badge with a Simple Icons slug must have
?logo={slug}&logoColor={white|black}.
- Respect existing style. Match the style of badges already present in the README; default to
flat-square only when no badges exist.
- Never modify content outside markers. Preserve all manual content outside
<!-- BADGES:START --> / <!-- BADGES:END --> markers.
- Always ask before writing. Never modify the README without user approval unless
--yes was explicitly passed.
- Check icon slugs carefully. Use the Tricky Icon Slugs list; verify against simpleicons.org when uncertain.
- Skip private-incompatible badges. When
repo.visibility is "private", never generate badges marked requires: public-api.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: wyattowalsh-agents-add-badges3description: Phase 1 — Detect4---56## Phase 1 — Detect78Run the detection script via the Bash tool:910```11uv run python skills/add-badges/scripts/detect.py <path>12```1314Parse the JSON output. The script detects: repo info, languages, package managers, frameworks, CI/CD, infrastructure, code quality, testing, docs, license, release, security, community, developer tooling, databases, monorepo signals, and existing badges.1516If the script fails (uv unavailable, Python missing, script error, invalid JSON), fall back to manual detection:17- Glob for manifest files (pyproject.toml, package.json, go.mod, Cargo.toml, etc.)18- Read `.git/config` or run `git remote get-url origin` for owner/repo19- Glob `.github/workflows/*.yml` for CI badge candidates20- Read LICENSE first line for SPDX type21- Check for Dockerfile, .pre-commit-config.yaml, codecov.yml, etc.2223## Phase 2 — Select2425Read `references/badge-catalog-core.md` (always). Read `references/badge-catalog-extended.md` when detection reports any non-basic signals (any of: frameworks, infrastructure, code_quality linters/formatters/type_checkers, docs, release, security, monorepo, databases, developer_tooling, community).2627Read `references/style-guide.md` for layout, ordering, and URL conventions.2829**Selection rules:**30- Prefer dynamic endpoints over static — never hardcode version numbers, coverage %, download counts31- Include `?logo={slug}&logoColor={white|black}` on every badge with a Simple Icons slug32- Match existing badge style if README already has badges (from `existing_badges.style`); default to `flat-square`33- If platform is GitLab or Bitbucket, use shields.io platform paths (`/gitlab/...`, `/bitbucket/...`)34- `--profile <name>`: preset badge selection by maturity. `new` (3-5 badges: status, license, language), `active` (8-12: core + quality, code-style, frameworks), `mature` (12-18: core + all extended except developer-tooling), `enterprise` (15-20: ALL 16 categories including OpenSSF). Overrides `--include`/`--exclude`. No profile = auto-select based on detected features35- Target 8-15 badges; group by display super-groups: Status > Quality > Package > Tech Stack > Social3637**Display super-group → category mapping:**3839| Super-group | Categories |40|---|---|41| Status | status |42| Quality | quality, code-style, security |43| Package | package, license |44| Tech Stack | language, frameworks, infrastructure, docs, release, databases, monorepo, developer-tooling |45| Social | social, community |46- Deduplicate against existing badges by comparing badge URL service/metric paths47- For CI status: prefer native badge URL (e.g., `github.com/{owner}/{repo}/actions/workflows/{file}/badge.svg`) — works for private repos. For repos with 5+ workflows, prioritize CI/test workflows; let user select others in Phase 348- If `repo.visibility` is `"private"`, skip badges marked `requires: public-api` and warn user. Prefer native URLs for CI and direct service URLs for coverage49- If existing badges reference dead services (from `existing_badges.dead_services`), flag them and suggest catalog replacements50- Custom badge support: if user requests a badge not in the catalog (Discord server, sponsor, custom API), construct from shields.io static badge API or endpoint badge API (`/badge/dynamic/json?url=...&query=...`). Ask for required params51- If user requests forthebadge.com-style decorative badges, use forthebadge.com API. Note: forthebadge is decorative only — no dynamic data. For dynamic badges in large bold style, use shields.io `?style=for-the-badge`5253**Flag handling:**54- `--include <categories>`: only generate badges from named categories (comma-separated). Category names: status, quality, package, license, language, social, code-style, frameworks, infrastructure, docs, release, databases, monorepo, community, security, developer-tooling. **Mutually exclusive with `--exclude`** — error if both provided55- `--exclude <categories>`: skip named categories. Same names as `--include`. Also accepts display group alias: `tech-stack` expands to language,frameworks,infrastructure,docs,release,databases,monorepo,developer-tooling. **Mutually exclusive with `--include`**56- `--style <style>`: override badge style (flat, flat-square, plastic, for-the-badge, social)57- `--layout <layout>`: badge arrangement — inline (default), centered, grouped, table, collapsible. `collapsible` wraps secondary groups (Tech Stack, Social) in `<details><summary>` elements — ideal for 15+ badges. See style-guide.md58- `--readme <path>`: target a specific file instead of auto-detected README59- `--dark-mode`: generate `<picture>` elements with `<source media="(prefers-color-scheme: dark)">` for theme-aware badges on GitHub. Produce HTML instead of pure markdown60- `--dry-run`: output proposed badge block and diff without modifying any file. Exit after preview61- `--yes`: skip approval prompt before modifying files62- `--replace`: replace content within markers AND consolidate scattered badges into the marker block6364## Phase 3 — Present6566Show grouped preview with category headers. Render badges as actual `[](link)` markdown so the user can see them.6768Diff indicators when updating existing badges:69- `[+]` new badge being added70- `[=]` existing badge being kept71- `[-]` existing badge being removed7273If scattered badges exist outside markers, show their locations and offer to consolidate into the marker block.7475If user requests removal only (e.g., "remove social badges"), skip detection, read existing badge block, remove specified badges, present updated block.7677Offer to reorder, add, or remove individual badges before finalizing. Accept natural language adjustments ("move stars before license", "drop the forks badge", "add a Discord badge").7879Ask for approval before modifying files. Skip approval if `--yes` passed. **Never skip prompts for missing required info** (owner/repo, workflow file names, etc.) even with `--yes`.8081If `--dry-run`, output the proposed block and exit without modifying files.8283## Phase 4 — Insert8485Find existing `<!-- BADGES:START -->` / `<!-- BADGES:END -->` markers or create them.8687Insert approved badges grouped by display super-group (Status, Quality, Package, Tech Stack, Social). Separate groups with a blank line. Add `<!-- generated by add-badges YYYY-MM-DD -->` comment inside the marker block.8889Insertion point priority:901. Existing markers (replace content between them)912. After first `# Title` heading923. Top of file if no heading found9394If no README exists, create one with `# {repo-name}` heading then add badges.9596If `--dark-mode`, wrap each badge in `<picture>` elements per style-guide.md.9798`--replace` consolidates any scattered badges found outside markers into the marker block. Show user exactly what will be moved — nothing silently deleted.99100Preserve any manual content outside markers.101102After insertion, optionally run `uv run python skills/add-badges/scripts/validate-badges.py <readme-path>` via Bash to verify all badge URLs return valid responses. Report any broken or slow badges to the user.103104## Style Rules105106Default style: `flat-square`. Match existing style if badges already present. Use `for-the-badge` for hero/landing sections. Use `social` style for star/follow count badges. Separate display groups with a blank line in the output.107108## Error Handling109110- No git remote: prompt for `owner/repo`. If user declines, generate only static language/framework/tooling badges (no remote-dependent badges)111- No manifest files: static-only badges112- RST/AsciiDoc README: use appropriate image syntax (see style-guide.md for format-specific syntax)113- Mixed existing styles: recommend standardizing, ask user which style114- Style-only change (`--style` with no other changes): preserve current badge set, update style param only115- Private repo detected: skip `requires: public-api` badges, prefer native badge URLs, warn user116- detect.py produces partial results: work with what is available, note missing sections117118## Tricky Icon Slugs119120Common Simple Icons gotchas: `gnubash` not `bash`, `nodedotjs` not `node`, `vuedotjs` not `vue`, `nextdotjs` not `next`, `.env` is `dotenv`, `springboot` not `spring-boot`, `flydotio` not `fly`. Note: `nuxt` is now correct (was `nuxtdotjs`). For icons not in the catalog, use lowercase brand name; check simpleicons.org if unsure.121122## Golden Example123124```markdown125<!-- BADGES:START -->126<!-- generated by add-badges 2025-01-15 -->127[](https://github.com/{owner}/{repo}/actions)128[](https://pypi.org/project/{package}/)129[](https://github.com/{owner}/{repo}/blob/main/LICENSE)130[](https://scorecard.dev/viewer/?uri=github.com/{owner}/{repo})131<!-- BADGES:END -->132```133134## Reference File Index135136| File | Read When |137|------|-----------|138| `references/badge-catalog-core.md` | Always — provides base badge definitions for common categories |139| `references/badge-catalog-extended.md` | Detection reports non-basic signals (frameworks, infrastructure, linters, docs, etc.) |140| `references/style-guide.md` | Determining layout, ordering, URL conventions, and format-specific syntax |141142## Canonical Vocabulary143144| Canonical Term | Meaning |145|----------------|---------|146| badge | A shields.io (or similar) image element displaying project metadata |147| shield | Synonym for badge; the rendered SVG from shields.io |148| style | Visual variant: flat, flat-square, plastic, for-the-badge, social |149| super-group | Display grouping: Status, Quality, Package, Tech Stack, Social |150| category | Classification of a badge type (e.g., license, language, frameworks) |151| marker | HTML comments (`<!-- BADGES:START/END -->`) delimiting the badge block |152| slug | Simple Icons identifier used in `?logo=` parameter (e.g., `gnubash`) |153| profile | Preset badge selection by project maturity: new, active, mature, enterprise |154| dynamic badge | Badge that fetches live data from an endpoint (version, coverage, downloads) |155| static badge | Badge with hardcoded text — avoid when a dynamic alternative exists |156157## Critical Rules158159Non-negotiable constraints for every badge operation:1601611. **Never hardcode dynamic values.** Always use shields.io dynamic endpoints for versions, coverage, and download counts.1622. **Always include logo parameters.** Every badge with a Simple Icons slug must have `?logo={slug}&logoColor={white|black}`.1633. **Respect existing style.** Match the style of badges already present in the README; default to `flat-square` only when no badges exist.1644. **Never modify content outside markers.** Preserve all manual content outside `<!-- BADGES:START -->` / `<!-- BADGES:END -->` markers.1655. **Always ask before writing.** Never modify the README without user approval unless `--yes` was explicitly passed.1666. **Check icon slugs carefully.** Use the Tricky Icon Slugs list; verify against simpleicons.org when uncertain.1677. **Skip private-incompatible badges.** When `repo.visibility` is `"private"`, never generate badges marked `requires: public-api`.168169---170> Converted and distributed by [TomeVault](https://tomevault.io/claim/wyattowalsh) — claim your Tome and manage your conversions.171<!-- tomevault:4.0:skill_md:2026-04-13 -->