← 返回 Skills 市场
encryptshawn

Astro Starlight

作者 EncryptShawn · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
114
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install astro-starlight
功能描述
Use this skill whenever the user wants to create, configure, customize, or troubleshoot an Astro Starlight documentation site. Triggers include any mention o...
使用说明 (SKILL.md)

Astro Starlight Skill

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

When to use this skill

  • Creating a new documentation site from scratch
  • Adding Starlight to an existing Astro project
  • Configuring sidebar navigation (manual, autogenerated, or mixed)
  • Styling/theming a Starlight site (custom CSS, Tailwind, dark mode)
  • Using MDX components inside docs (Tabs, Cards, Asides, Code, etc.)
  • Deploying to subpaths (/docs/), Vercel, Netlify, Cloudflare Pages
  • Setting up search (Pagefind, Algolia)
  • Internationalization (i18n)
  • Overriding built-in components
  • Troubleshooting common issues (404s, broken links, sidebar mismatches)

Quick orientation

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

Task Read first
New project or project structure references/project-setup.md
Sidebar, navigation, frontmatter references/sidebar-and-content.md
Styling, theming, Tailwind references/styling-and-theming.md
MDX components, custom components references/components.md
Deployment, subpaths, search, i18n references/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 the 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 FIRST

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.config.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. Write content in 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 and deploy

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

Key principles

  1. Design folder structure before writing content. Restructuring later means broken links and sidebar chaos.
  2. Keep sidebar config explicit rather than fully auto-generated — you'll want control over ordering and grouping.
  3. Use .mdx only when you need component imports. Plain .md is simpler and avoids hydration issues.
  4. Test deployment early, especially if hosting at a subpath. Don't wait until the end.
  5. Keep CSS overrides minimal. Work with Starlight's design tokens (CSS custom properties) rather than fighting its defaults.
  6. Use frontmatter sidebar.order to control page ordering within autogenerated groups.

Important gotchas (read these)

  • Subpath deployment is the #1 source of bugs. If deploying to /docs/, you must set both site and base in astro.config.mjs. See references/deployment-and-advanced.md.
  • MDX imports only work in .mdx files, not .md. If you get import errors, check your file extension.
  • Sidebar config and filesystem must agree. A page that exists on disk but isn't in the sidebar config (or vice versa) causes confusing 404s or missing nav items.
  • Tailwind + Starlight requires the @astrojs/starlight-tailwind compatibility package. Without it, styles will fight each other.
  • Pagefind search breaks on subpaths if base isn't configured correctly.
  • Custom components need client:load (or another client directive) if they use JavaScript/interactivity. Without it, they render as static HTML only.

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.config.mjs anatomy, content collections
  • references/sidebar-and-content.md — Sidebar config patterns, frontmatter reference, content authoring, ordering
  • references/styling-and-theming.md — Custom CSS, Tailwind integration, theming, dark mode, Expressive Code
  • references/components.md — Built-in components (Tabs, Cards, Asides, etc.), custom components in MDX, hydration
  • references/deployment-and-advanced.md — Deployment targets, subpath hosting, search, i18n, versioning, auth, SSR
  • references/troubleshooting.md — Diagnosis and fixes for the most common Starlight issues

Useful links

安全使用建议
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‑party integrations you enable have the appropriate access controls. If you want additional assurance, request a code-based skill (with an install spec) rather than an instruction-only skill so you can review execution behavior more concretely.
功能分析
Type: OpenClaw Skill Name: astro-starlight Version: 1.0.0 The astro-starlight skill bundle is a comprehensive and legitimate toolset for assisting users in building documentation sites with Astro Starlight. The files, including SKILL.md and various reference guides (e.g., project-setup.md, deployment-and-advanced.md), provide accurate technical instructions and standard development commands (such as 'npm create astro@latest') consistent with the framework's official documentation. No evidence of malicious intent, data exfiltration, or harmful prompt injection was found.
能力评估
Purpose & Capability
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.
Instruction Scope
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.
Install Mechanism
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.
Credentials
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.
Persistence & Privilege
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install astro-starlight
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /astro-starlight 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
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".
元数据
Slug astro-starlight
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Astro Starlight 是什么?

Use this skill whenever the user wants to create, configure, customize, or troubleshoot an Astro Starlight documentation site. Triggers include any mention o... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 114 次。

如何安装 Astro Starlight?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install astro-starlight」即可一键安装,无需额外配置。

Astro Starlight 是免费的吗?

是的,Astro Starlight 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Astro Starlight 支持哪些平台?

Astro Starlight 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Astro Starlight?

由 EncryptShawn(@encryptshawn)开发并维护,当前版本 v1.0.0。

💬 留言讨论