Skip to content

refactor(claude): fix impossible subagent steps and drop over-prescribed workflows - #353

Merged
evansenter merged 2 commits into
mainfrom
chore/agents-commands-cleanup
Oct 17, 2026
Merged

evansenter merged 2 commits into
mainfrom
chore/agents-commands-cleanup

Conversation

@evansenter

Copy link
Copy Markdown
Owner

This is the second PR updating the setup for the Opus 5.5 generation. It covers agents and commands.

Steps that could never run

Claude Code removes AskUserQuestion from every subagent (per the sub-agents docs), so these agent steps were dead:

File Problem Fix
rfc-create, rfc-respond Built around interactive questions Moved to commands (/rfc-create, /rfc-respond) so they run in the main session
audit-workflows Asked the user and applied edits from inside a throwaway worktree Returns findings with proposed fixes; the caller resolves them
improve-workflow, summarize-work Asked the user whether to implement or post Return the fix or exact command; the caller asks
audit-issues, audit-docs "After approval: apply…" Return the plan; the caller applies it

audit-workflows also globbed skills/*.md, which can't match because skills are directories. It still called the Agent tool "Task". It now also checks other files for impossible subagent steps.

Instructions written for older models

  • /work guided development launched 2–3 code-explorer and then 2–3 code-architect agents by default. That contradicts CLAUDE.md's delegation rule. It also chained the superpowers brainstorming and writing-plans skills and used "CRITICAL" pressure language. It now explores directly (one Explore agent only for wide searches), clarifies with the user, and presents 2–3 design options when there's a real choice.
  • Mandated verification passes (the superpowers:verification-before-completion calls in pr-create and audit-codebase) are removed. The global CLAUDE.md already says these cause over-verification.
  • Generic checklists of code smells, test qualities, and triage categories (the model already knows these) are replaced with the project-specific checks worth a deliberate look: design currency in issues, tests that can't fail, and the Evergreen lens. The "read the code before reporting" evidence rule stays.
  • audit-docs: removed the "Target 50%+ compression" goal. A specific outdated or contradictory instruction is the defect, not length.
  • improve-workflow: the two duplicated memory-writing blocks are merged into one, using the current metadata: frontmatter.

Plugin dependencies

Commands and agents no longer require superpowers, feature-dev, commit-commands, pr-review-toolkit, or claude-md-management:

Before After
commit-commands:commit-push-pr Explicit git/gh steps
clean_gone A for-each-ref one-liner
pr-review-toolkit fallback reviewer A general-purpose agent
receiving-code-review The rule it enforced, stated inline

The next PR disables the plugins themselves.

Docs and stale references

  • README: adds /rfc-create, /rfc-respond, and /schedule-audits (it was missing). Replaces the nonexistent /improve-workflow example.
  • docs/work-review-cycle.md: matches the new /work flow.
  • pr-create: removed the citation of a memory file that no longer exists.
  • statusline-command.sh: updated the header example model ID (suggestion from chore: update model references for Claude Opus 5.5 #351's review).

make check passes. The rewritten agents keep their frontmatter (model, memory: user, isolation: worktree), their output contracts, and their event-bus broadcasts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LBftoc1JCMLow9LDFZMADs

…bed workflows

Subagents can't call AskUserQuestion (Claude Code removes it from every
subagent), so several agents had steps that could never run:
- rfc-create / rfc-respond were built around interactive questions; move
  them to commands so they run in the main session.
- audit-workflows, improve-workflow, summarize-work, audit-issues and
  audit-docs asked the user or "applied after approval"; they now return
  findings and leave decisions to the caller. audit-workflows also
  globbed skills/*.md (skills are directories) and now checks for
  impossible subagent steps.

Trim instructions written for older models:
- /work no longer launches 2-3 explorer plus 2-3 architect agents by
  default (contradicting CLAUDE.md's delegation rule) or chains the
  brainstorming / writing-plans skills; it explores, clarifies with the
  user, and presents design options directly.
- Remove mandated verification-skill passes (pr-create, audit-codebase)
  and CRITICAL pressure language.
- Replace generic code-smell / test / triage checklists the model already
  knows with the project-specific checks worth a deliberate look.
- audit-docs: drop the "50%+ compression" target; length isn't the defect.
- improve-workflow: one memory format, matching the current frontmatter.

Drop plugin dependencies (superpowers, feature-dev, commit-commands,
pr-review-toolkit, claude-md-management) from commands and agents,
replacing them with built-ins or explicit git/gh steps. Fix a stale
memory-file citation in pr-create, "via Task" references, and the
README's nonexistent /improve-workflow example.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBftoc1JCMLow9LDFZMADs
### 4. Post Summary

If approved, use `gh pr comment` with "## Work Summary" header as marker for future staleness detection. Pass the body via `--body-file -` and a single-quoted heredoc — a bare `--body "..."` lets the shell evaluate `[[`, `==`, and parens in the markdown.
When posting is recommended, end with the exact command for the caller: `gh pr comment <N> --body-file -` fed by a single-quoted heredoc whose body starts with the `## Work Summary` marker (a bare `--body "..."` lets the shell evaluate `[[`, `==`, and parens in the markdown).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Suggestion] The agent now returns a recommendation plus the exact gh pr comment command, but the caller in commands/work.md (Confirm merge, ~L211-216) only says to highlight key files and the PR URL. Nothing tells it to ask about posting when posting is recommended. Consider adding a line there, e.g. "If summarize-work recommends posting, offer Post summary alongside Merge now / Wait." Without it, the ## Work Summary freshness check runs but its result is quietly dropped.

---

You are a workflow analyst. Investigate session-analytics data to surface actionable DX improvements.
You are a workflow analyst. Investigate session-analytics data and return actionable developer-experience improvements to the caller, who decides with the user what to implement.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Suggestion] Same handoff gap: commands/work.md:247-249 spawns this agent but does not say to present its (up to 3) findings to the user via AskUserQuestion (Implement / Skip / Defer). That was the old Phase 5, which could never run inside the subagent. A one-line caller instruction would finish the move.

claude[bot]
claude Bot previously approved these changes Oct 17, 2026

@claude claude 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.

Prompt: evansenter/dotfiles/.../claude-review.md

Code Review — Round 1

Summary
This PR moves the interactive RFC flows from agents to commands, removes subagent steps that could never run (AskUserQuestion, edits that stay in a worktree), drops dependencies on the plugins, and cuts generic checklists. I found no stale references to the removed rfc-* agents or plugin skills in commands, agents, skills, or hooks. The .claude/agents directory is symlinked as a whole, so deleting the two agent files leaves no dangling per-file links. The for-each-ref / awk [gone] one-liner correctly lists branches whose upstream is gone. The PR changes no hooks or guards, so it needs no live validation.

Suggestions (non-blocking)

  • The summarize-work and improve-workflow agents now hand the decision back to the caller, but /work does not yet tell the caller to act on what they return. See the inline comments. This is not a regression: the old in-agent prompts could never fire.
  • docs/work-review-cycle.md:158 still lists the plugins (superpowers, feature-dev, etc.) in the config table. This is fine until the follow-up PR disables them.

Verdict
APPROVE - No blocking findings.


Automated review by Claude Code

Both agents now hand decisions back to the caller; tell /work to offer
posting the summary and to present improve-workflow's findings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBftoc1JCMLow9LDFZMADs
@evansenter

Copy link
Copy Markdown
Owner Author

Feedback Addressed

Implemented

  • [Suggestion] summarize-work handoff: /work's merge confirmation now adds a "Post summary to PR" option when summarize-work recommends posting.
  • [Suggestion] improve-workflow handoff: /work's reflect step now presents its findings via AskUserQuestion (Implement / Skip / Defer) and acts on the answers.

Deferred

  • [Suggestion] docs/work-review-cycle.md plugin table: handled in the follow-up PR that disables the plugins.

When showing the output from summarize-work, always highlight the key files to look at, and the PR URL. Include any other relevant data as well.

**Always** ask user via AskUserQuestion (Merge now / Wait). Never auto-merge. After merge:
**Always** ask user via AskUserQuestion (Merge now / Wait), adding a "Post summary to PR" option when summarize-work recommends posting (it returns the exact command). Never auto-merge. After merge:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Suggestion] "Post summary to PR" is added as a third option next to Merge now / Wait. In a single-select AskUserQuestion, choosing it means not choosing Merge in that same answer, and nothing says to ask the merge question again after posting. Consider posting first and then asking Merge / Wait again, or making it a separate question in the same AskUserQuestion call (it accepts up to 4) so the user can choose both.


`Agent(subagent_type="improve-workflow", prompt="Analyze this session for workflow improvements")`

Present its findings (at most 3) via AskUserQuestion — Implement / Skip / Defer (a GitHub issue labeled `improvement`) — and act on the answers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Suggestion] The old improve-workflow Defer step warned that a bare --title "DX: [finding]" gets shell-evaluated and said to pass the body via --body-file - plus a heredoc. That warning was removed when the step moved here. The other new instructions in this PR (rfc-create, rfc-respond, summarize-work) keep the heredoc note, so it may be worth keeping it for this gh issue create too.

@claude claude 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.

Prompt: evansenter/dotfiles/.../claude-review.md

Code Review — Round 2

Summary
The follow-up commit adds the two handoffs from round 1: /work now offers to post summarize-work output and presents improve-workflow findings for a decision. I re-checked the tree. No stale references to the removed rfc-* agents or to the dropped plugin skills remain in commands, agents, skills, hooks, the Makefile, or CI. The only remaining plugin mentions are the settings.json enablement and the docs table, both deferred to the next PR as agreed. The PR changes no hooks or guards. I left two small non-blocking suggestions inline on the new /work lines.

Previously Addressed (Filtered)

  • summarize-work handoff (Implemented)
  • improve-workflow handoff (Implemented)
  • docs/work-review-cycle.md plugin table (Deferred to follow-up PR)

Verdict
APPROVE - No blocking findings.


Automated review by Claude Code

@evansenter
evansenter merged commit 2ef6412 into main Oct 17, 2026
10 checks passed
@evansenter
evansenter deleted the chore/agents-commands-cleanup branch October 17, 2026 17:49
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