Skip to content
Agentmart
Submit a tool

backend-dev

Backend development guide — API design, data modeling, business logic, security, performance

Skill by amas-nghia

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/amas-nghia-backend-dev

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Backend development guide — API design, data modeling, business logic, security, performance

Use cases: design, backend, data, security

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/backend-dev

What's inside

Skill name
backend-dev
Description
Backend development guide — API design, data modeling, business logic, security, performance
License
MIT
Instructions
117 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: "backend-dev" does not match folder "skill-backend-dev"

Files (2)

  • SKILL.md
  • package.json

SKILL.md (first lines)

# Backend Development Skill

## Quy trình triển khai

1. Xác định API contract trước — request/response shape, status codes
2. Thiết kế data model — schema, relations, indexes
3. Viết service layer logic (pure business logic, không HTTP)
4. Implement route handler (thin — chỉ validate, call service, trả response)
5. Viết migration nếu thay đổi schema
6. Test endpoint với real database

## API Design

### Response envelope nhất quán

```json
{
  "data": { ... },
  "error": null,
  "meta": { "total": 100, "page": 1, "limit": 20 }
}
```

### HTTP status codes

| Tình huống | Code |
|---|---|
| Thành công có data | 200 |
| Tạo mới thành công | 201 |
| Không có nội dung | 204 |
| Validation error | 400 |
| Chưa auth | 401 |
| Không có quyền | 403 |
| Không tìm thấy | 404 |
| Conflict (duplicate) | 409 |
| Server error | 500 |

### Versioning

- Dùng `/api/v1/` prefix
- Không breaking change trong cùng version
- Deprecate endpoint bằng header `Deprecated: true` trước khi remove

## Data Layer

### Query safety

- Luôn dùng parameterized query / ORM — không bao giờ string concat vào SQL
- Pagination bắt buộc cho list endpoints: `limit` max 100, default 20
- Soft delete bằng `deleted_at` timestamp thay hard delete với data quan trọng

### Transaction

```ts
// Wrap multi-step mutations trong transaction
await db.transaction(async (tx) => {
  await tx.update(tasks).set({ status: 'done' })
  await tx.insert(auditNotes).values({ ... })
})
```

### Index checklist

- [ ] Foreign key columns
- [ ] Columns thường xuyên filter/sort
- [ ] Composite index cho query phổ biến
- [ ] Không over-index — mỗi index có chi phí write

## Security (bắt buộc)

- Validate tất cả input tại route boundary (Zod, Joi, class-validator)
- Sanitize output — không leak internal fields
- Rate limiting trên tất cả public endpoints
- Auth middleware trước route handler — không inline
- `api_key_ref` phải dạng `env:VAR`, `secret:name` — không raw value
- Log request/response nhưng redact sensitive fields

## Error Handling

```ts
// Service throws typed errors
class NotFoundError extends Error {
  constructor(resource: string, id: string) {
    super(`${resource} ${id} not found`)
  }
}

// Route handler catches và map sang HTTP
try {
  const result = await service.getTask(id)
  return { data: result }
} catch (e) {
  if (e instanceof NotFoundError) return sendError(event, 404, e.message)
  throw e  // let global handler deal with unexpected errors
}
```

- Không log stack trace ra response
- Log đầy đủ context ở server side (request id, user id, timestamp)

## Performance

- Avoid N+1: JOIN hoặc batch load thay vì query trong loop
- Cache kết quả expensive computation (Redis / in-memory với TTL)
- Background jobs cho tác vụ không cần sync response
- Database connection pooling — không tạo connection mới mỗi request

## Code quality checklist

- [ ] Route handler < 30 dòng
- [ ] Service function < 50 dòng; tách helper nếu cần
- [ ] Không có business logic trong migration files
- [ ] Không hardcode secrets hoặc URLs
- [ ] Tất cả external calls có timeout
- [ ] Idempotent endpoints khi có thể (đặc biệt POST tạo resource)

From amas-nghia/relayhq, MIT.

More from amas-nghia/relayhq

Signals

Stars
2
Forks
0
Open issues
1
Last commit (this folder)
May 5, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from amas-nghia

Cite this page

backend-dev skill. Agent Mart. https://agentmart.dev/skills/amas-nghia-backend-dev (last updated 2026-10-24)