Development guidelines for Ponti backend using Go, focusing on precision, architecture patterns, and Spanish/English conventions
Comprehensive development guidelines for the Ponti backend project, a Go-based API with strict conventions around precision, architecture, and bilingual code practices.
**NEVER:**
**ALWAYS:**
```go
type Product struct {
ID *int64
Name string
Price decimal.Decimal // Para campos monetarios
Categories []string // Slice como valor
shareddomain.Base
}
```
```
HTTP Request → Adapter (DTO) → Use Case (Domain) → Repository (Model) → Database
```
```sql
-- Agregar campo de precio con precisión completa
ALTER TABLE products ADD COLUMN price NUMERIC(15,3) NOT NULL DEFAULT 0;
```
```go
func TestCalculateTotal(t *testing.T) {
tests := []struct {
name string
input decimal.Decimal
expected decimal.Decimal
}{
{"case 1", decimal.NewFromFloat(100.5), decimal.NewFromFloat(100.5)},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// test implementation
})
}
}
```
```bash
make test # Run tests in container
make migrate # Run migrations
make seed # Load seed data
```
```go
if err != nil {
return nil, fmt.Errorf("error al procesar producto: %w", err)
}
```
Always use these headers for testing:
```bash
curl -H "X-API-KEY: abc123secreta" \
-H "X-USER-ID: 123" \
http://localhost:8080/api/endpoint
```
1. **Read the request carefully** — understand the surgical scope
2. **Provide TLDR summary** of proposed approach
3. **Wait for approval** before implementing
4. **Implement surgically** — change only what's necessary
5. **Run tests immediately** without asking
6. **Verify with curl** using proper headers
Before submitting changes, verify:
This skill enforces strict conventions for a production backend where **precision matters** (financial calculations), **architecture is clean** (layered), and **bilingual practices** maintain code clarity for Spanish-speaking teams while following English coding standards.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/ponti-backend-development-rules/raw