gemini-task-runner
Foundation for task orchestration and execution
Open source Open in the app JSON README (API)
About
Foundation for task orchestration and execution
Details
- Kind
- Plugins
- Topic
- AI, RAG & memory
- Publisher
- ndiesslin
- Origin
- gemini
- Category
- ferramentas
- Version
- 1.0.0
- Stars
- 1
- Last push
- 2026-02-26T21:50:43Z
- Repository state
- ativo
- Language
- TypeScript
- License
- MIT
- Added
- 2026-08-30 14:13:39
- Updated
- 2026-08-30 14:13:39
- Origin id
ndiesslin/gemini-task-runner
README
# Gemini Task Runner
The Gemini Task Runner is a foundation for task orchestration and execution, designed to manage complex workflows through a series of structured phases: Design, Plan, Execute, and Validate.
## Features
- **Phase-Based Orchestration**: Structured workflow through Design, Plan, Execute, Review, and Validate.
- **Autonomous Self-Correction**: Automatically retries failed phases (up to 2 times) by passing previous error logs back to the agent for remediation.
- **Iterative Review Phase**: An intelligent gatekeeper phase where an Architect agent critiques implementation outputs and suggests improvements before final validation.
- **Persistent State Management**: Full task state is saved to `.task-state.json`, allowing for seamless resumption of interrupted tasks.
- **Worker Pool Concurrency**: Executes independent sub-tasks in parallel to optimize performance.
- **Intelligent Context Injection**: Automatically feeds relevant design, planning, and error context to each agent role.
## Architecture
The system is composed of several key components:
- **Runner** (`src/runner.ts`): The main orchestrator that manages the task lifecycle and handles the self-correction retry logic.
- **PhaseManager** (`src/phase-manager.ts`): Manages transitions between phases and prepares role-specific context files.
- **StateStore** (`src/state-store.ts`): Handles the persistence of the task state.
- **WorkerPool** (`src/worker-pool.ts`): Manages concurrent sub-task execution.
- **AgentDispatcher** (`src/agent-dispatcher.ts`): Interfaces with the `gemini` CLI, providing a robust wrapper for agent communication.
## Phases
1. **Design**: The **Architect** analyzes the request and produces a technical design.
2. **Plan**: The **Planner** decomposes the design into a dependency graph of sub-tasks.
3. **Execute**: **Coder** agents execute the sub-tasks concurrently.
4. **Review**: The **Architect** critiques the implementation and suggests fixes or refinements.
5. **Validate**: The **Tester** verifies the final system against the original requirements.
## Defining New Agent Roles and Prompts
To define a new agent role:
1. Create a new prompt file in the `prompts/` directory (e.g., `prompts/new-role.md`).
2. Update the `PhaseManager` or create a new phase that uses the `dispatchAgent` function with the new role name and prompt file.
Example of `dispatchAgent` usage:
```typescript
dispatchAgent('NewRole', 'prompts/new-role.md', ['context-file.txt']);
```
## Commands
- `/runner:start <prompt>`: Starts a new task with the provided prompt. Defined in `commands/runner.toml`.