Repository Documentation
Generates production-grade README files matching the Szum-Tech standard
(see references/section-standards.md for the canonical structure) and
produces two extra GitHub artifacts the user can paste directly into the
repo settings:
- README.md — created or updated in repository root
- GitHub description — single sentence, ≤ 350 characters
- GitHub topics — 5–20 lowercase-kebab-case tags
All output is in English by default, regardless of conversation language.
If the user explicitly requests another language, use it for README.md only.
The GitHub description and topics must always remain in English — they serve
GitHub's global search and discoverability.
Workflow
Follow these steps in order. Do not skip steps — each one feeds the next.
Step 1 — Detect project type
Read configuration files in the repository root to determine the project
type. Apply the rules in references/detection-rules.md. Use parallel
Read/Glob calls for speed.
Files to probe (in priority order):
.claude-plugin/marketplace.json or any plugin.json with skills/agents → claude-plugin
package.json → check dependencies, bin, workspaces, main/exports
app.json, expo.json, metro.config.js → mobile-app
pubspec.yaml → mobile-app (Flutter)
turbo.json, nx.json, pnpm-workspace.yaml, lerna.json → monorepo
next.config.*, vite.config.*, app/ or pages/ directory → web-app
bin/ directory or package.json#bin field → cli-tool
- npm package indicators:
main, module, exports, types, files, publishConfig → npm-package
- nothing matches → generic
Build an evidence list (e.g., ["expo@~50 in deps", "app.json present", "metro.config.js"])
so you can show the user why you picked the type.
Step 2 — Confirm type with user
Call AskUserQuestion with:
- The detected type as the recommended option (first, labeled "(Recommended)")
- 2–3 plausible alternatives based on the evidence
- Brief description for each option citing the evidence
If user picks "Other", ask a follow-up free-text question to capture the
custom type, then fall back to templates/generic.md.
Step 3 — Gather metadata
3a — Manifest & config (fast pass)
Extract everything you can from the filesystem without asking:
- name —
package.json#name / app.json#name / directory name
- description / tagline —
package.json#description
- author —
package.json#author / git config
- license —
package.json#license / LICENSE file
- repo URL —
package.json#repository.url / git remote
- node version —
package.json#engines.node / .nvmrc
- package manager — presence of
pnpm-lock.yaml, yarn.lock, bun.lockb, default npm
- scripts —
package.json#scripts
- key dependencies — top frameworks from
dependencies and notable
devDependencies. Capture, for each one, the exact package name and
whether it's a regular / dev / peer dependency, plus its npm scope (if
any). This is needed to build dependency-version badges in Step 6 — see
references/badges-registry.md → Dependency version badges.
- directory tree —
Glob on * (depth 2) to build Project Structure section
3b — Deep research (description quality pass)
package.json#description is often too short or stale. Before writing the
description and tagline, read the actual source to understand what the project
really does. Use parallel Read/Grep calls for speed.
What to read (in priority order):
- Entry points —
src/index.ts, src/main.ts, app/layout.tsx,
src/App.tsx, src/cli.ts, bin/<name> — reveals core API surface and
app structure.
- Feature directories — scan
src/, app/, lib/, packages/ with
Glob("**/*.ts", depth: 3). Read the most meaningful files (hooks,
services, routes, components with complex logic). Skip generated files,
node_modules, and test fixtures.
- Existing docs —
docs/, CHANGELOG.md, CHANGELOG.json,
.changeset/*.md, any .md in root other than README.
- Config that exposes purpose —
next.config.*, vite.config.*,
turbo.json, expo-plugins, feature flag configs. They reveal
integrations (auth, DB, CDN, analytics) not visible in package.json.
- Route / page map — for web apps, glob
app/**/page.tsx or
pages/**/*.tsx to list all routes; this reveals scope (dashboard,
auth flows, API surface, etc.).
- Plugin / agent manifests — for claude-plugin type, read all
plugin.json and SKILL.md files to enumerate capabilities.
From this research, synthesise:
- The primary purpose — what problem does it solve / what does it enable?
- The target user — developer tool? end-user app? library?
- Top 3–5 distinguishing features — what makes it notable vs. similar projects?
- The tech stack summary — core frameworks + notable tooling
Use this synthesis as the source of truth for the tagline, the Features
section, and the GitHub description. Do not rely solely on package.json#description.
If anything critical is still missing after this research, ask in ONE
AskUserQuestion round (group all questions). Do not ask about things you
can read from disk.
Step 4 — Load the right template
Read templates/<detected-type>.md. The template uses {{placeholders}}
that map directly to fields gathered in Step 3.
Step 5 — Merge with existing README (if any)
Read the current README.md. If present:
- Preserve verbatim:
Acknowledgments, Contact & Support, License
(if it points to a specific file), and any H2 sections not present in
the template (treat them as user-authored).
- Regenerate fresh: header, Features, Getting Started, Scripts
Overview, Testing, Project Structure, and all per-type sections —
these reflect current code state.
- Preserve the title if the user clearly customized it (different
from
package.json#name).
If no README exists, skip this merge step.
Step 6 — Generate README
Substitute placeholders, attach preserved sections at their original
positions, validate Markdown headings are properly nested (H1 → H2 → H3),
ensure the Table of Contents links match the actual section anchors.
Apply standards from references/section-standards.md:
- Centered header block with title, badges, tagline, nav links
- Emoji prefix on every H2/H3
- Language tags on every code fence
- Closing footer with "Back to Top" link
Pick badges from references/badges-registry.md matching the detected
stack (license, package version, build, coverage, etc.).
Dependencies must be rendered as dynamic version badges. Anywhere the
README enumerates project dependencies — Features → Core Technologies,
Tech Stack, Peer Dependencies in npm packages, "Built with" lists — emit
one shields.io github/package-json/dependency-version badge per entry,
pulling the live version from package.json. Static colour-chip badges
are forbidden for anything that exists as a package in package.json.
See references/section-standards.md → Dependencies / tech stack
rendering for the exact format.
Step 7 — Generate GitHub description
One sentence, ≤ 350 characters, English. Format:
{What it does} for {target users} — {key benefit / standout feature}.
Example: Enterprise-ready Next.js 16 template with TypeScript, Vitest, Playwright, Storybook, and GitHub Actions CI/CD pre-configured for production deployment.
See references/github-metadata.md for examples per project type.
Step 8 — Generate GitHub topics
5–20 tags, all lowercase-kebab-case, no spaces, no emoji, ≤ 50 chars
each. Compose from:
- Project type tag (e.g.,
nextjs, expo, npm-package, cli)
- Core frameworks/languages (
typescript, react, tailwindcss)
- Notable tools/integrations (
vitest, playwright, storybook)
- Domain tags (
design-system, boilerplate, template, monorepo)
Prefer well-known GitHub topics (check that they exist on
github.com/topics if uncertain). Avoid niche names no one searches for.
See references/github-metadata.md for curated topic pools per type.
Step 9 — Write README, auto-update GitHub & report
9a — Write README.md
Write the generated content to README.md in the repository root.
9b — Auto-update GitHub repository (via gh CLI)
Run the following sequence using Bash. At each step, capture the exit
code; on failure record the error and continue to 9c — do NOT abort.
Check auth:
gh auth status
If the command fails (not installed or not logged in), skip steps 2–4
and note the reason in the report.
Get repo owner/name:
gh repo view --json nameWithOwner -q .nameWithOwner
If this fails (not a GitHub remote, no remote configured), skip
steps 3–4 and note the reason.
Set description:
gh repo edit --description "<generated description>"
Replace all topics (PUT overwrites existing topics completely):
Build one -f "names[]=<topic>" argument per topic, then call:
gh api repos/<owner>/<repo>/topics -X PUT \
-f "names[]=topic1" -f "names[]=topic2" ...
9c — Final report
Output a structured summary. Use the exact layout below, filling in the
correct values. Omit the [If updating…] block for new READMEs.
─────────────────────────────────────────────────────────────────
Repository Documentation — Complete
─────────────────────────────────────────────────────────────────
📄 README.md
✅ Written to repository root
[If updating existing README:]
Preserved: Acknowledgments · Contact & Support · License
Regenerated: Header · Features · Getting Started · Scripts ·
Project Structure · [per-type sections]
─────────────────────────────────────────────────────────────────
🐙 GitHub repository
[Use the matching status block:]
On success:
✅ Description updated (XXX/350 chars)
✅ Topics replaced (N tags)
On auth failure:
⚠️ GitHub update skipped — gh not authenticated
Run: gh auth login
On other failure:
❌ GitHub update failed — <short error message>
Manual fallback commands:
gh repo edit --description "..."
gh api repos/OWNER/REPO/topics -X PUT -f "names[]=t1" ...
Description (XXX/350 chars):
<description text>
Topics (N):
<space-separated list>
─────────────────────────────────────────────────────────────────
Quality bar (must-pass before finishing)
Files in this skill
templates/web-app.md — Next.js / Vite / React SPA
templates/mobile-app.md — React Native / Expo / Flutter
templates/npm-package.md — Published library
templates/cli-tool.md — Command-line tool
templates/monorepo.md — Turborepo / Nx / pnpm workspaces
templates/claude-plugin.md — This repo's plugin format
templates/generic.md — Fallback
references/detection-rules.md — Type detection signals
references/section-standards.md — Canonical section structure & style
references/badges-registry.md — shields.io badge catalog
references/github-metadata.md — Description format + topics pools
1---2name: repository-documentation3description: Generate or update a project's README.md plus a ready-to-paste GitHub repository description and topics list, following the Szum-Tech documentation standard. Auto-detects project type (web app, mobile app, npm package, CLI tool, monorepo, Claude plugin) by analyzing package.json, configs, and folder structure, then confirms with the user before generating. Use whenever the user asks to "create README", "update README", "document repository", "generate project docs", "GitHub description", "GitHub topics", or invokes /repository-documentation.4---56# Repository Documentation78Generates production-grade README files matching the **Szum-Tech standard**9(see `references/section-standards.md` for the canonical structure) and10produces two extra GitHub artifacts the user can paste directly into the11repo settings:12131. **README.md** — created or updated in repository root142. **GitHub description** — single sentence, ≤ 350 characters153. **GitHub topics** — 5–20 lowercase-kebab-case tags1617All output is in **English** by default, regardless of conversation language.18If the user explicitly requests another language, use it for **README.md only**.19The GitHub description and topics must always remain in English — they serve20GitHub's global search and discoverability.2122---2324## Workflow2526Follow these steps in order. Do not skip steps — each one feeds the next.2728### Step 1 — Detect project type2930Read configuration files in the repository root to determine the project31type. Apply the rules in `references/detection-rules.md`. Use parallel32`Read`/`Glob` calls for speed.3334Files to probe (in priority order):3536- `.claude-plugin/marketplace.json` or any `plugin.json` with `skills`/`agents` → **claude-plugin**37- `package.json` → check `dependencies`, `bin`, `workspaces`, `main`/`exports`38- `app.json`, `expo.json`, `metro.config.js` → **mobile-app**39- `pubspec.yaml` → **mobile-app** (Flutter)40- `turbo.json`, `nx.json`, `pnpm-workspace.yaml`, `lerna.json` → **monorepo**41- `next.config.*`, `vite.config.*`, `app/` or `pages/` directory → **web-app**42- `bin/` directory or `package.json#bin` field → **cli-tool**43- npm package indicators: `main`, `module`, `exports`, `types`, `files`, `publishConfig` → **npm-package**44- nothing matches → **generic**4546Build an **evidence list** (e.g., `["expo@~50 in deps", "app.json present", "metro.config.js"]`)47so you can show the user *why* you picked the type.4849### Step 2 — Confirm type with user5051Call `AskUserQuestion` with:5253- The detected type as the recommended option (first, labeled "(Recommended)")54- 2–3 plausible alternatives based on the evidence55- Brief description for each option citing the evidence5657If user picks "Other", ask a follow-up free-text question to capture the58custom type, then fall back to `templates/generic.md`.5960### Step 3 — Gather metadata6162#### 3a — Manifest & config (fast pass)6364Extract everything you can from the filesystem without asking:6566- **name** — `package.json#name` / `app.json#name` / directory name67- **description / tagline** — `package.json#description`68- **author** — `package.json#author` / git config69- **license** — `package.json#license` / `LICENSE` file70- **repo URL** — `package.json#repository.url` / git remote71- **node version** — `package.json#engines.node` / `.nvmrc`72- **package manager** — presence of `pnpm-lock.yaml`, `yarn.lock`, `bun.lockb`, default `npm`73- **scripts** — `package.json#scripts`74- **key dependencies** — top frameworks from `dependencies` and notable75 `devDependencies`. Capture, for each one, the **exact package name** and76 whether it's a regular / dev / peer dependency, plus its npm scope (if77 any). This is needed to build dependency-version badges in Step 6 — see78 `references/badges-registry.md` → *Dependency version badges*.79- **directory tree** — `Glob` on `*` (depth 2) to build Project Structure section8081#### 3b — Deep research (description quality pass)8283`package.json#description` is often too short or stale. Before writing the84description and tagline, read the actual source to understand what the project85really does. Use parallel `Read`/`Grep` calls for speed.8687**What to read (in priority order):**88891. **Entry points** — `src/index.ts`, `src/main.ts`, `app/layout.tsx`,90 `src/App.tsx`, `src/cli.ts`, `bin/<name>` — reveals core API surface and91 app structure.922. **Feature directories** — scan `src/`, `app/`, `lib/`, `packages/` with93 `Glob("**/*.ts", depth: 3)`. Read the most meaningful files (hooks,94 services, routes, components with complex logic). Skip generated files,95 node_modules, and test fixtures.963. **Existing docs** — `docs/`, `CHANGELOG.md`, `CHANGELOG.json`,97 `.changeset/*.md`, any `.md` in root other than README.984. **Config that exposes purpose** — `next.config.*`, `vite.config.*`,99 `turbo.json`, `expo-plugins`, feature flag configs. They reveal100 integrations (auth, DB, CDN, analytics) not visible in package.json.1015. **Route / page map** — for web apps, glob `app/**/page.tsx` or102 `pages/**/*.tsx` to list all routes; this reveals scope (dashboard,103 auth flows, API surface, etc.).1046. **Plugin / agent manifests** — for claude-plugin type, read all105 `plugin.json` and `SKILL.md` files to enumerate capabilities.106107**From this research, synthesise:**108109- The **primary purpose** — what problem does it solve / what does it enable?110- The **target user** — developer tool? end-user app? library?111- **Top 3–5 distinguishing features** — what makes it notable vs. similar projects?112- The **tech stack summary** — core frameworks + notable tooling113114Use this synthesis as the source of truth for the tagline, the Features115section, and the GitHub description. Do not rely solely on `package.json#description`.116117If anything critical is still missing after this research, ask in ONE118`AskUserQuestion` round (group all questions). Do not ask about things you119can read from disk.120121### Step 4 — Load the right template122123Read `templates/<detected-type>.md`. The template uses `{{placeholders}}`124that map directly to fields gathered in Step 3.125126### Step 5 — Merge with existing README (if any)127128`Read` the current `README.md`. If present:129130- **Preserve verbatim**: `Acknowledgments`, `Contact & Support`, `License`131 (if it points to a specific file), and any H2 sections not present in132 the template (treat them as user-authored).133- **Regenerate fresh**: header, Features, Getting Started, Scripts134 Overview, Testing, Project Structure, and all per-type sections —135 these reflect current code state.136- **Preserve the title** if the user clearly customized it (different137 from `package.json#name`).138139If no README exists, skip this merge step.140141### Step 6 — Generate README142143Substitute placeholders, attach preserved sections at their original144positions, validate Markdown headings are properly nested (H1 → H2 → H3),145ensure the Table of Contents links match the actual section anchors.146147Apply standards from `references/section-standards.md`:148149- Centered header block with title, badges, tagline, nav links150- Emoji prefix on every H2/H3151- Language tags on every code fence152- Closing footer with "Back to Top" link153154Pick badges from `references/badges-registry.md` matching the detected155stack (license, package version, build, coverage, etc.).156157**Dependencies must be rendered as dynamic version badges.** Anywhere the158README enumerates project dependencies — Features → Core Technologies,159Tech Stack, Peer Dependencies in npm packages, "Built with" lists — emit160one shields.io `github/package-json/dependency-version` badge per entry,161pulling the live version from `package.json`. Static colour-chip badges162are forbidden for anything that exists as a package in `package.json`.163See `references/section-standards.md` → *Dependencies / tech stack164rendering* for the exact format.165166### Step 7 — Generate GitHub description167168One sentence, ≤ 350 characters, English. Format:169170> `{What it does} for {target users} — {key benefit / standout feature}.`171172Example: `Enterprise-ready Next.js 16 template with TypeScript, Vitest,173Playwright, Storybook, and GitHub Actions CI/CD pre-configured for174production deployment.`175176See `references/github-metadata.md` for examples per project type.177178### Step 8 — Generate GitHub topics1791805–20 tags, all `lowercase-kebab-case`, no spaces, no emoji, ≤ 50 chars181each. Compose from:182183- Project type tag (e.g., `nextjs`, `expo`, `npm-package`, `cli`)184- Core frameworks/languages (`typescript`, `react`, `tailwindcss`)185- Notable tools/integrations (`vitest`, `playwright`, `storybook`)186- Domain tags (`design-system`, `boilerplate`, `template`, `monorepo`)187188Prefer well-known GitHub topics (check that they exist on189github.com/topics if uncertain). Avoid niche names no one searches for.190See `references/github-metadata.md` for curated topic pools per type.191192### Step 9 — Write README, auto-update GitHub & report193194#### 9a — Write README.md195196`Write` the generated content to `README.md` in the repository root.197198#### 9b — Auto-update GitHub repository (via gh CLI)199200Run the following sequence using `Bash`. At each step, capture the exit201code; on failure record the error and continue to 9c — do NOT abort.2022031. **Check auth:**204 ```bash205 gh auth status206 ```207 If the command fails (not installed or not logged in), skip steps 2–4208 and note the reason in the report.2092102. **Get repo owner/name:**211 ```bash212 gh repo view --json nameWithOwner -q .nameWithOwner213 ```214 If this fails (not a GitHub remote, no remote configured), skip215 steps 3–4 and note the reason.2162173. **Set description:**218 ```bash219 gh repo edit --description "<generated description>"220 ```2212224. **Replace all topics** (PUT overwrites existing topics completely):223 Build one `-f "names[]=<topic>"` argument per topic, then call:224 ```bash225 gh api repos/<owner>/<repo>/topics -X PUT \226 -f "names[]=topic1" -f "names[]=topic2" ...227 ```228229#### 9c — Final report230231Output a structured summary. Use the exact layout below, filling in the232correct values. Omit the `[If updating…]` block for new READMEs.233234```235─────────────────────────────────────────────────────────────────236 Repository Documentation — Complete237─────────────────────────────────────────────────────────────────238239📄 README.md240 ✅ Written to repository root241242 [If updating existing README:]243 Preserved: Acknowledgments · Contact & Support · License244 Regenerated: Header · Features · Getting Started · Scripts ·245 Project Structure · [per-type sections]246247─────────────────────────────────────────────────────────────────248249🐙 GitHub repository250 [Use the matching status block:]251252 On success:253 ✅ Description updated (XXX/350 chars)254 ✅ Topics replaced (N tags)255256 On auth failure:257 ⚠️ GitHub update skipped — gh not authenticated258 Run: gh auth login259260 On other failure:261 ❌ GitHub update failed — <short error message>262 Manual fallback commands:263 gh repo edit --description "..."264 gh api repos/OWNER/REPO/topics -X PUT -f "names[]=t1" ...265266 Description (XXX/350 chars):267 <description text>268269 Topics (N):270 <space-separated list>271272─────────────────────────────────────────────────────────────────273```274275---276277## Quality bar (must-pass before finishing)278279- [ ] Header is wrapped in `<div align="center">` and contains title + at least one badge + tagline280- [ ] Every H2 starts with an emoji281- [ ] Table of Contents links resolve (anchors match section titles)282- [ ] All code fences specify a language283- [ ] Project Structure tree reflects actual directories (verified with `Glob`)284- [ ] License section matches actual `LICENSE` file (read it; don't assume MIT)285- [ ] Scripts section lists scripts present in `package.json` (no invented commands)286- [ ] GitHub description ≤ 350 chars and contains no markdown287- [ ] GitHub topics: 5–20 items, all kebab-case, no duplicates288- [ ] No `{{placeholders}}` remain unsubstituted in the final file289- [ ] Every dependency / tech-stack entry is rendered as a shields.io290 `github/package-json/dependency-version/{owner}/{repo}/...` badge291 (or `npm/v/...` fallback) — no static colour-chip badges for292 anything that exists in `package.json`293294---295296## Files in this skill297298- `templates/web-app.md` — Next.js / Vite / React SPA299- `templates/mobile-app.md` — React Native / Expo / Flutter300- `templates/npm-package.md` — Published library301- `templates/cli-tool.md` — Command-line tool302- `templates/monorepo.md` — Turborepo / Nx / pnpm workspaces303- `templates/claude-plugin.md` — This repo's plugin format304- `templates/generic.md` — Fallback305- `references/detection-rules.md` — Type detection signals306- `references/section-standards.md` — Canonical section structure & style307- `references/badges-registry.md` — shields.io badge catalog308- `references/github-metadata.md` — Description format + topics pools