impl-generator

Generate skeleton implementations for missing Go interface methods.

85|13|Updated Jul 14, 2022
One-click install
npx skills add https://github.com/HyperDbg/gui --skill impl-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: impl-generator
Source: https://github.com/HyperDbg/gui/tree/main/.trae/skills/impl-generator
Command: npx skills add https://github.com/HyperDbg/gui --skill impl-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates missing interface method implementations for Go structs, automatically detecting and resolving signature mismatches to speed up development.

Core Features & Use Cases

  • Identify which interface methods are missing on a struct and generate skeleton implementations.
  • Detect method signature mismatches and provide TODO notes for correction.
  • Preserve existing code while ordering methods to match the interface definition.

Quick Start

Run the generator with the target Go source file, the struct name, and the interface name to produce stub methods.

Frequently Asked Questions about impl-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I auto-implement missing interface methods for a Go struct?

To auto-implement missing interface methods for a Go struct, parse the source file and compare the struct's method set against the target interface. The generator then scaffolds skeleton implementations for any unimplemented methods.

Can I generate skeleton implementations for Go interfaces without losing existing code?

Yes, you can generate skeleton implementations while preserving existing code. The generator identifies unimplemented methods and inserts TODO stubs, ordering them to match the interface definition without overwriting current implementations.

What is the best way to detect method signature mismatches in Go structs?

The best way to detect method signature mismatches in Go structs is to parse the source code and compare the struct's method signatures against the interface definition. The generator flags mismatches and provides TODO notes for correction.

Does the generator work with complex Go interfaces and concrete types?

Yes, the generator works with complex Go interfaces and concrete types. It applies to Go codebases where interfaces must be implemented by concrete types, automatically aligning method signatures and scaffolding missing methods.

What do I need to provide to generate stub methods for a Go interface?

To generate stub methods for a Go interface, you need to provide the target Go source file, the struct name, and the interface name. The generator parses these inputs to produce the required skeleton implementations.