prefab-dev
/prefab-dev
Use this skill when developing Go applications with the Prefab server framework. This includes creating servers, adding gRPC/HTTP handlers, configuring authentication and authorization, setting up SSE streams, managing configuration, creating custom plugins, and following Prefab error handling and security patterns.
Assessment and security
- Files in this package
- 18
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 06.08.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use this skill when developing Go applications with the Prefab server framework. This includes creating servers, adding gRPC/HTTP handlers, configuring authentication and authorization, setting up SSE streams, managing configuration, creating custom plugins, and following Prefab error handling and security patterns.
Original author description
Use this skill when developing Go applications with the Prefab server framework. This includes creating servers, adding gRPC/HTTP handlers, configuring authentication and authorization, setting up SSE streams, managing configuration, creating custom plugins, and following Prefab error handling and security patterns.
How it works
- Core Concepts
- Quick Start Pattern
- Resources
- Code Style
- When to Load Resources
SKILL.md preview
---
name: prefab-dev
description: |
Use this skill when developing Go applications with the Prefab server framework.
This includes creating servers, adding gRPC/HTTP handlers, configuring authentication
and authorization, setting up SSE streams, managing configuration, creating custom
plugins, and following Prefab error handling and security patterns.
---
# Prefab Development Guide
Prefab is a Go server framework that simplifies building production-ready gRPC and HTTP services with a plugin-based architecture.
## Core Concepts
- **Server**: Central component that manages gRPC/HTTP services and plugins
- **Plugins**: Modular components for auth, storage, templates, etc.
- **Services**: gRPC service implementations with automatic HTTP gateway
- **Handlers**: Custom HTTP handlers for non-gRPC endpoints
Prefab servers commonly compose multiple gRPC services into a single process. This enables a service-oriented monolith architecture where related services share infrastructure (auth, storage, logging) while maintaining clear boundaries. As utilization requirements become known, individual services can be extracted into separate deployments without changing their interfaces.
## Quick Start Pattern
```go
import "github.com/dpup/prefab"
func main() {
s := prefab.New(
prefab.WithPort(8080),
prefab.WithPlugin(auth.Plugin()),
// Add more options...
)
s.RegisterService(
&myservice.MyService_ServiceDesc,
myservice.RegisterMyServiceHandler,
&myServiceImpl{},
)
if err := s.Start(); err != nil {
log.Fatal(err)
}
}
```
## Resources
Load these resources based on the specific task:
### Server & Services
- **[Project Setup](resources/project-setup.md)** - Proto files, Makefile, project structure
- **[Server Setup](resources/server-setup.md)** - Server creation, initialization, and basic configuration
- **[gRPC & HTTP](resources/grpc-http.md)** - Registering services, HTTP handlers, static files
### Authentication & Authorization
- **[Authentication](resources/auth.md)** - OAuth, password auth, magic links, fake auth for testing
- **[OAuth Server](resources/oauth-server.md)** - Build an OAuth2 authorization server for third-party apps
- **[Authorization](resources/authz.md)** - Declarative access control with proto annotations, policies, role describers
### Features
- **[SSE Streaming](resources/sse.md)** - Server-Sent Events for real-time updates
- **[Configuration](resources/configuration.md)** - YAML, environment variables, functional options
- **[Storage](resources/storage.md)** - Storage plugins (memory, SQLite)
- **[File Uploads](resources/uploads.md)** - File upload/download with authorization
- **[Email](resources/email.md)** - SMTP email sending
- **[Templates](resources/templates.md)** - Go HTML template rendering
- **[Event Bus](resources/eventbus.md)** - Publish/subscribe inter-plugin communication
### Development
- **[Custom Plugins](resources/plugins.md)** - Creating plugins with dependencies and lifecycle
- **[Error Handling](resources/errors.md)** - Stack traces, gRPC codes, log fields
- **[Logging](resources/logging.md)** - Structured context-aware logging
- **[Security](resources/security.md)** - CSRF, headers, HTTPS, token security
## Code Style
- Use `errors.New()`, `errors.NewC()`, `errors.Wrap()` for errors with stack traces
- Standard library imports first, then third-party
- Document public APIs with GoDoc comments
- Follow plugin interface patterns with `Plugin()` function and `PluginName` constant
## When to Load Resources
| Task | Resources to Load |
|------|-------------------|
| Starting a new project | project-setup.md, server-setup.md |
| Creating a new server | server-setup.md, configuration.md, logging.md |
| Adding authentication | auth.md, server-setup.md |
| Building an OAuth server | oauth-server.md, auth.md, storage.md |
| Setting up access control | authz.md, auth.md |
| Adding real-time features | sse.md |
| Creating a custom plugin | plugins.md, eventbus.md |
| Handling errors properly | errors.md, logging.md |
| Security review | security.md |
| Adding storage | storage.md |
| Adding HTTP/gRPC endpoints | grpc-http.md |
| Adding file uploads | uploads.md, authz.md |
| Sending emails | email.md, templates.md |
| Rendering templates | templates.md |
| Inter-plugin communication | eventbus.md |
| Setting up logging | logging.md |
Files in this package (18)
- SKILL.md 4 KB
- resources/auth.md 4 KB
- resources/authz.md 4 KB
- resources/configuration.md 3 KB
- resources/email.md 2 KB
- resources/errors.md 4 KB
- resources/eventbus.md 4 KB
- resources/grpc-http.md 2 KB
- resources/logging.md 3 KB
- resources/oauth-server.md 10 KB
- resources/plugins.md 3 KB
- resources/project-setup.md 5 KB
- resources/security.md 3 KB
- resources/server-setup.md 2 KB
- resources/sse.md 3 KB
- resources/storage.md 2 KB
- resources/templates.md 3 KB
- resources/uploads.md 3 KB
Versions
The database has no other skills named prefab-dev.
Database snapshot: 13.11.2026 · package version 6288723718a1 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95assets-prefab-save
Save a prefab. Use it when you are in prefab editing mode in Unity Editor. Use 'assets-prefab-open' tool to open a prefab first. - 95assets-prefab-close
Close currently opened prefab. Use it when you are in prefab editing mode in Unity Editor. Use 'assets-prefab-open' tool to open a prefab first. - 90edit-scene
Creates and modifies Unity scene and prefab files. Use this skill whenever creating, editing, or modifying .unity scene files or .prefab prefab files. This includes adding GameObjects, building uGUI hierarchies, wiring up components, and any task that results in changes to .unity or .prefab files. - 100prefab-text-exporter
Unity Prefab 文字匯出工具的設計指南。當需要:(1) 理解或修改 PrefabToTextExporter 相關程式碼 (2) 擴充匯出格式或新增支援的類型 (3) 新增 Component 類型對應 (4) 調整篩選邏輯或輸出格式時使用此 skill。 - 100uprefab
能讀懂並改動 Unity serialized data(prefab / scene / ScriptableObject)。當需要:(1) 找某個 component / 節點在哪些 prefab 或 scene 裡 (2) 讀某個 prefab 的階層結構或 FSM 狀態機架構 (3) 看某個子樹的 component 欄位細節 (4) prefab override 稽核 (5) 用 API 改 prefab / scene 結構、建 prefab variant、複製場景模板、組 FSM、建立或編輯 ScriptableObject… - 100bun-http-server
Use when building HTTP servers with Bun.serve, handling requests/responses, implementing routing, creating REST APIs, or configuring fetch handlers.