/ ディレクトリ / プレイグラウンド / symfony-hexagonal-skill
● コミュニティ aligundogdu ⚡ 即起動

symfony-hexagonal-skill

作者 aligundogdu · aligundogdu/symfony-hexagonal-skill

Enforces hexagonal architecture in Symfony projects — 10 auto-triggered skills plus 2 review agents that stop you from leaking infrastructure into domain.

A Claude Code plugin for Symfony developers who actually want to keep ports & adapters clean. Auto-triggers on Symfony code patterns to guide domain/application/infrastructure separation. Includes review agents that catch leaks (Doctrine entities imported into domain, controllers calling repositories directly).

なぜ使うのか

主な機能

ライブデモ

実際の動作

symfony-hexagonal-skill.replay ▶ 準備完了
0/0

インストール

クライアントを選択

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "symfony-hexagonal-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/aligundogdu/symfony-hexagonal-skill",
        "~/.claude/skills/symfony-hexagonal-skill"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config を開く。保存後、アプリを再起動。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "symfony-hexagonal-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/aligundogdu/symfony-hexagonal-skill",
        "~/.claude/skills/symfony-hexagonal-skill"
      ],
      "_inferred": true
    }
  }
}

Cursor は Claude Desktop と同じ mcpServers スキーマを使用。プロジェクト設定はグローバルより優先。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "symfony-hexagonal-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/aligundogdu/symfony-hexagonal-skill",
        "~/.claude/skills/symfony-hexagonal-skill"
      ],
      "_inferred": true
    }
  }
}

Cline サイドバーの MCP Servers アイコンをクリックし、"Edit Configuration" を選択。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "symfony-hexagonal-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/aligundogdu/symfony-hexagonal-skill",
        "~/.claude/skills/symfony-hexagonal-skill"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop と同じ形式。Windsurf を再起動して反映。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "symfony-hexagonal-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/aligundogdu/symfony-hexagonal-skill",
        "~/.claude/skills/symfony-hexagonal-skill"
      ]
    }
  ]
}

Continue はマップではなくサーバーオブジェクトの配列を使用。

~/.config/zed/settings.json
{
  "context_servers": {
    "symfony-hexagonal-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/aligundogdu/symfony-hexagonal-skill",
          "~/.claude/skills/symfony-hexagonal-skill"
        ]
      }
    }
  }
}

context_servers に追加。保存時に Zed がホットリロード。

claude mcp add symfony-hexagonal-skill -- git clone https://github.com/aligundogdu/symfony-hexagonal-skill ~/.claude/skills/symfony-hexagonal-skill

ワンライナー。claude mcp list で確認、claude mcp remove で削除。

ユースケース

実用的な使い方: symfony-hexagonal-skill

Scaffold a new bounded context with hexagonal layers

👤 Symfony devs building non-trivial domain logic ⏱ ~60 min advanced

使うタイミング: You're starting a new feature and want the layering right from day one.

前提条件
  • Symfony 6.x+ project — composer create-project symfony/skeleton
  • Skill installed — git clone https://github.com/aligundogdu/symfony-hexagonal-skill ~/.claude/skills/symfony-hexagonal-skill
フロー
  1. Name the context
    Use symfony-hexagonal-skill. Scaffold a 'Billing' bounded context with Invoice aggregate, issue/void commands, and a query for open invoices.✓ コピーしました
    → src/Billing/Domain, Application, Infrastructure folders with proper separation
  2. Wire the infrastructure
    Add a Doctrine adapter for InvoiceRepository behind the domain port.✓ コピーしました
    → Interface in Domain, implementation in Infrastructure, services.yaml binding
  3. Expose via controller
    Add an HTTP adapter with a POST /invoices endpoint that dispatches the IssueInvoice command.✓ コピーしました
    → Controller calls bus, not repository directly

結果: A clean bounded context that won't turn into spaghetti in 6 months.

注意点
  • Domain depending on Doctrine annotations — Use XML / attribute mapping in Infrastructure, not on domain entities
組み合わせ: filesystem

Review a PR for hexagonal layering violations

👤 Tech leads on Symfony teams ⏱ ~20 min intermediate

使うタイミング: Reviewing a PR and you want an automated first-pass on layering.

フロー
  1. Run the review agent
    Use symfony-hexagonal-skill review agent on this diff. Flag any Doctrine / Symfony FW imports in Domain/, any controller->repository direct calls, any ORM leakage into responses.✓ コピーしました
    → Concrete findings with file+line
  2. Suggest fixes
    For each finding, propose the minimal refactor.✓ コピーしました
    → Diffs introducing a port or DTO

結果: A PR that doesn't silently degrade the architecture.

組み合わせ: github

Progressively refactor an existing Symfony app toward hexagonal

👤 Teams with a legacy Symfony project ⏱ ~120 min advanced

使うタイミング: Big-bang rewrite is off the table; you want incremental cleanup.

フロー
  1. Identify a seam
    Use symfony-hexagonal-skill. Look at src/Module/Orders — what's the smallest slice I can lift into a clean domain?✓ コピーしました
    → Specific class identified with extraction plan
  2. Extract incrementally
    Walk me through the extraction in 3 PR-sized steps.✓ コピーしました
    → Staged plan with tests preserved at each step

結果: A legacy codebase getting better, one PR at a time.

注意点
  • Extracting too much in one step — PR-sized slices only; the plugin's review agent helps gate each step
組み合わせ: git

組み合わせ

他のMCPと組み合わせて10倍の力を

symfony-hexagonal-skill + github

Gate PRs on layering review before merge

Run the hex review on the open PR in this repo and post findings as comments.✓ コピーしました
symfony-hexagonal-skill + filesystem

Apply scaffolds into the actual repo

Apply the context scaffold to my project under src/.✓ コピーしました

ツール

このMCPが提供する機能

ツール入力呼び出すタイミングコスト
context_scaffold context name, aggregates New bounded context 0
port_adapter_pair port interface name, adapter type Adding infrastructure 0
layering_review diff or directory Pre-merge 0
refactor_plan legacy module Starting a cleanup 0

コストと制限

運用コスト

APIクォータ
None
呼び出しあたりのトークン
Moderate — reviews scan files
金額
Free
ヒント
Scope reviews to the diff, not whole repos, to save tokens.

セキュリティ

権限、シークレット、影響範囲

認証情報の保管: None
データ送信先: None from skill

トラブルシューティング

よくあるエラーと対処法

Review agent misses violations

Ensure the full diff is in context; very large diffs may need chunking

Scaffold produces old Symfony 5 style

Mention your Symfony version explicitly — 6 vs 7 conventions differ

代替案

symfony-hexagonal-skill 他との比較

代替案代わりに使う場面トレードオフ
Deptrac static analysisYou want rule-based static enforcement of layeringNo refactor help; purely gates violations
craftcms-claude-skillYou're on Craft CMS, not SymfonyDifferent framework

その他

リソース

📖 GitHub の公式 README を読む

🐙 オープンな issue を見る

🔍 400以上のMCPサーバーとSkillsを見る