소스 정보
- 저장소
- ubaniak/scoreboard
- 최근 소스 활동
- 2026년 4월 25일 12:58
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ubaniak/scoreboard --skill backend-style명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | backend-style |
| description | When developing backend components follow this style guideline |
You are helping the user add or modify Go backend code in the scoreboard project. When invoked, apply the patterns below exactly as described. Read relevant existing files before writing anything new.
Every domain lives under internal/<domain>/ and follows this exact three-file structure:
internal/<domain>/
app.go ← HTTP handlers + route registration
usecase.go ← business logic (UseCase interface + usecase struct)
storage.go ← Storage interface + NewSqlite constructor shim
entities/
entities.go ← plain Go structs, no GORM tags
storage/
<domain>.go ← GORM model struct
sqlite.go ← Sqlite struct, ToGormModel, ToEntity, CRUD methods
storage.go — interface shimThe package-level Storage interface and a thin NewSqlite wrapper that delegates to the concrete type:
type Storage interface {
Save(…) (uint, error)
List(…) ([]*entities.Foo, error)
Get(…) (*entities.Foo, error)
Delete(…) error
Update(…) error
}
func NewSqlite(db *gorm.DB) (Storage, error) {
return storage.NewSqlite(db)
}
storage/<domain>.go — GORM modelPlain GORM struct with gorm.Model embedded. No business logic.
type Foo struct {
gorm.Model
Name string `gorm:"not null"`
Status string `gorm:"not null"`
}
storage/sqlite.go — Sqlite implementationNewSqlite runs db.AutoMigrate and returns (*Sqlite, error)ToGormModel and ToEntity are value-receiver methods that convert between entity and GORM model*Sqlitetype Sqlite struct { db *gorm.DB }
func NewSqlite(db *gorm.DB) (*Sqlite, error) {
if err := db.AutoMigrate(&Foo{}); err != nil {
return nil, err
}
return &Sqlite{db: db}, nil
}
func (*Sqlite) ToGormModel(e *entities.Foo) *Foo { … }
func (*Sqlite) ToEntity(m Foo) *entities.Foo { … }
usecase.go — business logicUseCase interface listing every operationuseCase struct implements itNewUseCase returns the interface, not the structtype UseCase interface {
Create(…) error
Get(id uint) (*entities.Foo, error)
}
type useCase struct {
storage Storage
}
func NewUseCase(storage Storage) UseCase {
return &useCase{storage: storage}
}
app.go — HTTP layerApp struct holds a UseCase and any cross-domain interfaces (narrow interfaces, not full packages)type CardQuerier interface {
GetNumberOfJudges(cardId uint) (int, error)
}
RegisterRoutes registers every route on the passed-in *rbac.RouteBuilderpresenters.NewHTTPPresenter[T]:
func (a *App) Get(w http.ResponseWriter, r *http.Request) {
id, err := muxutils.ParseIntVar(r, "id")
…
result, err := a.useCase.Get(uint(id))
presenters.NewHTTPPresenter[*entities.Foo](r, w).
WithData(result).
WithError(err).
Present()
}
rbac.Admin or a judge role constant from internal/rbac/roles.goentities/entities.go — plain structsNo GORM tags. No JSON tags on internal domain entities (those go on the DTO/response structs in app.go).
cmd/main.gofooStorage, err := foo.NewSqlite(db)fooUseCase := foo.NewUseCase(fooStorage)fooApp := foo.NewApp(fooUseCase)register.Add(fooApp) under the appropriate subrouter| Thing | Convention |
|---|---|
| GORM model | Foo (same as entity, lives in storage/ package) |
| Entity | Foo (lives in entities/ package) |
| Interface | UseCase, Storage (not IFoo) |
| Constructor | NewFoo, NewUseCase, NewSqlite |
| HTTP handler method | PascalCase verb: Create, List, Get, Update, Delete |
| Route label | "<domain>.<action>" e.g. "bouts.create" |
app.goNewUseCase or NewSqlite at the package boundary — always return the interfaceapp.go — middleware belongs in cmd/main.go or rbacSOC 직업 분류 기준