Communitygithub.com

reyalka/astro

Astroモノレポでの開発に関する包括的なガイドです。アーキテクチャ、デバッグ、テスト、重要な制約事項をカバーしています。機能追加、修正、テスト、またはコードベース構造の理解に使用します。

astro とは?

Astro モノレポ内で AI エージェントや開発者が作業するためのコンテキスト読み込みスキルです。このスキルは、実行するタスクに基づいて適切なドキュメントを読み込みます。コア機能の追加、バグ修正、テストの作成・修正、またはコードベース構造の理解など、目的に応じて推奨されるドキュメントを決定するクイック決定表を提供します。また、ランタイム制約(例:`runtime/` 内での Node.js API の禁止)、テスト分離の重要性、事前リリースモードなど、よくある落とし穴に関する重要な警告も含まれています。このスキルは、Astro モノレポのアーキテクチャ、テスト戦略、デバッグ手法に関する深い知見を提供し、開発プロセスを効率化します。なお、単純な質問には直接回答し、バグトリアージや GitHub Actions のログ分析には使用しません。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/reyalka/astro/tree/HEAD/.agents/skills/astro-developer

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Astro 開発者スキル

Astro モノレポで作業する AI エージェントおよび開発者向けのコンテキスト読み込みスキルです。タスクに応じて関連ドキュメントを読み込みます。

クイック決定表

何をしていますか? → これらのファイルを読んでください:

タスク主要ドキュメント補足ドキュメント
コア機能の追加architecture.md, constraints.mdtesting.md
バグの修正debugging.mdarchitecture.md
テストの作成/修正testing.mdconstraints.md
インテグレーションの作成例として packages/integrations/ を探索testing.md
アーキテクチャの理解architecture.md-
エラーへの対処debugging.md, constraints.mdtesting.md
制約事項の理解constraints.mdarchitecture.md

重要な警告

開始する前に、以下のよくある落とし穴に注意してください:

  1. 単体テストを優先: デフォルトで単体テスト可能なコードを記述し、統合テストは必要な場合のみ使用 → testing.md
  2. Node.js API の制限: runtime/ 内のコードでは Node.js API を使用できません → constraints.md
  3. テストの分離: 各統合テストには一意の outDir を設定する必要があります → testing.md
  4. ランタイムの境界: コア、Vite、ブラウザの実行コンテキスト → architecture.md
  5. プレリリースモード: Changesets は origin/next ブランチを対象とします(.changeset/config.json を確認)

クイックコマンドリファレンス

# 開発
pnpm install                                    # インストール(ルートのみ)
pnpm run build                                  # 全パッケージをビルド
pnpm run dev                                    # ウォッチモード
pnpm run lint                                   # コードベースをリント

# テスト
pnpm -C packages/astro exec astro-scripts test "test/**/*.test.js"  # 全テスト
pnpm -C packages/astro exec astro-scripts test -m "pattern"         # フィルタテスト
pnpm run test:e2e                               # E2Eテスト
node --test test/file.test.js                   # 単一テスト

# サンプル
pnpm --filter @example/minimal run dev          # サンプルを実行

# Changesets
pnpm exec changeset --empty                     # Changesetを作成(対話モードなし)

主要ファイルパス

packages/astro/src/
├── core/              # Node.js実行コンテキスト(ビルド/開発コマンド)
├── runtime/
│   ├── server/        # Vite SSR実行コンテキスト
│   └── client/        # ブラウザ実行コンテキスト
├── virtual-modules/   # 仮想モジュールエントリポイント
├── content/           # コンテンツレイヤーシステム
├── vite-plugin-*/     # Viteプラグイン
└── types/             # 集中管理されたTypeScript型定義

packages/integrations/  # 公式インテグレーション
examples/              # ここで変更をテスト
test/fixtures/         # テストフィクスチャ

注意: node_modules/ 内のエラースタックトレースは packages/ 内のソースにマッピングされます。詳細は architecture.md を参照してください。

使用方法

このスキルは適切なコンテキストを読み込みますが、ワークフローを調整することはありません。適切なドキュメントを読み込んだ後:

  1. タスクに応じて推奨ファイルを読む
  2. 説明されているパターンと制約を適用する
  3. 提供されたコマンドとファイルパスを使用する
  4. 問題が発生した場合は、エラーメッセージについてドキュメントを検索する

アーキテクチャのクイックサマリー

3つの実行コンテキスト:

  • core/ → Node.js、ビルド/開発コマンド、Viteプラグイン以外でのNode APIを避ける
  • runtime/server/ → Vite SSR、Node APIを使用できない
  • runtime/client/ → ブラウザ、Node APIを一切使用できない

5つのパイプラインタイプ:

  • RunnablePipeline → Viteローダーシステムを備えた astro dev
  • NonRunnablePipeline → ランタイムモジュール読み込みなしの astro dev(Cloudflareアダプター)
  • BuildPipeline → astro build + 事前レンダリング
  • AppPipeline → プロダクションサーバーレス/SSR
  • ContainerPipeline → コンテナAPI

完全な詳細は architecture.md を参照してください。

テストのクイックサマリー

哲学: 統合テストよりも単体テストを優先します。デフォルトで単体テスト可能なコードを記述してください。

単体テスト(高速、推奨):

  • 純粋関数とビジネスロジックをテストする
  • インフラストラクチャからビジネスロジックを抽出する
  • 依存性注入を使用する

統合テスト(低速、控えめに使用):

  • 単体テストできない機能(仮想モジュール、完全なビルドパイプライン)にのみ使用
  • キャッシュ汚染を避けるために必ず一意の outDir を設定する

完全なパターンと例は testing.md を参照してください。

このスキルを使用すべきでない場合

  • バグトリアージ: 代わりに triage スキルを使用
  • GitHub Actionsの分析: 代わりに analyze-github-action-logs スキルを使用
  • 簡単な質問: 直接質問し、このスキルを読み込まないでください

関連ドキュメント

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

reyalka/astro

Analyze recent GitHub Actions workflow runs to identify patterns, mistakes, and improvements. Use when asked to "analyze workflow logs", "review action runs", or "analyze GitHub Actions".

reyalka/astro

Independently implement and validate an alternative solution for an Astro pull request. Use only for Factory's adversary blue team.

reyalka/astro

Qualify and compare red and blue solutions for an Astro pull request using Astro-specific merge and tie-break criteria. Use only for Factory's adversary purple team.

reyalka/astro

Perform a static, read-only code review of an Astro pull request or of a local branch, commit range, diff, patch, or working tree being prepared as a pull request. Determine whether the change satisfies its stated business requirements and is good enough to merge, using the PR description, linked requirement issues and roadmap items, and PR or issue discussions when available. Use this skill only for PR review or self-review, not issue triage or bug investigation. It reports only merge-relevant findings and never edits code or runs project code, tests, builds, checks, or scripts.

reyalka/astro

Write and update Astro pull requests with reviewer-friendly titles and high-signal bodies. Trigger whenever the user asks to create a PR, open a PR, draft a PR, update PR title/body, or write PR notes/summary/description.

reyalka/astro

Handle main-to-next merge tasks including conflict resolution, changeset cleanup, and CI fix-ups. Use when merging main into next.

reyalka/astro

How to write JSDoc (/** */) and inline (//) comments in the Astro codebase, for contributors reading the source — not end users. Use whenever writing or editing comments in .ts/.js source, including comments added incidentally while fixing bugs or building features. Does not cover the @docs-generated config/error reference.

関連スキル