Build Yii applications with AI agents
Bu içerik henüz dilinizde mevcut değil.
Use these skills when creating or changing a Yii 22.0 application. They describe application code conventions, controllers, models, migrations, forms, tests, and extension widgets. They are not instructions for developing the framework or maintaining this documentation site.
Quick start
Section titled “Quick start”- Create the Yii 22.0 application and open its root directory in the coding agent.
- Install
yii2-frameworkfor setup, or select a focused framework subsystem skill for an existing application. Add a package-owned skill when its workflow applies. - Confirm that the client discovers the installed skill, then activate it explicitly for the first task.
- Start with a small change. Give the agent a known Markdown page when possible; use
llms.txtonly to discover documentation when the relevant page is not known. - Review the changed files and run the application’s own tests, static analysis, and migration checks before accepting the result.
Follow Installing Yii, then open the new application’s directory in your coding agent. Keep its existing project instructions and code standards. The skill supplies Yii-specific guidance; it does not replace your application’s requirements or permissions.
The framework skill follows the yiisoft/yii2-app-basic template’s 22 branch: PHP 8.3+, Composer autoloading,
src/ for application classes, resources/views/ for views, and public/ as the Web root.
Install the relevant skill
Section titled “Install the relevant skill”Install from the application’s root, not inside Composer vendor/. Choose the workflow the application uses:
Yii framework skills
Section titled “Yii framework skills”Each skill has its own page in the corresponding Yii2 navigation section. These pages render the maintained
SKILL.md instructions; select the workflow you need, then follow the installation steps below.
| Skill | Workflow |
|---|---|
yii2-framework | Application setup |
yii2-upgrade-22 | Upgrade to Yii 22.0 |
yii2-autoload-di | Autoloading and DI |
yii2-caching | Caching |
yii2-console-commands | Console commands |
yii2-data-widgets | Data widgets |
yii2-database-migrations | Queries and migrations |
yii2-events-behaviors | Events and behaviors |
yii2-files-uploads | Files and uploads |
yii2-forms-validation | Forms and validation |
yii2-i18n-formatting | Translation and formatting |
yii2-logging-errors | Logging and errors |
yii2-mail | |
yii2-mutex | Mutex coordination |
yii2-rest-apis | REST APIs |
yii2-security-access | Identity and access |
yii2-sessions-cookies | Sessions and cookies |
yii2-testing-fixtures | Tests and fixtures |
yii2-views-assets | Views and assets |
yii2-web-routing-actions | Routing and actions |
All framework skills are owned by yii2-framework/docs. Each subsystem bundle carries its shared conventions.
Use the local checkout procedure for changes not yet published.
Package and tool skills
Section titled “Package and tool skills”| Skill | Owning repository | Guide |
|---|---|---|
yii2-bootstrap6-widgets | yii2-extensions/bootstrap6 | Bootstrap 6 |
yii2-filepond-uploads | yii2-extensions/filepond | FilePond uploads |
yii2-psr-bridge-worker | yii2-extensions/psr-bridge | Worker lifecycle |
yii2-roadrunner-worker | yii2-extensions/road-runner | RoadRunner worker |
yii2-frankenphp-worker | yii2-extensions/franken-php | FrankenPHP worker |
yii2-debug-inspection | yii2-extensions/debug | Debug inspection |
yii2-phpstan-analysis | yii2-extensions/phpstan | Static analysis |
yii2-inertia-integration | yii2-extensions/inertia | Inertia integration |
yii2-localeurls-configuration | yii2-extensions/localeurls | Language URLs |
yii2-docker-environment | yii2-extensions/docker-images | Docker environment |
The Basic Project Template uses Bootstrap 5, so select the Bootstrap 6 skill only when that extension is installed. Installing any skill does not install or switch PHP packages.
Use the verified skills CLI version 1.7.2. List the chosen source before installing:
npx skills@1.7.2 add yii2-framework/docs --listnpx skills@1.7.2 add yii2-framework/docs --skill yii2-framework --agent codexFor a package, replace the repository and skill with the matching row above. The installer reads the source’s
default branch; unpublished local changes require its absolute checkout path instead of the public repository.
Keep project scope. Use --agent claude-code or --agent opencode for those clients. Recheck options before using
another installer version.
Manual installation
Section titled “Manual installation”Copy the owning repository’s complete skills/<name>/ directory, including referenced resources, into the client
path below. Retain the <name>/SKILL.md structure and one copy per client. The portable
Agent Skills format is separate from client hooks, permissions and activation rules.
The site distributes unchanged package bundles under /docs/skills/<name>/; its
generated index records source refs and resource hashes.
Contributor source ownership explains regeneration.
Configure and verify the client
Section titled “Configure and verify the client”Installation, discovery, activation and the task result are separate checks. A copied skill proves installation; a client catalog proves discovery. Neither establishes correct execution.
| Client | Project path | Explicit activation | Native evidence to retain |
|---|---|---|---|
| Codex | .agents/skills/<name>/SKILL.md | $<name> or skill picker | Discovered workspace origin, matching loaded body, file changes and acceptance results. |
| Claude Code | .claude/skills/<name>/SKILL.md | /<name> | Native skill-tool event, consulted pages, file changes and acceptance results. |
| OpenCode | .opencode/skills/<name>/SKILL.md or .agents/skills/ | Request its native skill tool by name | Available-skills list, skill-tool event and functional results for the selected provider/model. |
| GitHub Copilot in VS Code | .github/skills/<name>/SKILL.md or .agents/skills/ | /<name> in agent chat | Client discovery and task outputs; installer support alone does not establish activation. |
| Amp | .agents/skills/<name>/SKILL.md | Ask it to load the skill | amp skills list, loading trace and task results. |
The installer chooses .agents/skills/ for Codex, OpenCode, Copilot and Amp, and .claude/skills/ for Claude Code.
When using the Codex extension inside VS Code, follow the Codex row. Use separate workspaces for explicit activation
and automatic selection, and include a negative task where the skill should remain unused.
Start with a small task, inspect the changed files, and run the application’s existing checks. A listed Composer script is not proof that its configuration or tests exist; see development checks.
Read only the documentation you need
Section titled “Read only the documentation you need”Choose the narrowest resource that covers the task:
| Need | Resource |
|---|---|
| A known guide page or API type | Fetch its <page>/index.md Markdown directly. |
| An unknown topic | Search llms.txt, then fetch the matching pages. |
| Several related pages | Use a bundle linked by llms.txt when the task genuinely crosses that topic or namespace. |
llms.txt is a proposed public convention for documentation discovery, not a protocol that every agent or client
loads automatically. Give the URL to the agent or ask it to fetch the index when discovery is needed. Do not attach
or reload the complete index when the task already identifies its pages.
The _llms-txt/<name>.txt route, its bundle names, and the way large groups are split are conventions of this site,
not requirements of the llms.txt proposal. Always take a bundle URL from the current index instead of constructing
or permanently storing it. For example, the current build may list getting-started.txt,
extensions-<package>.txt, or API namespace bundles such as api-yii2-di.txt. Later chunks are named after their
first page, namespace, or type and may change as the documentation grows.
Published multi-page bundles are limited to about 120 kB, estimated as roughly 30k tokens at four bytes per token.
The size shown in llms.txt is a planning estimate, not a measurement from a particular model’s tokenizer. A bundle
is therefore a budgeted convenience, not a guarantee that it fits every model or task. The index and bundles contain
English pages only.
Bulk exports for indexing tools
Section titled “Bulk exports for indexing tools”The bulk exports are for retrieval and indexing pipelines, not ordinary interactive tasks:
| Resource | Contents and limits |
|---|---|
llms-full.txt | Every English page except the API reference. It is too large to load whole into a normal task. |
llms-small.txt | An abridged non-API export that removes most non-warning blockquotes. It remains large and is intentionally lossy. |
The abridged export keeps warnings, but it can remove notes, tips, information blocks, ordinary quotations, and other context that matters to an implementation. Use focused page Markdown or the full export when completeness matters.
API reference and reference.json
Section titled “API reference and reference.json”The API reference is generated from PHPDoc: the framework’s 22.0 branch and the configured
extension sources. Each type has a page with stable member anchors such as #property-options and #method-widget.
For signatures, types, and defaults, use a filtered entry from
reference/yii2.json or reference/<package>.json.
Download and filter the catalog outside the model context, for example with jq:
curl -fsS https://yii2-framework.github.io/docs/reference/yii2.json \ | jq '.types["yii\\base\\Widget"].methods.widget'Check the catalog schema for other fields. A complete catalog can be large, and even an individual class can have many inherited members. Prefer a single method or property when that answers the question; use the guide when behavior or examples are needed.
Markdown version of each page
Section titled “Markdown version of each page”Append index.md to a page URL:
- HTML:
https://yii2-framework.github.io/docs/guide/structure-widgets/; - Markdown:
https://yii2-framework.github.io/docs/guide/structure-widgets/index.md.
Markdown contains the title, description, and page body. Relative page links point to Markdown versions; absolute
URLs from the source stay unchanged. The HTML page announces its Markdown URL with <link rel="alternate" type="text/markdown">.
Translated content also has Markdown URLs, for example /docs/ja/guide/start-hello/index.md. For a page shown through
English fallback in another locale, use its declared alternate URL; do not assume the locale-prefixed Markdown file
exists.
Page actions
Section titled “Page actions”The page menu can copy Markdown, open the Markdown URL, or open an assistant with that URL in its prompt. Passing a URL does not prove the assistant fetched it; check its retrieved context when accuracy matters.
Metadata
Section titled “Metadata”HTML pages declare the documented version and build date in <meta name="docs:version"> and
<meta name="docs:build-date">, and include JSON-LD (TechArticle and BreadcrumbList). The llms.txt header also
states the version and build date. Markdown page bodies do not currently include those HTML metadata fields.
Agent instructions and skills
Section titled “Agent instructions and skills”The repository’s AGENTS.md explains how agents consume the site. skills/ owns the framework application and subsystem skills; extension packages own their skills and the site generates their distribution bundles; maintaining this site uses the separate contributor documentation.
Extension guides
Section titled “Extension guides”The Extensions navigation and llms.txt list packages present in this build. Guides, reference pages, and examples
are synced from their package sources. Match the selected documentation to the
package state being inspected; a
site version label or skill bundle checksum alone does not establish that its
API matches an installed dependency.
For packages with demos, including Bootstrap 6 and FilePond, example snippets are rendered by a Yii 22.0 application
into static pages at /docs/demos/<package>/<slug>.html. HTML examples offer Preview, PHP, and HTML tabs. Markdown
and bundles retain the code without embedding demo UI. A build using local sources can differ from the public site.
Related resources
Section titled “Related resources”Bootstrap and AI documents Bootstrap’s own agent resources. Use the Yii extension skill for its PHP widgets, item objects, and enums; the upstream Bootstrap documentation covers the underlying CSS and JavaScript.
Limits
Section titled “Limits”- The GitHub Pages site is static: it does not provide
Accept: text/markdownnegotiation or a hosted MCP server; - use the explicit
/docs/llms.txtURL; host-root discovery files are not published by this repository; - this documentation records verified installation behavior separately from untested client and model behavior.