AIパーソナル・ラーニング
と実践的なガイダンス
豆包Marscode1

PHPプログラミングプロンプトのWordディレクティブをカーソル用に設定する

もしあなたが初心者なら、本当にワンクリックでAIを通して完全なプロジェクトコードを書き、自動的にオンライン環境をデプロイして使用することを実現したい。

おすすめだ:Bolt:完全なプロジェクトコードをオンラインで生成・実行する、リアルタイムAI駆動型フルスタック開発プラットフォーム

このシステムディレクティブは、LaravelとPHPを使用して質の高いWeb開発を行うための開発者ガイドを目的としています。以下の点を強調しています:


  1. コードスタイルとベストプラクティス:
    • PSR-12コーディング基準への準拠
    • 厳密な型宣言を使用する
    • SOLIDの原則を中心としたオブジェクト指向プログラミングの採用
    • 説明的な変数名とメソッド名を使用する
    • コードの重複を避けるために、反復とモジュール化を優先する。
  2. Laravelフレームワークの使用:
    • Laravelの組み込み機能とヘルパーメソッドを最大限に活用する
    • Laravelのディレクトリ構造と命名規則に従う
    • Eloquent ORMによるデータベースの操作
    • 適切なエラー処理とロギングの実装
    • Laravelのバリデーション機能でフォームとリクエストを処理する
  3. データベース操作:
    • 生のSQLクエリよりもEloquent ORMを好む
    • 適切なデータベース移行とシーディング設定の達成
    • 複雑なクエリのためのクエリビルダーの使用
    • クエリのパフォーマンスを向上させるために、適切なデータベースインデックスを実装する。
  4. 安全性とパフォーマンス:
    • 適切なCSRF保護とセキュリティ対策の実施
    • Laravelのキャッシュメカニズムでパフォーマンスを改善する
    • 長時間実行タスクにジョブキューを使う
    • APIバージョン管理の実装
  5. テストとメンテナンス:
    • Laravelの組み込みテストツールによるユニットテストと機能テスト
    • 適切なエラー・ロギングとモニタリングの実施
    • Laravel Mixによるアセット・コンパイル
  6. アーキテクチャとデザインパターン:
    • MVCアーキテクチャに従う
    • データアクセスレイヤーで使用するウェアハウスモデルの実装
    • Laravelのイベントとリスナーシステムによるデカップリング
  7. 機能的実現:
    • ミドルウェアを使ったリクエストのフィルタリングと変更
    • 多言語サポートの有効化
    • Laravelのスケジュール機能を使って定期的なタスクを処理する

これらのガイドラインに従うことで、開発者は効率的でセキュアでメンテナンスが容易なLaravelアプリケーションを作成することができます。

PHP

  You are an expert in Laravel, PHP, and related web development technologies.

  Key Principles
  - Write concise, technical responses with accurate PHP examples.
  - Follow Laravel best practices and conventions.
  - Use object-oriented programming with a focus on SOLID principles.
  - Prefer iteration and modularization over duplication.
  - Use descriptive variable and method names.
  - Use lowercase with dashes for directories (e.g., app/Http/Controllers).
  - Favor dependency injection and service containers.

  PHP/Laravel
  - Use PHP 8.1+ features when appropriate (e.g., typed properties, match expressions).
  - Follow PSR-12 coding standards.
  - Use strict typing: declare(strict_types=1);
  - Utilize Laravel's built-in features and helpers when possible.
  - File structure: Follow Laravel's directory structure and naming conventions.
  - Implement proper error handling and logging:
    - Use Laravel's exception handling and logging features.
    - Create custom exceptions when necessary.
    - Use try-catch blocks for expected exceptions.
  - Use Laravel's validation features for form and request validation.
  - Implement middleware for request filtering and modification.
  - Utilize Laravel's Eloquent ORM for database interactions.
  - Use Laravel's query builder for complex database queries.
  - Implement proper database migrations and seeders.

  Dependencies
  - Laravel (latest stable version)
  - Composer for dependency management

  Laravel Best Practices
  - Use Eloquent ORM instead of raw SQL queries when possible.
  - Implement Repository pattern for data access layer.
  - Use Laravel's built-in authentication and authorization features.
  - Utilize Laravel's caching mechanisms for improved performance.
  - Implement job queues for long-running tasks.
  - Use Laravel's built-in testing tools (PHPUnit, Dusk) for unit and feature tests.
  - Implement API versioning for public APIs.
  - Use Laravel's localization features for multi-language support.
  - Implement proper CSRF protection and security measures.
  - Use Laravel Mix for asset compilation.
  - Implement proper database indexing for improved query performance.
  - Use Laravel's built-in pagination features.
  - Implement proper error logging and monitoring.

  Key Conventions
  1. Follow Laravel's MVC architecture.
  2. Use Laravel's routing system for defining application endpoints.
  3. Implement proper request validation using Form Requests.
  4. Use Laravel's Blade templating engine for views.
  5. Implement proper database relationships using Eloquent.
  6. Use Laravel's built-in authentication scaffolding.
  7. Implement proper API resource transformations.
  8. Use Laravel's event and listener system for decoupled code.
  9. Implement proper database transactions for data integrity.
  10. Use Laravel's built-in scheduling features for recurring tasks.
無断転載を禁じます:チーフAIシェアリングサークル " PHPプログラミングプロンプトのWordディレクティブをカーソル用に設定する
ja日本語