@vesviet/agent-skills 5.6.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/INDEX.md +5 -5
  2. package/README.md +1 -1
  3. package/VERSION +1 -1
  4. package/adapters/antigravity/a2a-config.template.yaml +1 -1
  5. package/adapters/antigravity/role-skill-index.json +12 -12
  6. package/adapters/claude/CLAUDE_ADAPTER.md +1 -1
  7. package/adapters/cursor/README.md +185 -185
  8. package/bin/agent-skills.mjs +17 -14
  9. package/core/contracts/README.md +1 -1
  10. package/core/contracts/schemas/api-contract-spec.json +191 -191
  11. package/core/contracts/schemas/data-pipeline-spec.json +1 -1
  12. package/core/contracts/schemas/design-tokens-spec.json +19 -0
  13. package/core/contracts/schemas/feature-ticket.json +1293 -1293
  14. package/core/contracts/schemas/pull-request-spec.json +338 -338
  15. package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
  16. package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
  17. package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
  18. package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
  19. package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
  20. package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
  21. package/core/contracts/schemas/security-audit.json +143 -12
  22. package/core/contracts/schemas/system-design-spec.json +9 -1
  23. package/core/contracts/schemas/test-report.json +530 -530
  24. package/core/contracts/schemas/ux-flow-spec.json +66 -0
  25. package/core/roles/ai-systems-engineer.md +31 -18
  26. package/core/roles/aws-engineer.md +33 -29
  27. package/core/roles/backend-developer.md +6 -4
  28. package/core/roles/content-manager.md +7 -7
  29. package/core/roles/data-engineer.md +39 -36
  30. package/core/roles/qa-engineer.md +18 -18
  31. package/core/roles/references/ai-systems-engineer-review-checklist.md +11 -3
  32. package/core/roles/references/aws-engineer-review-checklist.md +29 -16
  33. package/core/roles/references/business-analyst-responsibilities.md +207 -207
  34. package/core/roles/references/content-manager-governance-standards.md +2 -2
  35. package/core/roles/references/content-manager-review-checklist.md +7 -1
  36. package/core/roles/references/data-engineer-review-checklist.md +11 -3
  37. package/core/roles/references/frontend-developer-responsibilities.md +275 -275
  38. package/core/roles/references/qa-engineer-review-checklist.md +10 -5
  39. package/core/roles/references/security-engineer-review-checklist.md +8 -0
  40. package/core/roles/references/solution-architect-review-checklist.md +6 -1
  41. package/core/roles/references/system-engineer-review-checklist.md +11 -0
  42. package/core/roles/references/ui-ux-designer-review-checklist.md +12 -0
  43. package/core/roles/security-engineer.md +35 -5
  44. package/core/roles/solution-architect.md +7 -7
  45. package/core/roles/system-engineer.md +470 -465
  46. package/core/roles/ui-ux-designer.md +17 -3
  47. package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
  48. package/core/skills/agent/architect-mcp-server/SKILL.md +3 -3
  49. package/core/skills/agent/decompose-agentic-system/SKILL.md +1 -1
  50. package/core/skills/ai/deploy-vllm-inference/SKILL.md +14 -14
  51. package/core/skills/ai-agent/agent-evaluation/SKILL.md +5 -0
  52. package/core/skills/ai-agent/context-optimization/SKILL.md +9 -0
  53. package/core/skills/backend/add-api-endpoint/SKILL.md +1 -0
  54. package/core/skills/backend/add-event-handler/SKILL.md +1 -0
  55. package/core/skills/backend/add-service-client/SKILL.md +1 -0
  56. package/core/skills/backend/build-mcp-server/SKILL.md +101 -100
  57. package/core/skills/backend/implement-auth/SKILL.md +1 -0
  58. package/core/skills/backend/implement-structured-outputs/SKILL.md +95 -94
  59. package/core/skills/backend/optimize-postgres/SKILL.md +1 -0
  60. package/core/skills/backend/scaffold-new-service/SKILL.md +1 -0
  61. package/core/skills/business/elicit-requirements/SKILL.md +102 -102
  62. package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
  63. package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
  64. package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
  65. package/core/skills/business/write-use-cases/SKILL.md +106 -106
  66. package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
  67. package/core/skills/content/audit-content/SKILL.md +3 -2
  68. package/core/skills/content/audit-content/references/information-gain-rubric.md +1 -1
  69. package/core/skills/content/design-content-strategy/SKILL.md +6 -5
  70. package/core/skills/content/design-content-strategy/references/information-gain-and-decay-triage.md +2 -2
  71. package/core/skills/content/optimize-seo/SKILL.md +6 -5
  72. package/core/skills/content/optimize-seo/references/geo-ai-citation-playbook.md +2 -2
  73. package/core/skills/content/optimize-seo/references/process-and-checklist.md +1 -1
  74. package/core/skills/content/repurpose-content/SKILL.md +4 -3
  75. package/core/skills/content/write-article/SKILL.md +6 -5
  76. package/core/skills/content/write-copy/SKILL.md +3 -2
  77. package/core/skills/document/pptx/SKILL.md +1 -0
  78. package/core/skills/document/pptx/scripts/add_slide.py +0 -0
  79. package/core/skills/document/pptx/scripts/clean.py +0 -0
  80. package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
  81. package/core/skills/document/xlsx/scripts/recalc.py +0 -0
  82. package/core/skills/documentation/write-documentation/SKILL.md +143 -143
  83. package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
  84. package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
  85. package/core/skills/foundation/design-review/SKILL.md +11 -1
  86. package/core/skills/foundation/design-ux-flow/SKILL.md +13 -1
  87. package/core/skills/foundation/performance-profiling/SKILL.md +3 -1
  88. package/core/skills/foundation/release-notes/SKILL.md +192 -192
  89. package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
  90. package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
  91. package/core/skills/foundation/write-tests/SKILL.md +11 -10
  92. package/core/skills/frontend/anti-ui-slop-finish-gate/SKILL.md +5 -0
  93. package/core/skills/frontend/design-md-specification/SKILL.md +1 -0
  94. package/core/skills/frontend/design-system-engineering/SKILL.md +4 -2
  95. package/core/skills/meetings-analysis/analyze-business-requirements/SKILL.md +1 -1
  96. package/core/skills/platform/add-telemetry-instrumentation/SKILL.md +2 -1
  97. package/core/skills/platform/aws-infrastructure/SKILL.md +12 -11
  98. package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
  99. package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
  100. package/core/skills/platform/debug-runtime-platform/SKILL.md +1 -0
  101. package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
  102. package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
  103. package/core/skills/platform/setup-gpu-finops/SKILL.md +111 -107
  104. package/core/skills/platform/setup-llm-gateway/SKILL.md +110 -108
  105. package/core/skills/platform/supply-chain-security/SKILL.md +1 -0
  106. package/core/skills/platform/system-design/SKILL.md +7 -0
  107. package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
  108. package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
  109. package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
  110. package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
  111. package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
  112. package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
  113. package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
  114. package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
  115. package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
  116. package/core/skills/platform/web-perf/SKILL.md +151 -151
  117. package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
  118. package/core/skills/product/build-story-map/SKILL.md +104 -104
  119. package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
  120. package/core/skills/product/define-product-strategy/SKILL.md +105 -105
  121. package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
  122. package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
  123. package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
  124. package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
  125. package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
  126. package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
  127. package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
  128. package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
  129. package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
  130. package/core/skills/repo-ops/review-service/SKILL.md +186 -186
  131. package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
  132. package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
  133. package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
  134. package/core/skills/security-data/build-data-pipeline/SKILL.md +15 -14
  135. package/core/skills/security-data/build-data-pipeline/references/producer-contracts-and-lakehouse.md +5 -5
  136. package/core/skills/security-data/database-maintenance/SKILL.md +1 -0
  137. package/core/skills/security-data/database-maintenance/references/relational-and-vector-maintenance.md +5 -5
  138. package/core/skills/security-data/manage-secrets/SKILL.md +3 -0
  139. package/core/skills/security-data/optimize-olap-database/SKILL.md +14 -13
  140. package/core/skills/security-data/optimize-olap-database/references/olap-database-guide.md +2 -2
  141. package/core/skills/security-data/prompt-injection-defense/SKILL.md +3 -0
  142. package/core/skills/security-data/query-analytical-engine/SKILL.md +8 -7
  143. package/core/skills/security-data/query-analytical-engine/references/analytical-query-guide.md +3 -3
  144. package/core/skills/security-data/security-audit/SKILL.md +126 -119
  145. package/core/workflows/add-new-feature.md +212 -212
  146. package/core/workflows/agent-a2a-delegation.md +142 -142
  147. package/core/workflows/bug-fix.md +147 -147
  148. package/core/workflows/build-deploy.md +208 -208
  149. package/core/workflows/code-review.md +137 -137
  150. package/core/workflows/curriculum-delivery.md +1 -1
  151. package/core/workflows/dependency-upgrade.md +193 -193
  152. package/core/workflows/feature-delivery.md +149 -149
  153. package/core/workflows/hotfix-production.md +172 -172
  154. package/core/workflows/qa-validation.md +231 -231
  155. package/core/workflows/refactoring.md +154 -154
  156. package/core/workflows/revert-deployment.md +147 -147
  157. package/core/workflows/security-incident-response.md +191 -191
  158. package/core/workflows/seo-content-lifecycle.md +91 -91
  159. package/core/workflows/service-review-release.md +223 -223
  160. package/core/workflows/setup-new-service.md +214 -214
  161. package/core/workflows/tech-repo-review.md +245 -245
  162. package/core/workflows/troubleshooting.md +241 -241
  163. package/overlays/astro-cloudflare/README.md +93 -93
  164. package/overlays/data-analyst-stack/README.md +109 -109
  165. package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
  166. package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
  167. package/overlays/ecommerce-microservices/README.md +65 -65
  168. package/overlays/go-microservices/README.md +78 -78
  169. package/overlays/go-microservices/rules/go-conventions.md +223 -223
  170. package/overlays/laravel-filament/README.md +90 -90
  171. package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
  172. package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
  173. package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
  174. package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
  175. package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
  176. package/overlays/r3f-stack/README.md +89 -89
  177. package/overlays/r3f-stack/rules/stub.md +43 -43
  178. package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
  179. package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
  180. package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
  181. package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
  182. package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
  183. package/package.json +2 -2
  184. package/core/README.md +0 -53
