一键导入
design-review
Deep design review of Go codebase — naming, structure, consistency, interfaces, error handling. Scores each dimension and provides actionable fixes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deep design review of Go codebase — naming, structure, consistency, interfaces, error handling. Scores each dimension and provides actionable fixes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Index a folder's contents into the MemPalace semantic memory for search and retrieval. Use this skill whenever the user asks to "index a folder", "index a directory", "index memory", "mine a project into memory", "make a folder searchable", "embed a folder", "ingest code into the palace", or "index this directory for semantic search". Covers the full flow: model download, mempalace.yaml room configuration, mining, and verification via search. Also trigger when the user says "memory index", "index memory of folder", or asks how to make a project's code semantically searchable with pi-go's MemPalace.
Lazy senior dev mode — always pick the simplest solution that works. Use this skill whenever writing, refactoring, or reviewing code to keep changes minimal: prefer the standard library, native platform features, and already-installed dependencies over new code or dependencies. Trigger when the user says "ponytail", "keep it simple", "simplest thing that works", "don't over-engineer", "lazy mode", or asks to avoid unnecessary abstractions, boilerplate, or premature complexity. The best code is the code never written.
Before any commit, run linters, vet, tests, and build verification; do not commit until checks pass
Go 1.24–1.26 coding guidelines for the dimetron/pi-go AI agent runtime. Use this skill whenever writing, reviewing, or refactoring ANY Go code in pi-go. This covers idiomatic style, error handling, concurrency, project layout, testing (table-driven, fuzz, benchmarks, synctest), new stdlib usage, golangci-lint v2 configuration, slog logging, and manual dependency injection with functional options. Always consult this skill before generating Go code for pi-go, even for small snippets, to ensure every output is idiomatic and modern.
Review code for quality, run linters, check test coverage, fix issues, and enforce gates. Save the final report to ./specs/issues/003-code-review-pi/PROMPT.md. Use before committing changes.
Mine project files or conversations into the MemPalace memory system. Indexes source code and conversation history as searchable palace drawers with semantic embeddings and room assignment.
| name | design-review |
| description | Deep design review of Go codebase — naming, structure, consistency, interfaces, error handling. Scores each dimension and provides actionable fixes. |
| metadata | {"author":"dimetron","version":"1.1"} |
Perform a comprehensive design review of the Go codebase. Evaluate code quality, naming conventions, consistency, and architectural patterns. Produce a scored report with actionable improvements.
Use this skill when:
Do NOT use for:
code-review instead)code-review instead)| Aspect | design-review | code-review |
|---|---|---|
| Scope | Entire codebase or package | Changed files only |
| Action | Read-only audit, scored report | Fix issues, enforce gates |
| Focus | Architecture, patterns, idioms | Correctness, coverage, linting |
| Output | Scorecard + recommendations | Pass/fail gates + fixes applied |
Score each dimension 1-10 and provide specific file:line references for issues found.
utils, helpers, common)-er suffix where appropriate (Reader, Writer)ID, URL, HTTP, not Id, Url, Http)TestFuncName_Scenario patternio.Reader, io.Writer, fmt.Stringer used where applicablefmt.Errorf("...: %w", err)err returns)var ErrFoo = errors.New(...) not string comparisoncontext.Context propagated correctlysync.WaitGroup or errgroup used for fan-outNewFoo patternfoo.go / foo_test.go)init() functions avoided (or justified)Set scope first:
/design-review, package path, or --focus)Scan structure: Use Glob (**/*.go) to map the package layout.
Use Shell with go list ./... to enumerate packages and wc -l for line counts.
Automated checks: Run in parallel:
go vet ./... — catch common mistakesgolangci-lint run ./... (if available) — extended lint checks//nolint directives and their justificationsNaming audit: Use Grep to sample each package:
Id[^s] instead of ID, Url[^s] instead of URLRead to check receiver name consistency per typeInterface audit: Use Grep for type \w+ interface to find all interface definitions:
Error handling audit: Sample error paths:
Grep for unchecked errors: _, _ = or bare function calls%w vs %v vs %sConsistency audit: Compare patterns across packages:
Grep for func New across all packages and compare signaturesCross-reference: Use tooling for efficiency:
Grep for unexported function definitions, then Grep for call sites within the packageValidate report before output: Self-check the report against these gates:
file:line reference, or an explicit "no issues found" noteN/A
If any gate fails, fix the report before presenting it.*.go files in requested scopevendor/, testdata/, generated files (// Code generated), and protobuf outputs (for example *.pb.go) unless explicitly requested--include-tests to include test style and coverage patterns in scoring--include-generated to include generated code in analysisinternal/tui), score only that scope and state this clearlyIn addition to general Go review, check:
model.LLM, tool.Tool, session.Service — no custom abstractions wrapping ADKinternal/provider/ implement the same interface consistentlytool.NewFunctionTool, registered in tools.CoreTools()session.Serviceinternal/agent/retry.go patternscharm.land/bubbletea/v2, not the old github.com/charmbracelet/bubbletea pathinit() functions: prefer explicit initializationUse these weights for overall score:
Calibration:
| Score | Meaning |
|---|---|
| 9-10 | Stdlib/kubernetes quality — exemplary, publishable as reference |
| 7-8 | Production quality — minor issues, follows idioms well |
| 5-6 | Functional — noticeable gaps, inconsistencies, or missing patterns |
| 3-4 | Below standard — systematic issues, needs refactoring |
| 1-2 | Problematic — fundamental design issues |
Rules:
1-10 using the calibration table aboveN/A when a dimension does not apply to the reviewed scopePresent results as a scorecard table, then detailed findings per dimension.
## Scorecard
| Dimension | Score | Notes |
|---------------------|-------|---------------------------------|
| Naming Conventions | X/10 | brief note |
| Package Design | X/10 | brief note |
| Interface Design | X/10 | brief note |
| Error Handling | X/10 | brief note |
| Concurrency | X/10 | brief note |
| API Consistency | X/10 | brief note |
| Code Organization | X/10 | brief note |
| Documentation | X/10 | brief note |
|---------------------|-------|---------------------------------|
| **Overall** | X/10 | weighted average (1 decimal) |
## Key Strengths
1. **[Title]** — why it's good + `file:line` reference
2. ...
(minimum 2 strengths required)
## Top 5 Actionable Improvements
1. **[Title]** (impact: high/medium/low, effort: high/medium/low)
- Confidence: high/medium/low
- What: one-sentence description of the problem
- Where: `file:line` references (every affected location)
- Why: what breaks, degrades, or confuses without the fix
- How: concrete fix — include before/after code snippet
```go
// before
func GetUserId() string { ... }
// after
func GetUserID() string { ... }
... (repeat for each — every item MUST have a before/after snippet or exact command)
Issues (each must have evidence):
| # | Location | Issue | Suggested fix |
|---|---|---|---|
| 1 | file.go:42 | userId should be userID | Rename to userID |
| ... | ... | ... | ... |
What's working well: brief note on what this dimension does right.
... (repeat per dimension — every scored dimension MUST have the issues table)
## Guidelines
- DO NOT make changes — this is a read-only audit
- **Evidence is mandatory**: every finding must include a `file:line` reference. For systemic issues, provide at least one concrete example plus a count ("12 occurrences across 4 packages")
- **Fixes must be concrete**: "improve naming" is not a fix; `rename userId to userID in store.go:42` is
- **Before/after required**: every Top 5 improvement must include a code snippet showing the current state and the proposed fix
- Be fair: note strengths as well as weaknesses in every dimension
- Prioritize by impact: focus on issues that affect maintainability
- Prioritize repository conventions and Effective Go first; use stdlib/well-known projects as secondary tie-breakers
- Score honestly — use the calibration table; 7/10 is good, 10/10 means stdlib-quality
- **No empty dimensions**: if a dimension is scored, it must have the issues table populated. If no issues are found, state "no issues found" explicitly and justify the score
- **Report is incomplete if**: any scored dimension lacks evidence, any Top 5 item lacks a before/after snippet, or the weighted average doesn't match the computed overall score
## Parallel Execution Strategy
For codebases with 5+ packages, split work across subagents:
1. **Main agent**: scan structure (step 2), run automated checks (step 3), produce final report
2. **Subagent per package group**: steps 4-7 (naming, interface, error, consistency audits)
- Group small packages together (< 3 files each)
- Each subagent returns dimension scores + findings for its packages
3. **Main agent**: merge subagent findings, resolve cross-package issues (step 8), compute final scores
## Examples
- `/design-review` — Full design review of entire codebase
- `/design-review internal/tui` — Review only the TUI package
- `/design-review --focus naming` — Review only naming conventions