Makefile 11 KB

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