Astro Sites Manager 标志

Astro Sites Manager

社区
fabricioctelles
astro-sites-manager

用于构建、迁移和维护 Astro v7 项目的综合技能。涵盖官方 AGENTS.md 中的最佳实践、从 v6 迁移到 v7 的路径、破坏性变更和已弃用模式的验证、AI 增强型开发服务器的用法(后台模式、JSON 日志)、使用 src/fetch.ts 实现高级路由、路由缓存、Sätteri Markdown 以及 Rust 编译器。用户提到“Astro”、“ .astro 文件”、“astro dev”、“astro build”、“islands 架构”、“内容集合”、“SSG”、“SSR adapter”、“升级到 Astro 7”、“迁移 Astro”、“Astro v7”、“Astro v6”、“Sätteri”、“路由缓存”、“Astro.cache”、“astro dev --background”、“src/fetch.ts”、“高级路由”、“Hono + Astro”、“Rolldown”、“Vite 8”、“排队渲染”、“CDN 缓存提供商”、“Astro AI”、“相关内容”、“相关文章”、“Astro 向量嵌入”、“astro-related-content”,或询问如何使用 Astro 生成静态网站时使用。

Add to TypingMind

概览

发布者fabricioctelles
代码仓库skills
技能名称astro-sites-manager
星标数
87
复刻数
7
附带文件
12
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 12 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 fabricioctelles 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Astro Sites Manager AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/fabricioctelles/skills/tree/main/skills/astro-sites-manager
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fabricioctelles/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/astro-sites-manager .claude/skills/astro-sites-manager
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Astro Sites Manager,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Astro Sites Manager。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Astro Sites Manager 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Astro Framework — v7

MCP Documentation Access

This skill works alongside the Astro Docs MCP server. Before answering Astro questions, check if the astro-docs MCP tool is available and query it for the latest documentation. The MCP server provides real-time access to docs.astro.build and is the single source of truth for current APIs.

MCP Server: astro-docs
Tool: search_astro_docs

If the MCP server is unavailable, fall back to the reference material in this skill and https://docs.astro.build.


Best Practices

Component Design

  • One .astro component per file. Keep components small and focused.
  • Use frontmatter (---) for data fetching and logic; template below for markup only.
  • Prefer Astro components over framework components unless client interactivity is needed.
  • Use client:* directives sparingly — each adds JavaScript to the bundle.
  • Directive hierarchy: client:idle > client:visible > client:load (prefer lazy).

Routing & Pages

  • Use file-based routing in src/pages/. Dynamic routes: [slug].astro, [...path].astro.
  • Always export getStaticPaths() for prerendered dynamic routes.
  • For SSR pages: export const prerender = false at the top.
  • Use src/fetch.ts (v7) only when you need control beyond middleware — don't use it for simple auth.

Content Collections

  • Define schemas in content.config.ts with Zod — never trust untyped content.
  • Use getCollection() for lists, getEntry() for single items.
  • Prefer glob() loader for local files, custom loaders for CMS data.

Performance

  • Default to static (prerender = true). Use SSR only for personalized/dynamic content.
  • Use <Image /> from astro:assets — never raw <img> for local images.
  • Prefer Sätteri (default v7) over unified for Markdown — it's significantly faster.
  • Use Server Islands (server:defer) for mixing static shells with dynamic fragments.

Styling

  • Scoped <style> in .astro files is default and preferred.
  • Use is:global only when truly needed (third-party component styling).
  • Tailwind: install with astro add tailwind, don't configure manually.

TypeScript

  • Run astro sync after changing content schemas or env variables.
  • Run astro check before committing — catches template type errors other tools miss.
  • Use astro:env/server and astro:env/client for typed env variables (never process.env directly).

Development Workflow

  • Use astro dev for HMR. Never use python -m http.server or other static servers.
  • Use astro add for official integrations — don't manually edit config for them.
  • Use astro build && astro preview to test production behavior locally.
  • In AI agent workflows: use astro dev --background and validate via /_astro/status.

CLI Commands

bash
npx astro dev              # Dev server (foreground)
npx astro dev --background # Dev server (detached, for AI agents)
npx astro dev --json       # Dev server with JSON structured logs
npx astro build            # Production build
npx astro preview          # Serve production build locally
npx astro check            # Type checking and diagnostics
npx astro sync             # Generate TypeScript types
npx astro add <integration># Install and configure integration

Background Dev Server (AI Agents)

When working as an AI agent, use background mode:

bash
# Start (blocks until ready, then detaches)
astro dev --background
# → Dev server running at http://localhost:4321 (pid 12345)

# Check status
astro dev status

# Read logs
astro dev logs

# Stop
astro dev stop

# Health check endpoint (JSON)
curl http://localhost:4321/_astro/status
# → {"ok": true}

Key behaviors:

  • Lockfile prevents duplicate instances — starting again returns existing instance
  • All commands are idempotent (stop when not running = silent success)
  • Auto-detected when running inside an AI agent (no flag needed)
  • Opt out: ASTRO_DEV_BACKGROUND=0 astro dev

Project Structure

