feat: team-lead prompt rewrite — system mode with XML behavioral blocks - #616
Conversation
Rewrote team-lead AGENTS.md using prompt-optimizer patterns: - promptMode: append → system (replaces CC default prompt entirely) - XML-tagged blocks: <mission>, <principles>, <tool_usage>, <lifecycle>, <heartbeat>, <commands_reference>, <constraints> - No role prompting — direct mission with motivation - Tool usage instructions included (Bash, Read, Write, Edit, Grep, Glob) - Focused on orchestration, not general assistance
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the team-lead agent prompt to use a system prompt with XML-style behavioral blocks, which is a great improvement for clarity and structure. The changes are well-implemented, and the corresponding test update is correct. I've left a couple of minor suggestions in the prompt files to further improve clarity for the agent and prevent potential misinterpretations.
| 3. **Workers** — `genie ls` + `genie read <worker>` — are they alive, stuck, or waiting? | ||
| 4. **CI/PR** — `gh pr checks <number>` — green? Are there comments to address? | ||
| 5. **Dispatch next** — if a group's dependencies are satisfied and no worker is on it, dispatch. | ||
| 6. **Handle stuck** — worker failed twice? Kill it, re-dispatch once. After 2 total rounds on any item, run `genie team blocked <team>`. |
There was a problem hiding this comment.
The instruction for handling stuck workers is a bit ambiguous. Phrases like "failed twice", "re-dispatch once", and "on any item" could be misinterpreted by the agent. I suggest making the rule more explicit about what constitutes a failure round to ensure predictable behavior.
| 6. **Handle stuck** — worker failed twice? Kill it, re-dispatch once. After 2 total rounds on any item, run `genie team blocked <team>`. | |
| 6. **Handle stuck** — If a worker fails twice on a task, kill it. Re-dispatch the task once. After 2 total dispatch rounds for a task, run `genie team blocked <team>`. |
| genie team blocked <name> — mark team as blocked (kills all members) | ||
| gh pr create --base dev — create PR targeting dev | ||
| gh pr checks <number> — check CI status | ||
| gh api repos/{o}/{r}/pulls/{n}/comments — read PR comments |
There was a problem hiding this comment.
The placeholders {o}, {r}, and {n} in the gh api command are ambiguous and inconsistent with placeholders like <number> used in other commands. This could confuse the agent. Using more descriptive and consistent placeholders like {owner}, {repo}, and <number> would improve clarity.
| gh api repos/{o}/{r}/pulls/{n}/comments — read PR comments | |
| gh api repos/{owner}/{repo}/pulls/<number>/comments — read PR comments |
| 3. **Workers** — `genie ls` + `genie read <worker>` — are they alive, stuck, or waiting? | ||
| 4. **CI/PR** — `gh pr checks <number>` — green? Are there comments to address? | ||
| 5. **Dispatch next** — if a group's dependencies are satisfied and no worker is on it, dispatch. | ||
| 6. **Handle stuck** — worker failed twice? Kill it, re-dispatch once. After 2 total rounds on any item, run `genie team blocked <team>`. |
There was a problem hiding this comment.
The instruction for handling stuck workers is a bit ambiguous. Phrases like "failed twice", "re-dispatch once", and "on any item" could be misinterpreted by the agent. I suggest making the rule more explicit about what constitutes a failure round to ensure predictable behavior.
| 6. **Handle stuck** — worker failed twice? Kill it, re-dispatch once. After 2 total rounds on any item, run `genie team blocked <team>`. | |
| 6. **Handle stuck** — If a worker fails twice on a task, kill it. Re-dispatch the task once. After 2 total dispatch rounds for a task, run `genie team blocked <team>`. |
| genie team blocked <name> — mark team as blocked (kills all members) | ||
| gh pr create --base dev — create PR targeting dev | ||
| gh pr checks <number> — check CI status | ||
| gh api repos/{o}/{r}/pulls/{n}/comments — read PR comments |
There was a problem hiding this comment.
The placeholders {o}, {r}, and {n} in the gh api command are ambiguous and inconsistent with placeholders like <number> used in other commands. This could confuse the agent. Using more descriptive and consistent placeholders like {owner}, {repo}, and <number> would improve clarity.
| gh api repos/{o}/{r}/pulls/{n}/comments — read PR comments | |
| gh api repos/{owner}/{repo}/pulls/<number>/comments — read PR comments |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78579397cf
ℹ️ 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".
| 4. **CI/PR** — `gh pr checks <number>` — green? Are there comments to address? | ||
| 5. **Dispatch next** — if a group's dependencies are satisfied and no worker is on it, dispatch. | ||
| 6. **Handle stuck** — worker failed twice? Kill it, re-dispatch once. After 2 total rounds on any item, run `genie team blocked <team>`. | ||
| 7. **Exit if done** — all groups done + PR created → `genie team done <team>`. |
There was a problem hiding this comment.
Require CI/QA completion before calling team done
The new heartbeat exit condition (all groups done + PR created) lets the loop call genie team done immediately after opening a PR, which terminates the team before Phase 5 can process CI/review feedback and before any Phase 7 QA can run. This regresses the previous behavior (PR merged + QA passed) and can mark wishes complete even when the PR is red or review comments still require fixes.
Useful? React with 👍 / 👎.
Summary
Rewrote team-lead AGENTS.md using prompt-optimizer patterns:
promptMode: append→system— replaces CC's default system prompt entirely. The team-lead no longer thinks of itself as Claude Code or a general assistant.<mission>,<principles>,<tool_usage>,<lifecycle>,<heartbeat>,<commands_reference>,<constraints>Test plan
genie team create --wish <slug>— team-lead stays focused on orchestrationgenie team doneand exits cleanly