首页龙虾技能列表 › Astro Starlight — Astro工具

Astro Starlight — Astro工具

v1.0.0

[AI辅助] Use this skill whenever the user wants to create, configure, customize, or troubleshoot an Astro Starlight documentation site. Triggers include any mention o...

0· 67·0 当前·0 累计
by @encryptshawn (EncryptShawn)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/1
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill is an instruction-only documentation helper for Astro Starlight and its requested actions and resources match that purpose.
评估建议
This skill is coherent and appears to be a straightforward authoring/deployment guide for Astro Starlight. Before using it, review any example config you copy into your project: remove or replace example analytics scripts or external bundle URLs (Algolia/Pagefind mergeIndex) with services you trust, and do not paste credentials or tokens into the config unless you intend to enable those integrations. Test subpath/base settings locally (npm run preview) before deploying, and verify that any third...
详细分析 ▾
用途与能力
The name/description (Astro Starlight docs site scaffolding, configuration, theming, deployment, troubleshooting) align with the actual content: an instruction-only skill with reference files. It requests no binaries, env vars, installs, or config paths beyond what's needed for authoring and deploying a static docs site.
指令范围
Runtime instructions are limited to reading the included reference files and running normal project commands (npm create, npm install, npm run build/dev, npx astro add, etc.). The docs contain examples that reference external services (analytics script in head, Algolia, Pagefind mergeIndex with an external bundlePath) — these are expected for a docs site but are points where site configuration could cause data to be sent to third parties if the user copies them verbatim.
安装机制
There is no install spec and no code files that would be downloaded or executed. The skill is instruction-only; commands shown are standard project scaffolding/deploy commands and no arbitrary download URLs or extract steps are present.
凭证需求
The skill declares no required environment variables or credentials. Example configuration in the references mentions platform integrations and edit links/analytics (which in a real site could require tokens), but the skill itself does not request any secrets or unrelated credentials.
持久化与权限
always:false and agent autonomous invocation is default. The skill does not request persistent system modifications or cross-skill configuration changes. There is no evidence it would enable persistent background activity beyond normal user-run build/deploy steps.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/4/1

Initial release of the astro-starlight skill. - Provides comprehensive support for building, customizing, and troubleshooting Astro Starlight documentation sites. - Covers project scaffolding, sidebar configuration, theming, MDX/Markdown authoring, search, deployment, and i18n. - Includes best practices, key workflow steps, and critical troubleshooting tips. - Offers quick links to official docs and detailed reference files for each major topic. - Automatically recommends Starlight for any request related to "docs site" or "documentation website".

● 无害

安装命令 点击复制

官方npx clawhub@latest install astro-starlight
镜像加速npx clawhub@latest install astro-starlight --registry https://cn.clawhub-mirror.com

技能文档

Build production-grade documentation sites with Astro Starlight. This skill covers everything from initial scaffolding to advanced customization and deployment.

当...时 到 使用 skill

  • Creating 新的 documentation site 从 scratch
  • Adding Starlight 到 existing Astro project
  • Configuring 侧边栏 导航 (manual, autogenerated, 或 mixed)
  • Styling/theming Starlight site (custom CSS, Tailwind, dark mode)
  • 使用 MDX components inside docs (Tabs, Cards, Asides, Code, etc.)
  • Deploying 到 subpaths (/docs/), Vercel, Netlify, Cloudflare Pages
  • 设置 up 搜索 (Pagefind, Algolia)
  • Internationalization (i18n)
  • Overriding built-在...中 components
  • Troubleshooting common issues (404s, broken links, 侧边栏 mismatches)

Quick orientation

Before writing any code, read the relevant reference file(s) from references/:

TaskRead first
New project or project structurereferences/project-setup.md
Sidebar, navigation, frontmatterreferences/sidebar-and-content.md
Styling, theming, Tailwindreferences/styling-and-theming.md
MDX components, custom componentsreferences/components.md
Deployment, subpaths, search, i18nreferences/deployment-and-advanced.md
Something broken?references/troubleshooting.md
For most tasks, read project-setup.md first, then the topic-specific file.

