Skip to content

Code Simplifier improvements #172

Closed

Description

@strawgate

See elastic/beats#48971

Small changes like this are not particularly useful. Lets focus on changes that either bring a block of code into the style of the codebase (remove an outlier), that utilize a helper function/etc instead of rewriting logic, or that greatly improve clarity or improve DRY.

Let's avoid tiny changes that take longer to review than they provide benefit

Activity

  1. github-actions commented on Feb 19, 2026

    @github-actions
    Contributor

    TL;DR: I recommend tightening the Code Simplifier prompt with a materiality gate (prefer outliers/helper reuse/DRY wins; skip tiny cosmetic edits), because the current prompt still explicitly biases toward very small changes.

    Recommendation

    Update the Code Simplifier workflow prompt to require “meaningful simplifications” and explicitly noop micro-edits, then recompile lockfiles.

    Findings
    • Issue Code Simplifier improvements #172 asks to avoid tiny changes and prioritize outlier cleanup, helper reuse, and DRY improvements (same direction as your note on elastic/beats#48971).
    • Current constraints still emphasize minimal scope:
      • .github/workflows/gh-aw-code-simplifier.md:83 — “Keep changes small and localized (prefer 1-2 files and minimal line churn).”
      • .github/workflows/gh-aw-code-simplifier.md:100 — “Pick one small area…”
    • Current prompt does not explicitly require a minimum usefulness bar (for example, “don’t open PRs for single-condition/one-liner cleanup unless part of a broader simplification”).
    • The workflow already imports rigor guidance (.github/workflows/gh-aw-fragments/rigor.md:3-10), but this issue indicates that generic rigor text is not specific enough for Code Simplifier decisions.
    • Related history:
    Verification

    I ran workflow linting to confirm current config health before recommending prompt edits:

    $ make lint-workflows
    Setting up actionlint...
    Downloading actionlint v1.7.10...
    ✓ actionlint installed to bin/actionlint
    Validating GitHub Actions workflow files...
    ... (workflow checks) ...
    (exited with exit code 0)

    I also inspected the current simplifier prompt and docs directly:

    • .github/workflows/gh-aw-code-simplifier.md
    • gh-agent-workflows/code-simplifier/README.md
    Detailed Action Plan
    1. Add a materiality gate in constraints in .github/workflows/gh-aw-code-simplifier.md near current constraints (~79-87):
      • Keep behavior-preserving requirement.
      • Add explicit “do not open PR for tiny or purely cosmetic simplifications.”
      • Add positive criteria matching this issue: prioritize outlier alignment, helper/shared utility reuse, and meaningful DRY reductions.
    2. Update target selection guidance near Step 2 (~98-101):
      • Replace “Pick one small area” with “Pick one meaningful area with clear reviewer value.”
      • Require the change to reduce either duplication, branching complexity, or custom logic surface area in a visible way.
    3. Strengthen quality gate near Step 4 (~108-117):
      • Add a check like: “Would this still be worth a PR if reviewed in isolation?” If not, call noop.
      • Keep the existing “reviewer would approve quickly” check, but tie it to impact not just safety.
    4. Regenerate compiled workflow artifacts:
      • Run make compile (per gh-agent-workflows/DEVELOPING.md:125-128).
      • Commit updated source + lockfile (.github/workflows/gh-aw-code-simplifier.lock.yml).
    5. Optional docs alignment:
      • If desired, slightly adjust gh-agent-workflows/code-simplifier/README.md:3 to mention “meaningful simplifications” so behavior is explicit to consumers.
    Related Items
    Type Link / File Relevance
    Issue #172 Current request to avoid low-value tiny simplifications
    External PR elastic/beats#48971 Example motivating this improvement
    Issue #75 Original Code Simplifier workflow request
    PR #81 Added Code Simplifier workflow
    Issue #135 Added required repo-command guidance already present in prompt
    File .github/workflows/gh-aw-code-simplifier.md:83,87,100,105-106 Current prompt language and constraints to refine
    File .github/workflows/gh-aw-fragments/rigor.md:3-10 Existing generic rigor guidance
    File gh-agent-workflows/DEVELOPING.md:125-128 Compile/regenerate workflow process

    What is this? | From workflow: Issue Triage Agent

    Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. for issue #172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions