ADVISORY validation of code against design principles that linters cannot enforce.
Loaded by go-code-reviewer agent for design analysis guidance. Also invoked by @refactoring (after pattern application).
Can be manually invoked for standalone code review.
Categorizes findings as Design Debt, Readability Debt, or Polish Opportunities. Does NOT block commits.
ADVISORY validation of code against design principles that linters cannot enforce.
Loaded by go-code-reviewer agent for design analysis guidance. Also invoked by @refactoring (after pattern application).
Can be manually invoked for standalone code review.
Categorizes findings as Design Debt, Readability Debt, or Polish Opportunities. Does NOT block commits.
Expert design analysis that detects issues linters can't catch.
Returns detailed report to caller with categorized findings and fix recommendations.
Pure Analysis & Reporting - Generates report, doesn't fix anything or invoke skills.
Reference: See reference.md for complete detection checklist with examples.
Examples: See examples.md for real-world review scenarios.
<quick_start>
Read files under review (all staged or specific files)
Check package sizes — normally surfaced automatically by the plugin's PostToolUse hook (hooks/check-package-sizes.sh). For review-only sessions (no recent edits), count non-test .go files per touched directory: red (≥13) → Design Debt; yellow (8–12) → Polish.
Apply design principles checklist from reference.md (LLM reasoning)
Generate structured report with file:line locations and fix recommendations
Return report to caller (no fixes, no skill invocations)
</quick_start>
<input_output>
Files to review (specific files or all staged changes)
Review mode: full (first run) or incremental (subsequent runs)
Previous findings (optional, for incremental mode)
Context (invoked by refactoring, orchestrator, subagent, or user)
- Structured report with categorized findings
- Each finding: `file:line`, issue, why it matters, fix strategy, effort estimate
- Prioritized by impact and effort
- Format: Parseable for combined analysis (when invoked by orchestrator)
<invocation_modes>
<direct_skill_invocation context="User or Orchestrator">
Full control, can invoke other skills
Can make changes based on findings
Interactive mode with user feedback
</direct_skill_invocation>
<subagent_mode context="Task tool with go-code-reviewer">
Read-only analysis, returns report only
Cannot invoke other skills
Used for parallel execution by orchestrator
Designed for speed and focused analysis
</subagent_mode>
</invocation_modes>
<who_invokes>
go-code-reviewer agent - Loads this skill for design analysis guidance during parallel quality analysis
@refactoring skill - After applying patterns, validates design quality remains high
User - Manual code review before commit
</who_invokes>
<detection_capabilities>
What Reviewer Detects (That Linters Can't):
Primitive obsession (with juiciness scoring)
Unstorified functions (mixed abstraction levels)
Missing domain concepts (implicit types that should be explicit)
Non-self-validating types (defensive code in methods, reliance on upstream validation, re-validation of composed types)
Poor comment quality (explaining what instead of why)
File structure issues (too long, too many types)
Package size zone violations: surfaced automatically by the plugin's PostToolUse hook after edits. Thresholds: ≥13 non-test .go files at one directory level = red (Design Debt, hard gate); 8–12 = yellow (Polish, review before adding the next file). For review-only sessions where no edit has fired the hook, verify manually before reporting. When a violation is reported, apply the 3-step design review: (1) does the package name reflect a real-world domain concept — not a role or container? (2) are there big structs with disjoint method sets or primitive-obsession fields hiding new types? (3) only after that review, decide whether to extract sub-packages, new leaf types, or both.
Significant: >20 minutes (architectural refactoring, complex type extraction)
file:line Format: Must be exact for orchestrator to correlate with linter errors
Example: pkg/parser.go:45
NOT: parser.go line 45 or pkg/parser.go (line 45)
</structured_output>
</report_format>
This skill MUST NOT:
- Invoke other skills (@refactoring, @code-designing, @testing)
- Fix anything or make code changes
- Make decisions on behalf of user
- Parse AST or calculate complexity metrics (linter does this)
- Run linter (caller does this)
- Iterate or loop (caller decides whether to re-invoke)
- Block commits (findings are advisory)
**Will cause runtime failures or correctness issues**
- Nil dereferences, ignored errors, resource leaks
- Invalid nil returns, race conditions
- Fix immediately before any other work
<design_debt severity="high">
Will cause pain when extending/modifying code
Primitive obsession, missing domain types
Non-self-validating types
Wrong architecture (horizontal vs vertical)
Fix before commit recommended
</design_debt>
<readability_debt severity="medium">
Makes code harder to understand and work with
Mixed abstraction levels, not storified
Functions too long or complex
Poor naming, unclear intent
Fix improves team productivity
</readability_debt>
**Minor improvements for consistency and quality**
- Non-idiomatic naming, missing examples
- Comment improvements, minor refactoring
- Low priority, nice to have
See reference.md for detailed principles and examples for each category.
</finding_categories>