src/
├── pages/          # File-based routing (.astro, .md, .mdx)
├── layouts/        # Reusable page layouts
├── components/     # Astro & framework components
├── content/        # Content collections (type-safe)
├── middleware.ts   # Request middleware
├── fetch.ts        # Advanced routing (v7, optional)
├── styles/         # Global CSS
├── assets/         # Optimized assets (images, fonts)
├── actions/        # Server actions
└── env.d.ts        # Environment type declarations
astro.config.mjs    # Main configuration
content.config.ts   # Content collection schemas
tsconfig.json       # TypeScript config

Configuration (v7)

typescript
import { defineConfig, memoryCache, logHandlers } from 'astro/config';

export default defineConfig({
  // Output mode
  output: 'static', // or configure per-page with server adapter

  // Route caching (stable in v7)
  cache: {
    provider: memoryCache(),
  },
  routeRules: {
    '/blog/[...path]': { maxAge: 300, swr: 60 },
  },

  // Logger (stable in v7)
  logger: logHandlers.json(), // or .console(), or .compose(...)

  // Markdown (Sätteri is default in v7)
  markdown: {
    // No config needed for defaults (GFM, smartypants, heading IDs)
    // For extra features:
    // processor: satteri({ features: { directive: true, math: true } })
  },

  // Advanced routing file (default: src/fetch.ts)
  // fetchFile: null, // disable if src/fetch.ts is used for other purposes

  // Whitespace (v7 default: 'jsx')
  compressHTML: 'jsx', // or true (v6 behavior), or false (preserve all)
});

Islands Architecture (client:* directives)

astro
<!-- Load immediately (interactive above the fold) -->
<Counter client:load />

<!-- Load when browser is idle (non-critical interactivity) -->
<Newsletter client:idle />

<!-- Load when scrolled into viewport (below the fold) -->
<Comments client:visible />

<!-- Load on media query match (mobile-only widget) -->
<MobileMenu client:media="(max-width: 768px)" />

<!-- Client-only, skip SSR entirely (browser APIs needed) -->
<MapWidget client:only="react" />

<!-- Server Island: static shell, fetched at request time (v6+) -->
<UserGreeting server:defer />

Decision guide: No directive (default) = zero JS, static HTML. Add directive only when user interaction is required.


Image Optimization

astro
---
import { Image } from 'astro:assets';
import heroImage from '../assets/hero.jpg';
---
<!-- Local image (optimized, lazy-loaded, responsive) -->
<Image src={heroImage} alt="Hero" width={1200} />

<!-- Remote image (must allowlist domain in config) -->
<Image src="https://cdn.example.com/photo.jpg" alt="Photo" width={800} height={600} />

Config for remote images:

typescript
// astro.config.mjs
image: {
  domains: ['cdn.example.com'],
  remotePatterns: [{ protocol: 'https', hostname: '**.cloudinary.com' }],
}

Detailed References

  • Install MCP Server — Setup Astro Docs MCP for any AI tool (Kiro, Claude, Cursor, VS Code, etc.)
  • Migration Guide v6→v7 — Step-by-step upgrade plan with breaking changes checklist
  • Validation Checklist — Verify installation, detect breaking/deprecated patterns
  • AI Dev Server — Background mode, JSON logging, agent detection
  • Astro v7 Features — Rust compiler, Sätteri, Advanced Routing, Route Caching, CDN providers
  • Astro v6 Features — Content Collections v2, Actions, Sessions, Server Islands, env module
  • Related Content — Vector embeddings para posts relacionados, deploy leve no Coolify sem modelo
  • Testing — Vitest components, Playwright E2E, link checking, CI pipeline
  • SEO Full Stack — JSON-LD graph, agent discovery, IndexNow, OG images, build-time validation, performance
  • Starlight & Patterns — Docs sites, Pagefind search, i18n, pagination, RSS
  • Deployment — Cloudflare, Vercel, Netlify, Firebase, GitHub Pages, Docker/Coolify, Azure
  • Coolify Deploy — Self-hosted deploy on Coolify (Dockerfile, API, gotchas, recommended stack)

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Astro Sites Manager AI 技能有什么作用?

用于构建、迁移和维护 Astro v7 项目的综合技能。涵盖官方 AGENTS.md 中的最佳实践、从 v6 迁移到 v7 的路径、破坏性变更和已弃用模式的验证、AI 增强型开发服务器的用法(后台模式、JSON 日志)、使用 src/fetch.ts 实现高级路由、路由缓存、Sätteri Markdown 以及 Rust 编译器。用户提到“Astro”、“ .astro 文件”、“astro dev”、“astro build”、“islands 架构”、“内容集合”、“SSG”、“SSR adapter”、“升级到 Astro 7”、“迁移 Astro”、“Astro v7”、“Astro v6”、“Sätteri”、“路由缓存”、“Astro.cache”、“astro dev --background”、“src/fetch.ts”、“高级路由”、“Hono + Astro”、“Rolldown”、“Vite 8”、“排队渲染”、“CDN 缓存提供商”、“Astro AI”、“相关内容”、“相关文章”、“Astro 向量嵌入”、“astro-related-content”,或询问如何使用 Astro 生成静态网站时使用。

为什么在 TypingMind 中使用 Astro Sites Manager?

因为您只需安装一次,就能搭配任何模型使用。Astro Sites Manager 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Astro Sites Manager?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/fabricioctelles/skills/tree/main/skills/astro-sites-manager。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Astro Sites Manager?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Astro Sites Manager 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Astro Sites Manager 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Astro Sites Manager AI 技能免费吗?

是的。fabricioctelles 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