Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/RunnerQuan/SAFE-Agent --skill go-backend명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | go-backend |
| description | Goバックエンド開発 - Goイディオム、並行処理、エラーハンドリング、テスト |
| requires-guidelines | ["golang","common"] |
| hooks | [{"event":"PreSkillUse","command":"~/.claude/hooks/pre-skill-use.sh"}] |
// ❌ 危険: エラー無視
result, _ := userRepo.Find(id)
// ❌ 危険: panic乱用
if err != nil {
panic(err) // サーバークラッシュの原因
}
// ✅ 正しい: エラー適切処理
result, err := userRepo.Find(id)
if err != nil {
return fmt.Errorf("failed to find user: %w", err)
}
// ❌ 危険: 終了しないgoroutine
func process() {
ch := make(chan int)
go func() {
for v := range ch { // chがクローズされない
fmt.Println(v)
}
}()
}
// ✅ 正しい: context でキャンセル制御
func process(ctx context.Context) {
ch := make(chan int)
go func() {
defer close(ch)
for {
select {
case <-ctx.Done():
return
case v := <-ch:
fmt.Println(v)
}
}
}()
}
// ❌ 危険: 不要なインターフェース
type UserRepositoryInterface interface {
Find(int) (*User, error)
Save(*User) error
}
// ✅ 正しい: 必要な場所でのみ定義(Accept interfaces)
// domain/repository.go
type UserRepository interface {
Find(int) (*User, error)
}
// infrastructure/user_repository.go
type userRepositoryImpl struct { ... }
func (r *userRepositoryImpl) Find(id int) (*User, error) { ... }
// ⚠️ タイムアウト制御がない
func FetchData(url string) ([]byte, error) {
resp, err := http.Get(url)
...
}
// ✅ context でタイムアウト制御
func FetchData(ctx context.Context, url string) ([]byte, error) {
req, _ := http.NewRequestWithContext(ctx, "GET", url, nil)
resp, err := http.DefaultClient.Do(req)
...
}
// ⚠️ Unlock 忘れのリスク
mu.Lock()
if err := process(); err != nil {
return err // Unlock されない
}
mu.Unlock()
// ✅ defer で確実に Unlock
mu.Lock()
defer mu.Unlock()
if err := process(); err != nil {
return err
}
// ⚠️ 同じテストコードの繰り返し
func TestAdd(t *testing.T) {
if Add(1, 2) != 3 { t.Error("failed") }
if Add(0, 0) != 0 { t.Error("failed") }
}
// ✅ テーブル駆動
func TestAdd(t *testing.T) {
tests := []struct {
name string
a, b int
want int
}{
{"positive", 1, 2, 3},
{"zero", 0, 0, 0},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := Add(tt.a, tt.b); got != tt.want {
t.Errorf("got %d, want %d", got, tt.want)
}
})
}
}
user not users)Reader, Finder)fmt.Errorf("%w", err) でラップしているかvar Err... で定義しているか🔴 Critical: ファイル:行 - エラー処理違反/goroutineリーク - 修正案
🟡 Warning: ファイル:行 - イディオム違反 - 改善案
📊 Summary: Critical X件 / Warning Y件
開発実施前に以下のガイドラインを参照:
~/.claude/guidelines/languages/golang.md~/.claude/guidelines/common/code-quality-design.md~/.claude/guidelines/common/testing-guidelines.md最新のGoベストプラクティス確認には context7 を活用:
プロジェクト固有のGo実装情報を確認: