@vesviet/agent-skills 5.6.0 → 5.6.1

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 (113) hide show
  1. package/INDEX.md +1 -1
  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 +1 -1
  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/schemas/api-contract-spec.json +191 -191
  10. package/core/contracts/schemas/feature-ticket.json +1293 -1293
  11. package/core/contracts/schemas/pull-request-spec.json +338 -338
  12. package/core/contracts/schemas/references/detailed/01-solution-and-governance.md +19 -19
  13. package/core/contracts/schemas/references/detailed/02-engineering-delivery.md +93 -93
  14. package/core/contracts/schemas/references/detailed/04-finance-accounting-and-compliance.md +54 -54
  15. package/core/contracts/schemas/references/detailed/05-design-and-content.md +92 -92
  16. package/core/contracts/schemas/references/detailed/06-seo-and-publishing.md +48 -48
  17. package/core/contracts/schemas/references/detailed/07-a2a-protocol.md +85 -85
  18. package/core/contracts/schemas/test-report.json +530 -530
  19. package/core/roles/references/business-analyst-responsibilities.md +207 -207
  20. package/core/roles/references/frontend-developer-responsibilities.md +275 -275
  21. package/core/roles/system-engineer.md +465 -465
  22. package/core/skills/agent/agent-memory-compaction/references/anchored-schema-and-compaction-algorithms.md +141 -141
  23. package/core/skills/backend/build-mcp-server/SKILL.md +100 -100
  24. package/core/skills/backend/implement-structured-outputs/SKILL.md +94 -94
  25. package/core/skills/business/elicit-requirements/SKILL.md +102 -102
  26. package/core/skills/business/elicit-requirements/references/elicitation-techniques-and-babok-criteria.md +60 -60
  27. package/core/skills/business/trace-requirements-impact/SKILL.md +97 -97
  28. package/core/skills/business/trace-requirements-impact/references/rtm-graph-and-prioritization-models.md +109 -109
  29. package/core/skills/business/write-use-cases/SKILL.md +106 -106
  30. package/core/skills/business/write-use-cases/references/cockburn-scoping-and-13-field-template.md +135 -135
  31. package/core/skills/document/pptx/scripts/add_slide.py +0 -0
  32. package/core/skills/document/pptx/scripts/clean.py +0 -0
  33. package/core/skills/document/pptx/scripts/thumbnail.py +0 -0
  34. package/core/skills/document/xlsx/scripts/recalc.py +0 -0
  35. package/core/skills/documentation/write-documentation/SKILL.md +143 -143
  36. package/core/skills/documentation/write-tech-radar/SKILL.md +149 -149
  37. package/core/skills/foundation/accessibility-review/SKILL.md +160 -160
  38. package/core/skills/foundation/release-notes/SKILL.md +192 -192
  39. package/core/skills/foundation/webapp-server-runner/scripts/with_server.py +0 -0
  40. package/core/skills/foundation/write-product-brief/SKILL.md +160 -160
  41. package/core/skills/platform/cloudflare-email-service/SKILL.md +166 -166
  42. package/core/skills/platform/cloudflare-email-service/references/routing.md +199 -199
  43. package/core/skills/platform/debug-workers-edge/SKILL.md +111 -111
  44. package/core/skills/platform/sandbox-sdk/SKILL.md +183 -183
  45. package/core/skills/platform/setup-gpu-finops/SKILL.md +107 -107
  46. package/core/skills/platform/setup-llm-gateway/SKILL.md +108 -108
  47. package/core/skills/platform/turnstile-spin/SKILL.md +118 -118
  48. package/core/skills/platform/turnstile-spin/scripts/auth-probe.sh +0 -0
  49. package/core/skills/platform/turnstile-spin/scripts/fetch-secret.sh +0 -0
  50. package/core/skills/platform/turnstile-spin/scripts/persist-skill.sh +0 -0
  51. package/core/skills/platform/turnstile-spin/scripts/validate.sh +0 -0
  52. package/core/skills/platform/turnstile-spin/scripts/widget-create.sh +0 -0
  53. package/core/skills/platform/turnstile-spin/scripts/worker-deploy.sh +0 -0
  54. package/core/skills/platform/turnstile-spin/templates/worker/src/index.ts +199 -199
  55. package/core/skills/platform/turnstile-spin/templates/worker/wrangler.toml +31 -31
  56. package/core/skills/platform/web-perf/SKILL.md +151 -151
  57. package/core/skills/platform/workers-best-practices/references/rules.md +463 -463
  58. package/core/skills/product/build-story-map/SKILL.md +104 -104
  59. package/core/skills/product/build-story-map/references/story-mapping-and-cpm-scheduling.md +101 -101
  60. package/core/skills/product/define-product-strategy/SKILL.md +105 -105
  61. package/core/skills/product/define-product-strategy/references/strategy-frameworks-and-pr-faq.md +142 -142
  62. package/core/skills/product/model-saas-metrics/SKILL.md +104 -104
  63. package/core/skills/product/model-saas-metrics/references/saas-unit-economics-and-pricing.md +110 -110
  64. package/core/skills/product/prioritize-roadmap/SKILL.md +106 -106
  65. package/core/skills/product/prioritize-roadmap/references/prioritization-scoring-and-kill-criteria.md +105 -105
  66. package/core/skills/repo-ops/commit-code/SKILL.md +190 -190
  67. package/core/skills/repo-ops/commit-code/references/multi-repo-and-deployment.md +21 -21
  68. package/core/skills/repo-ops/navigate-service/SKILL.md +199 -199
  69. package/core/skills/repo-ops/review-code/references/process-and-format.md +100 -100
  70. package/core/skills/repo-ops/review-service/SKILL.md +186 -186
  71. package/core/skills/repo-ops/troubleshoot-service/SKILL.md +127 -127
  72. package/core/skills/repo-ops/troubleshoot-service/references/failure-modes-and-security.md +22 -22
  73. package/core/skills/repo-ops/troubleshoot-service/references/suggested-process.md +110 -110
  74. package/core/skills/security-data/security-audit/SKILL.md +119 -119
  75. package/core/workflows/add-new-feature.md +212 -212
  76. package/core/workflows/agent-a2a-delegation.md +142 -142
  77. package/core/workflows/bug-fix.md +147 -147
  78. package/core/workflows/build-deploy.md +208 -208
  79. package/core/workflows/code-review.md +137 -137
  80. package/core/workflows/dependency-upgrade.md +193 -193
  81. package/core/workflows/feature-delivery.md +149 -149
  82. package/core/workflows/hotfix-production.md +172 -172
  83. package/core/workflows/qa-validation.md +231 -231
  84. package/core/workflows/refactoring.md +154 -154
  85. package/core/workflows/revert-deployment.md +147 -147
  86. package/core/workflows/security-incident-response.md +191 -191
  87. package/core/workflows/seo-content-lifecycle.md +91 -91
  88. package/core/workflows/service-review-release.md +223 -223
  89. package/core/workflows/setup-new-service.md +214 -214
  90. package/core/workflows/tech-repo-review.md +245 -245
  91. package/core/workflows/troubleshooting.md +241 -241
  92. package/overlays/astro-cloudflare/README.md +93 -93
  93. package/overlays/data-analyst-stack/README.md +109 -109
  94. package/overlays/data-analyst-stack/rules/metric-dashboard-templates.md +135 -135
  95. package/overlays/data-analyst-stack/rules/stack-conventions.md +80 -80
  96. package/overlays/ecommerce-microservices/README.md +65 -65
  97. package/overlays/go-microservices/README.md +78 -78
  98. package/overlays/go-microservices/rules/go-conventions.md +223 -223
  99. package/overlays/laravel-filament/README.md +90 -90
  100. package/overlays/laravel-filament/rules/laravel-conventions.md +220 -220
  101. package/overlays/laravel-filament/skills/develop-laravel-feature/SKILL.md +141 -141
  102. package/overlays/laravel-filament/workflows/deploy-laravel.md +133 -133
  103. package/overlays/obj-configurator/rules/obj-project-rules.md +111 -111
  104. package/overlays/obj-configurator/skills/develop-obj-feature/SKILL.md +71 -71
  105. package/overlays/r3f-stack/README.md +89 -89
  106. package/overlays/r3f-stack/rules/stub.md +43 -43
  107. package/overlays/r3f-stack/skills/debug-3d-scene/SKILL.md +166 -166
  108. package/overlays/r3f-stack/skills/integrate-r3f-three-legacy/SKILL.md +159 -159
  109. package/overlays/r3f-stack/skills/optimize-3d-assets/SKILL.md +128 -128
  110. package/overlays/seo-publishing/rules/site-mix-and-cannibalization.md +52 -52
  111. package/overlays/ui-design-system/rules/handoff-conventions.md +73 -73
  112. package/package.json +2 -2
  113. package/core/README.md +0 -53