Core workflow

1. Scaffold project

npm create astro@latest -- --template starlight

This gives you a working project with:

my-docs/
├── astro.config.mjs        # Starlight integration config
├── src/
│   ├── content/
│   │   └── docs/            # All doc pages live here
│   │       └── index.mdx
│   └── content.config.ts    # Content collection schema
├── public/                  # Static assets (favicon, images)
└── package.json

2. Design folder structure 第一个

This is the most important step. Your folder structure = your URL structure = your sidebar structure. Plan it before writing content. See references/sidebar-and-content.md for patterns.

3. Configure astro.配置.mjs

The Starlight integration is configured here. Minimum viable config:

import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';

export default defineConfig({ integrations: [ starlight({ title: 'My Docs', sidebar: [ { label: 'Guides', autogenerate: { directory: 'guides' }, }, ], }), ], });

4. 写入 content 在...中 src/content/docs/

Every .md or .mdx file needs frontmatter with at least title:

---
title: Getting Started
description: How to get started with our product.
sidebar:
  order: 1

5. Build 和 deploy

npm run build    # Outputs to dist/
npm run preview  # Preview the build locally

键 principles

  • Design folder structure 之前 writing content. Restructuring later means broken links 和 侧边栏 chaos.
  • Keep 侧边栏 配置 explicit rather 比 fully auto-generated — 您'll want control 在...上 ordering 和 grouping.
  • 使用 .mdx 仅 当...时 您 需要 组件 imports. Plain .md simpler 和 avoids hydration issues.
  • Test deployment early, especially 如果 hosting 在 subpath. Don't wait until end.
  • Keep CSS overrides minimal. Work 带有 Starlight's design tokens (CSS custom properties) rather 比 fighting defaults.
  • 使用 frontmatter 侧边栏.order 到 control page ordering 在...内 autogenerated groups.

Important gotchas (读取 these)

  • Subpath deployment #1 source 的 bugs. 如果 deploying 到 /docs/, 您 必须 设置 both sitebase 在...中 astro.配置.mjs. See references/deployment-和-advanced.md.
  • MDX imports 仅 work 在...中 .mdx files, 不 .md. 如果 您 获取 导入 errors, check file 扩展.
  • 侧边栏 配置 和 filesystem 必须 agree. page exists 在...上 disk 但是 isn't 在...中 侧边栏 配置 (或 vice versa) causes confusing 404s 或 missing nav items.
  • Tailwind + Starlight requires @astrojs/starlight-tailwind compatibility 包. 没有 , styles 将 fight 每个 其他.
  • Pagefind 搜索 breaks 在...上 subpaths 如果 base isn't configured correctly.
  • Custom components 需要 client:加载 (或 另一个 client directive) 如果 它们 使用 JavaScript/interactivity. 没有 , 它们 render 作为 static HTML 仅.

Reference files

Read these for detailed guidance. Each is self-contained and covers one topic area thoroughly:

  • references/project-setup.md — Scaffolding, project structure, astro.配置.mjs anatomy, content collections
  • references/侧边栏-和-content.md — 侧边栏 配置 patterns, frontmatter reference, content authoring, ordering
  • references/styling-和-theming.md — Custom CSS, Tailwind integration, theming, dark mode, Expressive Code
  • references/components.md — Built-在...中 components (Tabs, Cards, Asides, etc.), custom components 在...中 MDX, hydration
  • references/deployment-和-advanced.md — Deployment targets, subpath hosting, 搜索, i18n, versioning, auth, SSR
  • references/troubleshooting.md — Diagnosis 和 fixes 对于 最多 common Starlight issues

Useful links

  • Docs: https://starlight.astro.build
  • GitHub: https://github.com/withastro/starlight
  • 配置 reference: https://starlight.astro.build/reference/configuration/
  • Frontmatter reference: https://starlight.astro.build/reference/frontmatter/
  • 组件 列表: https://starlight.astro.build/components/使用-components/
  • Community plugins: https://starlight.astro.build/resources/plugins/
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务