webiny-project-structure
できること
Webinyプロジェクトのフォルダの構成と、その主要な設定ファイルの役割を説明します。Webinyに慣れておらず、コードをどこに置くべきかを知る必要がある開発者向けです。
使う場面
- ✓Webinyプロジェクトのどこにカスタムのコードを置くべきかを、開発者が尋ねるとき。
- ✓webiny.config.tsxファイルが何をするかを知りたい開発者がいるとき。
- ✓Webinyプロジェクトに新しい拡張を登録する必要があるとき。
スキルのリンク
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/project-structure/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Webinyプロジェクトのどこに、私のカスタムのコードを置くべきですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、主要なフォルダと、すべての拡張が登録される設定ファイルを説明します。AIはこれを使って、新しいコードを正しい場所に置きます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Webiny Project Structure
TL;DR
A Webiny project has a flat structure centered around webiny.config.tsx -- the single configuration file where all extensions are registered. Custom code lives in the extensions/ folder. Extensions are registered as React components (<Api.Extension>, <Admin.Extension>, <Infra.*>, <Cli.Command>) and can be conditionally loaded per environment.
Project Layout
my-webiny-project/
├── extensions/ # All custom code -- API, Admin, Infra, CLI extensions
│ └── README.md
├── public/ # Static assets for the Admin app
│ ├── favicon.ico
│ ├── global.css
│ ├── index.html
│ └── robots.txt
├── package.json # Single package.json for the whole project
├── tsconfig.json # Single TypeScript config
├── webiny.config.tsx # Main configuration -- all extensions registered here
├── webiny-env.d.ts # TypeScript environment types
└── yarn.lock
Key points:
- Single
package.json-- no monorepo, no workspaces needed. - Single
tsconfig.json-- straightforward TypeScript setup. webiny.config.tsx-- the entry point for everything. All extensions, infrastructure options, and project settings are declared here.extensions/-- where all your custom code lives. Organize with subfolders as needed (e.g.,extensions/contactSubmission/,extensions/AdminBranding/).
The webiny.config.tsx File
This file exports a single React component called Extensions. It uses JSX to declaratively register all configuration:
// webiny.config.tsx
import React from "react";
import { Admin, Api, Cli, Infra, Project, Security } from "webiny/extensions";
import { Cognito } from "@webiny/cognito";
export const Extensions = () => {
return (
<>
{/* Infrastructure configuration */}
<Infra.Aws.DefaultRegion name={"us-east-1"} />
<Infra.Core.OpenSearch enabled={true} />
<Infra.Aws.Tags tags={{ OWNER: "me", PROJECT: "my-project" }} />
{/* Identity provider */}
<Cognito />
{/* API extensions (backend) */}
<Api.Extension src={"/extensions/ProductCategoryModel.ts"} />
<Api.Extension src={"/extensions/ProductModel.ts"} />
<Api.Extension src={"/extensions/contactSubmission/ContactSubmissionHook.ts"} />
{/* Security hooks */}
<Api.Extension src={"/extensions/MyApiKey.ts"} />
<Security.ApiKey.AfterUpdate src={"/extensions/MyApiKeyAfterUpdate.ts"} />
{/* Admin extensions (frontend) */}
<Admin.Extension src={"/extensions/AdminTheme/AdminTheme.tsx"} />
<Admin.Extension src={"/extensions/AdminTitleLogo/AdminTitleLogo.tsx"} />
<Admin.Extension src={"/extensions/contactSubmission/EmailEntryListColumn.tsx"} />
{/* Infrastructure / Pulumi extensions */}
<Infra.Core.Pulumi src={"/extensions/MyCorePulumiHandler.ts"} />
{/* CLI extensions */}
<Cli.Command src={"/extensions/MyCustomCommand.ts"} />
{/* Project settings */}
<Project.Telemetry enabled={false} />
</>
);
};
Extension Types
| JSX Element | What It Does | File Type |
|---|---|---|
<Api.Extension src="..." /> |
Registers a backend extension (GraphQL schemas, content models, lifecycle hooks) | .ts |
<Admin.Extension src="..." /> |
Registers a frontend Admin UI extension (themes, branding, custom columns, custom forms) | .tsx |
<Infra.Core.Pulumi src="..." /> |
Registers a Pulumi infrastructure handler | .ts |
<Cli.Command src="..." /> |
Registers a custom CLI command | .ts |
<Security.ApiKey.AfterUpdate src="..." /> |
Registers a security lifecycle hook | .ts |
YOU MUST include the full file path with the .ts or .tsx extension in every src prop. For example, use src={"/extensions/MyModel.ts"}, NOT src={"/extensions/MyModel"}. Omitting the file extension will cause a build failure.
YOU MUST use export default for the createImplementation() call when the file is targeted directly by an Extensio
よくある質問
extensionsフォルダは何のためにありますか?
プロジェクトのAPI、管理画面、インフラ、コマンドラインの部分のためのカスタムのコードを保持します。
Webinyプロジェクトは複数のパッケージファイルを使いますか?
いいえ。スキルは、プロジェクトには一つのpackage.jsonと一つのtsconfig.jsonがあり、モノレポの構成はないと述べています。
どの種類の拡張が登録されますか?
スキルは、API、管理画面、インフラ、コマンドラインの拡張を挙げており、それらは設定ファイルにコンポーネントとして追加されます。
詳細
作者による元の説明
Webiny project layout, webiny.config.tsx anatomy, and extension registration. Use this skill when the developer asks about folder structure, where custom code goes, how to register extensions, what webiny.config.tsx does, or how the project is organized. Also use when they need to understand the relationship between extensions/, webiny.config.tsx, and the different extension types (Api, Admin, Infra, CLI).
repo: webiny/webiny-js
人気
- GitHubのスター
- 8.1k
- ランキング
- #12616
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
prd-to-plan
8.1k製品要件書を、それぞれ端から端まで成立する小さなスライスの段階的な計画に変え、Markdownファイルとして保存するよう、エージェントを支援します。
webiny-admin-architect
8.1kビジネスロジックの層とプレゼンターのパターンを使い、Webinyプラットフォームの管理画面を作る方法をエージェントに教えます。
webiny-admin-permissions
8.1k自動生成される権限フォームや、表示・非表示のチェックを含め、Webinyの管理画面に権限の制御を追加するよう、エージェントに教えます。
webiny-form-model
8.1kビルダーで宣言的にフィールドを定義し、レイアウト、検証、条件付きのルールを使って、Webinyのフォームを作るよう、エージェントに教えます。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。