Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: optimize ce:compound speed and effectiveness#370

Merged
tmchow merged 4 commits into
mainfrom
feat/optimize-compound-agents
Mar 25, 2026
Merged

feat: optimize ce:compound speed and effectiveness#370
tmchow merged 4 commits into
mainfrom
feat/optimize-compound-agents

Conversation

@tmchow
Copy link
Copy Markdown
Collaborator

@tmchow tmchow commented Mar 25, 2026

Summary

This improves ce:compound so it runs more quickly and is more accurate to boot.

  • Merge Category Classifier into Context Analyzer -- inline schema enums and category mapping table so the agent validates against exact values instead of guessing
  • Merge Prevention Strategist into Solution Extractor -- prevention strategies, best practices, and test cases are now part of the solution extraction with explicit instruction to include code examples
  • Optimize Related Docs Finder with grep-first filtering strategy (pre-filter before reading files) and gh CLI preference for GitHub issue search with MCP/skip fallback. This mimics what we did for learnings-analyst.
  • Reduce Phase 1 from 5 parallel subagents to 3, cutting orchestration overhead

Benchmark Results

Tested across 3 scenarios: N+1 query fix, Stimulus/Turbo race condition, and Stripe integration issue. Each scenario was run with both the old (5-subagent) and new (3-subagent) skill versions.

Speed

Test Case NEW (3 agents) OLD (5 agents) Delta
N+1 Query 68.0s 161.6s 58% faster
Stimulus Race 139.9s 196.4s 29% faster
Average 100.1s 148.6s 33% faster

Token Usage

Test Case NEW OLD Delta
N+1 Query 25,680 28,317 9% fewer
Stimulus Race 33,444 29,711 12% more
Average 29,562 29,014 ~equal

Schema Compliance (the big win)

Metric NEW OLD
problem_type uses valid enum 3/3 1/3
component uses valid enum 3/3 0/3

The old version invented values like race_condition, billing, and app/javascript/controllers/dashboard_controller.js instead of using schema enums. The new version uses correct values every time because the enums are inline in the Context Analyzer instructions.

Quality Scores (9 assertions per output)

Test Case NEW OLD
N+1 Query 8/9 9/9
Stimulus Race 8/9 8/9

Quality is equivalent. The NEW version's 8/9 on N+1 was a missing category: frontmatter field -- fixed in this PR by explicitly requiring it in the Context Analyzer return spec.

Other

Snuck in a quick fix for learnings-reseacher to be tool agnostic so it works cross agent.

Test plan

  • Run /ce:compound after solving a problem and verify 3 subagents are spawned (not 5)
  • Verify output doc has category: field in YAML frontmatter
  • Verify problem_type and component use valid schema enum values
  • Verify prevention section includes code examples where applicable
  • Run /ce:compound --compact and verify compact mode still works (unchanged)

… compliance

Merge Category Classifier into Context Analyzer (inline schema enums and
category mapping), merge Prevention Strategist into Solution Extractor,
and add grep-first filtering to Related Docs Finder. Also add gh CLI
preference for GitHub issue search with MCP fallback.

Benchmarked across 3 test scenarios (N+1 query, Stimulus race condition,
Stripe integration). Results show 33% faster average duration and 100%
schema enum compliance vs 33% with the old 5-subagent version, with
equivalent quality scores (8.3/9 both versions).
@tmchow tmchow changed the title feat: optimize ce:compound from 5 subagents to 3 feat: optimize ce:compound speed and effectiveness Mar 25, 2026
Copy link
Copy Markdown

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

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: a032ea917c

ℹ️ 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 plugins/compound-engineering/skills/ce-compound/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/ce-compound/SKILL.md Outdated
tmchow added 2 commits March 24, 2026 19:54
Address PR review feedback:
- Replace Claude-specific `Grep` tool name with capability-based
  description ("native content-search tool") per AGENTS.md convention
- Change `[keyword]` regex placeholders to `<keyword>` angle-bracket
  templates to avoid regex character class interpretation
Same fix as ce:compound SKILL.md -- replace Claude-specific Grep tool
name with capability-based "native content-search tool" descriptions
per AGENTS.md convention.
Copy link
Copy Markdown

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

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: 7dabcdc883

ℹ️ 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 plugins/compound-engineering/skills/ce-compound/SKILL.md Outdated
gh issue list defaults to open issues only, missing relevant closed
issues when documenting solved problems. Add --state all to include
closed issues in related-issue discovery.
@tmchow tmchow merged commit 4e3af07 into main Mar 25, 2026
2 checks passed
This was referenced Mar 25, 2026
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