Adopt package development skills - #453
Conversation
Publish Laravel, MCP, Tailwind, and Psalm guidance for Core. Adapt shared instructions and examples to Orchestra Testbench and package boundaries.
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c032f363e1
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| $response = Http::retry([100, 500, 1000]) | ||
| ->timeout(10) | ||
| ->post('https://api.example.com/v1/charges', $data); |
There was a problem hiding this comment.
Require idempotency before retrying charge requests
When a non-idempotent request such as this charge succeeds remotely but its response is lost, retry() sends the POST again and can create duplicate charges. Restrict this recommendation to idempotent operations, or require an idempotency key and a retry predicate that is safe for the target API.
Useful? React with 馃憤聽/ 馃憥.
| ## Batch Related Jobs | ||
|
|
||
| Use `Bus::batch()` when jobs should succeed or fail together. |
There was a problem hiding this comment.
Do not describe job batches as atomic
When one job fails after earlier jobs have completed, Bus::batch() does not roll back those completed jobs or their side effects, so an import can remain partially applied despite the batch failure. Describe batches as coordination and monitoring, and require transactional, idempotent, or compensating behavior when the work must succeed or fail as a unit.
Useful? React with 馃憤聽/ 馃憥.
| Correct (index-friendly subquery, no PHP memory overhead): | ||
|
|
||
| ```php | ||
| $query->whereIn('company_id', Company::where('name', 'like', $term)->select('id')); |
There was a problem hiding this comment.
Preserve relationship constraints in query rewrites
When company() defines additional constraints or uses nonstandard foreign or owner keys, replacing whereHas() with this hard-coded subquery changes which records match because it bypasses the relationship definition. The performance benefit is also database- and plan-dependent, so this should only be recommended after reproducing all relationship constraints and comparing the query plans.
Useful? React with 馃憤聽/ 馃憥.
Summary
Validation
quick_validate.pycomposer validate --strictcomposer test:lintcomposer buildnpm run build