parselynk/laravel-ai-attributes
Bring AI-ready metadata to your Laravel code with native PHP attributes. Annotate classes and methods to describe their intent and expose structured hints for AI agents, tools, and LLM integrations—declarative, discoverable, and colocated with your code.
Assessment status: First assessment for this package (no prior baseline). Based on v2.0.0 release notes only; no code review, dependency audit, or live-provider testing has been performed.
Bottom line: v2.0.0 is a strategic retreat that improves the package's risk profile while shrinking its differentiation. It is now a thin ergonomics-and-caching layer over first-party laravel/ai. That is a defensible thing to adopt — but it is an easy thing to re-implement, so treat it as a tactical accelerator, not a platform dependency.
Architecture fit
AIManager, AIDriver, and HttpRetrier removes the exact layer that would have rotted fastest (provider API churn, retry semantics, auth quirks).foreach over a collection can silently become N remote calls.Integration feasibility
composer require, publish config/ai.php, set AI_ATTRIBUTES_PROVIDER, declare $aiAttributes on a model, dispatch or read.laravel/ai becomes a mandatory transitive dependency. Effectively we are adopting two packages, and our supported-version window becomes the intersection of both.Technical risk
| Risk | Severity | Notes |
|---|---|---|
Upstream absorption — laravel/ai adds native attribute support, package becomes redundant |
High | Most likely long-term outcome for any "one layer above first-party" package. Plan for a cheap exit. |
| Thin test surface — 46 tests / 77 assertions for a package orchestrating remote calls | Medium-High | All tests are AnonymousAgent::fake(); there is no live-provider contract test. Mock drift is undetectable until runtime. |
| Silent cost/latency from implicit attribute access | High | Needs explicit guardrails before broad rollout. |
| Cache correctness (staleness, key composition, no documented invalidation) | High | Blocks production use on user-facing content. |
Config relocation to config/ai.php collides with other laravel/ai consumers |
Medium | Single shared config surface across all AI usage; ownership must be assigned. |
| Small/unknown maintainer vs. first-party dependency asymmetry | Medium | We inherit upstream's breakage but not upstream's support commitments. |
Key questions
null, or last-cached value? hasAiAttribute() / aiAttributeOrNull() suggest graceful degradation; confirm it is the default.ai:regenerate invalidation story for content that must stay fresh?toArray, API resources, Blade loops)? If yes, what prevents N+1 remote calls?laravel/ai's minor versions, and what is our policy when upstream ships a breaking minor?Stack fit
laravel/ai (auto-installed). Fits cleanly with standard queue workers, existing Eloquent model conventions, and Laravel's config/env layering.config/ai.php, published by upstream. This is the right call — one AI config surface rather than two — but it means this package no longer owns its own configuration namespace, so config changes now have blast radius across every other laravel/ai consumer in the app.laravel/ai; our existing env conventions should be re-checked rather than assumed to carry over.Migration path
laravel/ai → move provider config from config/ai-attributes.php to config/ai.php → rename driver → provider in every $aiAttributes declaration → delete max_tokens / temperature (now upstream's concern) → set AI_ATTRIBUTES_PROVIDER. Mechanical, but a repo-wide grep is required to size it.Compatibility
laravel/ai. Our compatibility matrix is upstream's matrix; we should stop maintaining our own.temperature, max_tokens) loses per-attribute control. If any use case genuinely needs per-field tuning, that is a functional regression to flag now rather than discover later.Sequencing
laravel/ai maturity, published version cadence, and the PHP/Laravel floor against our estate. Pull the actual dependency tree. Do not proceed on release notes alone.config/ai.php before a second team adopts, so it does not become an unowned shared surface.GenerateAiAttributeJob the default path and treat synchronous attribute reads as the exception. Backfill via ai:regenerate against a rate-limited queue.Maintenance
Support
laravel/ai. Establish that as step one of the runbook, with the AnonymousAgent::fake() test suite as the isolation tool.laravel/ai misconfiguration. Plan for one named owner rather than diffused responsibility.Scaling
ai:regenerate runs with concurrency caps rather than a single dispatch.Failure modes
null with aiAttributeOrNull().json cast — auto-decoding means a schema deviation becomes a decode exception. Needs a defined fallback (null, raw string, or retry) and alerting on decode-failure rate.laravel/ai minor release breaks config or manager behaviour, taking this package down with it. Mitigate with pinned versions and a staging soak before bumping.config/ai.php made for another AI use case silently alters attribute generation behaviour.Ramp-up
ai:regenerate command and peek methods give a safe, inspectable surface.How can I help you explore Laravel packages today?