forge-quench

Simplify complex Go functions while preserving behavior using static analysis tools.

5|2|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/srnichols/plan-forge --skill forge-quench
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: forge-quench
Source: https://github.com/srnichols/plan-forge/tree/main/presets/go/.github/skills/forge-quench
Command: npx skills add https://github.com/srnichols/plan-forge --skill forge-quench

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gocyclo, gocognit, golangci-lint, and includes scripts (resource) and references (resource) components.

What problem does it solve?

The forge-quench Skill unit addresses the issue of complex Go code that is difficult to maintain, providing a systematic approach to reduce complexity without altering behavior.

Core Features & Use Cases

  • Complexity Measurement: Identifies complex functions using static analysis tools.
  • Understanding and Documentation: Ensures the reasoning behind complexity is documented.
  • Simplification Proposals: Proposes changes to simplify the code while preserving behavior.
  • Safety Rules and Reporting: Enforces safety rules and provides a comprehensive report on the process.

Quick Start

Run the forge-quench Skill on your Go code to simplify its complexity and improve maintainability.

Frequently Asked Questions about forge-quench

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

FAQPage Schema
How do I reduce Go code complexity without changing program behavior?

You can reduce Go code complexity without changing behavior by using static analysis tools like gocyclo and gocognit to identify complex functions, then proposing structural simplifications that preserve the exact logic and outputs.

What is the best way to measure and simplify Go code maintainability?

Measuring and simplifying Go code maintainability involves running static analysis to detect high cognitive complexity, documenting the reasoning behind complex logic, and proposing safe changes to streamline the code while enforcing safety rules.

Do I need golangci-lint to automate Go code simplification?

Yes, you need golangci-lint along with gocyclo and gocognit to automate Go code simplification, as these dependencies provide the required static analysis to identify complex functions and ensure proposed changes preserve behavior.

How does static analysis identify which Go functions need simplification?

Static analysis identifies Go functions needing simplification by measuring cyclomatic and cognitive complexity metrics using tools like gocyclo and gocognit, then generating a comprehensive report flagging functions that exceed maintainability thresholds.

Can I safely refactor complex Go code without altering its outputs?

You can safely refactor complex Go code without altering outputs by enforcing safety rules during the simplification process, which ensures that all proposed changes to reduce complexity preserve the exact behavior of the original functions.

When should I not use automated complexity reduction on my Go codebase?

You should not use automated complexity reduction when your Go codebase lacks comprehensive tests, because the process relies on static analysis and safety rules to propose changes that preserve behavior without runtime verification.