@@ -1,223 +1,223 @@
1
- # Go Microservices Conventions
2
-
3
- Standards for the `go-microservices` overlay. All roles working in this overlay MUST follow these rules.
4
-
5
- ## Project Structure And Architecture
6
-
7
- - Follow Clean Architecture / Hexagonal Architecture (Ports and Adapters).
8
- - Keep business logic isolated from transport concerns (HTTP, gRPC, ConnectRPC).
9
- - Use constructor-based dependency injection for testability and decoupling.
10
- - Kratos layout: `api` (contracts), `internal/service` (adapter), `internal/biz` (business logic), `internal/data` (persistence).
11
-
12
- ## Go 1.25 Features To Adopt
13
-
14
- ```go
15
- // Container-aware GOMAXPROCS (Go 1.25) — no more uber-go/automaxprocs workaround
16
- // Built-in: Go 1.25 automatically respects K8s CPU limits
17
-
18
- // testing/synctest — eliminates flaky time-based concurrency tests
19
- func TestTimeout(t *testing.T) {
20
- synctest.Run(func() {
21
- // ... time.Sleep and time.After are simulated
22
- })
23
- }
24
-
25
- // encoding/json/v2 (experimental in Go 1.25 — test it; faster + stricter)
26
- import "encoding/json/v2"
27
- ```
28
-
29
- ## Dependency Injection (2026 Standard)
30
-
31
- ⚠️ `google/wire` original repo is **ARCHIVED and unmaintained**.
32
-
33
- ```go
34
- // ✅ PREFERRED: Manual constructor injection (most idiomatic, 95% of apps)
35
- func NewUserService(repo UserRepository, logger *slog.Logger) *UserService {
36
- return &UserService{repo: repo, logger: logger}
37
- }
38
-
39
- // ✅ Large codebases (30+ wiring lines): community-maintained fork
40
- // go get github.com/goforj/wire
41
- // Compile-time, zero reflection overhead
42
-
43
- // ✅ Enterprise-scale lifecycle management (accept reflection tradeoff)
44
- // go get go.uber.org/fx
45
- ```
46
-
47
- ## Kratos v3 (2026 Standard)
48
-
49
- ```go
50
- // ✅ v3 import path (current)
51
- import "github.com/go-kratos/kratos/v3"
52
- // ❌ v2 is maintenance-only
53
- ```
54
-
55
- v3 breaking changes:
56
- - Logging: use standard `log/slog`, not kratos `log.Helper`
57
- - JSON codec split: import `encoding/json` AND `encoding/protojson` separately
58
- - `binding.EncodeURL` → `http.BuildPath`
59
- - HTTP context: use `Bind`, `BindVars`, `BindQuery`, `BindForm` methods
60
-
61
- ## Database Layer (2026)
62
-
63
- | Tool | Use Case |
64
- |------|----------|
65
- | `sqlc` + `pgx/v5` | ✅ **Preferred for new services** — type-safe, compile-time verified, no reflection |
66
- | `golang-migrate` or `Atlas` | Schema migrations |
67
- | GORM v2 | CRUD MVPs, rapid prototyping (reflection overhead matters at scale) |
68
- | `pgx/v5` raw | LISTEN/NOTIFY, COPY protocol, advanced JSONB ops |
69
-
70
- ```go
71
- // sqlc generated code example (compile-time type-safe)
72
- type Queries struct { db *pgxpool.Pool }
73
- func (q *Queries) GetUser(ctx context.Context, id int64) (User, error) { ... }
74
- ```
75
-
76
- ## Communication (2026)
77
-
78
- | Option | When |
79
- |--------|------|
80
- | **ConnectRPC** | ✅ New services — works with HTTP/1.1, browser `fetch`, no proxy needed |
81
- | **gRPC-Go** | Existing high-perf internal service-to-service |
82
- | **grpc-gateway v2** | Expose gRPC as REST for external consumers |
83
-
84
- ```go
85
- // ConnectRPC server setup (new projects)
86
- import "connectrpc.com/connect"
87
- mux := http.NewServeMux()
88
- mux.Handle(userv1connect.NewUserServiceHandler(userSvc))
89
- ```
90
-
91
- ## Dapr 1.15 Patterns
92
-
93
- ```go
94
- // Jobs API — replace cron bindings for scheduled tasks
95
- daprClient.ScheduleJobAlpha1(ctx, &runtime.Job{
96
- Name: "daily-report",
97
- Schedule: "@daily",
98
- })
99
-
100
- // Dapr Workflow — STABLE (fan-out/fan-in, task chaining)
101
- daprClient.NewWorkflowRuntime().RegisterWorkflow(MyWorkflow)
102
-
103
- // Binary state — avoids JSON serialization for non-textual data
104
- daprClient.SaveState(ctx, storeName, key, binaryData, &dapr.StateOptions{})
105
- ```
106
-
107
- ## Concurrency
108
-
109
- - Prefer channels for communication. Avoid shared state.
110
- - Use `sync` package only when channels are not appropriate.
111
- - `errgroup.WithContext()` for managed goroutine pools.
112
- - No unmanaged goroutines in request-scoped handlers.
113
-
114
- ## Error Handling
115
-
116
- - Check errors explicitly — never discard.
117
- - Wrap with context: `fmt.Errorf("userService.GetByID(%d): %w", id, err)`.
118
- - Map biz errors → gRPC/HTTP status codes in service layer only.
119
- - Never expose raw database errors to API consumers.
120
-
121
- ## Logging (Standard `log/slog`)
122
-
123
- ```go
124
- // ✅ Structured JSON logging (Go 1.21+ standard library)
125
- logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
126
- Level: slog.LevelInfo,
127
- }))
128
- logger.InfoContext(ctx, "user created",
129
- slog.Int64("user_id", user.ID),
130
- slog.String("trace_id", traceID),
131
- )
132
-
133
- // ❌ Never use unstructured fmt.Print or log.Print in production paths
134
- ```
135
-
136
- ## Observability (OTel 2026)
137
-
138
- ```go
139
- // ✅ Compile-time instrumentation (zero-code, stable Jul 2026)
140
- // Build flag: go build -toolexec otel-go-build-tool ./...
141
- // Automatically instruments code + deps + stdlib
142
-
143
- // ✅ Manual spans for business-critical paths
144
- ctx, span := tracer.Start(ctx, "userService.CreateUser",
145
- trace.WithAttributes(
146
- attribute.Int64("user_id", userID),
147
- ),
148
- )
149
- defer span.End()
150
-
151
- // Always implement graceful shutdown
152
- defer tp.Shutdown(context.Background())
153
- defer mp.Shutdown(context.Background())
154
- ```
155
-
156
- - Export via OTLP only (vendor-agnostic).
157
- - Watch metric cardinality — SDK has protections against unbounded memory growth.
158
-
159
- ## Testing
160
-
161
- ```go
162
- // Table-driven tests (standard)
163
- func TestUserService_Create(t *testing.T) {
164
- tests := []struct {
165
- name string
166
- input CreateInput
167
- wantErr bool
168
- }{
169
- {"valid user", CreateInput{Name: "Alice"}, false},
170
- {"empty name", CreateInput{Name: ""}, true},
171
- }
172
- for _, tt := range tests {
173
- t.Run(tt.name, func(t *testing.T) { ... })
174
- }
175
- }
176
-
177
- // Time-based concurrency tests (Go 1.25 testing/synctest)
178
- func TestRateLimit_Resets(t *testing.T) {
179
- synctest.Run(func() { ... })
180
- }
181
- ```
182
-
183
- - Mock external dependencies at the interface boundary.
184
- - Target critical business logic paths (state transitions, calculations, payments).
185
-
186
- ## APIs
187
-
188
- - ConnectRPC for new internal services — HTTP/1.1 compatible, browser-native.
189
- - gRPC for existing high-performance internal communication.
190
- - REST/GraphQL for external-facing clients and gateways (grpc-gateway v2).
191
-
192
- ## Standard 2026 Alignment
193
-
194
- This overlay rule file is part of the agent-skills engineering pack. The 2026
195
- upgrade pass added the following Standard 2026 alignment footer to every
196
- overlay rule file in the pack.
197
-
198
- - **OWASP ASI**: applied as described in the core pack — see
199
- `core/roles/role-standard.md` (ASI01-ASI10) and the per-skill
200
- `## Security Guardrails (OWASP ASI)` section in each skill. The rules in this
201
- file are applied by the role that owns the affected action; the runtime
202
- gate is `core/scripts/hooks/check-policy.py` with
203
- `core/policies/action-boundaries.yaml`.
204
- - **Failure Modes** (overlay-specific): the rules in this file can be violated
205
- by drift, missing context, or untracked exceptions. The owning role is
206
- expected to surface concrete failure scenarios in the workflow's
207
- `### Failure Modes` section and to capture remediations via
208
- `contracts/schemas/incident-report.json` when the rule is bypassed.
209
- - **Output Contracts**: when a rule in this file produces a structured
210
- artifact (brief, plan, config, content handoff, audit event), the artifact
211
- must conform to the corresponding schema in `core/contracts/schemas/`.
212
- See `See `core/skills/backend/add-api-endpoint/SKILL.md` and the `api-contract-spec.json` schema.` for the related skill output contract reference.
213
- - **Skill Toolbox Lock**: a rule in this file is enforced by the role whose
214
- Skill Toolbox lists the related skill as Primary. Roles that hold the
215
- skill as Supporting must delegate rather than execute directly (per
216
- `core/workflows/README.md`).
217
- - **Commit / publish gate**: rule changes that affect user-visible behavior
218
- must follow the META-RULE in `core/rules/code.md` — no commit, no push,
219
- no publish without explicit user confirmation.
220
-
221
- See `core/skills/backend/add-api-endpoint/SKILL.md` and the `api-contract-spec.json` schema.
222
-
223
- Last updated: 2026-09-01
1
+ # Go Microservices Conventions
2
+
3
+ Standards for the `go-microservices` overlay. All roles working in this overlay MUST follow these rules.
4
+
5
+ ## Project Structure And Architecture
6
+
7
+ - Follow Clean Architecture / Hexagonal Architecture (Ports and Adapters).
8
+ - Keep business logic isolated from transport concerns (HTTP, gRPC, ConnectRPC).
9
+ - Use constructor-based dependency injection for testability and decoupling.
10
+ - Kratos layout: `api` (contracts), `internal/service` (adapter), `internal/biz` (business logic), `internal/data` (persistence).
11
+
12
+ ## Go 1.25 Features To Adopt
13
+
14
+ ```go
15
+ // Container-aware GOMAXPROCS (Go 1.25) — no more uber-go/automaxprocs workaround
16
+ // Built-in: Go 1.25 automatically respects K8s CPU limits
17
+
18
+ // testing/synctest — eliminates flaky time-based concurrency tests
19
+ func TestTimeout(t *testing.T) {
20
+ synctest.Run(func() {
21
+ // ... time.Sleep and time.After are simulated
22
+ })
23
+ }
24
+
25
+ // encoding/json/v2 (experimental in Go 1.25 — test it; faster + stricter)
26
+ import "encoding/json/v2"
27
+ ```
28
+
29
+ ## Dependency Injection (2026 Standard)
30
+
31
+ ⚠️ `google/wire` original repo is **ARCHIVED and unmaintained**.
32
+
33
+ ```go
34
+ // ✅ PREFERRED: Manual constructor injection (most idiomatic, 95% of apps)
35
+ func NewUserService(repo UserRepository, logger *slog.Logger) *UserService {
36
+ return &UserService{repo: repo, logger: logger}
37
+ }
38
+
39
+ // ✅ Large codebases (30+ wiring lines): community-maintained fork
40
+ // go get github.com/goforj/wire
41
+ // Compile-time, zero reflection overhead
42
+
43
+ // ✅ Enterprise-scale lifecycle management (accept reflection tradeoff)
44
+ // go get go.uber.org/fx
45
+ ```
46
+
47
+ ## Kratos v3 (2026 Standard)
48
+
49
+ ```go
50
+ // ✅ v3 import path (current)
51
+ import "github.com/go-kratos/kratos/v3"
52
+ // ❌ v2 is maintenance-only
53
+ ```
54
+
55
+ v3 breaking changes:
56
+ - Logging: use standard `log/slog`, not kratos `log.Helper`
57
+ - JSON codec split: import `encoding/json` AND `encoding/protojson` separately
58
+ - `binding.EncodeURL` → `http.BuildPath`
59
+ - HTTP context: use `Bind`, `BindVars`, `BindQuery`, `BindForm` methods
60
+
61
+ ## Database Layer (2026)
62
+
63
+ | Tool | Use Case |
64
+ |------|----------|
65
+ | `sqlc` + `pgx/v5` | ✅ **Preferred for new services** — type-safe, compile-time verified, no reflection |
66
+ | `golang-migrate` or `Atlas` | Schema migrations |
67
+ | GORM v2 | CRUD MVPs, rapid prototyping (reflection overhead matters at scale) |
68
+ | `pgx/v5` raw | LISTEN/NOTIFY, COPY protocol, advanced JSONB ops |
69
+
70
+ ```go
71
+ // sqlc generated code example (compile-time type-safe)
72
+ type Queries struct { db *pgxpool.Pool }
73
+ func (q *Queries) GetUser(ctx context.Context, id int64) (User, error) { ... }
74
+ ```
75
+
76
+ ## Communication (2026)
77
+
78
+ | Option | When |
79
+ |--------|------|
80
+ | **ConnectRPC** | ✅ New services — works with HTTP/1.1, browser `fetch`, no proxy needed |
81
+ | **gRPC-Go** | Existing high-perf internal service-to-service |
82
+ | **grpc-gateway v2** | Expose gRPC as REST for external consumers |
83
+
84
+ ```go
85
+ // ConnectRPC server setup (new projects)
86
+ import "connectrpc.com/connect"
87
+ mux := http.NewServeMux()
88
+ mux.Handle(userv1connect.NewUserServiceHandler(userSvc))
89
+ ```
90
+
91
+ ## Dapr 1.15 Patterns
92
+
93
+ ```go
94
+ // Jobs API — replace cron bindings for scheduled tasks
95
+ daprClient.ScheduleJobAlpha1(ctx, &runtime.Job{
96
+ Name: "daily-report",
97
+ Schedule: "@daily",
98
+ })
99
+
100
+ // Dapr Workflow — STABLE (fan-out/fan-in, task chaining)
101
+ daprClient.NewWorkflowRuntime().RegisterWorkflow(MyWorkflow)
102
+
103
+ // Binary state — avoids JSON serialization for non-textual data
104
+ daprClient.SaveState(ctx, storeName, key, binaryData, &dapr.StateOptions{})
105
+ ```
106
+
107
+ ## Concurrency
108
+
109
+ - Prefer channels for communication. Avoid shared state.
110
+ - Use `sync` package only when channels are not appropriate.
111
+ - `errgroup.WithContext()` for managed goroutine pools.
112
+ - No unmanaged goroutines in request-scoped handlers.
113
+
114
+ ## Error Handling
115
+
116
+ - Check errors explicitly — never discard.
117
+ - Wrap with context: `fmt.Errorf("userService.GetByID(%d): %w", id, err)`.
118
+ - Map biz errors → gRPC/HTTP status codes in service layer only.
119
+ - Never expose raw database errors to API consumers.
120
+
121
+ ## Logging (Standard `log/slog`)
122
+
123
+ ```go
124
+ // ✅ Structured JSON logging (Go 1.21+ standard library)
125
+ logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
126
+ Level: slog.LevelInfo,
127
+ }))
128
+ logger.InfoContext(ctx, "user created",
129
+ slog.Int64("user_id", user.ID),
130
+ slog.String("trace_id", traceID),
131
+ )
132
+
133
+ // ❌ Never use unstructured fmt.Print or log.Print in production paths
134
+ ```
135
+
136
+ ## Observability (OTel 2026)
137
+
138
+ ```go
139
+ // ✅ Compile-time instrumentation (zero-code, stable Jul 2026)
140
+ // Build flag: go build -toolexec otel-go-build-tool ./...
141
+ // Automatically instruments code + deps + stdlib
142
+
143
+ // ✅ Manual spans for business-critical paths
144
+ ctx, span := tracer.Start(ctx, "userService.CreateUser",
145
+ trace.WithAttributes(
146
+ attribute.Int64("user_id", userID),
147
+ ),
148
+ )
149
+ defer span.End()
150
+
151
+ // Always implement graceful shutdown
152
+ defer tp.Shutdown(context.Background())
153
+ defer mp.Shutdown(context.Background())
154
+ ```
155
+
156
+ - Export via OTLP only (vendor-agnostic).
157
+ - Watch metric cardinality — SDK has protections against unbounded memory growth.
158
+
159
+ ## Testing
160
+
161
+ ```go
162
+ // Table-driven tests (standard)
163
+ func TestUserService_Create(t *testing.T) {
164
+ tests := []struct {
165
+ name string
166
+ input CreateInput
167
+ wantErr bool
168
+ }{
169
+ {"valid user", CreateInput{Name: "Alice"}, false},
170
+ {"empty name", CreateInput{Name: ""}, true},
171
+ }
172
+ for _, tt := range tests {
173
+ t.Run(tt.name, func(t *testing.T) { ... })
174
+ }
175
+ }
176
+
177
+ // Time-based concurrency tests (Go 1.25 testing/synctest)
178
+ func TestRateLimit_Resets(t *testing.T) {
179
+ synctest.Run(func() { ... })
180
+ }
181
+ ```
182
+
183
+ - Mock external dependencies at the interface boundary.
184
+ - Target critical business logic paths (state transitions, calculations, payments).
185
+
186
+ ## APIs
187
+
188
+ - ConnectRPC for new internal services — HTTP/1.1 compatible, browser-native.
189
+ - gRPC for existing high-performance internal communication.
190
+ - REST/GraphQL for external-facing clients and gateways (grpc-gateway v2).
191
+
192
+ ## Standard 2026 Alignment
193
+
194
+ This overlay rule file is part of the agent-skills engineering pack. The 2026
195
+ upgrade pass added the following Standard 2026 alignment footer to every
196
+ overlay rule file in the pack.
197
+
198
+ - **OWASP ASI**: applied as described in the core pack — see
199
+ `core/roles/role-standard.md` (ASI01-ASI10) and the per-skill
200
+ `## Security Guardrails (OWASP ASI)` section in each skill. The rules in this
201
+ file are applied by the role that owns the affected action; the runtime
202
+ gate is `core/scripts/hooks/check-policy.py` with
203
+ `core/policies/action-boundaries.yaml`.
204
+ - **Failure Modes** (overlay-specific): the rules in this file can be violated
205
+ by drift, missing context, or untracked exceptions. The owning role is
206
+ expected to surface concrete failure scenarios in the workflow's
207
+ `### Failure Modes` section and to capture remediations via
208
+ `contracts/schemas/incident-report.json` when the rule is bypassed.
209
+ - **Output Contracts**: when a rule in this file produces a structured
210
+ artifact (brief, plan, config, content handoff, audit event), the artifact
211
+ must conform to the corresponding schema in `core/contracts/schemas/`.
212
+ See `See `core/skills/backend/add-api-endpoint/SKILL.md` and the `api-contract-spec.json` schema.` for the related skill output contract reference.
213
+ - **Skill Toolbox Lock**: a rule in this file is enforced by the role whose
214
+ Skill Toolbox lists the related skill as Primary. Roles that hold the
215
+ skill as Supporting must delegate rather than execute directly (per
216
+ `core/workflows/README.md`).
217
+ - **Commit / publish gate**: rule changes that affect user-visible behavior
218
+ must follow the META-RULE in `core/rules/code.md` — no commit, no push,
219
+ no publish without explicit user confirmation.
220
+
221
+ See `core/skills/backend/add-api-endpoint/SKILL.md` and the `api-contract-spec.json` schema.
222
+
223
+ Last updated: 2026-09-01
@@ -1,90 +1,90 @@
1
- # Laravel Filament Overlay
2
-
3
- Generic, reusable conventions for any Laravel 13+ project using Filament v4 admin, Livewire 3 interactive islands, and Blade static rendering. Stack-specific, project-agnostic.
4
-
5
- ## Tech Stack (2026)
6
-
7
- - **Framework:** Laravel **13** (released Mar 17, 2026; PHP 8.3+ required)
8
- - ⚠️ Laravel 12 bug fix support **ended Aug 13, 2026** — migrate now
9
- - **Admin:** Filament PHP **v4** (released Aug 12, 2025 — unified `Schema` API, breaking changes)
10
- - **Frontend:** Blade + Livewire **3** + Alpine.js + TailwindCSS **v4**
11
- - **Database:** PostgreSQL / MySQL
12
- - **Media:** Spatie Media Library (optional)
13
- - **Testing:** Pest PHP **v5** (v5 = current; adds AI-based Evals testing)
14
- - **PHP:** 8.3+ (8.4 recommended — Property Hooks, Asymmetric Visibility)
15
- - **WebSockets:** Laravel Reverb (self-hosted, replaces Pusher/Soketi)
16
- - **Monitoring:** Laravel Pulse (zero-config, ships with Laravel 13)
17
-
18
- ## ⚠️ 2026 Critical Changes
19
-
20
- ### Filament v4 — Breaking Schema API
21
- ```php
22
- // ❌ Filament v3
23
- public function form(Form $form): Form
24
- {
25
- return $form->schema([...]);
26
- }
27
-
28
- // ✅ Filament v4 — unified Schema API
29
- public function form(Schema $schema): Schema
30
- {
31
- return $schema->components([...]); // .schema() renamed to .components()
32
- }
33
- ```
34
-
35
- New in v4: TipTap rich editor, slider, code editor, table repeater, MFA built-in,
36
- custom data sources (not Eloquent-only), deep nested resources, 2–3× faster table rendering.
37
-
38
- ### Laravel 13 New Features
39
- - **Laravel AI SDK** (stable) — `use Illuminate\Support\Facades\AI;`
40
- - **PHP Attributes** for framework components: `#[Table]`, `#[Fillable]`
41
- - **JSON:API Resources** built-in
42
- - `PreventRequestForgery` middleware (CSRF via `Sec-Fetch-Site` header)
43
-
44
- ### PHP 8.4 Features (Use in New Code)
45
- ```php
46
- // Property Hooks
47
- class Product {
48
- public string $slug {
49
- get => Str::slug($this->name);
50
- set => $this->name = $value;
51
- }
52
- }
53
-
54
- // Asymmetric Visibility
55
- class Order {
56
- public private(set) string $status = 'pending';
57
- }
58
-
59
- // New array functions
60
- $found = array_find($items, fn($i) => $i->id === $id);
61
- ```
62
-
63
- ## Included
64
-
65
- - `rules/laravel-conventions.md` — Architecture, DB integrity, Filament v4, Livewire 3, testing standards
66
- - `skills/develop-laravel-feature/` — Generic skill for building features in this stack
67
-
68
- Compose with global core and optionally with a project-specific overlay.
69
-
70
- ## Standard 2026 Alignment
71
-
72
- This file is part of the agent-skills engineering pack. The 2026 upgrade
73
- pass added this footer so every prose file in the pack carries a
74
- consistent Standard 2026 pointer.
75
-
76
- - **OWASP ASI**: applied as described in `core/roles/role-standard.md`
77
- (ASI01-ASI10) and the per-skill `## Security Guardrails (OWASP ASI)` sections.
78
- - **Failure Modes**: the rule in this file can be violated by drift, missing
79
- context, or untracked exceptions. Concrete failure scenarios belong in the
80
- related skill or workflow's `### Failure Modes` section.
81
- - **Output Contracts**: structured artifacts produced under this file must
82
- conform to schemas in `core/contracts/schemas/`.
83
- - **Skill Toolbox Lock**: this file's rules are enforced by the role that
84
- owns the affected action; the runtime gate is
85
- `core/scripts/hooks/check-policy.py`.
86
- - **Commit / publish gate**: changes that affect user-visible behavior
87
- follow the META-RULE in `core/rules/code.md` — no commit, no push, no
88
- publish without explicit user confirmation.
89
-
90
- Last updated: 2026-09-01
1
+ # Laravel Filament Overlay
2
+
3
+ Generic, reusable conventions for any Laravel 13+ project using Filament v4 admin, Livewire 3 interactive islands, and Blade static rendering. Stack-specific, project-agnostic.
4
+
5
+ ## Tech Stack (2026)
6
+
7
+ - **Framework:** Laravel **13** (released Mar 17, 2026; PHP 8.3+ required)
8
+ - ⚠️ Laravel 12 bug fix support **ended Aug 13, 2026** — migrate now
9
+ - **Admin:** Filament PHP **v4** (released Aug 12, 2025 — unified `Schema` API, breaking changes)
10
+ - **Frontend:** Blade + Livewire **3** + Alpine.js + TailwindCSS **v4**
11
+ - **Database:** PostgreSQL / MySQL
12
+ - **Media:** Spatie Media Library (optional)
13
+ - **Testing:** Pest PHP **v5** (v5 = current; adds AI-based Evals testing)
14
+ - **PHP:** 8.3+ (8.4 recommended — Property Hooks, Asymmetric Visibility)
15
+ - **WebSockets:** Laravel Reverb (self-hosted, replaces Pusher/Soketi)
16
+ - **Monitoring:** Laravel Pulse (zero-config, ships with Laravel 13)
17
+
18
+ ## ⚠️ 2026 Critical Changes
19
+
20
+ ### Filament v4 — Breaking Schema API
21
+ ```php
22
+ // ❌ Filament v3
23
+ public function form(Form $form): Form
24
+ {
25
+ return $form->schema([...]);
26
+ }
27
+
28
+ // ✅ Filament v4 — unified Schema API
29
+ public function form(Schema $schema): Schema
30
+ {
31
+ return $schema->components([...]); // .schema() renamed to .components()
32
+ }
33
+ ```
34
+
35
+ New in v4: TipTap rich editor, slider, code editor, table repeater, MFA built-in,
36
+ custom data sources (not Eloquent-only), deep nested resources, 2–3× faster table rendering.
37
+
38
+ ### Laravel 13 New Features
39
+ - **Laravel AI SDK** (stable) — `use Illuminate\Support\Facades\AI;`
40
+ - **PHP Attributes** for framework components: `#[Table]`, `#[Fillable]`
41
+ - **JSON:API Resources** built-in
42
+ - `PreventRequestForgery` middleware (CSRF via `Sec-Fetch-Site` header)
43
+
44
+ ### PHP 8.4 Features (Use in New Code)
45
+ ```php
46
+ // Property Hooks
47
+ class Product {
48
+ public string $slug {
49
+ get => Str::slug($this->name);
50
+ set => $this->name = $value;
51
+ }
52
+ }
53
+
54
+ // Asymmetric Visibility
55
+ class Order {
56
+ public private(set) string $status = 'pending';
57
+ }
58
+
59
+ // New array functions
60
+ $found = array_find($items, fn($i) => $i->id === $id);
61
+ ```
62
+
63
+ ## Included
64
+
65
+ - `rules/laravel-conventions.md` — Architecture, DB integrity, Filament v4, Livewire 3, testing standards
66
+ - `skills/develop-laravel-feature/` — Generic skill for building features in this stack
67
+
68
+ Compose with global core and optionally with a project-specific overlay.
69
+
70
+ ## Standard 2026 Alignment
71
+
72
+ This file is part of the agent-skills engineering pack. The 2026 upgrade
73
+ pass added this footer so every prose file in the pack carries a
74
+ consistent Standard 2026 pointer.
75
+
76
+ - **OWASP ASI**: applied as described in `core/roles/role-standard.md`
77
+ (ASI01-ASI10) and the per-skill `## Security Guardrails (OWASP ASI)` sections.
78
+ - **Failure Modes**: the rule in this file can be violated by drift, missing
79
+ context, or untracked exceptions. Concrete failure scenarios belong in the
80
+ related skill or workflow's `### Failure Modes` section.
81
+ - **Output Contracts**: structured artifacts produced under this file must
82
+ conform to schemas in `core/contracts/schemas/`.
83
+ - **Skill Toolbox Lock**: this file's rules are enforced by the role that
84
+ owns the affected action; the runtime gate is
85
+ `core/scripts/hooks/check-policy.py`.
86
+ - **Commit / publish gate**: changes that affect user-visible behavior
87
+ follow the META-RULE in `core/rules/code.md` — no commit, no push, no
88
+ publish without explicit user confirmation.
89
+
90
+ Last updated: 2026-09-01