agent/pkg/lib/task/code/simplifier/patterns.md
Snider 21f234aa7c refactor: flatten go/ subdir, migrate to dappco.re/go/agent, restore process service
- Module path: dappco.re/go/agent
- Core import: dappco.re/go/core v0.4.7
- Process service re-enabled with new Core API
- Plugin bumped to v0.11.0
- Directory flattened from go/ to root

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 11:10:44 +00:00

568 B

Simplification Patterns

Consolidate

  • Three similar blocks → extract helper function
  • Duplicate error handling → shared handler
  • Repeated string → constant

Flatten

  • Nested if/else → early return
  • Deep indentation → guard clauses
  • Long switch → map lookup

Remove

  • Unused variables, imports, functions
  • Wrapper functions that just delegate
  • Dead branches (always true/false conditions)
  • Comments that restate the code

Tighten

  • Long function (>50 lines) → split
  • God struct → focused types
  • Mixed concerns → separate files