-
Notifications
You must be signed in to change notification settings - Fork 827
feat: add /lfg-ext — external delegate LFG (Codex/Gemini/OpenCode in parallel worktrees) #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
terry-li-hm
wants to merge
2
commits into
EveryInc:main
Choose a base branch
from
terry-li-hm:feat/lfg-ext
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+110
−5
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this, this is auto managed by release process. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this, this is auto managed by release process. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| --- | ||
| name: lfg-ext | ||
| description: LFG with external delegates (Codex/Gemini CLI) in parallel worktrees — preserves Claude token budget while maintaining parallel execution | ||
| argument-hint: "[feature description]" | ||
| disable-model-invocation: true | ||
| --- | ||
|
|
||
| External-delegate LFG. Uses CE for planning and review; replaces `/ce:work` swarm with external AI tools running in isolated git worktrees. Preserves Claude token budget for planning and review where it adds the most value. | ||
|
|
||
| Run these steps in order. Do not stop between steps — complete every step through to the end. | ||
|
|
||
| ## Phase 1: Plan | ||
|
|
||
| 1. `/ce:plan $ARGUMENTS` | ||
| 2. `/compound-engineering:deepen-plan` | ||
| 3. **Commit the plan** — worktrees only see committed git history, not the working tree. Uncommitted plan files are invisible to delegates. | ||
|
|
||
| ```bash | ||
| git add docs/plans/ && git commit -m "plan: <feature>" | ||
| ``` | ||
|
|
||
| ## Phase 2: Check tools & decompose | ||
|
|
||
| 4. **Check which external tools are available:** | ||
|
|
||
| ```bash | ||
| command -v codex && echo "codex: available" || echo "codex: not installed" | ||
| command -v gemini && echo "gemini: available" || echo "gemini: not installed" | ||
| ``` | ||
|
|
||
| If neither is installed, **stop here and run `/slfg` instead** — there's no point creating worktrees without delegates to fill them. | ||
|
|
||
| 5. Read the generated plan. Identify tasks that target **different files/modules with no shared state**. | ||
|
|
||
| Good signal: tasks write to non-overlapping files. | ||
| Bad signal: tasks share a model, schema, config, or any single file — don't force it, fall back to `/slfg` or sequential `/ce:work`. | ||
|
|
||
| Aim for 2–4 parallel streams. More rarely helps. | ||
|
|
||
| ## Phase 3: External Swarm | ||
|
|
||
| 6. **Create one worktree per task** using the CE worktree manager: | ||
|
|
||
| ```bash | ||
| bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create <task-branch> | ||
| ``` | ||
|
|
||
| The script handles `.env` file copying, `.gitignore` management, and directory setup automatically. | ||
|
|
||
| 7. **Launch all delegates in parallel** — one per worktree, all backgrounded simultaneously. | ||
|
|
||
| Assign tasks to tools by type: | ||
|
|
||
| | Task type | Preferred tool | Command | | ||
| |-----------|----------------|---------| | ||
| | Multi-file, repo navigation, test loops | **Codex** | `cd .worktrees/<branch> && codex exec --full-auto "<prompt>"` | | ||
| | Algorithmic, isolated logic | **Gemini CLI** | `cd .worktrees/<branch> && gemini -p "<prompt>" --yolo` | | ||
|
|
||
| Each delegate prompt must include: | ||
| - Absolute file paths (let the delegate read — don't inline file contents) | ||
| - Constraints: "don't modify X", "keep existing patterns" | ||
| - Verification: "run `npm test` / `bin/rails test` / `pytest` to verify" | ||
| - "Implement fully. No stubs, no TODOs, no simplified versions." | ||
|
|
||
| 8. **Wait for all delegates to complete.** | ||
|
|
||
| ## Phase 4: Merge | ||
|
|
||
| 9. For each worktree — review scope before merging: | ||
|
|
||
| ```bash | ||
| git diff --stat <task-branch> # check for unexpected file changes | ||
| git merge <task-branch> | ||
| bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup | ||
| ``` | ||
|
|
||
| Merge conflicts mean tasks weren't fully independent. Resolve manually, then continue. | ||
|
|
||
| ## Phase 5: Review & Ship | ||
|
|
||
| 10. `/ce:review` | ||
| 11. `/compound-engineering:resolve_todo_parallel` | ||
|
|
||
| > Note: `/lfg-ext` omits `/feature-video` — external delegates don't produce a reviewable PR automatically, so a video walkthrough isn't meaningful until you've raised one manually. | ||
|
|
||
| --- | ||
|
|
||
| ## When to use vs /slfg | ||
|
|
||
| | Signal | Use | | ||
| |--------|-----| | ||
| | Want fully hands-off, token cost not a concern | `/slfg` | | ||
| | Token budget constrained, or tasks decompose cleanly by file | `/lfg-ext` | | ||
| | Tasks share files or state | `/slfg` or sequential `/ce:work` | | ||
| | Want Codex repo navigation or Gemini algorithmic strength | `/lfg-ext` | | ||
| | No external tools installed | `/slfg` | |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this, this is auto managed by release process.