بنقرة واحدة
go-review-service
Audit a GOB Go microservice against all project conventions and patterns
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Audit a GOB Go microservice against all project conventions and patterns
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Strategic critique of an idea/plan/decision. Triggers: "me aconselhe", "critique meu plano", "avalie minha ideia", "feedback estrategico", "advisor". Skip for technical tasks (use bugfix/execute-task).
Internal POSIX runtime helpers for agente-00c/feature-00c orchestrators (state, lock, validation, hashes, secrets filter). NOT user-invocable.
Cross-artifact SDD consistency analysis (spec/plan/tasks/constitution) — read-only. Triggers: "analyze", "cross-check", "auditar artefatos", "validar spec vs tasks". Skip for single-document validation (use validate-documentation).
Apply Codex usage insights to current project — improve AGENTS.md, hooks, workflows. Triggers: "aplicar insights", "otimizar fluxo", "melhorar agents.md". This is the APPLY step that consumes the insights/usage-analysis output, not the insights generation step itself.
Structured project discovery interview (vision, users, constraints, stack). Triggers: "briefing", "discovery", "iniciar projeto", "kickoff". Skip if briefing already complete and user did not ask for update.
Multi-layer bug investigation and fix (traces across services before patching). Triggers: "bugfix", "fix bug", "corrigir bug", "debug", "investigar bug". Skip for new feature work (use execute-task/specify).
| name | go-review-service |
| description | Audit a GOB Go microservice against all project conventions and patterns |
Adapted from JotJunior/cstk skill go-review-service at commit 35922cf.
Use this as a Codex skill; follow local repository instructions and Codex tool names when source text mentions Claude-specific commands or slash commands.
Perform a comprehensive read-only audit of a GOB Go microservice, checking 17 conventions. Outputs a structured PASS/FAIL/WARNING report with line references.
"review service", "audit service", "validar servico", "check service", "verificar servico", "checar servico"
the user's request should specify:
gob-member-service) — requiredDetermine the service root:
services/{service-name}/
Read these files first (in parallel where possible):
cmd/api/main.go — middleware order, wiring, shutdowninternal/factory/factory.go — repository factoryinternal/repository/repository.go — interfacesinternal/handler/*.go — route registrationgo.mod — module path, dependenciesmigrations/ — list files for schema referenceFor each check, output one of:
Expected order (top to bottom in main.go):
recover.New()requestid.New()nrfiber.Middleware(nrApp) — after requestid, before loggingmiddleware.LoggingWithLogger(log) or middleware.Logging()cors.New(...) — with AllowOrigins, AllowHeaders, AllowMethods, AllowCredentialsmiddleware.DryRun(...) — if service supports dry-runmiddleware.DryRunFinalizer() — if dry-run presentmiddleware.AuditPublisher(...) — after cors/dryrun, before endpointsSearch: Look for app.Use( calls in main.go. Verify order matches.
rabbitmq.NewFromURL)middleware.AuditExchange constantif rmqURL != "" with warning on failuredefer auditRMQ.Close() presentSearch: AuditPublisher in main.go.
observability.NewRelicApp(serviceName, cfg, log) callednrfiber.Middleware(nrApp) (only if nrApp != nil)defer observability.ShutdownNewRelic(nrApp) presentrequestid and before logging middlewareSearch: NewRelicApp, nrfiber, ShutdownNewRelic in main.go.
For each handler's RegisterRoutes() method:
/types, /counts, /search) MUST come BEFORE parameterized routes (/:id)/groups) MUST be registered BEFORE /:id catch-allFAIL if: Any /:id or /:param route appears before a static route at the same level.
Search: All RegisterRoutes methods in internal/handler/.
context.Context is the first parameter in every methodFindByID returns (*domain.X, error) — nil/nil when not foundinternal/repository/repository.goSearch: repository.go file, look for interface definitions.
GetContext (single row) and SelectContext (multiple rows)sql.ErrNoRows returns nil, nil (not wrapped as error)member.members)$1, $2, ... positional parameters (not ?)db:"" tags separate from domain structstoDomain() converter methods on row structsSearch: internal/repository/postgres/*.go files.
var ErrXxxNotFound = errors.New("...")Search: internal/service/*.go files, look for var Err and return types.
errors.Is() for sentinel error matchingdto.ErrorResponse with appropriate HTTP status codesmiddleware.GetUserID(c), middleware.GetClaims(c)c.Status(xxx).JSON(dto.ErrorResponse{...}) patternSearch: internal/handler/*.go for errors.Is and ErrorResponse.
Repositories struct holds all repo instancesNewRepositories(db) constructor creates all reposNewDryRunRepositories(db) for dry-run mode (if applicable)RepositoryFactory with isDryRun flag (if dry-run supported)Search: internal/factory/factory.go.
snake_case (e.g., json:"lodge_id")snake_case matching column names (e.g., db:"lodge_id")omitempty on optional/nullable fieldsdb:"-" on computed/relation fieldsjson:"-" on fields that should be visible in APISearch: Domain structs in internal/domain/*.go, check tags.
All three must be present:
GET /health — returns 200 OKGET /ready — pings DB (db.PingContext) and returns health statusGET /version — returns service version infoSearch: /health, /ready, /version in main.go.
EnableTrustedProxyCheck: trueTrustedProxies configured (e.g., private network ranges)ProxyHeader: "X-Real-Ip" or "X-Forwarded-For"fiber.Config{} in main.goSearch: fiber.New( or fiber.Config in main.go.
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)consumer.Stop()) if RabbitMQ consumer existsapp.ShutdownWithContext(ctx) or app.Shutdown()Search: signal.Notify, Shutdown, defer in main.go.
github.com/gob/gob-{service-name}github.com/gob/gob-process-serviceSearch: First line of go.mod.
storage.Storage interface from gob-go-commons/pkg/storage/storage.NewFromConfig(cfg) (auto-selects S3 or local)Upload(ctx, key, reader, size, contentType) — NOT PutPresignedGetURL(ctx, key, expiry) — NOT GetPresignedURL{service}/{category}/{entityID}/{uuid}-{filename}.extstorage.ValidateFileType() and storage.ValidateFileSize()storage.Storage parameterSearch: storage.Storage in handler/service files.
N/A if service doesn't handle file uploads.
AMQPPublisher + NoopPublisher (graceful degradation when RabbitMQ unavailable)SetPublisher() method or accepts publisher in constructortopic and durableSearch: Publisher, AMQPPublisher, NoopPublisher in service and messaging files.
N/A if service doesn't publish events.
Verify logging follows the project standards (see AGENTS.md "Structured Logging Standards"):
15a. Repository layer has logger injected:
log *logger.Logger field*logger.Logger parameter15b. Repository methods have entry/exit/duration logging:
entity, operationduration_msWithError(err) before returningFindByID not-found path must log Debug (not Error)duration_ms15c. Service layer has logging:
log *logger.Logger fieldentity_idWithError(err)15d. Handler layer has logging:
WithRequestID(requestID), WithError(err)entity, operation fields15e. No anti-patterns:
fmt.Println or log.Println (standard library) — must use logger.Loggerlogger.Default() in production code (inject via constructor)fmt.Println or log.Println found in non-test codeSearch: All .go files in internal/, look for log., logger., fmt.Print, log.Print.
# Service Audit: {service-name}
Date: {current date}
## Summary
PASS: X/17 | FAIL: Y/17 | WARNING: Z/17 | N/A: W/17
## Results
### 1. Middleware Order
**PASS** — Correct order: recover → requestid → nrfiber → logging → cors → dryrun → audit
(main.go:45-82)
### 2. Audit Middleware
**FAIL** — Missing separate RabbitMQ connection. Audit reuses existing connection.
(main.go:95)
### 3. New Relic APM
**WARNING** — nrfiber middleware not conditional on nrApp != nil
(main.go:52)
... (continue for all 17 checks)
## Recommendations
1. [Highest priority fixes]
2. [Medium priority improvements]
3. [Low priority suggestions]
This skill includes material adapted from JotJunior/cstk, licensed under MIT. The copyright and permission notice are included in references/cstk-license.md.