@@ -1,141 +1,141 @@
1
- ---
2
- name: develop-laravel-feature
3
- description: Develop features in a Laravel 13 + Filament v4 + Livewire 3 monolith. Use when adding admin resources, Blade pages, Livewire components, Actions, Services, or database migrations in this stack.
4
- allowed-tools: [read_file, write_file, edit_file, create_file, search_code, php_artisan_test, php_artisan_lint, php_artisan_serve, run_tests]
5
- ---
6
-
7
- # Develop Laravel Feature
8
-
9
- Use this skill when building or modifying features in a Laravel 13 monolith using Filament v4 for admin, Livewire 3 for interactive components, and Blade for static rendering.
10
-
11
- **Stack baseline (2026):** Laravel 13, Filament v4, Livewire 3, PHP 8.3+, TailwindCSS v4, Pest PHP v5.
12
-
13
- ## Core Rules
14
-
15
- - **Thin Controller**: Controllers validate (FormRequest) and return views/responses. Business logic goes in `app/Actions/` or `app/Services/`.
16
- - **Livewire islands only**: Use Livewire for interactive widgets (drawers, modals, dynamic forms). Static pages and listings render with pure Blade.
17
- - **DB transactions**: Multi-table writes must use `DB::transaction()`.
18
- - **Soft deletes**: Models referenced by foreign keys should use `SoftDeletes`.
19
- - **FormRequest always**: Never validate inside controllers or Livewire components directly — use FormRequest or Livewire `#[Validate]` attributes.
20
- - **Queue for I/O**: Email, notifications, and external API calls go through the queue.
21
- - **Laravel Reverb**: Use Reverb for WebSockets — not Pusher — in new installations.
22
- - **Laravel Pulse**: Check Pulse dashboard for slow queries, queue failures, and exceptions in dev.
23
-
24
- ## Filament v4 — Schema API (Breaking from v3)
25
-
26
- ```php
27
- // ❌ Filament v3 (old)
28
- use Filament\Forms\Form;
29
- public function form(Form $form): Form
30
- {
31
- return $form->schema([TextInput::make('name')]);
32
- }
33
-
34
- // ✅ Filament v4 (current)
35
- use Filament\Schemas\Schema;
36
- public function form(Schema $schema): Schema
37
- {
38
- return $schema->components([TextInput::make('name')]);
39
- // Note: .schema() renamed to .components()
40
- }
41
- ```
42
-
43
- ## PHP 8.4 Features (Use in New Code)
44
-
45
- ```php
46
- // Property Hooks — replace getters/setters
47
- class Product extends Model {
48
- public string $slug {
49
- get => Str::slug($this->name);
50
- }
51
- }
52
-
53
- // Asymmetric Visibility
54
- class Order extends Model {
55
- public private(set) string $status = 'pending';
56
- }
57
-
58
- // New array functions
59
- $item = array_find($items, fn($i) => $i->id === $id);
60
- ```
61
-
62
- ## Suggested Process
63
-
64
- ### 1. Identify The Layer
65
-
66
- | Task | Layer | Location |
67
- |------|-------|----------|
68
- | Admin CRUD | Filament v4 Resource | `app/Filament/Resources/` |
69
- | New public page | Controller + Blade | `app/Http/Controllers/` + `resources/views/` |
70
- | Interactive widget | Livewire | `app/Livewire/` + `resources/views/livewire/` |
71
- | Business logic | Action / Service | `app/Actions/` or `app/Services/` |
72
- | Schema change | Migration | `database/migrations/` |
73
- | Input validation | FormRequest / Rule | `app/Http/Requests/` or `app/Rules/` |
74
-
75
- ### 2. Read Existing Patterns
76
-
77
- Before writing code, open 1–2 existing files in the same layer to match:
78
- - Filament v4 Resource structure (`Schema::components()` — not `Form::schema()`)
79
- - Controller response patterns (view rendering, redirects)
80
- - Livewire event dispatching and Alpine.js integration
81
- - Model casts, relationships, scopes, and media conversions
82
- - Action class invocation and `DB::transaction()` usage
83
-
84
- ### 3. Implement Following Standards
85
-
86
- - Match the established pattern — do not introduce new architectural layers without discussion.
87
- - Use Filament v4 `Schema` API for admin features.
88
- - Use `FormRequest` classes for all HTTP validation.
89
- - Wrap multi-table operations in `DB::transaction()`.
90
-
91
- ### 4. Test Critical Paths
92
-
93
- - Write Pest v5 tests for business logic in Actions/Services.
94
- - Write Feature tests for critical HTTP flows.
95
- - Run: `php artisan test` or `./vendor/bin/pest`.
96
-
97
- ## Failure Modes
98
-
99
- - **v3 Filament API used instead of v4**: a resource is written with the deprecated `Form::schema()` API. **Mitigation:** the Core Rules require the v4 `Schema::components()` API; reject v3 code at PR.
100
- - **Business logic in controller**: a controller contains business logic instead of dispatching to Action or Service. **Mitigation:** the Thin Controller rule forbids it; refactor to Action or Service.
101
- - **Livewire used for static content**: a static listing is built as a Livewire component. **Mitigation:** the Livewire-islands-only rule forbids it; rebuild as pure Blade.
102
- - **DB::transaction missing on multi-table writes**: a checkout writes to orders and order_items without a transaction. **Mitigation:** the Core Rules require `DB::transaction()`; reject un-wrapped multi-table writes.
103
- - **Sync email dispatch**: a notification is sent synchronously inside the request. **Mitigation:** the Core Rules require queue dispatch; reject sync sends.
104
- - **Validation inside controller or Livewire**: validation logic is duplicated inline instead of using FormRequest or `#[Validate]`. **Mitigation:** the FormRequest-always rule forbids inline validation; refactor.
105
-
106
- ## Output Contracts
107
-
108
- When this skill produces a structured handoff, emit:
109
-
110
- - **`contracts/schemas/implementation-result.json`** — Required fields: `change_summary`, `files_touched[]`, and `validation_run` output proving Pest v5 tests pass.
111
- - **`contracts/schemas/api-contract-spec.json`** when a new Filament v4 Resource or public Blade route introduces a typed surface.
112
-
113
- Skip structured emission for trivial UI tweaks that do not cross a role boundary.
114
- ## Security Guardrails (OWASP ASI)
115
-
116
- - **ASI03 Identity & Privilege Abuse**: Filament v4 Resources and FormRequest validation must enforce role-based access; user data must not be exposed across role boundaries.
117
- - **ASI04 Supply Chain**: every Laravel, Filament, Livewire, Pest, and Reverb dependency must be schema-validated against the expected manifest; treat unknown versions as untrusted.
118
- - **ASI05 RCE Guard**: do not construct SQL queries, payment payloads, or Blade strings from external or user-supplied content without strict schema validation; reject string-concatenated SQL.
119
- - **ASI07 Inter-Agent Communication**: the implementation result is consumed by Backend Developer, QA Engineer, and Frontend Developer roles; emit a structured contract so each role can validate.
120
- - **ASI09 Human-Agent Trust Exploitation**: do not present a feature as "production-ready" without the actual smoke test evidence; surface the residual risk honestly.
121
- ## Checklist
122
-
123
- - [ ] feature placed in the correct architectural layer (Action/Service/Controller/Livewire/Filament)
124
- - [ ] thin controller pattern followed — no business logic in controllers
125
- - [ ] Livewire used only for interactive islands, Blade for static content
126
- - [ ] Filament v4 `Schema::components()` API used (not deprecated `Form::schema()`)
127
- - [ ] DB::transaction() wraps any multi-table write operations
128
- - [ ] migrations include proper indexes on slug, foreign key, and status columns
129
- - [ ] SoftDeletes used on models referenced by foreign keys
130
- - [ ] FormRequest used for HTTP validation
131
- - [ ] email and notifications dispatched via queue (never synchronous)
132
- - [ ] Pest v5 tests written for critical business logic
133
- - [ ] Laravel Pulse checked for slow queries and queue health after significant changes
134
-
135
- ## Related Skills
136
-
137
- - **review-code**: review changes against Laravel and project conventions
138
- - **write-tests**: write Pest v5 tests for business logic
139
- - **navigate-service**: understand the codebase structure before changes
140
- - **troubleshoot-service**: debug runtime issues
141
- - **commit-code**: commit with proper conventions
1
+ ---
2
+ name: develop-laravel-feature
3
+ description: Develop features in a Laravel 13 + Filament v4 + Livewire 3 monolith. Use when adding admin resources, Blade pages, Livewire components, Actions, Services, or database migrations in this stack.
4
+ allowed-tools: [read_file, write_file, edit_file, create_file, search_code, php_artisan_test, php_artisan_lint, php_artisan_serve, run_tests]
5
+ ---
6
+
7
+ # Develop Laravel Feature
8
+
9
+ Use this skill when building or modifying features in a Laravel 13 monolith using Filament v4 for admin, Livewire 3 for interactive components, and Blade for static rendering.
10
+
11
+ **Stack baseline (2026):** Laravel 13, Filament v4, Livewire 3, PHP 8.3+, TailwindCSS v4, Pest PHP v5.
12
+
13
+ ## Core Rules
14
+
15
+ - **Thin Controller**: Controllers validate (FormRequest) and return views/responses. Business logic goes in `app/Actions/` or `app/Services/`.
16
+ - **Livewire islands only**: Use Livewire for interactive widgets (drawers, modals, dynamic forms). Static pages and listings render with pure Blade.
17
+ - **DB transactions**: Multi-table writes must use `DB::transaction()`.
18
+ - **Soft deletes**: Models referenced by foreign keys should use `SoftDeletes`.
19
+ - **FormRequest always**: Never validate inside controllers or Livewire components directly — use FormRequest or Livewire `#[Validate]` attributes.
20
+ - **Queue for I/O**: Email, notifications, and external API calls go through the queue.
21
+ - **Laravel Reverb**: Use Reverb for WebSockets — not Pusher — in new installations.
22
+ - **Laravel Pulse**: Check Pulse dashboard for slow queries, queue failures, and exceptions in dev.
23
+
24
+ ## Filament v4 — Schema API (Breaking from v3)
25
+
26
+ ```php
27
+ // ❌ Filament v3 (old)
28
+ use Filament\Forms\Form;
29
+ public function form(Form $form): Form
30
+ {
31
+ return $form->schema([TextInput::make('name')]);
32
+ }
33
+
34
+ // ✅ Filament v4 (current)
35
+ use Filament\Schemas\Schema;
36
+ public function form(Schema $schema): Schema
37
+ {
38
+ return $schema->components([TextInput::make('name')]);
39
+ // Note: .schema() renamed to .components()
40
+ }
41
+ ```
42
+
43
+ ## PHP 8.4 Features (Use in New Code)
44
+
45
+ ```php
46
+ // Property Hooks — replace getters/setters
47
+ class Product extends Model {
48
+ public string $slug {
49
+ get => Str::slug($this->name);
50
+ }
51
+ }
52
+
53
+ // Asymmetric Visibility
54
+ class Order extends Model {
55
+ public private(set) string $status = 'pending';
56
+ }
57
+
58
+ // New array functions
59
+ $item = array_find($items, fn($i) => $i->id === $id);
60
+ ```
61
+
62
+ ## Suggested Process
63
+
64
+ ### 1. Identify The Layer
65
+
66
+ | Task | Layer | Location |
67
+ |------|-------|----------|
68
+ | Admin CRUD | Filament v4 Resource | `app/Filament/Resources/` |
69
+ | New public page | Controller + Blade | `app/Http/Controllers/` + `resources/views/` |
70
+ | Interactive widget | Livewire | `app/Livewire/` + `resources/views/livewire/` |
71
+ | Business logic | Action / Service | `app/Actions/` or `app/Services/` |
72
+ | Schema change | Migration | `database/migrations/` |
73
+ | Input validation | FormRequest / Rule | `app/Http/Requests/` or `app/Rules/` |
74
+
75
+ ### 2. Read Existing Patterns
76
+
77
+ Before writing code, open 1–2 existing files in the same layer to match:
78
+ - Filament v4 Resource structure (`Schema::components()` — not `Form::schema()`)
79
+ - Controller response patterns (view rendering, redirects)
80
+ - Livewire event dispatching and Alpine.js integration
81
+ - Model casts, relationships, scopes, and media conversions
82
+ - Action class invocation and `DB::transaction()` usage
83
+
84
+ ### 3. Implement Following Standards
85
+
86
+ - Match the established pattern — do not introduce new architectural layers without discussion.
87
+ - Use Filament v4 `Schema` API for admin features.
88
+ - Use `FormRequest` classes for all HTTP validation.
89
+ - Wrap multi-table operations in `DB::transaction()`.
90
+
91
+ ### 4. Test Critical Paths
92
+
93
+ - Write Pest v5 tests for business logic in Actions/Services.
94
+ - Write Feature tests for critical HTTP flows.
95
+ - Run: `php artisan test` or `./vendor/bin/pest`.
96
+
97
+ ## Failure Modes
98
+
99
+ - **v3 Filament API used instead of v4**: a resource is written with the deprecated `Form::schema()` API. **Mitigation:** the Core Rules require the v4 `Schema::components()` API; reject v3 code at PR.
100
+ - **Business logic in controller**: a controller contains business logic instead of dispatching to Action or Service. **Mitigation:** the Thin Controller rule forbids it; refactor to Action or Service.
101
+ - **Livewire used for static content**: a static listing is built as a Livewire component. **Mitigation:** the Livewire-islands-only rule forbids it; rebuild as pure Blade.
102
+ - **DB::transaction missing on multi-table writes**: a checkout writes to orders and order_items without a transaction. **Mitigation:** the Core Rules require `DB::transaction()`; reject un-wrapped multi-table writes.
103
+ - **Sync email dispatch**: a notification is sent synchronously inside the request. **Mitigation:** the Core Rules require queue dispatch; reject sync sends.
104
+ - **Validation inside controller or Livewire**: validation logic is duplicated inline instead of using FormRequest or `#[Validate]`. **Mitigation:** the FormRequest-always rule forbids inline validation; refactor.
105
+
106
+ ## Output Contracts
107
+
108
+ When this skill produces a structured handoff, emit:
109
+
110
+ - **`contracts/schemas/implementation-result.json`** — Required fields: `change_summary`, `files_touched[]`, and `validation_run` output proving Pest v5 tests pass.
111
+ - **`contracts/schemas/api-contract-spec.json`** when a new Filament v4 Resource or public Blade route introduces a typed surface.
112
+
113
+ Skip structured emission for trivial UI tweaks that do not cross a role boundary.
114
+ ## Security Guardrails (OWASP ASI)
115
+
116
+ - **ASI03 Identity & Privilege Abuse**: Filament v4 Resources and FormRequest validation must enforce role-based access; user data must not be exposed across role boundaries.
117
+ - **ASI04 Supply Chain**: every Laravel, Filament, Livewire, Pest, and Reverb dependency must be schema-validated against the expected manifest; treat unknown versions as untrusted.
118
+ - **ASI05 RCE Guard**: do not construct SQL queries, payment payloads, or Blade strings from external or user-supplied content without strict schema validation; reject string-concatenated SQL.
119
+ - **ASI07 Inter-Agent Communication**: the implementation result is consumed by Backend Developer, QA Engineer, and Frontend Developer roles; emit a structured contract so each role can validate.
120
+ - **ASI09 Human-Agent Trust Exploitation**: do not present a feature as "production-ready" without the actual smoke test evidence; surface the residual risk honestly.
121
+ ## Checklist
122
+
123
+ - [ ] feature placed in the correct architectural layer (Action/Service/Controller/Livewire/Filament)
124
+ - [ ] thin controller pattern followed — no business logic in controllers
125
+ - [ ] Livewire used only for interactive islands, Blade for static content
126
+ - [ ] Filament v4 `Schema::components()` API used (not deprecated `Form::schema()`)
127
+ - [ ] DB::transaction() wraps any multi-table write operations
128
+ - [ ] migrations include proper indexes on slug, foreign key, and status columns
129
+ - [ ] SoftDeletes used on models referenced by foreign keys
130
+ - [ ] FormRequest used for HTTP validation
131
+ - [ ] email and notifications dispatched via queue (never synchronous)
132
+ - [ ] Pest v5 tests written for critical business logic
133
+ - [ ] Laravel Pulse checked for slow queries and queue health after significant changes
134
+
135
+ ## Related Skills
136
+
137
+ - **review-code**: review changes against Laravel and project conventions
138
+ - **write-tests**: write Pest v5 tests for business logic
139
+ - **navigate-service**: understand the codebase structure before changes
140
+ - **troubleshoot-service**: debug runtime issues
141
+ - **commit-code**: commit with proper conventions
@@ -1,134 +1,134 @@
1
- # Deploy Laravel (Filament Stack)
2
-
3
- Role: `devops-engineer`
4
-
5
- Deployment workflow for Laravel 11 + Filament v3 projects. Use after MR is merged and all tests pass locally.
6
-
7
- ## Checklist
8
-
9
- - [ ] **Step 1** — Pre-flight checks
10
- - [ ] **Step 2** — Pull latest code on server
11
- - [ ] **Step 3** — Install / update dependencies
12
- - [ ] **Step 4** — Run database migrations
13
- - [ ] **Step 5** — Clear and rebuild caches
14
- - [ ] **Step 6** — Restart queue workers
15
- - [ ] **Step 7** — Verify deployment
16
-
17
- ---
18
-
19
- ## Step 1 — Pre-flight checks
20
-
21
- Role: `devops-engineer`
22
-
23
- Before deploying, confirm:
24
-
25
- 1. All tests pass: `php artisan test` (or `./vendor/bin/pest`).
26
- 2. Migration files reviewed — no destructive changes (DROP, TRUNCATE) without rollback plan.
27
- 3. `.env` on server has any new required variables from the release.
28
- 4. Queue jobs in-flight will tolerate a worker restart (idempotent jobs).
29
-
30
- **Stop if any check fails.** Do not deploy with failing tests or unreviewed destructive migrations.
31
-
32
- ---
33
-
34
- ## Step 2 — Pull latest code on server
35
-
36
- Role: `devops-engineer`
37
-
38
- ```bash
39
- cd /var/www/<project>
40
- git fetch origin
41
- git pull origin main
42
- ```
43
-
44
- Confirm the correct commit SHA is live: `git log --oneline -1`.
45
-
46
- ---
47
-
48
- ## Step 3 — Install / update dependencies
49
-
50
- Role: `devops-engineer`
51
-
52
- ```bash
53
- composer install --no-dev --optimize-autoloader
54
- npm ci && npm run build # only if assets changed
55
- ```
56
-
57
- Use `--no-dev` in production. Never run `composer update` in production without a tested `composer.lock`.
58
-
59
- ---
60
-
61
- ## Step 4 — Run database migrations
62
-
63
- Role: `devops-engineer`
64
-
65
- ```bash
66
- php artisan migrate --force
67
- ```
68
-
69
- `--force` bypasses the production confirmation prompt. Only run when migration has been reviewed.
70
-
71
- For large tables: use `--pretend` first to preview SQL, then run batched with a maintenance window if needed.
72
-
73
- ---
74
-
75
- ## Step 5 — Clear and rebuild caches
76
-
77
- Role: `devops-engineer`
78
-
79
- ```bash
80
- php artisan config:cache
81
- php artisan route:cache
82
- php artisan view:cache
83
- php artisan event:cache
84
- php artisan filament:cache-components # Filament v3 component cache
85
- ```
86
-
87
- Run `php artisan optimize` as a shortcut when the above defaults are sufficient.
88
-
89
- ---
90
-
91
- ## Step 6 — Restart queue workers
92
-
93
- Role: `devops-engineer`
94
-
95
- ```bash
96
- php artisan queue:restart
97
- ```
98
-
99
- This signals workers to gracefully finish their current job then exit. Supervisor restarts them automatically. Verify with:
100
-
101
- ```bash
102
- sudo supervisorctl status
103
- ```
104
-
105
- ---
106
-
107
- ## Step 7 — Verify deployment
108
-
109
- Role: `devops-engineer`
110
-
111
- 1. Open the application URL in a browser — confirm no 500 errors.
112
- 2. Log into Filament admin panel — confirm resources load.
113
- 3. Trigger a test job (if safe) to confirm queue workers are processing.
114
- 4. Check Laravel logs: `tail -50 storage/logs/laravel.log`.
115
- 5. Check Horizon dashboard (if enabled) for queue health.
116
-
117
- **Rollback:** `git revert <commit>` + re-run steps 3–7 if a critical issue is found post-deploy.
118
-
119
- ### Failure Modes
120
-
121
- - **Deploy with failing tests**: a release ships with red tests on the server. **Mitigation:** Step 1 (Pre-flight) requires passing tests; reject the deploy and surface the failure to the user.
122
- - **Destructive migration without rollback**: a DROP or TRUNCATE ships without a verified rollback path. **Mitigation:** Step 1 requires a rollback plan for destructive migrations; reject the deploy when the plan is missing.
123
- - **Missing env var on server**: a release introduces a new env var that is not set on production. **Mitigation:** Step 1 diffs `.env` against the new requirements; reject the deploy when a required env var is missing.
124
- - **Worker restart loses in-flight jobs**: a non-idempotent job is restarted mid-execution. **Mitigation:** Step 1 requires in-flight jobs to tolerate the worker restart; reject non-idempotent jobs in the deploy window.
125
- - **Cache stale after deploy**: a config or route cache is not rebuilt and serves old code. **Mitigation:** Step 5 clears and rebuilds every cache; reject the deploy when the cache step is skipped.
126
- - **Verify step skipped**: a release is declared successful without an HTTP smoke test. **Mitigation:** Step 7 requires a browser check, an admin check, and a queue check; reject the deploy when any verify step is missing.
127
-
128
- ### Output Contracts
129
-
130
- When this workflow produces a structured handoff, emit:
131
-
132
- - **`contracts/schemas/deployment-plan.json`** — capture infrastructure changes, config updates, and the `validation_run` output proving the verify step passed.
133
- - **`contracts/schemas/incident-report.json`** when the deploy triggers an anomaly; capture the trace id, the threshold, and the recommended action.
1
+ # Deploy Laravel (Filament Stack)
2
+
3
+ Role: `devops-engineer`
4
+
5
+ Deployment workflow for Laravel 11 + Filament v3 projects. Use after MR is merged and all tests pass locally.
6
+
7
+ ## Checklist
8
+
9
+ - [ ] **Step 1** — Pre-flight checks
10
+ - [ ] **Step 2** — Pull latest code on server
11
+ - [ ] **Step 3** — Install / update dependencies
12
+ - [ ] **Step 4** — Run database migrations
13
+ - [ ] **Step 5** — Clear and rebuild caches
14
+ - [ ] **Step 6** — Restart queue workers
15
+ - [ ] **Step 7** — Verify deployment
16
+
17
+ ---
18
+
19
+ ## Step 1 — Pre-flight checks
20
+
21
+ Role: `devops-engineer`
22
+
23
+ Before deploying, confirm:
24
+
25
+ 1. All tests pass: `php artisan test` (or `./vendor/bin/pest`).
26
+ 2. Migration files reviewed — no destructive changes (DROP, TRUNCATE) without rollback plan.
27
+ 3. `.env` on server has any new required variables from the release.
28
+ 4. Queue jobs in-flight will tolerate a worker restart (idempotent jobs).
29
+
30
+ **Stop if any check fails.** Do not deploy with failing tests or unreviewed destructive migrations.
31
+
32
+ ---
33
+
34
+ ## Step 2 — Pull latest code on server
35
+
36
+ Role: `devops-engineer`
37
+
38
+ ```bash
39
+ cd /var/www/<project>
40
+ git fetch origin
41
+ git pull origin main
42
+ ```
43
+
44
+ Confirm the correct commit SHA is live: `git log --oneline -1`.
45
+
46
+ ---
47
+
48
+ ## Step 3 — Install / update dependencies
49
+
50
+ Role: `devops-engineer`
51
+
52
+ ```bash
53
+ composer install --no-dev --optimize-autoloader
54
+ npm ci && npm run build # only if assets changed
55
+ ```
56
+
57
+ Use `--no-dev` in production. Never run `composer update` in production without a tested `composer.lock`.
58
+
59
+ ---
60
+
61
+ ## Step 4 — Run database migrations
62
+
63
+ Role: `devops-engineer`
64
+
65
+ ```bash
66
+ php artisan migrate --force
67
+ ```
68
+
69
+ `--force` bypasses the production confirmation prompt. Only run when migration has been reviewed.
70
+
71
+ For large tables: use `--pretend` first to preview SQL, then run batched with a maintenance window if needed.
72
+
73
+ ---
74
+
75
+ ## Step 5 — Clear and rebuild caches
76
+
77
+ Role: `devops-engineer`
78
+
79
+ ```bash
80
+ php artisan config:cache
81
+ php artisan route:cache
82
+ php artisan view:cache
83
+ php artisan event:cache
84
+ php artisan filament:cache-components # Filament v3 component cache
85
+ ```
86
+
87
+ Run `php artisan optimize` as a shortcut when the above defaults are sufficient.
88
+
89
+ ---
90
+
91
+ ## Step 6 — Restart queue workers
92
+
93
+ Role: `devops-engineer`
94
+
95
+ ```bash
96
+ php artisan queue:restart
97
+ ```
98
+
99
+ This signals workers to gracefully finish their current job then exit. Supervisor restarts them automatically. Verify with:
100
+
101
+ ```bash
102
+ sudo supervisorctl status
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Step 7 — Verify deployment
108
+
109
+ Role: `devops-engineer`
110
+
111
+ 1. Open the application URL in a browser — confirm no 500 errors.
112
+ 2. Log into Filament admin panel — confirm resources load.
113
+ 3. Trigger a test job (if safe) to confirm queue workers are processing.
114
+ 4. Check Laravel logs: `tail -50 storage/logs/laravel.log`.
115
+ 5. Check Horizon dashboard (if enabled) for queue health.
116
+
117
+ **Rollback:** `git revert <commit>` + re-run steps 3–7 if a critical issue is found post-deploy.
118
+
119
+ ### Failure Modes
120
+
121
+ - **Deploy with failing tests**: a release ships with red tests on the server. **Mitigation:** Step 1 (Pre-flight) requires passing tests; reject the deploy and surface the failure to the user.
122
+ - **Destructive migration without rollback**: a DROP or TRUNCATE ships without a verified rollback path. **Mitigation:** Step 1 requires a rollback plan for destructive migrations; reject the deploy when the plan is missing.
123
+ - **Missing env var on server**: a release introduces a new env var that is not set on production. **Mitigation:** Step 1 diffs `.env` against the new requirements; reject the deploy when a required env var is missing.
124
+ - **Worker restart loses in-flight jobs**: a non-idempotent job is restarted mid-execution. **Mitigation:** Step 1 requires in-flight jobs to tolerate the worker restart; reject non-idempotent jobs in the deploy window.
125
+ - **Cache stale after deploy**: a config or route cache is not rebuilt and serves old code. **Mitigation:** Step 5 clears and rebuilds every cache; reject the deploy when the cache step is skipped.
126
+ - **Verify step skipped**: a release is declared successful without an HTTP smoke test. **Mitigation:** Step 7 requires a browser check, an admin check, and a queue check; reject the deploy when any verify step is missing.
127
+
128
+ ### Output Contracts
129
+
130
+ When this workflow produces a structured handoff, emit:
131
+
132
+ - **`contracts/schemas/deployment-plan.json`** — capture infrastructure changes, config updates, and the `validation_run` output proving the verify step passed.
133
+ - **`contracts/schemas/incident-report.json`** when the deploy triggers an anomaly; capture the trace id, the threshold, and the recommended action.
134
134
  - For the Rollback branch, also emit `contracts/schemas/coordination-plan.json` when more than one service is affected by the revert.