| user | 5a7d60d | 2025-07-27 21:22:04 +0400 | [diff] [blame^] | 1 | # Staff MVP - AI Multi-Agent Development System |
| 2 | |
| 3 | ## Quick Start (5 minutes) |
| 4 | |
| 5 | Staff MVP is a lean AI multi-agent system where specialized AI agents autonomously handle development tasks and create GitHub pull requests. |
| 6 | |
| 7 | ### 1. Prerequisites |
| 8 | |
| 9 | - **Go 1.21+** installed |
| 10 | - **OpenAI API key** (get one at [platform.openai.com](https://platform.openai.com)) |
| 11 | - **GitHub personal access token** with repo permissions |
| 12 | |
| 13 | ### 2. Setup |
| 14 | |
| 15 | ```bash |
| 16 | # Clone and setup |
| 17 | git clone <your-repo> |
| 18 | cd staff |
| 19 | ./setup.sh |
| 20 | |
| 21 | # Configure (edit with your API keys) |
| 22 | cp config.example.yaml config.yaml |
| 23 | nano config.yaml |
| 24 | ``` |
| 25 | |
| 26 | ### 3. Configuration |
| 27 | |
| 28 | Edit `config.yaml` with your credentials: |
| 29 | |
| 30 | ```yaml |
| 31 | openai: |
| 32 | api_key: "sk-your-openai-key-here" |
| 33 | |
| 34 | github: |
| 35 | token: "ghp_your-github-token-here" |
| 36 | owner: "your-github-username" |
| 37 | repo: "your-repo-name" |
| 38 | ``` |
| 39 | |
| 40 | Or use environment variables: |
| 41 | ```bash |
| 42 | export OPENAI_API_KEY="sk-your-openai-key-here" |
| 43 | export GITHUB_TOKEN="ghp_your-github-token-here" |
| 44 | ``` |
| 45 | |
| 46 | ### 4. Usage |
| 47 | |
| 48 | ```bash |
| 49 | cd server |
| 50 | |
| 51 | # Create a task |
| 52 | ./staff create-task "Add user authentication system" --priority high --agent backend-engineer |
| 53 | |
| 54 | # Start an agent to process tasks |
| 55 | ./staff start-agent backend-engineer |
| 56 | |
| 57 | # List all tasks |
| 58 | ./staff list-tasks |
| 59 | |
| 60 | # Check agent status |
| 61 | ./staff list-agents |
| 62 | ``` |
| 63 | |
| 64 | ## How It Works |
| 65 | |
| 66 | 1. **Create Tasks**: You create development tasks with descriptions and assign them to specialized agents |
| 67 | 2. **Agent Processing**: Agents fetch their assigned tasks and process them using OpenAI GPT-4 |
| 68 | 3. **GitHub Integration**: Completed tasks automatically create pull requests in your repository |
| 69 | 4. **Human Review**: You review and merge the PRs like any normal development workflow |
| 70 | |
| 71 | ## Available Agents |
| 72 | |
| 73 | - **CEO**: Strategic decisions and business direction |
| 74 | - **Product Manager**: Requirements, user stories, specifications |
| 75 | - **Backend Engineer**: Server-side code, APIs, databases |
| 76 | - **Frontend Engineer**: UI/UX, client-side applications |
| 77 | |
| 78 | ## Task Workflow |
| 79 | |
| 80 | ``` |
| 81 | Create Task → Assign to Agent → Agent Processes → Creates PR → Human Review → Merge |
| 82 | ``` |
| 83 | |
| 84 | Tasks are stored as markdown files in the `tasks/` directory and use Git for version control. |
| 85 | |
| 86 | ## Commands |
| 87 | |
| 88 | ```bash |
| 89 | # Task Management |
| 90 | ./staff create-task <description> [--priority high|medium|low] [--agent <agent-name>] |
| 91 | ./staff list-tasks [--status pending|in_progress|completed] |
| 92 | ./staff assign-task <task-id> <agent-name> |
| 93 | |
| 94 | # Agent Management |
| 95 | ./staff start-agent <agent-name> [--loop] [--interval 30s] |
| 96 | ./staff list-agents |
| 97 | ./staff stop-agent <agent-name> |
| 98 | |
| 99 | # Utilities |
| 100 | ./staff config-check |
| 101 | ./staff --help |
| 102 | ``` |
| 103 | |
| 104 | ## Project Structure |
| 105 | |
| 106 | ``` |
| 107 | ├── config.yaml # Main configuration |
| 108 | ├── tasks/ # Task storage (Git-tracked) |
| 109 | │ ├── task-001.md # Individual tasks |
| 110 | │ └── completed/ # Completed tasks |
| 111 | ├── operations/ |
| 112 | │ └── agents/ # Agent system prompts |
| 113 | │ ├── ceo/ |
| 114 | │ ├── product-manager/ |
| 115 | │ ├── backend-engineer/ |
| 116 | │ └── frontend-engineer/ |
| 117 | └── server/ # Go backend |
| 118 | ├── cmd/ # CLI commands |
| 119 | ├── config/ # Configuration system |
| 120 | ├── agent/ # Agent processing logic |
| 121 | ├── llm/ # LLM integration |
| 122 | └── git/ # Git/GitHub operations |
| 123 | ``` |
| 124 | |
| 125 | ## Example Task |
| 126 | |
| 127 | ```markdown |
| 128 | # Task: Add User Authentication |
| 129 | |
| 130 | **ID**: task-001 |
| 131 | **Priority**: high |
| 132 | **Agent**: backend-engineer |
| 133 | **Status**: pending |
| 134 | |
| 135 | ## Description |
| 136 | Implement a complete user authentication system with: |
| 137 | - User registration and login |
| 138 | - JWT token-based authentication |
| 139 | - Password hashing and validation |
| 140 | - Basic user profile management |
| 141 | |
| 142 | ## Acceptance Criteria |
| 143 | - [ ] Users can register with email/password |
| 144 | - [ ] Users can login and receive JWT token |
| 145 | - [ ] Protected routes require valid token |
| 146 | - [ ] Passwords are securely hashed |
| 147 | - [ ] Basic user profile endpoints |
| 148 | ``` |
| 149 | |
| 150 | ## GitHub Integration |
| 151 | |
| 152 | When agents complete tasks, they automatically: |
| 153 | |
| 154 | 1. Create a new branch: `task/001-add-user-authentication` |
| 155 | 2. Commit their solution with detailed commit message |
| 156 | 3. Create a pull request with: |
| 157 | - Task description and solution summary |
| 158 | - List of files changed |
| 159 | - Agent identification |
| 160 | |
| 161 | ## Limitations (MVP) |
| 162 | |
| 163 | - Single user only (no user management) |
| 164 | - Manual task assignment |
| 165 | - No PR comment handling |
| 166 | - No self-learning or improvement |
| 167 | - OpenAI only (no other LLM providers yet) |
| 168 | |
| 169 | ## Troubleshooting |
| 170 | |
| 171 | **"API key required" error**: |
| 172 | - Check your `config.yaml` has the correct OpenAI API key |
| 173 | - Or set `OPENAI_API_KEY` environment variable |
| 174 | |
| 175 | **"GitHub token invalid" error**: |
| 176 | - Ensure your GitHub token has `repo` permissions |
| 177 | - Check the owner/repo settings in config |
| 178 | |
| 179 | **Build errors**: |
| 180 | - Ensure Go 1.21+ is installed: `go version` |
| 181 | - Run `go mod tidy` in the server directory |
| 182 | |
| 183 | ## Next Steps |
| 184 | |
| 185 | This MVP can be extended with: |
| 186 | - Multi-user support and authentication |
| 187 | - Additional LLM providers (Claude, Gemini) |
| 188 | - PR comment handling and iteration |
| 189 | - Agent learning and improvement |
| 190 | - Web UI for task management |
| 191 | - Integration with project management tools |
| 192 | |
| 193 | --- |
| 194 | |
| 195 | **Built with ❤️ using Go + OpenAI + GitHub** |