首页龙虾技能列表 › Astro - Advanced Developer — Astro工具

Astro - Advanced Developer — Astro工具

v1.0.0

[AI辅助] Comprehensive skill for building, configuring, and troubleshooting Astro projects. Use this skill whenever the user mentions Astro, .astro files, Astro confi...

0· 75·0 当前·0 累计
by @encryptshawn (EncryptShawn)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/1
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
This is an instruction-only Astro guidance skill whose requirements and instructions are consistent with its stated purpose and do not request unexpected credentials or install any code.
评估建议
This skill is documentation-only and appears coherent with its stated purpose: it provides detailed guidance and examples for Astro projects and does not request credentials or install code. Before installing, consider: 1) provenance — the source/homepage is unknown; if you require trusted authorship, ask the publisher or prefer an official/established source; 2) operational behavior — the skill contains example commands (e.g., `npx astro add`) that, if the agent is allowed to execute shell comm...
详细分析 ▾
用途与能力
The name/description match the included documentation and reference files: project setup, rendering modes, islands, SSR, deployment, SEO, troubleshooting. The skill requests no binaries, env vars, or installs — which is proportionate for a documentation-style skill.
指令范围
SKILL.md and the references are documentation and code examples for Astro projects (commands like `npx astro add`, sample astro files, caching headers, API endpoints). They do not instruct the agent to read arbitrary host files, secrets, or to call external endpoints beyond examples. Note: the frontmatter trigger language is broad (will trigger on many Astro-related mentions and even some syntax patterns), so the skill may be invoked frequently in contexts that are only tangentially related.
安装机制
No install spec and no code files that would be written/executed by an installer. Instruction-only skills have a minimal disk/execution footprint.
凭证需求
The skill declares no required environment variables or credentials. The docs mention typical environment variables and deployment settings as examples (which is expected for this domain) but do not request access to any secrets.
持久化与权限
Flags are standard (always: false, user-invocable: true, disable-model-invocation: false). It does not request permanent presence or system-level changes. Autonomous invocation is allowed but is the platform default; there are no additional privilege escalations.
安全有层次,运行前请审查代码。

License

MIT-0

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

运行时依赖

无特殊依赖

版本

latestv1.0.02026/4/1

Astro Advanced Skill v1.0.0 - Introduces comprehensive guidance for building, configuring, and troubleshooting Astro projects. - Covers project setup, rendering strategies (SSG/SSR/hybrid), adapters, and framework integrations. - Includes best practices for SEO, layouts, content collections, performance, and SSR caching. - Features a step-by-step decision tree for common Astro scenarios and mistakes. - Provides clear troubleshooting tips for issues like hydration mismatches and build/deploy errors.

● 无害

安装命令 点击复制

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

技能文档

), or island architecture concepts. This skill covers project setup, rendering modes (SSG/SSR/hybrid), SSR caching, SEO, layouts, templates, Vue island integration, content collections, data fetching, deployment, auth, performance, and troubleshooting.


# Astro Advanced Skill

This skill provides production-grade guidance for Astro projects — from initial scaffolding through deployment, caching, and performance tuning. It covers the patterns that actually matter in real projects and the mistakes that actually happen.

如何 到 使用 skill

  • 读取 file 第一个 对于 core workflow 和 decision tree.
  • Consult reference files 在...中 references/ 对于 deep dives 在...上 specific topics:
- references/setup-和-structure.md — Project creation, file structure, 配置, adapters - references/rendering-modes.md — SSG vs SSR vs Hybrid, 当...时 到 使用 每个, caching strategies - references/seo.md — Meta tags, 打开 图形, JSON-LD, sitemaps, canonical URLs - references/islands-和-vue.md — Island architecture, client directives, Vue/React/Svelte integration - references/content-和-data.md — Content collections, data fetching, dynamic routes - references/deployment.md — Adapters, static hosts, serverless, environment variables - references/performance.md — Image optimization, bundle analysis, hydration control - references/troubleshooting.md — Common errors 和 fixes organized 由 symptom

Core decision tree

When helping with an Astro project, follow this sequence:

1. Identify rendering strategy 第一个

This is the single most important decision in any Astro project. Everything else flows from it.

  • Pure static site (blog, docs, marketing)? → SSG (默认). 否 adapter needed.
  • Needs 用户-specific data, auth, 或 real-时间 content? → SSR 带有 adapter.
  • Mostly static 但是 few dynamic pages? → Hybrid mode. 设置 输出: 'static' 在...中 配置 和 使用 导出 const prerender = 假 在...上 dynamic pages.

2. Pick right adapter

Only needed for SSR or hybrid:
  • Vercel@astrojs/vercel (serverless 或 edge)
  • Netlify@astrojs/netlify
  • Cloudflare Pages@astrojs/cloudflare
  • Self-hosted 节点@astrojs/节点 (standalone 或 中间件)

3. 设置 up integrations

Add only what you need. Each integration is a potential build-time dependency:

# Common additions
npx astro add vue        # Vue islands
npx astro add tailwind   # Tailwind CSS
npx astro add mdx        # MDX support
npx astro add sitemap    # Auto sitemap generation

4. Establish content strategy

  • Few pages, hand-authored → Regular .astro pages 在...中 /src/pages
  • Blog/docs 带有 structured content → Content collections 带有 Zod schemas
  • CMS-driven → 获取 在 build 时间 (SSG) 或 runtime (SSR)

5. Apply SEO 从 开始

Don't bolt it on later. See references/seo.md for the full pattern, but at minimum:
  • 创建 reusable 组件 对于 head tags
  • 设置 up canonical URLs
  • 添加 structured data (JSON-LD) 对于 键 pages
  • Generate sitemap 通过 @astrojs/sitemap

键 patterns 到 always 关注

布局 pattern

Every page should use a layout. Layouts handle , , and shared chrome:

---
// src/layouts/Base.astro
import SEO from '../components/SEO.astro';
const { title, description } = Astro.props;

Island pattern

Static by default. Only hydrate what needs interactivity:


#1 Astro mistake: forgetting client: 在...上 组件 needs interactivity, then wondering why click handlers don't work.

SSR caching pattern

SSR without caching is just a slow website. Always pair SSR with a caching strategy:

// In an SSR endpoint or page
return new Response(JSON.stringify(data), {
  headers: {
    "Cache-Control": "public, s-maxage=60, stale-while-revalidate=300",
    "Content-Type": "application/json"
  }
});

当...时 things go wrong

Read references/troubleshooting.md for a symptom-based guide. The top 5 issues:

  • "组件 doesn't 做 anything" → Missing client: directive
  • Build fails 之后 adding integration → Version mismatch, check 包.json
  • SSR returns 500 → Missing adapter 或 wrong 输出 mode 在...中 配置
  • Broken links 之后 deploy → Base path 不 设置, 或 trailing slash mismatch
  • Hydration mismatch errors → Server/client HTML differs (conditional rendering, dates, randomness)

File 输出 conventions

When generating Astro project files:

  • Always include frontmatter fence (---) 甚至 如果 空
  • 使用 .astro 扩展 对于 Astro components 和 pages
  • Place pages 在...中 src/pages/, components 在...中 src/components/, layouts 在...中 src/layouts/
  • 使用 TypeScript 在...中 frontmatter 当...时 project uses TS
  • Include astro.配置.mjs 带有 仅 integrations 和 settings actually needed
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

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

了解定制服务