Declarative .mdcกฎ Cursor/Claude/Windsurf และเวิร์กโฟลว์ n8nทักษะตัวแทนตรวจสอบการรั่วไหลแบบ Zero-Secret แล้ว

ไป 1.27 + gqlgen + pgx/v5 ทักษะไมโครเซอร์วิสหน่วยความจำต่ำ

ทักษะด้านวิศวกรรม CLAUDE.md และ .mdc ที่ประกาศได้สำหรับการสร้างแบ็กเอนด์ <50MB RSS Go GraphQL พร้อมด้วยตัวแก้ไข gqlgen ในเวลาคอมไพล์และการเชื่อมต่อ pgxpool แบบมีขอบเขต

ไฟล์กฎตัวแทนและ IDE ที่ประกาศ

---
description: Go 1.27, gqlgen GraphQL resolvers, and pgx/v5 PostgreSQL pool patterns for sub-50MB microservices
globs: backend/**/*.{go,graphqls,yml}
alwaysApply: false
---

# Go 1.27 + gqlgen + pgx/v5 Production Architecture

- Configure `pgxpool` with `MaxConns = 10`, `MinConns = 1`, and `MaxConnIdleTime = 5 * time.Minute` to keep microservice RAM under 40–60 MB RSS.
- Propagate `context.Context` with explicit timeouts (`context.WithTimeout(ctx, 5*time.Second)`) across every SQL query and outbound HTTP request.
- Use parameterized `$1, $2` placeholders exclusively in `pgx` queries; never concatenate raw user input into SQL strings.
- Project localized JSONB payloads directly in PostgreSQL (`COALESCE(translations->$1, translations->'en')`) instead of unmarshaling all 26 locales in Go memory.
- Compile production binaries with `-ldflags='-s -w'` and bind internal API listeners strictly to `127.0.0.1:<PORT>` behind Nginx.

## Verification Check
```bash
go vet ./... && go build -ldflags='-s -w' ./cmd/server
```

หมายเหตุการตั้งค่าชุมชนและบทวิจารณ์การผลิต (0)

ยังไม่มีบันทึกของชุมชน แบ่งปันเคล็ดลับการกำหนดค่าการใช้งานจริงของคุณด้านล่าง

โพสต์บันทึกการตั้งค่าหรือเคล็ดลับการยืนยัน

เครื่องมือ MCP ที่เปิดเผยและตัวตรวจสอบสคีมาทรัพยากร

เครื่องมือ / ตัวระบุทรัพยากรพารามิเตอร์อินพุตพฤติกรรมการดำเนินการ
bounded_pgxpool_configinternal/db/*.goEnforces MaxConns <= 10, context deadlines, and single-query JSONB projection.
compile_time_gqlgen_resolversgraph/*.goPrevents reflection bottlenecks and N+1 resolver loops.