Makefile 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. # OpenAgents - GitHub Project Management & Development
  2. # Quick commands for managing your GitHub Project board and running tests
  3. REPO := darrenhinde/OpenAgents
  4. PROJECT_NUMBER := 2
  5. OWNER := darrenhinde
  6. .PHONY: help idea ideas board labels project-info issue-view issue-comment issue-close bug feature
  7. .PHONY: test-evals test-golden test-smoke test-verbose build-evals validate-evals
  8. help: ## Show this help message
  9. @echo "OpenAgents GitHub Project Management"
  10. @echo ""
  11. @echo "Usage: make [target] [ARGS]"
  12. @echo ""
  13. @echo "Targets:"
  14. @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}'
  15. @echo ""
  16. @echo "Examples:"
  17. @echo " make idea TITLE=\"Add eval harness\" BODY=\"Description here\""
  18. @echo " make bug TITLE=\"Fix login error\" BODY=\"Users can't login\""
  19. @echo " make feature TITLE=\"Add dark mode\" PRIORITY=\"high\""
  20. @echo " make ideas"
  21. @echo " make board"
  22. @echo " make issue-view NUM=123"
  23. idea: ## Create a new idea (requires TITLE, optional BODY, PRIORITY, CATEGORY)
  24. @if [ -z "$(TITLE)" ]; then \
  25. echo "Error: TITLE is required"; \
  26. echo "Usage: make idea TITLE=\"Your title\" BODY=\"Description\" PRIORITY=\"high\" CATEGORY=\"agents\""; \
  27. exit 1; \
  28. fi
  29. @LABELS="idea"; \
  30. BODY=$${BODY:-}; \
  31. if [ -n "$(PRIORITY)" ]; then LABELS="$$LABELS,priority-$(PRIORITY)"; fi; \
  32. if [ -n "$(CATEGORY)" ]; then LABELS="$$LABELS,$(CATEGORY)"; fi; \
  33. gh issue create \
  34. --repo $(REPO) \
  35. --title "$(TITLE)" \
  36. --body "$$BODY" \
  37. --label "$$LABELS"
  38. bug: ## Create a bug report (requires TITLE, optional BODY, PRIORITY)
  39. @if [ -z "$(TITLE)" ]; then \
  40. echo "Error: TITLE is required"; \
  41. echo "Usage: make bug TITLE=\"Bug description\" BODY=\"Details\" PRIORITY=\"high\""; \
  42. exit 1; \
  43. fi
  44. @LABELS="bug"; \
  45. BODY=$${BODY:-}; \
  46. if [ -n "$(PRIORITY)" ]; then LABELS="$$LABELS,priority-$(PRIORITY)"; fi; \
  47. if [ -n "$(CATEGORY)" ]; then LABELS="$$LABELS,$(CATEGORY)"; fi; \
  48. gh issue create \
  49. --repo $(REPO) \
  50. --title "$(TITLE)" \
  51. --body "$$BODY" \
  52. --label "$$LABELS"
  53. feature: ## Create a feature request (requires TITLE, optional BODY, PRIORITY, CATEGORY)
  54. @if [ -z "$(TITLE)" ]; then \
  55. echo "Error: TITLE is required"; \
  56. echo "Usage: make feature TITLE=\"Feature name\" BODY=\"Description\" PRIORITY=\"high\" CATEGORY=\"agents\""; \
  57. exit 1; \
  58. fi
  59. @LABELS="feature"; \
  60. BODY=$${BODY:-}; \
  61. if [ -n "$(PRIORITY)" ]; then LABELS="$$LABELS,priority-$(PRIORITY)"; fi; \
  62. if [ -n "$(CATEGORY)" ]; then LABELS="$$LABELS,$(CATEGORY)"; fi; \
  63. gh issue create \
  64. --repo $(REPO) \
  65. --title "$(TITLE)" \
  66. --body "$$BODY" \
  67. --label "$$LABELS"
  68. ideas: ## List all open ideas
  69. @gh issue list --repo $(REPO) --label idea --state open
  70. bugs: ## List all open bugs
  71. @gh issue list --repo $(REPO) --label bug --state open
  72. features: ## List all open features
  73. @gh issue list --repo $(REPO) --label feature --state open
  74. issues: ## List all open issues
  75. @gh issue list --repo $(REPO) --state open
  76. by-priority: ## List issues by priority (requires PRIORITY=high|medium|low)
  77. @if [ -z "$(PRIORITY)" ]; then \
  78. echo "Error: PRIORITY is required"; \
  79. echo "Usage: make by-priority PRIORITY=high"; \
  80. exit 1; \
  81. fi
  82. @gh issue list --repo $(REPO) --label "priority-$(PRIORITY)" --state open
  83. by-category: ## List issues by category (requires CATEGORY=agents|evals|framework|docs)
  84. @if [ -z "$(CATEGORY)" ]; then \
  85. echo "Error: CATEGORY is required"; \
  86. echo "Usage: make by-category CATEGORY=agents"; \
  87. exit 1; \
  88. fi
  89. @gh issue list --repo $(REPO) --label "$(CATEGORY)" --state open
  90. board: ## Open the project board in browser
  91. @open "https://github.com/users/$(OWNER)/projects/$(PROJECT_NUMBER)"
  92. labels: ## List all labels in the repo
  93. @gh label list --repo $(REPO)
  94. project-info: ## Show project information
  95. @gh project view $(PROJECT_NUMBER) --owner $(OWNER)
  96. project-items: ## List all items in the project
  97. @gh project item-list $(PROJECT_NUMBER) --owner $(OWNER) --format json | jq -r '.items[] | "\(.id) - \(.content.title) [\(.content.state)]"'
  98. issue-view: ## View an issue (requires NUM=issue_number)
  99. @if [ -z "$(NUM)" ]; then \
  100. echo "Error: NUM is required"; \
  101. echo "Usage: make issue-view NUM=123"; \
  102. exit 1; \
  103. fi
  104. @gh issue view $(NUM) --repo $(REPO)
  105. issue-comment: ## Comment on an issue (requires NUM and COMMENT)
  106. @if [ -z "$(NUM)" ] || [ -z "$(COMMENT)" ]; then \
  107. echo "Error: NUM and COMMENT are required"; \
  108. echo "Usage: make issue-comment NUM=123 COMMENT=\"Your comment\""; \
  109. exit 1; \
  110. fi
  111. @gh issue comment $(NUM) --repo $(REPO) --body "$(COMMENT)"
  112. issue-close: ## Close an issue (requires NUM)
  113. @if [ -z "$(NUM)" ]; then \
  114. echo "Error: NUM is required"; \
  115. echo "Usage: make issue-close NUM=123"; \
  116. exit 1; \
  117. fi
  118. @gh issue close $(NUM) --repo $(REPO)
  119. # Advanced: Add issue to project (requires ISSUE_URL)
  120. add-to-project: ## Add an issue to the project (requires ISSUE_URL)
  121. @if [ -z "$(ISSUE_URL)" ]; then \
  122. echo "Error: ISSUE_URL is required"; \
  123. echo "Usage: make add-to-project ISSUE_URL=https://github.com/darrenhinde/OpenAgents/issues/123"; \
  124. exit 1; \
  125. fi
  126. @gh project item-add $(PROJECT_NUMBER) --owner $(OWNER) --url "$(ISSUE_URL)"
  127. # Quick shortcuts
  128. .PHONY: new list open high-priority
  129. new: idea ## Alias for 'idea'
  130. list: ideas ## Alias for 'ideas'
  131. open: board ## Alias for 'board'
  132. high-priority: ## List all high priority items
  133. @make by-priority PRIORITY=high
  134. # =============================================================================
  135. # Evaluation Framework Commands
  136. # =============================================================================
  137. build-evals: ## Build the evaluation framework
  138. @echo "🔨 Building evaluation framework..."
  139. @pnpm install --frozen-lockfile
  140. @pnpm --dir evals/framework run build
  141. @echo "✅ Build complete"
  142. validate-evals: ## Validate all test suites
  143. @echo "🔍 Validating test suites..."
  144. @pnpm --dir evals/framework run validate:suites:all
  145. @echo "✅ Validation complete"
  146. test-golden: ## Run golden tests (8 tests, ~3-5 min)
  147. @echo "🧪 Running golden tests..."
  148. @pnpm --dir evals/framework run eval:sdk -- --agent=openagent --pattern="**/golden/*.yaml"
  149. test-smoke: ## Run smoke test only (1 test, ~30s)
  150. @echo "🧪 Running smoke test..."
  151. @pnpm --dir evals/framework run eval:sdk -- --agent=openagent --pattern="**/golden/01-smoke-test.yaml"
  152. test-verbose: ## Run golden tests with full conversation output
  153. @echo "🧪 Running golden tests (verbose)..."
  154. @pnpm --dir evals/framework run eval:sdk -- --agent=openagent --pattern="**/golden/*.yaml" --verbose
  155. test-evals: build-evals validate-evals test-golden ## Full eval pipeline: build, validate, test
  156. # Test with specific agent
  157. test-agent: ## Run tests for specific agent (requires AGENT=name)
  158. @if [ -z "$(AGENT)" ]; then \
  159. echo "Error: AGENT is required"; \
  160. echo "Usage: make test-agent AGENT=openagent"; \
  161. echo " make test-agent AGENT=opencoder"; \
  162. exit 1; \
  163. fi
  164. @echo "🧪 Running tests for agent: $(AGENT)..."
  165. @pnpm --dir evals/framework run eval:sdk -- --agent=$(AGENT) --pattern="**/golden/*.yaml"
  166. # Test with specific model
  167. test-model: ## Run tests with specific model (requires MODEL=provider/model)
  168. @if [ -z "$(MODEL)" ]; then \
  169. echo "Error: MODEL is required"; \
  170. echo "Usage: make test-model MODEL=opencode/grok-code-fast"; \
  171. echo " make test-model MODEL=anthropic/claude-3-5-sonnet-20241022"; \
  172. exit 1; \
  173. fi
  174. @echo "🧪 Running tests with model: $(MODEL)..."
  175. @pnpm --dir evals/framework run eval:sdk -- --agent=openagent --model=$(MODEL) --pattern="**/golden/*.yaml"
  176. # Test with prompt variant
  177. test-variant: ## Run tests with prompt variant (requires VARIANT=name)
  178. @if [ -z "$(VARIANT)" ]; then \
  179. echo "Error: VARIANT is required"; \
  180. echo "Usage: make test-variant VARIANT=gpt"; \
  181. echo " make test-variant VARIANT=llama"; \
  182. echo "Available: default, gpt, gemini, grok, llama"; \
  183. exit 1; \
  184. fi
  185. @echo "🧪 Running tests with prompt variant: $(VARIANT)..."
  186. @pnpm --dir evals/framework run eval:sdk -- --agent=openagent --prompt-variant=$(VARIANT) --pattern="**/golden/*.yaml"
  187. # Test subagent standalone
  188. test-subagent: ## Test subagent in standalone mode (requires SUBAGENT=name)
  189. @if [ -z "$(SUBAGENT)" ]; then \
  190. echo "Error: SUBAGENT is required"; \
  191. echo "Usage: make test-subagent SUBAGENT=coder-agent"; \
  192. echo " make test-subagent SUBAGENT=tester"; \
  193. echo ""; \
  194. echo "Available subagents:"; \
  195. echo " Code: coder-agent, tester, reviewer, build-agent"; \
  196. echo " Core: task-manager, documentation, context-retriever"; \
  197. echo " System: agent-generator, command-creator, context-organizer"; \
  198. exit 1; \
  199. fi
  200. @echo "⚡ Testing subagent (standalone mode): $(SUBAGENT)..."
  201. @pnpm --dir evals/framework run eval:sdk -- --subagent=$(SUBAGENT)
  202. # Test subagent via delegation
  203. test-subagent-delegate: ## Test subagent via parent delegation (requires SUBAGENT=name)
  204. @if [ -z "$(SUBAGENT)" ]; then \
  205. echo "Error: SUBAGENT is required"; \
  206. echo "Usage: make test-subagent-delegate SUBAGENT=coder-agent"; \
  207. echo " make test-subagent-delegate SUBAGENT=tester"; \
  208. exit 1; \
  209. fi
  210. @echo "🔗 Testing subagent (delegation mode): $(SUBAGENT)..."
  211. @pnpm --dir evals/framework run eval:sdk -- --subagent=$(SUBAGENT) --delegate
  212. # View results
  213. view-results: ## Open results dashboard in browser
  214. @echo "📊 Opening results dashboard..."
  215. @open evals/results/index.html 2>/dev/null || xdg-open evals/results/index.html 2>/dev/null || echo "Open evals/results/index.html in your browser"
  216. # Show latest results
  217. show-results: ## Show latest test results summary
  218. @echo "📊 Latest test results:"
  219. @if [ -f "evals/results/latest.json" ]; then \
  220. echo ""; \
  221. jq -r '"Agent: \(.meta.agent)\nModel: \(.meta.model)\nTimestamp: \(.meta.timestamp)\n\nResults: \(.summary.passed)/\(.summary.total) passed (\(.summary.pass_rate * 100 | floor)%)\nDuration: \(.summary.duration_ms)ms"' evals/results/latest.json; \
  222. echo ""; \
  223. echo "Tests:"; \
  224. jq -r '.tests[] | " \(if .passed then "✅" else "❌" end) \(.id) (\(.duration_ms)ms)"' evals/results/latest.json; \
  225. else \
  226. echo "No results found. Run 'make test-golden' first."; \
  227. fi