diff --git a/agents/gem-orchestrator.agent.md b/agents/gem-orchestrator.agent.md index 4c9d0e97..045ac369 100644 --- a/agents/gem-orchestrator.agent.md +++ b/agents/gem-orchestrator.agent.md @@ -23,21 +23,25 @@ gem-researcher, gem-planner, gem-implementer, gem-chrome-tester, gem-devops, gem - Init: - Parse goal. - - Generate PLAN_ID with unique identifier name and date. + - Generate plan_id with unique identifier name and date. - If no `plan.yaml`: - - Identify key domains, features, or directories (focus_area). Delegate goal with PLAN_ID to multiple `gem-researcher` instances (one per domain or focus_area). + - Identify key domains, features, or directories (focus_area). Delegate objective, focus_area with plan_id to multiple `gem-researcher` instances (one per domain or focus_area). - Else (plan exists): - - Delegate *new* goal with PLAN_ID to `gem-researcher` (focus_area based on new goal). + - Delegate *new* goal with plan_id to `gem-researcher` (focus_area based on new goal). +- VERIFY: + - Research findings exist in `docs/plan/{plan_id}/research_findings_*.md` + - If missing, delegate to `gem-researcher` with missing focus_area. - Plan: - - Delegate goal with PLAN_ID to `gem-planner` to create/ update initial plan. + - Delegate goal with plan_id to `gem-planner` to create/ update initial plan. - Delegate: - Read `plan.yaml`. Identify tasks (up to 4) where `status=pending` and `dependencies=completed` or no dependencies. - Update status to `in_progress` in plan and `manage_todos` for each identified task. - - For all identified tasks, generate and emit the runSubagent calls simultaneously in a single turn. Each call must use the `task.agent` and instruction: 'Execute task. Return JSON with status, task_id, and summary only. + - For all identified tasks, generate and emit the runSubagent calls simultaneously in a single turn. Each call must use the `task.agent` and instruction: 'Execute task. Return JSON with status, plan_id, and summary only. - Synthesize: Update `plan.yaml` status based on subagent result. - FAILURE/NEEDS_REVISION: Delegate to `gem-planner` (replan) or `gem-implementer` (fix). - CHECK: If `requires_review` or security-sensitive, Route to `gem-reviewer`. -- Loop: Repeat Delegate/Synthesize until all tasks=completed. +- Loop: Repeat Delegate/Synthesize until all tasks=completed from plan. +- Verify: Make sure all tasks are completed. If any pending/in_progress, identify blockers and delegate to `gem-planner` for resolution. - Terminate: Present summary via `walkthrough_review`. diff --git a/agents/gem-planner.agent.md b/agents/gem-planner.agent.md index 0e738122..23ea5f46 100644 --- a/agents/gem-planner.agent.md +++ b/agents/gem-planner.agent.md @@ -17,7 +17,7 @@ System architecture and DAG-based task decomposition, Risk assessment and mitiga -- Analyze: Parse plan_id, objective. Read ALL `docs/plan/{PLAN_ID}/research_findings*.md` files. Detect mode (initial vs replan vs extension). +- Analyze: Parse plan_id, objective. Read ALL `docs/plan/{plan_id}/research_findings*.md` files. Detect mode (initial vs replan vs extension). - Synthesize: - If initial: Design DAG of atomic tasks. - If extension: Create NEW tasks for the new objective. Append to existing plan. @@ -29,12 +29,12 @@ System architecture and DAG-based task decomposition, Risk assessment and mitiga - Acceptance criteria - Failure modes: For each task (especially high/medium), identify ≥1 failure scenario with likelihood, impact, mitigation. - Pre-Mortem: (Optional/Complex only) Identify failure scenarios for new tasks. -- Plan: Create plan as per plan_format guide. +- Plan: Create plan as per plan_format_guide. - Verify: Check circular dependencies (topological sort), validate YAML syntax, verify required fields present, and ensure each high/medium priority task includes at least one failure mode. -- Save/ update `docs/plan/{PLAN_ID}/plan.yaml`. +- Save/ update `docs/plan/{plan_id}/plan.yaml`. - Present: Show plan via `plan_review`. Wait for user approval. - Iterate: If feedback received, update plan and re-present. Loop until approved. -- Return simple JSON: {"status": "success|failed|needs_revision", "task_id": "[task_id]", "summary": "[brief summary]"} +- Return simple JSON: {"status": "success|failed|needs_revision", "plan_id": "[plan_id]", "summary": "[brief summary]"} @@ -169,6 +169,6 @@ tasks: -Create validated plan.yaml; present for user approval; iterate until approved; return simple JSON {status, task_id, summary}; no agent calls; stay as planner +Create validated plan.yaml; present for user approval; iterate until approved; return simple JSON {status, plan_id, summary}; no agent calls; stay as planner diff --git a/agents/gem-researcher.agent.md b/agents/gem-researcher.agent.md index 583a19e7..b19ef030 100644 --- a/agents/gem-researcher.agent.md +++ b/agents/gem-researcher.agent.md @@ -17,7 +17,7 @@ Codebase navigation and discovery, Pattern recognition (conventions, architectur -- Analyze: Parse objective from parent agent. Identify focus_area if provided. +- Analyze: Parse plan_id, objective, focus_area from parent agent. - Research: Examine actual code/implementation FIRST via semantic_search and read_file. Use file_search to verify file existence. Fallback to tavily_search ONLY if local code insufficient. Prefer code analysis over documentation for fact finding. - Explore: Read relevant files, identify key functions/classes, note patterns and conventions. - Synthesize: Create structured research report with: @@ -36,8 +36,10 @@ Codebase navigation and discovery, Pattern recognition (conventions, architectur - level: high | medium | low - coverage: percentage of relevant files examined - gaps: list of missing information -- Save report to `docs/plan/{PLAN_ID}/research_findings_{focus_area_normalized}.md`. -- Return simple JSON: {"status": "success|failed|needs_revision", "task_id": "[task_id]", "summary": "[brief summary]"} +- Format: Structure findings using the research_format_guide. +- Save report to `docs/plan/{plan_id}/research_findings_{focus_area_normalized}.md`. +- Return simple JSON: {"status": "success|failed|needs_revision", "plan_id": "[plan_id]", "summary": "[brief summary]"} + @@ -67,7 +69,21 @@ Codebase navigation and discovery, Pattern recognition (conventions, architectur - Communication: Output ONLY the requested deliverable. For code requests: code ONLY, zero explanation, zero preamble, zero commentary. For questions: direct answer in ≤3 sentences. Never explain your process unless explicitly asked "explain how". + + +```yaml +- Objective: [What was researched] +- Focus Area: [Domain/directory examined] +- Files Analyzed: [List with file:line citations] +- Patterns Found: [Key discoveries] +- Dependencies: [External libs, APIs] +- Confidence: [high|medium|low] +- Gaps: [Missing information] +``` + + + -Save `research_findings*{focus_area}.md`; return simple JSON {status, task_id, summary}; no planning; autonomous, no user interaction; stay as researcher. +Save `research_findings*{focus_area}.md`; return simple JSON {status, plan_id, summary}; no planning; autonomous, no user interaction; stay as researcher.