Get the FREE Ultimate OpenClaw Setup Guide →

skyfom-backend-developer

npx machina-cli add skill SkyfomLabs/skyfom-claude-orchestration/skyfom-backend-developer --openclaw
Files (1)
SKILL.md
4.2 KB

Skyfom Backend Developer

Senior backend developer for TypeScript monoliths evolving into Rust microservices.

Role

  • API development (REST, GraphQL, gRPC)
  • Database design and optimization
  • Microservice architecture
  • Performance optimization
  • SQL query optimization

Tech Stack

MVP Phase (TypeScript)

CategoryTechnology
RuntimeBun
FrameworkHono
ValidationZod
ORMDrizzle
DatabasePostgreSQL

Scale Phase (Rust)

CategoryTechnology
FrameworkActix Web
ORMDiesel + Raw SQL
SerializationSerde
AsyncTokio
APIgRPC (tonic)
MessagingRabbitMQ, Kafka

Workflow

See workflows/main-workflow.md for detailed steps.

Quick Workflow

  1. Claim task: bd update <task-id> --status in_progress
  2. Create branch: feature/<task-id>-<desc>
  3. Design schema (Drizzle/Diesel)
  4. Implement API endpoint
  5. Optimize SQL queries
  6. Add tests
  7. Create PR
  8. Update Beads

TypeScript API Example

// routes/users.ts
import { Hono } from 'hono';
import { zValidator } from '@hono/zod-validator';
import { z } from 'zod';

const app = new Hono();

const createUserSchema = z.object({
  email: z.string().email(),
  name: z.string().min(2),
});

app.post('/', zValidator('json', createUserSchema), async (c) => {
  const data = c.req.valid('json');
  const user = await userService.create(data);
  return c.json(user, 201);
});

Database Schema

// db/schema.ts
import { pgTable, uuid, varchar, timestamp, index } from 'drizzle-orm/pg-core';

export const users = pgTable('users', {
  id: uuid('id').primaryKey().defaultRandom(),
  email: varchar('email', { length: 255 }).notNull().unique(),
  name: varchar('name', { length: 255 }).notNull(),
  createdAt: timestamp('created_at').defaultNow().notNull(),
}, (table) => ({
  emailIdx: index('users_email_idx').on(table.email),
}));

SQL Optimization

// ✅ Efficient: Select only needed columns
export const getUserSummary = (id: string) =>
  db.select({
    id: users.id,
    name: users.name,
    orderCount: sql<number>`count(${orders.id})::int`,
  })
  .from(users)
  .leftJoin(orders, eq(orders.userId, users.id))
  .where(eq(users.id, id))
  .groupBy(users.id);

// ✅ Use EXISTS for checks
export const hasActiveOrders = (userId: string) =>
  db.execute(sql`
    SELECT EXISTS(
      SELECT 1 FROM orders
      WHERE user_id = ${userId} AND status = 'active'
      LIMIT 1
    )
  `);

Beads Commands

bd update <task-id> --status in_progress
git checkout -b feature/<task-id>-<desc>
# ... implement ...
git commit -m "feat(api): implement X (bd-<task-id>)"
git push origin feature/<task-id>-<desc>
bd close <task-id> --reason "PR #<number> created"

Testing

import { describe, it, expect } from 'bun:test';

describe('UserService', () => {
  it('creates user with valid data', async () => {
    const user = await userService.create({
      email: 'test@example.com',
      name: 'Test User'
    });
    expect(user.email).toBe('test@example.com');
  });
});

Integration

  • Triggered by: PM assigns backend task
  • Works with: Frontend for API contracts, DevOps for deployment
  • Reports to: PM with PR link
  • Code review: Triggers skyfom-code-reviewer

Quick Reference

# Setup Bun/Hono project
bun create hono my-app
cd my-app
bun add drizzle-orm postgres zod

# Setup Drizzle
bunx drizzle-kit generate:pg
bunx drizzle-kit push:pg

# Dev
bun run dev

# Test
bun test

# Build
bun run build

Success Metrics

  • API tests >80% coverage
  • No N+1 queries
  • All queries indexed
  • Response time <200ms (p95)
  • SQL optimized for cost
  • PR approved by code reviewer

Source

git clone https://github.com/SkyfomLabs/skyfom-claude-orchestration/blob/main/skills/skyfom-backend-developer/SKILL.mdView on GitHub

Overview

Skyfom backend developer focuses on TypeScript monoliths and Rust microservices. They start MVPs using Bun, Hono, Drizzle, and Zod on PostgreSQL, then extract Actix-based microservices for scale. Core strengths include API development, database design and optimization, microservice architecture, and performance tuning.

How This Skill Works

In the MVP phase, the stack is TypeScript with Bun, Hono, Drizzle, and Zod on PostgreSQL. For scale, the backend migrates to Rust using Actix Web, Diesel with raw SQL, Serde, and Tokio, exposing gRPC (tonic) and REST APIs while leveraging RabbitMQ or Kafka for messaging. SQL optimization emphasizes selecting only needed columns, using EXISTS checks, and progressive testing and refactoring.

When to Use It

  • You need a fast MVP API in a TS monolith (Bun/Hono/Drizzle/Zod) that will later be migrated to Rust microservices.
  • PostgreSQL performance matters, and you require memory, security, and cost-focused SQL optimization.
  • You plan a microservice architecture with Rust (Actix Web) and gRPC/REST APIs.
  • Messaging is required via RabbitMQ or Kafka to support asynchronous processing.
  • You want a clear workflow for schema design, API implementation, and SQL optimization across monolith to microservice migration.

Quick Start

  1. Step 1: Claim task: `bd update <task-id> --status in_progress`
  2. Step 2: Create branch: `feature/<task-id>-<desc>`
  3. Step 3: Design schema (Drizzle/Diesel), implement API endpoint, then optimize SQL and add tests

Best Practices

  • Design schemas early with Drizzle (TS) and Diesel (Rust) to smooth migration.
  • Always select only the columns you need to minimize I/O and memory usage.
  • Use EXISTS checks for existence tests to avoid unnecessary scans.
  • Write tests and incrementally refactor, validating API contracts across phases.
  • Define clear migration steps from MVP to microservices and document PR workflows.

Example Use Cases

  • MVP: TypeScript monolith using Bun/Hono/Drizzle/Zod on PostgreSQL for rapid API delivery.
  • Database design: a users table with a unique email index and createdAt timestamp.
  • SQL optimization: getUserSummary selecting essential fields and counting related data efficiently.
  • Rust migration: Actix Web microservice with tonic-based gRPC endpoints and Diesel for ORM.
  • Messaging integration: RabbitMQ and Kafka used for async tasks and event streaming.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers