Skip to content

feat: team-lead prompt rewrite — system mode with XML behavioral blocks - #616

Merged
namastex888 merged 2 commits into
devfrom
fix/team-lead-prompt-and-hook-stdio
Mar 16, 2026
Merged

namastex888 merged 2 commits into
devfrom
fix/team-lead-prompt-and-hook-stdio

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

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.
  • XML-tagged behavioral blocks — <mission>, <principles>, <tool_usage>, <lifecycle>, <heartbeat>, <commands_reference>, <constraints>
  • No role prompting — direct mission with motivation ("Every action matters because the output ships to a real codebase")
  • Tool usage instructions — Bash, Read, Write, Edit, Grep, Glob documented since CC defaults are gone
  • Focused on orchestration — everything is about dispatching, monitoring, and completing

Test plan

  • 736/736 tests pass (updated promptMode assertion)
  • genie team create --wish <slug> — team-lead stays focused on orchestration
  • Team-lead doesn't try to write code itself
  • Team-lead calls genie team done and exits cleanly

Test User added 2 commits March 16, 2026 16:20
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
@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7a6ec0c5-7a5b-4488-aab0-01764773af82

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/team-lead-prompt-and-hook-stdio
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 team-lead agent's prompt by transitioning to a system prompt mode and organizing its directives into structured XML blocks. This change aims to provide a clearer, more focused, and robust set of instructions for the agent, ensuring it strictly adheres to its role as an orchestrator of tasks rather than a code implementer. The new structure explicitly defines the agent's mission, operational principles, tool usage, lifecycle, and constraints, thereby improving its autonomous execution of wishes from draft to merged pull request.

Highlights

  • Prompt Mode Change: The team-lead agent's promptMode has been switched from append to system, ensuring the new prompt entirely replaces the default system prompt and prevents the agent from acting as a general assistant.
  • XML-Tagged Behavioral Blocks: The agent's instructions are now structured using XML tags such as <mission>, <principles>, <tool_usage>, <lifecycle>, <heartbeat>, <commands_reference>, and <constraints>, enhancing clarity and adherence to specific behaviors.
  • Focused Orchestration: The prompt explicitly removes role prompting and emphasizes the team-lead's core mission of orchestration, delegation, and monitoring, strictly prohibiting it from writing code itself.
  • Detailed Tool Usage: Comprehensive instructions for using tools like Bash, Read, Write, Edit, Grep, Glob, and SendMessage have been added, providing clear guidance for the agent's interactions.
  • Updated Test Assertion: A relevant test case was updated to correctly assert the team-lead role's promptMode as system.
Changelog
  • plugins/genie/agents/team-lead.md
    • Updated promptMode from append to system.
    • Restructured the prompt content into XML-tagged sections: <mission>, <principles>, <tool_usage>, <lifecycle>, <heartbeat>, <commands_reference>, and <constraints>.
    • Revised the agent's mission and principles for clearer guidance.
    • Detailed available tools and their usage.
    • Refined the lifecycle phases and associated genie commands.
    • Added explicit constraints to prevent the agent from writing code or merging to main/master.
  • plugins/genie/agents/team-lead/AGENTS.md
    • Updated promptMode from append to system.
    • Restructured the prompt content into XML-tagged sections: <mission>, <principles>, <tool_usage>, <lifecycle>, <heartbeat>, <commands_reference>, and <constraints>.
    • Revised the agent's mission and principles for clearer guidance.
    • Detailed available tools and their usage.
    • Refined the lifecycle phases and associated genie commands.
    • Added explicit constraints to prevent the agent from writing code or merging to main/master.
  • src/lib/builtin-agents.test.ts
    • Updated the test case to assert that the team-lead role now has system as its promptMode.
Activity
  • Pull request was opened by namastex888 to rewrite the team-lead prompt.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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>`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
gh api repos/{o}/{r}/pulls/{n}/comments — read PR comments
gh api repos/{owner}/{repo}/pulls/<number>/comments — read PR comments

@namastex888
namastex888 merged commit 4d082fc into dev Mar 16, 2026
6 checks passed

@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: 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>`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@namastex888
namastex888 deleted the fix/team-lead-prompt-and-hook-stdio branch March 29, 2026 22:10
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