Skip to content

🤖 refactor: add simplify workflow#3563

Open
ThomasK33 wants to merge 20 commits into
mainfrom
simplify-skill-aca4
Open

🤖 refactor: add simplify workflow#3563
ThomasK33 wants to merge 20 commits into
mainfrom
simplify-skill-aca4

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Adds a tracked simplify workflow that reviews current changes for code reuse, quality, and efficiency, synthesizes actionable findings, and applies minimal fixes through a committed child-workspace patch when the reviewed content is available in child workspaces.

Background

This ports the ad-hoc global simplify skill into a durable Mux workflow so the review lanes run in parallel with structured outputs, bounded prompt context, resumable workflow steps, and native patch application.

Implementation

  • Captures git status, changed files, diff stats, and bounded diff text through built-in git workflow actions.
  • Runs reuse, quality, and efficiency review lanes in parallel with strict JSON schemas.
  • Uses compact handoff payloads so synthesis and fix phases avoid raw diff/token bloat.
  • Short-circuits clean/no-op scopes and skips expensive diff reads when changedFiles proves there are no diffable hunks.
  • Skips review with clear guidance for untracked-only current-change scopes, and for explicit targets that are themselves untracked, contain untracked files, or target the repo root with untracked files, because workflow child workspaces cannot read parent-only untracked contents.
  • Allows explicit target reviews when untracked scratch files are unrelated to the target, even alongside reviewable branch diffs.
  • Tells reviewers that untracked metadata paths are names only when branch/staged/unstaged diffs are still reviewable.
  • Skips auto-fix with clear guidance when uncommitted changes are present, because workflow child workspaces do not inherit parent dirty files.
  • Forces unresolved/non-current symbolic --head ranges into review-only/no-apply behavior so patches are never applied to the wrong checkout; resolved raw commit SHAs are allowed by SHA equality.
  • Refreshes Git status with cache: false immediately before patch application, rejects dirty/changed checkouts, and passes the reviewed expectedHeadSha to avoid stale patch application.
  • Keeps workflow helpers self-contained for the workflow runtime and logs partial git-context failures.

Validation

  • make static-check
  • node --check .mux/workflows/simplify.js
  • bunx prettier --check .mux/workflows/simplify.js
  • git diff --check
  • Targeted Bun harness verifying untracked-only current changes skip review agents, untracked explicit targets/directories/root targets skip review agents even when other diffs exist, explicit target reviews still run with unrelated untracked files, branch diffs with unrelated untracked files still run review-only, other uncommitted changes skip fixer/applyPatch, non-current symbolic --head skips fixer/applyPatch even at the same SHA, unresolved hex-looking --head skips fixer/applyPatch, clean branch changes refresh status with cache: false and call applyPatch with reviewed expectedHeadSha, dirty drift skips patch application, and changed HEAD skips patch application.
  • /simplify dogfood run; workflow patch application succeeded before the final dirty-worktree auto-fix guard was added.
  • /workflow simplify --review-only --base HEAD --head HEAD no-op dogfood; returned No reviewable changes found and exercised the diff-skip path.

Risks

Low to medium. This is a new workflow file and does not alter existing app runtime paths, but it exercises workflow orchestration, agent handoffs, and patch-application behavior. Review/fix now intentionally applies only when the relevant content is present in child workspaces and the parent checkout is clean/matches the reviewed head; dirty worktrees still receive explicit guidance to add/commit/stash before rerunning.


Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: 3032979{MUX_COSTS_USD:-unknown}

Move the simplify workflow into the tracked project workflow directory so child workspaces can inspect it.

Refactor the workflow to keep agent structured-output schemas as constants before the workflow entrypoint, and simplify the orchestration code around lane prompts, synthesis, fixing, and argument parsing.

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `3422439{MUX_COSTS_USD:-unknown}`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=11.77 -->
Implement the self-review findings for the tracked simplify workflow:

- cap raw diff text before fanning out review agents
- pass compact diff metadata, not raw diffs, to synthesis/fix phases
- render malformed workflow arguments as validation/usage output instead of assertion crashes

No custom workflow actions are introduced.

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `3484700{MUX_COSTS_USD:-unknown}`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=15.49 -->
Apply the latest simplify workflow dogfood findings:

- reuse the base resolved by changedFiles for diffStat/diff calls
- avoid an adapter allocation when summarizing workflow diff compactions

Validation:
- workflow_read simplify
- workflow_run simplify --help
- workflow_run simplify --base
- bunx prettier --check .mux/workflows/simplify.js
- make static-check

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `72154{MUX_COSTS_USD:-unknown}`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=15.49 -->
Apply the final dogfood findings for the simplify workflow:

- return early when there are no reviewable changes
- bound compact git metadata in prompts and outputs
- compose finding schemas from shared core fields
- use object spread for git context variants

Validation:
- workflow_read simplify
- workflow_run simplify --help
- workflow_run simplify --base
- bunx prettier --check .mux/workflows/simplify.js
- make static-check

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `149245{MUX_COSTS_USD:-unknown}`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=15.49 -->
Address simplify workflow review cleanup:

- turn the read-only prompt and no-op synthesis into constants
- inline one-off context/diff helper wrappers
- reuse optional chaining and existing tiny predicates where it shortens code
- hoist the value-flag table out of parseValueFlag

Validation:
- workflow_read simplify
- workflow_run simplify --help
- workflow_run simplify --base
- bunx prettier --check .mux/workflows/simplify.js
- make static-check

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `423759{MUX_COSTS_USD:-unknown}`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=27.02 -->
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24b106a618

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the dirty-worktree patch application fix.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d47ab0f38d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the staged-index auto-fix guard.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb89614f11

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the fresh pre-apply Git status and expectedHeadSha guard.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec1b61c2d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the non-current --head auto-fix guard.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c4ec02d18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the symbolic --head guard.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbce6b11f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the unresolved --head guard.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99f12ee063

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js
Comment thread .mux/workflows/simplify.js
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the dirty-worktree auto-fix guard and force removal.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b04963da7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after the untracked-file review guard.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e358c93d89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after scoping the untracked-file guard to untracked-only reviews.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e8e9b69d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after allowing explicit-target reviews with unrelated untracked files.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e48a26b656

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after keeping explicit untracked targets on the skip path.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b0bd836c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after guarding mixed untracked explicit targets.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4a1bb4620

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .mux/workflows/simplify.js
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look after treating root targets as containing untracked files.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant