Conversation
The rule was lost when heal-plugin removed inline patterns. Added it back to the juiciness_test section where extract-type guidance lives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR tightens and documents the Go linter-driven development workflow by making skill invocation explicit, improving linter-to-skill routing guidance, and enabling IDE diagnostics across the workflow.
Changes:
- Permits
mcp__ide__getDiagnosticsacross relevant skills, agents, and commands for consistent diagnostics access. - Adds/standardizes
<skill_invocation>guidance and linter routing tables to ensure skills are invoked programmatically (via the Skill tool). - Strengthens workflow quality gates and refactoring guidance (tests/coverage expectations, god-object thresholds, file-splitting patterns).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| go-linter-driven-development/skills/testing/SKILL.md | Updates auto-invocation phase reference for testing in the workflow. |
| go-linter-driven-development/skills/refactoring/SKILL.md | Adds explicit skill invocation rules, routing tables, and stronger enforcement/verification guidance. |
| go-linter-driven-development/skills/linter-driven-development/SKILL.md | Adds diagnostics tool permission, explicit skill invocation requirements, and expanded routing/quality-gate steps. |
| go-linter-driven-development/skills/code-designing/SKILL.md | Adds diagnostics tool permission and linter-triggered design patterns (options/result/file splitting). |
| go-linter-driven-development/commands/go-ldd-status.md | Allows diagnostics tool for status command context. |
| go-linter-driven-development/commands/go-ldd-review.md | Allows diagnostics tool for final review command context. |
| go-linter-driven-development/commands/go-ldd-quickfix.md | Allows diagnostics tool and clarifies Skill-tool-based invocation guidance. |
| go-linter-driven-development/commands/go-ldd-autopilot.md | Allows diagnostics tool and clarifies Skill-tool-based invocation guidance. |
| go-linter-driven-development/commands/go-ldd-analyze.md | Allows diagnostics tool during analysis runs. |
| go-linter-driven-development/agents/quality-analyzer.md | Allows diagnostics tool and documents linter categorization/routing reference. |
| go-linter-driven-development/agents/go-code-reviewer.md | Allows diagnostics tool and clarifies explicit Skill-tool usage for pre-commit guidance loading. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| <enforcement> | ||
| Before marking refactoring complete: | ||
| 1. List all types created: `grep -r "^type.*struct" internal/` |
There was a problem hiding this comment.
The enforcement command grep -r "^type.*struct" internal/ assumes the project uses an internal/ directory. For Go modules that organize code under pkg/, cmd/, or the module root, this will fail and can incorrectly skip test enforcement. Consider searching from . (or using go list ./... + file scanning) instead of hard-coding internal/.
| 1. List all types created: `grep -r "^type.*struct" internal/` | |
| 1. List all types created: `grep -r "^type.*struct" .` |
| 4. Coverage check: `go test -cover ./...` - leaf types must show 100% | ||
| 5. Scan for nolint in all uncommitted files (staged + unstaged): | ||
| ```bash | ||
| { git diff --name-only; git diff --cached --name-only; } | sort -u | xargs grep "//nolint" 2>/dev/null |
There was a problem hiding this comment.
The xargs grep "//nolint" pipeline can hang or behave unexpectedly when there are no changed files (e.g., xargs may invoke grep with no path args and wait on stdin on some platforms). Add an empty-input guard (or use an xargs form that won’t run when the list is empty) so the verification step is reliable.
| { git diff --name-only; git diff --cached --name-only; } | sort -u | xargs grep "//nolint" 2>/dev/null | |
| changed_files=$({ git diff --name-only; git diff --cached --name-only; } | sort -u) | |
| if [ -n "$changed_files" ]; then | |
| printf '%s\n' "$changed_files" | xargs grep "//nolint" 2>/dev/null | |
| fi |
|
|
||
| **Verification**: After refactoring, scan for nolint in all uncommitted files (staged + unstaged): | ||
| ```bash | ||
| { git diff --name-only; git diff --cached --name-only; } | sort -u | xargs grep "//nolint" 2>/dev/null |
There was a problem hiding this comment.
Same issue as above: this xargs grep "//nolint" verification can run grep with no file args when the file list is empty, which may block waiting on stdin. Add a guard / empty-input-safe approach here as well so the scan is deterministic.
| { git diff --name-only; git diff --cached --name-only; } | sort -u | xargs grep "//nolint" 2>/dev/null | |
| files="$({ git diff --name-only; git diff --cached --name-only; } | sort -u)" | |
| if [ -n "$files" ]; then | |
| printf '%s\n' "$files" | xargs grep "//nolint" 2>/dev/null | |
| fi |
| Verify: `grep -r "TypeName" --include="*.go" . | grep -v "type_file.go"` | ||
| If found elsewhere → move to type's file |
There was a problem hiding this comment.
grep -r "TypeName" --include="*.go" . will match usages of the type (including tests, comments, and other packages), not just declarations that should be co-located. That can produce false positives and suggest moving code that doesn’t belong in the type’s file. Prefer searching specifically for declarations you want to co-locate (e.g., methods/constructors/constants tied to the type) rather than any reference to the identifier.
| Verify: `grep -r "TypeName" --include="*.go" . | grep -v "type_file.go"` | |
| If found elsewhere → move to type's file | |
| Verify by searching for declarations tied to the type, not every usage of its name. | |
| Check for receiver methods (for example, `grep -R -nE '^func \\([^)]+\\*?TypeName\\)' --include="*.go" .`), | |
| constructors like `NewTypeName`, and related `const`/`var` declarations that belong with the type. | |
| If declaration(s) that should be co-located are found elsewhere → move those declarations to the type's file |
- hooks/check-package-sizes.sh: PostToolUse hook flagging Go packages with >=13 non-test .go files (red, exit 2) or 8-12 (yellow, advisory). Portable: only find/wc/tr/sort, guards on go.mod so non-Go projects no-op. - hooks/hooks.json: registers the hook on Write|Edit|MultiEdit. - refactoring skill: new <package_decomposition> section with 3-step design review (domain naming, type scoping, split decision), Store pattern, function stutter, import direction, phased migration. Trimmed duplicate find/wc snippets now that the hook surfaces detection automatically. - pre-commit-review skill: package-size zones now detected via the hook; skill carries the HOW and a manual fallback for review-only sessions. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- <when_to_use>: add PostToolUse hook yellow/red zone as a design-time trigger (intervene before the zone escalates). Cross-refs the full playbook in @Refactoring <package_decomposition>. - <plan_package_structure>: add the naming method (parent names the actor, sub-package names the domain object — worker/ + worker/job/), the "say pkg.Type out loud" test, anti-pattern list (handlers/, types/, common/, domain/, etc.), and the strict-downward import direction rule. - <success_criteria>: add package-name check (domain concept, not role) and import-direction check. No duplication with @Refactoring: code-designing is forward design (avoid creating red-zone packages); refactoring is reactive response (hook fires → decompose). The two link to each other. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This pull request introduces several improvements to the linter-driven Go development workflow, focusing on explicit skill invocation, enhanced linter-to-skill routing, stricter quality gates, and improved documentation for design and refactoring patterns. The changes ensure that skills are invoked programmatically (not just referenced), clarify how linter errors map to remediation steps, and add detailed design guidance for handling common linter failures. Additionally, the
mcp__ide__getDiagnosticstool is now permitted in all relevant agents and commands, enabling better diagnostic integration.Key changes include:
Skill Invocation and Tooling Consistency
mcp__ide__getDiagnosticstool, ensuring consistent access to IDE diagnostics across the workflow. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]<skill_invocation>sections to all major skills, requiring that skills (e.g.,@testing,@refactoring) be invoked via the Skill tool, not just referenced in text. Clear tables show the mapping between notation and tool calls. [1] [2] [3]Linter Error Routing and Design Patterns
argument-limit→ options struct,function-result-limit→ result type,file-length-limit→ file splitting/god object decomposition). [1] [2] [3] [4]Workflow and Quality Gate Enhancements
Documentation and Usability Improvements
These changes collectively make the Go linter-driven workflow more robust, explicit, and maintainable by enforcing best practices and ensuring all automation is performed through well-defined skill invocations.