Repository navigation
feat: orchestration rules overhaul + agent folder structure + session fixes - #575
Conversation
Group 1 — Orchestration Rules: - Create plugins/genie/rules/genie-orchestration.md (~15 lines) - Remove hardcoded ORCHESTRATION_PROMPT from smart-install.js - Update install.sh to copy from package file with fallback - Both installers log where the rule was created - Add removal of ~/.claude/rules/genie-orchestration.md to uninstall Group 2 — Agent Consolidation: - Rename implementor → engineer - Merge spec-reviewer + quality-reviewer → reviewer (SHIP/FIX-FIRST) - Merge tests → qa (writes tests + validates on dev) - Delete old agent files - Update builtin-agents.ts, skills, and all references Group 4 — Session Fixes: - getAgentsSystemPrompt() → getAgentsFilePath() (returns path not content) - team-lead-command.ts: accept systemPromptFile, delete PROMPTS_DIR copy - --agent-name uses basename(cwd) instead of hardcoded "team-lead" - launchTmuxSpawn: use send-keys for first agent in team window
…gistry Group 3 of fix-orchestration-rules wish: - Convert every agent .md into folder/<name>/AGENTS.md with symlinks - Create team-lead/ with AGENTS.md + SOUL.md + HEARTBEAT.md - Create pm/ with AGENTS.md + SOUL.md + HEARTBEAT.md - Add SOUL.md for all council members with real-person philosophy - Add @SOUL.md import to council AGENTS.md files - Rewrite builtin-agents.ts: scan plugins/genie/agents/*/ for discovery, parse CC frontmatter, no inline systemPrompt strings - Add resolveBuiltinAgentPath(name) for file-based resolution - Update agents.ts: use agentPath as systemPromptFile, no inline prompts - Update tests for new folder structure and naming (council-- double dash)
|
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 agent orchestration and management within the Genie system. The core changes involve simplifying the agent ecosystem by consolidating roles, introducing a more organized folder structure for agent definitions, and streamlining how orchestration rules and agent prompts are handled during installation and session creation. These updates aim to improve the maintainability, clarity, and flexibility of the agent system, making it easier to define and manage agent behaviors. Highlights
Changelog
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 introduces a significant and valuable refactoring of the agent system. Key changes include consolidating agent roles, moving from hardcoded agent definitions to a more maintainable filesystem-based discovery, and improving session management. The new agent structure with AGENTS.md, SOUL.md, and HEARTBEAT.md files is a great step towards modularity. I've identified a couple of issues: one critical discrepancy where files intended as symlinks are created as plain text files, and a bug in how cd commands are constructed that will fail for paths containing spaces. Overall, this is a strong set of improvements.
I am having trouble creating individual review comments. Click here to see my feedback.
plugins/genie/agents/council--architect.md (1)
This file appears to be intended as a symlink to council--architect/AGENTS.md for backward compatibility, as mentioned in the pull request description ("Symlinks: <name>.md → <name>/AGENTS.md for CC Agent tool"). However, it has been committed as a text file containing the path, not a symbolic link. This could cause issues with tooling that expects a symlink.
This comment applies to all similar new agent files in this pull request (e.g., council.md, docs.md, engineer.md, etc.) which are also text files instead of symlinks.
src/term-commands/agents.ts (513)
The cd command being sent to tmux does not properly quote the ctx.cwd path. This will cause it to fail if the path contains spaces or other special characters. The replace call for single quotes is ineffective here as the path itself is not quoted.
To fix this, you should shell-quote the path. A robust way to do this is to wrap it in double quotes and escape any internal double quotes.
execSync(`tmux send-keys -t '${paneId}' 'cd "${ctx.cwd.replace(/"/g, '\\"')}"' Enter`, { encoding: 'utf-8' });
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6736130133
ℹ️ 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".
| `--agent-id ${shellQuote(`${folderName}@${sanitized}`)}`, | ||
| `--agent-name ${shellQuote(folderName)}`, |
There was a problem hiding this comment.
Keep team-lead identity stable across launcher and team state
buildTeamLeadCommand now derives GENIE_AGENT_NAME/--agent-id from basename(process.cwd()), but the rest of the team/session stack still keys leader state as team-lead (for example, resume lookup in session.ts uses findLastSessionId(..., 'team-lead', ...), and native-team config/inbox code uses team-lead@<team>). In any repo whose folder name is not team-lead, this mismatch breaks leader identity continuity (missed resume and inconsistent native-team leader registration).
Useful? React with 👍 / 👎.
| for candidate in \ | ||
| "$PLUGIN_SYMLINK/rules/genie-orchestration.md" \ | ||
| "$HOME/.claude/plugins/genie/rules/genie-orchestration.md" \ | ||
| "$(npm root -g 2>/dev/null)/@automagik/genie/plugins/genie/rules/genie-orchestration.md" \ | ||
| "$(bun pm -g bin 2>/dev/null)/../lib/node_modules/@automagik/genie/plugins/genie/rules/genie-orchestration.md"; do |
There was a problem hiding this comment.
Load orchestration rules from the resolved package path
This lookup only checks hardcoded candidate paths and does not use the installer’s already-resolved PKG_DIR; in run_install, inject_orchestration_prompt runs before plugin linking, so these candidates can miss the actual install location and trigger the fallback minimal rules file. That silently drops the full orchestration policy during install instead of copying plugins/genie/rules/genie-orchestration.md.
Useful? React with 👍 / 👎.
session.ts hardcoded 'team-lead' as the agent name in ensureNativeTeamForLeader, findLastSessionId calls, and console.log messages. Since team-lead-command.ts derives agent name from basename(cwd), session.ts must match to avoid session resume mismatches and incorrect native team registration. Also simplify install.sh orchestration rules lookup to use the already-resolved PKG_DIR instead of scanning hardcoded candidate paths.
Summary
Major restructure of genie's agent system and orchestration rules. Council-approved simplification from 8+ agents to 4 standard + 4 on-demand.
Changes
Orchestration Rules (Group 1)
plugins/genie/rules/genie-orchestration.md(~15 lines) — just "use genie CLI"Agent Consolidation (Group 2)
implementor→engineer(renamed)spec-reviewer+quality-reviewer→reviewer(merged — one pass, criteria + quality)tester→qa(merged — writes tests AND validates on dev)Agent Folder Structure (Group 3)
plugins/genie/agents/<name>/AGENTS.md<name>.md → <name>/AGENTS.mdfor CC Agent toolteam-lead/(AGENTS.md + SOUL.md + HEARTBEAT.md),pm/(AGENTS.md + SOUL.md + HEARTBEAT.md),qa/builtin-agents.tsrewired as filesystem resolver — no inline promptsSession Fixes (Group 4)
Test plan
bun run typecheckpasses