|
| 1 | +# How to Use Prompt Files in docs/prompts/ |
| 2 | + |
| 3 | +This directory contains prompts for automatic generation of Ray.InputQuery Input classes and usage examples. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +### input-class-generator.md |
| 8 | + |
| 9 | +- Use this prompt when asking AI to automatically generate Input classes or perform refactoring. |
| 10 | +- Helpful when converting existing flat parameter lists into structured Input objects. |
| 11 | +- Example: |
| 12 | + |
| 13 | +```html |
| 14 | +<!-- Generate Input classes from this HTML form --> |
| 15 | +<form> |
| 16 | + <input name="user_name" type="text"> |
| 17 | + <input name="user_email" type="email"> |
| 18 | + <input name="order_id" type="number"> |
| 19 | + <input name="order_total" type="number"> |
| 20 | +</form> |
| 21 | +``` |
| 22 | + |
| 23 | +### usage-generator.md |
| 24 | + |
| 25 | +- Use this prompt when asking AI to generate usage examples of Input classes or integration examples with Ray.MediaQuery and BEAR.Resource. |
| 26 | +- Helpful when you want to know how to use Input classes or see implementation examples. |
| 27 | +- Example: |
| 28 | + |
| 29 | +```php |
| 30 | +final class UserRegistrationInput |
| 31 | +{ |
| 32 | + public function __construct( |
| 33 | + #[Input] public readonly AccountInput $account, |
| 34 | + #[Input] public readonly ProfileInput $profile, |
| 35 | + #[Input] public readonly PreferencesInput $preferences |
| 36 | + ) {} |
| 37 | +} |
| 38 | + |
| 39 | +final class AccountInput |
| 40 | +{ |
| 41 | + public function __construct( |
| 42 | + #[Input] public readonly string $email, |
| 43 | + #[Input] public readonly string $password, |
| 44 | + #[Input] public readonly string $passwordConfirm |
| 45 | + ) {} |
| 46 | +} |
| 47 | + |
| 48 | +final class ProfileInput |
| 49 | +{ |
| 50 | + public function __construct( |
| 51 | + #[Input] public readonly string $firstName, |
| 52 | + #[Input] public readonly string $lastName, |
| 53 | + #[Input] public readonly ?string $displayName = null |
| 54 | + ) {} |
| 55 | +} |
| 56 | +``` |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +These prompts are useful for AI-assisted development support including introduction, utilization, refactoring, and documentation generation for Ray.InputQuery. |
0 commit comments