Astro 开发
- 作者仓库星标 59,805
- 作者仓库 astro
Astro Developer Skill
Context-loading skill for AI agents and developers working in the Astro monorepo. Loads relevant documentation based on your task.
Quick Decision Matrix
What are you doing? → Read these files:
| Task | Primary Docs | Supporting Docs |
|---|---|---|
| Adding a core feature | architecture.md, constraints.md | testing.md |
| Fixing a bug | debugging.md | architecture.md |
| Writing/fixing tests | testing.md | constraints.md |
| Creating an integration | Explore packages/integrations/ for examples |
testing.md |
| Understanding architecture | architecture.md | - |
| Dealing with errors | debugging.md, constraints.md | testing.md |
| Understanding constraints | constraints.md | architecture.md |
Critical Warnings
Before you start, be aware of these common pitfalls:
- Prefer Unit Tests: Write unit-testable code by default. Use integration tests only when necessary → testing.md
- Node.js API Restrictions: Cannot use Node.js APIs in
runtime/code → constraints.md - Test Isolation: Must set unique
outDirfor each integration test → testing.md - Runtime Boundaries: Core vs Vite vs Browser execution contexts → architecture.md
- Prerelease Mode: Changesets target
origin/nextbranch (check.changeset/config.json)
Quick Command Reference
# Development
pnpm install # Install (root only)
pnpm run build # Build all packages
pnpm run dev # Watch mode
pnpm run lint # Lint codebase
# Testing
pnpm -C packages/astro exec astro-scripts test "test/**/*.test.js" # All tests
pnpm -C packages/astro exec astro-scripts test -m "pattern" # Filter tests
pnpm run test:e2e # E2E tests
node --test test/file.test.js # Single test
# Examples
pnpm --filter @example/minimal run dev # Run example
# Changesets
pnpm exec changeset --empty # Create changeset, no interactive mode
Key File Paths
packages/astro/src/
├── core/ # Node.js execution context (build/dev commands)
├── runtime/
│ ├── server/ # Vite SSR execution context
│ └── client/ # Browser execution context
├── virtual-modules/ # Virtual module entry points
├── content/ # Content layer system
├── vite-plugin-*/ # Vite plugins
└── types/ # Centralized TypeScript types
packages/integrations/ # Official integrations
examples/ # Test your changes here
test/fixtures/ # Test fixtures
Note: Error stack traces in node_modules/ map to source in packages/. See architecture.md for details.
Usage
This skill loads relevant context—it doesn't orchestrate workflows. After loading appropriate docs:
- Read the recommended files for your task
- Apply the patterns and constraints described
- Use the commands and file paths provided
- Search docs for error messages if you encounter issues
Architecture Quick Summary
Three Execution Contexts:
- core/ → Node.js, build/dev commands, avoid Node APIs except in Vite plugins
- runtime/server/ → Vite SSR, CANNOT use Node APIs
- runtime/client/ → Browser, CANNOT use Node APIs at all
Five Pipeline Types:
- RunnablePipeline →
astro devwith Vite loader system - NonRunnablePipeline →
astro devwithout runtime module loading (Cloudflare adapter) - BuildPipeline →
astro build+ prerendering - AppPipeline → Production serverless/SSR
- ContainerPipeline → Container API
See architecture.md for complete details.
Testing Quick Summary
Philosophy: Prefer unit tests over integration tests. Write unit-testable code by default.
Unit tests (fast, preferred):
- Test pure functions and business logic
- Extract business logic from infrastructure
- Use dependency injection
Integration tests (slow, use sparingly):
- Only for features that cannot be unit tested (virtual modules, full build pipeline)
- Always set unique
outDirto avoid cache pollution
See testing.md for complete patterns and examples.
When NOT to Use This Skill
- Bug triage: Use the
triageskill instead - GitHub Actions analysis: Use the
analyze-github-action-logsskill - Simple questions: Just ask directly, don't load this skill
Related Documentation
- Root: /AGENTS.md
- Root: /CONTRIBUTING.md
- Astro docs: https://docs.astro.build/llms.txt
- Package: packages/astro/src/core/README.md
- Build plugins: packages/astro/src/core/build/plugins/README.md
- 流狐分类
- AI 智能
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @withastro · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 What are you doing? → Read these files: Task · Primary Docs · Supporting Docs Adding a core feature · architecture.md, constraints.md · testing.md
Before you start, be aware of these common pitfalls: Prefer Unit Tests: Write unit-testable code by default. Use integration tests only when necessary → testing.md Node.js API Restrictions: Cannot use Node.js APIs in runtime/ code → constraints.md
Quick Command Reference
Note: Error stack traces in nodemodules/ map to source in packages/. See architecture.md for details.
This skill loads relevant context—it doesn't orchestrate workflows. After loading appropriate docs: Read the recommended files for your task Apply the patterns and constraints described
Three Execution Contexts: core/ → Node.js, build/dev commands, avoid Node APIs except in Vite plugins runtime/server/ → Vite SSR, CANNOT use Node APIs
# Astro Developer Skill
Context-loading skill for AI agents and developers working in the Astro monorepo. Loads relevant documentation based on your task.
## Quick Decision Matrix
**What are you doing?** → **Read these files:**
| Task | Primary Docs | Supporting Docs |
| -------------------------- | -------------------------------------------------------------------- | ---------------------------------- |
| Adding a core feature | [architecture.md](architecture.md), [constraints.md](constraints.md) | [testing.md](testing.md) |
| Fixing a bug | [debugging.md](debugging.md) | [architecture.md](architecture.md) |
| Writing/fixing tests | [testing.md](testing.md) | [constraints.md](constraints.md) |
| Creating an integration | Explore `packages/integrations/` for examples | [testing.md](testing.md) |
| Understanding architecture | [architecture.md](architecture.md) | - |
| Dealing with errors | [debugging.md](debugging.md), [constraints.md](constraints.md) | [testing.md](testing.md) |
| Understanding constraints | [constraints.md](constraints.md) | [architecture.md](architecture.md) |
## Critical Warnings
**Before you start, be aware of these common pitfalls:**
1. **Prefer Unit Tests**: Write unit-testable code by default. Use integration tests only when necessary → [testing.md](testing.md)
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Quick Decision Matrix → Critical Warnings → Quick Command Reference → Key File Paths → Usage → Architecture Quick Summary
要点 -> What are you doing? · Read these files · Before you start, be aware of these common pitfalls · Prefer Unit Tests · Node.js API Restrictions · Test Isolation · Runtime Boundaries · Prerelease Mode
文件/命令 -> packages/integrations/ · runtime/ · outDir · origin/next · .changeset/config.json · nodemodules/ · packages/ · astro dev
内容 SHA-256 -> acc6acff9bb8
原文结构
适用与边界
原文中的明确线索
packages/integrations/、runtime/、outDir、origin/next、.changeset/config.json、nodemodules/、packages/、astro dev