Overview
This runbook covers operational procedures for managing SO1 engineering agents, including Hono API development, Next.js frontend component creation, and TypeScript shared library maintenance. These procedures ensure consistent code quality and development velocity across the platform. Purpose: Provide step-by-step instructions for using engineering agents in development workflows Scope: API endpoint development, frontend components, shared TypeScript packages, code generation Target Audience: Software engineers, frontend developers, backend developersPrerequisites
Required Access
Required Access
- GitHub repository access (
so1-io/control-plane,so1-io/console,so1-io/shared) - Control Plane API access (
CONTROL_PLANE_API_KEY) - Railway project access (API deployments)
- Vercel project access (Console deployments)
- npm registry access (for shared packages)
Required Tools
Required Tools
- Node.js 20+ and npm/pnpm
- TypeScript 5.0+
- OpenCode with engineering agents installed
- Git CLI
- Docker (for local testing)
Required Knowledge
Required Knowledge
- TypeScript/JavaScript fundamentals
- Understanding of Hono framework (API backend)
- Familiarity with Next.js 14+ (App Router)
- REST API design principles
- Component-driven architecture
Procedure 1: Create Hono API Endpoint
Step 1: Design API Specification
Define the endpoint requirements:Step 2: Invoke Hono Backend Agent
Step 3: Review and Integrate Generated Code
Step 4: Test Generated Endpoint
Step 5: Deploy to Railway
See Deployment Runbook for full deployment procedures.Procedure 2: Create Next.js Frontend Component
Step 1: Define Component Requirements
Step 2: Invoke Next.js Frontend Agent
Step 3: Review Generated Component
Step 4: Test Component
Step 5: Integrate into Application
Procedure 3: Manage TypeScript Shared Library
Step 1: Create Shared Type Definitions
Step 2: Review Generated Types
Step 3: Publish Shared Package
Step 4: Update Consuming Projects
Step 5: Verify Type Consistency
Procedure 4: Code Review and Quality Checks
Step 1: Run Automated Quality Checks
Step 2: Review Agent-Generated Code
Quality Checklist:Step 3: Run Security Scan
Step 4: Performance Testing
Verification Checklist
After completing engineering operations, verify:Troubleshooting
Issue: Generated Code Has Type Errors
Symptoms: TypeScript compiler errors in agent-generated code Possible Causes:- Outdated agent generation templates
- Incompatible TypeScript version
- Missing type definitions
Issue: Frontend Component Not Rendering
Symptoms: Component shows blank or throws runtime error Possible Causes:- Missing CSS imports
- Client/Server component mismatch
- Hydration errors
Issue: Shared Types Version Mismatch
Symptoms: Type errors when consuming shared package in multiple projects Possible Causes:- Different versions of
@so1/typesinstalled - Breaking changes not communicated
Related Resources
Hono Backend Agent
API endpoint generation with Hono
Next.js Frontend Agent
React component generation for Console
TypeScript Shared Agent
Shared type library management
DevOps Runbook
Deployment and CI/CD operations
Best Practices
API Development
- Always use Zod schemas for request/response validation
- Implement rate limiting on all public endpoints (use
@hono/rate-limiter) - Return consistent error formats:
- Use proper HTTP status codes: 200 (success), 201 (created), 400 (validation), 401 (auth), 404 (not found), 500 (server error)
- Document endpoints with OpenAPI/Swagger annotations
Frontend Development
- Prefer Server Components unless interactivity is required
- Use TypeScript strict mode (
strict: truein tsconfig.json) - Implement loading states for all async operations
- Add error boundaries around component trees
- Follow accessibility guidelines: ARIA labels, keyboard navigation, focus management
- Optimize images: Use Next.js
<Image>component with proper sizing
Shared Library Management
- Use semantic versioning: Major (breaking), Minor (features), Patch (fixes)
- Document breaking changes in CHANGELOG.md
- Keep dependencies minimal in shared packages
- Export both TypeScript types and Zod schemas for runtime validation
- Write migration guides when introducing breaking changes