Hacker News new | ask | show | jobs
by Leynos 255 days ago
It depends what you're fitting to. At the simplest, you can ask for a reduction in cyclomatic/cognitive complexity measured using a linter, extraction of methods (where a paragraph of code serves no purpose other than to populate a variable) or complex conditionals, move from an imperative to a declarative approach, etc. These are all things that can be caught through pattern matching and measured using a linter or code review tool (CodeRabbit, Sourcery or Codescene).

Other things might need to be done in two stages. You might ask the agent to first identify where code violates CQRS, then for each instance, explain the problem, and spawn a sub-agent to address that problem.

Other things the agent might identify this way: multiple implications, use of conflicted APIs, poor separation of concerns at a module or class level.

I don't typically let the agent do any of this end to end, but I would typically manually review findings before spawning subagents with those findings.