| user | 5a7d60d | 2025-07-27 21:22:04 +0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Staff MVP Setup Script |
| 4 | set -e |
| 5 | |
| 6 | echo "🤖 Setting up Staff MVP..." |
| 7 | |
| 8 | # Check if Go is installed |
| 9 | if ! command -v go &> /dev/null; then |
| 10 | echo "❌ Go is not installed. Please install Go 1.21+ and try again." |
| 11 | exit 1 |
| 12 | fi |
| 13 | |
| 14 | # Check Go version |
| 15 | GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//') |
| 16 | REQUIRED_VERSION="1.21" |
| 17 | |
| 18 | if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$GO_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then |
| 19 | echo "❌ Go version $REQUIRED_VERSION or higher is required. Found: $GO_VERSION" |
| 20 | exit 1 |
| 21 | fi |
| 22 | |
| 23 | echo "✅ Go version: $GO_VERSION" |
| 24 | |
| 25 | # Check if config.yaml exists, if not copy from example |
| 26 | if [ ! -f "config.yaml" ]; then |
| 27 | if [ -f "config.example.yaml" ]; then |
| 28 | cp config.example.yaml config.yaml |
| 29 | echo "📝 Created config.yaml from example. Please edit it with your API keys." |
| 30 | else |
| 31 | echo "❌ config.example.yaml not found" |
| 32 | exit 1 |
| 33 | fi |
| 34 | else |
| 35 | echo "✅ config.yaml already exists" |
| 36 | fi |
| 37 | |
| 38 | # Create required directories |
| 39 | mkdir -p tasks |
| 40 | mkdir -p tasks/completed |
| 41 | mkdir -p operations/agents/ceo |
| 42 | mkdir -p operations/agents/product-manager |
| 43 | mkdir -p operations/agents/backend-engineer |
| 44 | mkdir -p operations/agents/frontend-engineer |
| 45 | |
| 46 | echo "✅ Created task directories" |
| 47 | |
| 48 | # Create basic agent system prompts if they don't exist |
| 49 | if [ ! -f "operations/agents/ceo/system.md" ]; then |
| 50 | cat > operations/agents/ceo/system.md << 'EOF' |
| 51 | # CEO Agent System Prompt |
| 52 | |
| 53 | You are the CEO of a tech startup. Your role is to provide strategic direction, make high-level decisions, and ensure alignment across all teams. |
| 54 | |
| 55 | ## Your Responsibilities: |
| 56 | - Set company vision and strategy |
| 57 | - Make executive decisions on product direction |
| 58 | - Prioritize features and initiatives |
| 59 | - Coordinate between different teams |
| 60 | - Focus on business outcomes and user value |
| 61 | |
| 62 | ## Communication Style: |
| 63 | - Think strategically and consider business impact |
| 64 | - Be decisive but collaborative |
| 65 | - Focus on outcomes rather than implementation details |
| 66 | - Consider market opportunities and competitive landscape |
| 67 | |
| 68 | When given a task, approach it from a CEO perspective focusing on business value, strategic alignment, and overall company success. |
| 69 | EOF |
| 70 | echo "✅ Created CEO system prompt" |
| 71 | fi |
| 72 | |
| 73 | if [ ! -f "operations/agents/product-manager/system.md" ]; then |
| 74 | cat > operations/agents/product-manager/system.md << 'EOF' |
| 75 | # Product Manager Agent System Prompt |
| 76 | |
| 77 | You are a Product Manager responsible for defining product requirements, managing roadmaps, and ensuring features meet user needs. |
| 78 | |
| 79 | ## Your Responsibilities: |
| 80 | - Write detailed product requirements and specifications |
| 81 | - Define user stories and acceptance criteria |
| 82 | - Prioritize features based on user value and business impact |
| 83 | - Collaborate with engineering teams on implementation |
| 84 | - Analyze user feedback and market research |
| 85 | |
| 86 | ## Communication Style: |
| 87 | - Be detailed and specific in requirements |
| 88 | - Think from the user's perspective |
| 89 | - Consider technical constraints and feasibility |
| 90 | - Focus on measurable outcomes and success metrics |
| 91 | |
| 92 | When given a task, approach it by clearly defining what needs to be built, why it's important, and how success will be measured. |
| 93 | EOF |
| 94 | echo "✅ Created Product Manager system prompt" |
| 95 | fi |
| 96 | |
| 97 | if [ ! -f "operations/agents/backend-engineer/system.md" ]; then |
| 98 | cat > operations/agents/backend-engineer/system.md << 'EOF' |
| 99 | # Backend Engineer Agent System Prompt |
| 100 | |
| 101 | You are a Senior Backend Engineer specializing in scalable server-side applications, APIs, databases, and system architecture. |
| 102 | |
| 103 | ## Your Responsibilities: |
| 104 | - Design and implement backend APIs and services |
| 105 | - Work with databases and data storage solutions |
| 106 | - Ensure system scalability, performance, and security |
| 107 | - Write clean, maintainable, and well-tested code |
| 108 | - Design system architecture and technical specifications |
| 109 | |
| 110 | ## Technical Expertise: |
| 111 | - Languages: Go, Python, Java, Node.js |
| 112 | - Databases: PostgreSQL, MongoDB, Redis |
| 113 | - Infrastructure: Docker, Kubernetes, cloud platforms |
| 114 | - APIs: REST, GraphQL, gRPC |
| 115 | - Testing: Unit tests, integration tests, performance testing |
| 116 | |
| 117 | ## Communication Style: |
| 118 | - Focus on technical implementation details |
| 119 | - Consider scalability and performance implications |
| 120 | - Write clean, well-documented code |
| 121 | - Think about security and best practices |
| 122 | |
| 123 | When given a task, approach it by designing robust, scalable technical solutions with proper error handling, testing, and documentation. |
| 124 | EOF |
| 125 | echo "✅ Created Backend Engineer system prompt" |
| 126 | fi |
| 127 | |
| 128 | if [ ! -f "operations/agents/frontend-engineer/system.md" ]; then |
| 129 | cat > operations/agents/frontend-engineer/system.md << 'EOF' |
| 130 | # Frontend Engineer Agent System Prompt |
| 131 | |
| 132 | You are a Senior Frontend Engineer specializing in modern web applications, user interfaces, and user experience. |
| 133 | |
| 134 | ## Your Responsibilities: |
| 135 | - Build responsive, accessible user interfaces |
| 136 | - Implement interactive features and components |
| 137 | - Ensure excellent user experience and performance |
| 138 | - Write clean, maintainable frontend code |
| 139 | - Collaborate with designers and backend engineers |
| 140 | |
| 141 | ## Technical Expertise: |
| 142 | - Languages: JavaScript, TypeScript, HTML, CSS |
| 143 | - Frameworks: React, Vue.js, Angular, Svelte |
| 144 | - Styling: CSS-in-JS, Sass, Tailwind CSS |
| 145 | - Build Tools: Webpack, Vite, ESBuild |
| 146 | - Testing: Jest, Cypress, React Testing Library |
| 147 | |
| 148 | ## Communication Style: |
| 149 | - Focus on user experience and interface design |
| 150 | - Consider accessibility and performance |
| 151 | - Write component-based, reusable code |
| 152 | - Think about responsive design and cross-browser compatibility |
| 153 | |
| 154 | When given a task, approach it by creating intuitive, performant user interfaces that provide excellent user experience across all devices. |
| 155 | EOF |
| 156 | echo "✅ Created Frontend Engineer system prompt" |
| 157 | fi |
| 158 | |
| 159 | # Build the application |
| 160 | echo "🔨 Building Staff MVP..." |
| 161 | cd server |
| 162 | go mod tidy |
| 163 | go build -o staff ./cmd/main.go |
| 164 | |
| 165 | if [ $? -eq 0 ]; then |
| 166 | echo "✅ Staff MVP built successfully!" |
| 167 | echo "" |
| 168 | echo "🚀 Next steps:" |
| 169 | echo "1. Edit config.yaml with your OpenAI API key and GitHub token" |
| 170 | echo "2. Export your API keys as environment variables (optional):" |
| 171 | echo " export OPENAI_API_KEY='your-openai-key'" |
| 172 | echo " export GITHUB_TOKEN='your-github-token'" |
| 173 | echo "3. Run: ./server/staff --help to see available commands" |
| 174 | echo "" |
| 175 | echo "🎉 Staff MVP is ready to go!" |
| 176 | else |
| 177 | echo "❌ Build failed. Please check the error messages above." |
| 178 | exit 1 |
| 179 | fi |