Необов'язковий стиль коду команди UFO-Tech для PHP — типізація, DTO, тонкі контролери, сервіси, ранні повернення. Для проєктів, що його приймають.
Встановити через агента — скажіть йому:
Прочитай https://ufo-tech.space/ai/install.md і встанови правило ufo-code-style з каталогу UFO Tech у цей проєкт.
Встановлення
Claude Code
У проєкт — docs/ai/ufo-code-style.md
macOS, Linux, WSL, Git Bash
mkdir -p "docs/ai"
curl -fsSL https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -o "docs/ai/ufo-code-style.md"
Windows PowerShell
New-Item -ItemType Directory -Force "docs\ai" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -OutFile "docs\ai\ufo-code-style.md"
Додайте в CLAUDE.md у корені проєкту рядок:
@docs/ai/ufo-code-style.md
Codex
У проєкт — docs/ai/ufo-code-style.md
macOS, Linux, WSL, Git Bash
mkdir -p "docs/ai"
curl -fsSL https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -o "docs/ai/ufo-code-style.md"
Windows PowerShell
New-Item -ItemType Directory -Force "docs\ai" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -OutFile "docs\ai\ufo-code-style.md"
Додайте в AGENTS.md у корені проєкту рядок:
Follow docs/ai/ufo-code-style.md.
Cursor
У проєкт — .cursor/rules/ufo-code-style.mdc
macOS, Linux, WSL, Git Bash
mkdir -p ".cursor/rules"
curl -fsSL https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -o ".cursor/rules/ufo-code-style.mdc"
Windows PowerShell
New-Item -ItemType Directory -Force ".cursor\rules" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -OutFile ".cursor\rules\ufo-code-style.mdc"
Prepend Cursor frontmatter: description (one line), globs (if the rule targets specific paths), alwaysApply: false.
GitHub Copilot
У проєкт — .github/instructions/ufo-code-style.instructions.md
macOS, Linux, WSL, Git Bash
mkdir -p ".github/instructions"
curl -fsSL https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -o ".github/instructions/ufo-code-style.instructions.md"
Windows PowerShell
New-Item -ItemType Directory -Force ".github\instructions" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -OutFile ".github\instructions\ufo-code-style.instructions.md"
Prepend frontmatter with applyTo, e.g. applyTo: "src/**".
AGENTS.md
У проєкт — docs/ai/ufo-code-style.md
macOS, Linux, WSL, Git Bash
mkdir -p "docs/ai"
curl -fsSL https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -o "docs/ai/ufo-code-style.md"
Windows PowerShell
New-Item -ItemType Directory -Force "docs\ai" | Out-Null
Invoke-WebRequest https://ufo-tech.space/ai/files/rule/ufo-code-style/universal/ufo-code-style.md -OutFile "docs\ai\ufo-code-style.md"
Додайте в AGENTS.md у корені проєкту рядок:
Follow docs/ai/ufo-code-style.md.
Опис
Необов'язковий стиль коду команди UFO-Tech для PHP-проєктів. Підключайте його лише в проєктах, що приймають цей стиль; якщо у проєкті вже є власні домовленості, агент має дотримуватися їх.
Що всередині
declare(strict_types=1);, повна типізація аргументів, результатів і властивостей;- DTO й value objects замість асоціативних масивів, незмінність за замовчуванням;
- тонкі контролери, бізнес-логіка в сервісах, репозиторії лише для доступу до даних;
- ранні повернення, невелика вкладеність і короткі методи.
Файл англійською.