Makefile 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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. @cd evals/framework && npm ci && npm run build
  140. @echo "✅ Build complete"
  141. validate-evals: ## Validate all test suites
  142. @echo "🔍 Validating test suites..."
  143. @cd evals/framework && npm run validate:suites:all
  144. @echo "✅ Validation complete"
  145. test-golden: ## Run golden tests (8 tests, ~3-5 min)
  146. @echo "🧪 Running golden tests..."
  147. @cd evals/framework && npm run eval:sdk -- --agent=openagent --pattern="**/golden/*.yaml"
  148. test-smoke: ## Run smoke test only (1 test, ~30s)
  149. @echo "🧪 Running smoke test..."
  150. @cd evals/framework && npm run eval:sdk -- --agent=openagent --pattern="**/golden/01-smoke-test.yaml"
  151. test-verbose: ## Run golden tests with full conversation output
  152. @echo "🧪 Running golden tests (verbose)..."
  153. @cd evals/framework && npm run eval:sdk -- --agent=openagent --pattern="**/golden/*.yaml" --verbose
  154. test-evals: build-evals validate-evals test-golden ## Full eval pipeline: build, validate, test
  155. # Test with specific agent
  156. test-agent: ## Run tests for specific agent (requires AGENT=name)
  157. @if [ -z "$(AGENT)" ]; then \
  158. echo "Error: AGENT is required"; \
  159. echo "Usage: make test-agent AGENT=openagent"; \
  160. echo " make test-agent AGENT=opencoder"; \
  161. exit 1; \
  162. fi
  163. @echo "🧪 Running tests for agent: $(AGENT)..."
  164. @cd evals/framework && npm run eval:sdk -- --agent=$(AGENT) --pattern="**/golden/*.yaml"
  165. # Test with specific model
  166. test-model: ## Run tests with specific model (requires MODEL=provider/model)
  167. @if [ -z "$(MODEL)" ]; then \
  168. echo "Error: MODEL is required"; \
  169. echo "Usage: make test-model MODEL=opencode/grok-code-fast"; \
  170. echo " make test-model MODEL=anthropic/claude-3-5-sonnet-20241022"; \
  171. exit 1; \
  172. fi
  173. @echo "🧪 Running tests with model: $(MODEL)..."
  174. @cd evals/framework && npm run eval:sdk -- --agent=openagent --model=$(MODEL) --pattern="**/golden/*.yaml"
  175. # Test with prompt variant
  176. test-variant: ## Run tests with prompt variant (requires VARIANT=name)
  177. @if [ -z "$(VARIANT)" ]; then \
  178. echo "Error: VARIANT is required"; \
  179. echo "Usage: make test-variant VARIANT=gpt"; \
  180. echo " make test-variant VARIANT=llama"; \
  181. echo "Available: default, gpt, gemini, grok, llama"; \
  182. exit 1; \
  183. fi
  184. @echo "🧪 Running tests with prompt variant: $(VARIANT)..."
  185. @cd evals/framework && npm run eval:sdk -- --agent=openagent --prompt-variant=$(VARIANT) --pattern="**/golden/*.yaml"
  186. # Test subagent standalone
  187. test-subagent: ## Test subagent in standalone mode (requires SUBAGENT=name)
  188. @if [ -z "$(SUBAGENT)" ]; then \
  189. echo "Error: SUBAGENT is required"; \
  190. echo "Usage: make test-subagent SUBAGENT=coder-agent"; \
  191. echo " make test-subagent SUBAGENT=tester"; \
  192. echo ""; \
  193. echo "Available subagents:"; \
  194. echo " Code: coder-agent, tester, reviewer, build-agent"; \
  195. echo " Core: task-manager, documentation, context-retriever"; \
  196. echo " System: agent-generator, command-creator, context-organizer"; \
  197. exit 1; \
  198. fi
  199. @echo "⚡ Testing subagent (standalone mode): $(SUBAGENT)..."
  200. @cd evals/framework && npm run eval:sdk -- --subagent=$(SUBAGENT)
  201. # Test subagent via delegation
  202. test-subagent-delegate: ## Test subagent via parent delegation (requires SUBAGENT=name)
  203. @if [ -z "$(SUBAGENT)" ]; then \
  204. echo "Error: SUBAGENT is required"; \
  205. echo "Usage: make test-subagent-delegate SUBAGENT=coder-agent"; \
  206. echo " make test-subagent-delegate SUBAGENT=tester"; \
  207. exit 1; \
  208. fi
  209. @echo "🔗 Testing subagent (delegation mode): $(SUBAGENT)..."
  210. @cd evals/framework && npm run eval:sdk -- --subagent=$(SUBAGENT) --delegate
  211. # View results
  212. view-results: ## Open results dashboard in browser
  213. @echo "📊 Opening results dashboard..."
  214. @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"
  215. # Show latest results
  216. show-results: ## Show latest test results summary
  217. @echo "📊 Latest test results:"
  218. @if [ -f "evals/results/latest.json" ]; then \
  219. echo ""; \
  220. 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; \
  221. echo ""; \
  222. echo "Tests:"; \
  223. jq -r '.tests[] | " \(if .passed then "✅" else "❌" end) \(.id) (\(.duration_ms)ms)"' evals/results/latest.json; \
  224. else \
  225. echo "No results found. Run 'make test-golden' first."; \
  226. fi