feat(ai): add make:agent artisan command#1432
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1432 +/- ##
==========================================
+ Coverage 68.71% 68.76% +0.04%
==========================================
Files 359 361 +2
Lines 27733 27776 +43
==========================================
+ Hits 19058 19099 +41
- Misses 7830 7831 +1
- Partials 845 846 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
1 similar comment
|
@coderabbitai review |
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Pull request overview
Adds scaffolding support for the AI module by introducing a make:agent artisan command, wiring it into the AI service provider, and activating the AI binding entry (with Config dependency) in the binding registry so dependency ordering works correctly.
Changes:
- Enable
binding.AIin the binding registry and declare its dependency onbinding.Config. - Add
ai/console/AgentMakeCommand+ stub template to generate agent boilerplate underapp/agents/. - Register the new command in
ai.ServiceProvider.Boot()and add tests for both the command and provider boot.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/binding/binding.go | Activates the AI binding entry and sets Config as a dependency for ordering. |
| ai/service_provider.go | Uses binding-declared dependencies and registers make:agent during boot. |
| ai/service_provider_test.go | Adds a boot test asserting commands registration is invoked. |
| ai/console/stubs.go | Introduces the agent scaffold stub template. |
| ai/console/agent_make_command.go | Implements the make:agent generator command. |
| ai/console/agent_make_command_test.go | Adds filesystem-based tests covering command behavior and generated content. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
make:agentartisan command to scaffold new AI agent filesBootmethodConfigin the binding registryCloses goravel/goravel#916
Why
The AI module lacked a scaffolding command, requiring developers to manually create agent files. The new
make:agentcommand generates a boilerplate agent struct inapp/agents/with the correct interface methods, consistent with othermake:*commands in the framework.The
AIbinding entry in the registry was commented out and itsDependenciesfield was missing, which prevented proper dependency ordering during boot. These are now activated so the AI service provider correctly declares its dependency on theConfigbinding.