mkdocs-site-bootstrap
mkdocs-site-bootstrap
Bootstrap and (optionally) deploy a MkDocs Material documentation site for a repository, then keep helping the user add pages over time.
This skill is consent-gated. It records the user's preferences in
.skills/preferences.yaml and never repeats destructive actions without
asking. If the user changes their mind, scripts/check-preferences.sh --reset mkdocs_site_bootstrap clears the recorded decision so the next invocation
starts fresh.
When to trigger
- User asks to "set up docs", "create a docs site", "add a documentation site", "publish docs to GitHub Pages"
- User has loose markdown notes / a
docs/directory and wants it browsable - User wants the same docs stack as the
daviddwlee84/agent-skillsrepo applied to a new project - User says they want an LLM-friendly docs site (llms.txt, copy-to-LLM)
- User asks for "bilingual docs", "雙語 docs", "i18n", "multilingual", "add Traditional Chinese", "add zh-TW", "translate the docs", or to add any non-English language to an existing site → jump to step 7
When NOT to trigger
- User just wants to write a single doc file → don't scaffold a whole site
- User explicitly opted out (preferences.yaml says
enabled: false) → defer unless the user is now reversing that decision - User wants to evaluate or benchmark a skill → use
skill-creator - User wants to author a new agent skill → use
skill-author
Workflow
1. Read preferences first
Before doing anything, check whether this repo already has a recorded decision:
bash skills/local/mkdocs-site-bootstrap/scripts/check-preferences.sh \
--get mkdocs_site_bootstrap
Possible states:
| State | Meaning | What to do |
|---|---|---|
| File doesn't exist or key missing | Never asked | Proceed to step 2 (interview) |
enabled: true, pages_deployed: true |
Site is live | Skip to step 6 (ongoing helpers) |
enabled: true, pages_deployed: false |
Bootstrapped but not deployed | Skip to step 5 (deploy) |
enabled: false |
User opted out | Confirm they want to reverse that, then --reset and re-run |
2. Interview (only if no recorded decision)
Ask the user explicitly:
- "Do you want a MkDocs Material documentation site for this project? (yes / no / I'll think about it)"
- If yes: "Should it auto-deploy to GitHub Pages on push to main? (yes / no — I'll deploy manually)"
Record both answers immediately so an interrupted session doesn't lose them:
bash skills/local/mkdocs-site-bootstrap/scripts/check-preferences.sh \
--set mkdocs_site_bootstrap.enabled=true \
--set mkdocs_site_bootstrap.stack=mkdocs-material \
--set mkdocs_site_bootstrap.auto_deploy=true
If the user said no, record enabled: false and stop. Don't pester on
future invocations.
3. Detect existing docs (consent gate)
Before scaffolding, scan the target repo. Read
references/existing-docs-handling.md for the full decision tree, but
the short version:
- If
mkdocs.ymlalready exists → report "looks like an mkdocs site already exists at ; not overwriting" and stop. - If
docs/exists and is non-empty → list the files, ask the user one of: (a) skip — leave my docs alone, just createmkdocs.ymlpointing at them; (b) wrap — createmkdocs.ymlwith my files included as-is in the nav; (c) manual — let me reorganize first, then re-run. - If neither exists → safe to scaffold from scratch.
Record the decision under mkdocs_site_bootstrap.existing_docs_decision.
4. Scaffold
Run init-docs-site.sh. It writes (or refuses to overwrite) mkdocs.yml,
pyproject.toml (with [project.optional-dependencies] docs = […]), the
docs/ skeleton, .github/workflows/docs.yml, and stub assets for
copy-to-llm.
bash skills/local/mkdocs-site-bootstrap/scripts/init-docs-site.sh \
--site-name "My Project" \
--repo-slug owner/repo \
--site-url https://owner.github.io/repo/
Use --dry-run first to preview. The script always preserves any existing
files unless --force is passed.
After scaffolding, run a local strict build to catch obvious issues:
uv sync --extra docs
uv run mkdocs build --strict
5. Enable Pages and trigger first deploy (consent gate)
This calls the GitHub API (gh api -X POST .../pages -f build_type=workflow)
and then triggers the workflow. Always confirm with the user first —
say exactly which API call you're about to make and which repo it'll affect.
Only proceed on explicit yes.
bash skills/local/mkdocs-site-bootstrap/scripts/enable-pages.sh \
--repo owner/repo
Flags:
--dry-run— print theghcalls without running them--no-trigger— enable Pages but don't run the workflow yet
After success, set pages_deployed=true and pages_enabled_at=$(date +%F)
in preferences.
6. Ongoing: add docs pages
For each new doc the user wants, use the helper instead of hand-editing
mkdocs.yml:
bash skills/local/mkdocs-site-bootstrap/scripts/add-docs-page.sh \
--section workflows \
--title "My new workflow" \
--slug my-new-workflow
It creates docs/<section>/<slug>.md from the page template and inserts a
nav entry into mkdocs.yml under the matching section heading. Idempotent
— re-running with the same slug is a no-op.
If the project has additional languages configured in
.skills/preferences.yaml (mkdocs_site_bootstrap.languages), add-docs-page.sh
also generates *.<LANG>.md stubs for every non-default language, with the
terminology-rule admonition pre-injected. Use --lang LANG to add only the
translation for one specific language without re-creating the default.
7. Optional: add a non-English language
The skill supports bilingual / multi-language sites via the
mkdocs-static-i18n plugin (suffix layout: index.md + index.zh-TW.md).
This step is opt-in and decoupled from initial bootstrap.
Trigger: user asks for "bilingual docs", "雙語 docs", "add zh-TW", "i18n", "add Traditional Chinese", "translate the docs", or similar.
Read references/i18n-guide.md first — it covers the terminology
preservation rule ("中文 (English original)" format on first mention; no
invented translations) which authors must follow on non-English pages.
Then run (with --drop-strict if your CI uses mkdocs build --strict —
keeping llmstxt will fail strict-mode builds with "Page URI not found"
warnings, so the script offers to patch .github/workflows/docs.yml and
Makefile for you):
bash skills/local/mkdocs-site-bootstrap/scripts/add-language.sh \
--lang zh-TW --drop-strict
This inserts the i18n plugin into mkdocs.yml, creates *.zh-TW.md stub
siblings of every existing page (with the terminology admonition
pre-injected), uncomments mkdocs-static-i18n in pyproject.toml, drops
--strict from CI/Makefile, and records the choice in
.skills/preferences.yaml. Idempotent — re-running with the same --lang
is a no-op.
If you'd rather lose /llms.txt than --strict, use --remove-llmstxt
instead (and skip --drop-strict).
After it runs, re-sync deps and rebuild:
uv sync --extra docs
uv run mkdocs build # --strict only if you went the --remove-llmstxt route
After the script finishes — translation is a separate step
add-language.sh only produces structural placeholders: each
*.<LANG>.md stub contains the terminology admonition plus a "Translation
pending" warning. The script never auto-translates body prose, because LLM
translation routinely violates the "no invented translations" terminology
rule (e.g. coining 「嵌入」/「向量」/「内嵌」 for embedding when none is
canonical).
Once stubs exist, explicitly ask the user whether to translate them now — do not assume. A reasonable script:
"Stubs created. Want me to translate the bodies page-by-page? I'll do 4-6 pages per batch, run
mkdocs buildbetween batches to verify, and follow the terminology rule (English original on first mention, never invent translations)."
Only proceed on explicit yes. If the user defers, leave the stubs in place — they're already valid pages and the build passes.
When translating, also offer to populate nav_translations in mkdocs.yml
for top-level section headings (see references/i18n-guide.md
§nav_translations). This is independent from page-body translation and the
user may want one without the other.
Available scripts
scripts/check-preferences.sh— Read, set, or reset.skills/preferences.yaml. Always-safe to run.- Flags:
--get KEY,--set KEY=VALUE(repeatable),--reset NAMESPACE,--list,--dry-run,--json.
- Flags:
scripts/init-docs-site.sh— Scaffold the site files.- Flags:
--site-name,--repo-slug,--site-url,--existing skip|wrap,--no-workflow,--dry-run,--force.
- Flags:
scripts/enable-pages.sh— Enable Pages and trigger first deploy viagh api. Requiresgh auth statusto pass first.- Flags:
--repo OWNER/REPO,--no-trigger,--dry-run.
- Flags:
scripts/add-docs-page.sh— Create a new page and insert it intomkdocs.yml's nav. If multiple languages are configured, also writes*.<LANG>.mdstubs for every non-default language.- Flags:
--section,--title,--slug,--template PATH,--lang LANG(single-language stub only),--dry-run,--force.
- Flags:
scripts/add-language.sh— Retrofit a non-default language into an existing site. Insertsplugins.i18n, creates*.<LANG>.mdstubs with the terminology admonition, updates preferences, uncomments the static-i18n dep. Keepsmkdocs-llmstxtby default; auto-patches CI to drop--strictwith--drop-strict. Idempotent.- Flags:
--lang LANG(required),--name NAME,--default-lang LANG,--target-dir DIR,--no-stubs,--remove-llmstxt,--drop-strict,--dry-run,--force.
- Flags:
Reference files
references/preferences-schema.md— Schema for.skills/preferences.yamland conventions for cross-skill use. Read this whenever you're touching a preferences key for the first time.references/existing-docs-handling.md— Full decision tree for handling user's pre-existingdocs/content without surprises. Read this before step 3 of every fresh bootstrap.references/docs-stack-recipe.md— Verbatim stack recipe (mkdocs.yml, pyproject.toml, workflow, linking rules). Useful when the user asks "what exactly is this stack?" or wants to apply pieces manually.references/i18n-guide.md— Bilingual / multi-language docs setup usingmkdocs-static-i18n. Read this before runningadd-language.sh. Includes the verbatim "preserve English originals" terminology rule for zh-TW pages.references/mkdocs-2-and-zensical.md— Why the stack pinsmkdocs<2andmkdocs-material<10. Captures the MkDocs 2.0 plugin-removal situation, Material team's Zensical replacement, and the criteria for lifting the caps. Read whenever a user asks about upgrading MkDocs or why the docs build is on 1.x.
Bundled assets
Templates the scripts copy from. Edit them here, not in the user's repo.
assets/mkdocs.yml.template— Material theme + llmstxt + copy-to-llm plugins + pymdownx.snippets, parameterized with{{SITE_NAME}},{{REPO_SLUG}},{{SITE_URL}}.assets/pyproject.toml.template— Minimal[project]block + the docs optional-deps group.assets/docs-workflow.yml.template—.github/workflows/docs.ymlwith paths filter, uv setup, strict build, Pages deploy.assets/docs-skeleton/—index.md,getting-started.md,_snippets/examples,assets/copy-to-llm/JS+CSS files copied from this repo.assets/page.md.template— Used byadd-docs-page.sh.assets/translation-stub.md.template— Stub used for non-default-language pages byadd-language.shandadd-docs-page.sh. Contains the verbatim terminology-rule admonition.assets/i18n-plugin.yml.snippet— Reference YAML block for themkdocs-static-i18nplugin (used byreferences/i18n-guide.md; the script builds the equivalent block viayq).
Gotchas
- MkDocs strict mode rejects relative
.mdlinks pointing outsidedocs/. Insidedocs/→ relative is fine. Outsidedocs/for.mdfiles (e.g., linking to repoTODO.md) → use absolute GitHub URL. Outsidedocs/for directories or non-.md(backlog/,pyproject.toml) → relative is downgraded to INFO and tolerated. Templates already do this right; don't "fix" the absolute URLs. pymdownx.snippetsrequires_snippets/innot_in_nav:or strict mode complains about pages-not-in-nav. Template handles it.gh api -X POST .../pagesis idempotent forbuild_type=workflowbut errors on404 Not Foundif the repo isn't pushed to GitHub yet. Checkgh repo viewsucceeds before runningenable-pages.sh.- The Pages deploy workflow needs
permissions: pages: write, id-token: writeat the workflow level. Template has it; if you copy pieces into an existing workflow, don't lose this. copy-to-llmplugin'srepo_urlis the SITE URL, not the GitHub URL. Counter-intuitive name.- Don't auto-migrate existing user docs. Always ask. Migrating someone's
hand-curated
docs/into a new structure is a high-trust action that should be the user's explicit decision, not the agent's default. .skills/preferences.yamlis per-repo, not global. Don't write it to~/.skills/or~/.config/. Each repo has its own decisions.mkdocs-static-i18nrequirestheme.languageset to the default language code. The plugin warns when it's missing.add-language.shsets it on first run; if you copy pieces by hand, don't forget.docs_structure: suffixonly.add-language.shwrites the suffix layout (index.md+index.zh-TW.mdsiblings); thei18n_structure: folderpreference key is reserved but not implemented. Don't paste afolderconfig intomkdocs.ymland expect the script to keep it consistent.mkdocs-llmstxtis incompatible withmkdocs-static-i18nunder--strict. llmstxt'ssections:source-path lookups break afterreconfigure_materialremaps the page index.add-language.shkeeps llmstxt by default (most users want/llms.txtmore than they want--strict's safety net) and offers--drop-strictto auto-patch.github/workflows/docs.ymlandMakefileso the build doesn't fail on the resulting warnings. Use--remove-llmstxtto flip the trade-off and keep--strict. The dep stays inpyproject.tomleither way.add-language.shremovesnavigation.instantfromtheme.featuresbecause the language switcher's contextual link is incompatible with instant navigation. Material's plugin emits the warning itself; the script is just acting on it.- Don't translate technical terms in zh-TW pages without the English original. The terminology rule (kept English in parens on first mention, no invented translations) is non-negotiable; the stub template injects the rule as an admonition so authors see it before they start.
Updating an existing site (not bootstrapping)
If mkdocs.yml already exists, this skill mostly defers — only
add-docs-page.sh and check-preferences.sh are useful. Don't try to
"upgrade" the user's mkdocs.yml without an explicit ask; their config may
have customizations the templates don't know about.
More from daviddwlee84/agent-skills
project-knowledge-harness
Set up a structured project memory for any software project — TODO.md as priority/effort-tagged index of future work, backlog/ for resume-friendly research/design notes on P? items, and pitfalls/ as a symptom-grep-able knowledge base of past traps. Use when a user wants somewhere to record "maybe later" ideas, freeze troubleshooting state, capture trade-off analysis, or stop re-debugging the same problem.
15agent-history-hygiene
Commit SpecStory chat transcripts (`.specstory/history/*.md`), Claude Code plan files (`.claude/plans/*.md`, `plansDirectory`), and other coding-agent artifacts (`.cursor/plans/`, `.cursor/rules/`, `.opencode/plans/`, `.specify/`, `.codex/`) alongside the feature diff they produced — without leaking `.env` contents, API keys, or private-key PEM blocks into git history. Use when the user says "commit my chat", "save this specstory session", "stage the plan file", "scrub the transcript", "my .env leaked in chat", "bootstrap pre-commit for this project", or when you notice untracked `.specstory/history/*.md` or `.claude/plans/*.md` files while running `git status`. Also use after an accidental push of a secret to enforce rotate-first, rewrite-last remediation instead of reflexive `git push --force`.
11pueue-job-queue
Drive Nukesor/pueue (https://github.com/Nukesor/pueue) for queued, parallel, scheduled, and lightly-DAG'd shell jobs — wraps `pueue add --after`, `pueue status --json`, `pueue log --json`, group-level parallelism, and `pueued` daemon health. Use when the user wants to background long-running shell commands across reboots, queue dozens of jobs with capped parallelism, run a fan-out / fan-in pipeline of shell steps, says "pueue", "pueued", "pueue add", "pueue queue", "pueue group", "task queue for shell", "background this job", or asks how to schedule/parallelize CLI work without a real orchestrator (Airflow/Prefect/Dagster). Good fit for ML sweeps, long-running data pipelines, batched evaluations, scheduled `--delay` jobs, "wait for X then run Y" sequences.
4skill-author
Author a new agent skill or refactor an existing one to follow agentskills.io best practices — gotchas sections, output templates, validation loops, calibrated specificity (fragility-based), and agentic script design (--help, --dry-run, structured stdout, stderr diagnostics, PEP 723 inline deps, pinned uvx/npx versions). Use whenever the user wants to create a new skill from scratch, scaffold a SKILL.md, write a reference file, design a script meant to be invoked by an agent, lint a draft skill for quality, or convert an ad-hoc workflow into a reusable skill. For evaluating skill output quality with test cases, benchmarking, or optimizing the description trigger rate, defer to the `skill-creator` skill instead — this skill focuses on authoring, not evaluation.
2quantatitive-factor-researcher
assists in designing, evaluating and implementing factor-based investment strategies with Python
2nextjs
Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications — routing, Server Components, Server Actions, Cache Components, layouts, middleware/proxy, data fetching, rendering strategies, and deployment on Vercel.
1