-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (71 loc) · 4.13 KB
/
Copy pathMakefile
File metadata and controls
82 lines (71 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
AGENT_DIR := $(HOME)/.config/opencode/agents
PROMPTS := $(wildcard prompts/*.md)
PROMPT_NAMES := $(notdir $(basename $(PROMPTS)))
.PHONY: install uninstall list installed instructions help $(addprefix install-,$(PROMPT_NAMES)) $(addprefix uninstall-,$(PROMPT_NAMES))
help:
@echo "Usage:"
@echo " make install Install all agent prompts"
@echo " make install-<name> Install a specific agent prompt"
@echo " make uninstall Uninstall all agent prompts"
@echo " make uninstall-<name> Uninstall a specific agent prompt"
@echo " make list List available agent prompts"
@echo " make installed Show installed agent prompts"
@echo " make instructions Show how to set up instructions"
@echo ""
@$(MAKE) --no-print-directory list
install: $(addprefix install-,$(PROMPT_NAMES))
uninstall: $(addprefix uninstall-,$(PROMPT_NAMES))
define PROMPT_RULES
install-$(1):
@mkdir -p $(AGENT_DIR)
@cp prompts/$(1).md $(AGENT_DIR)/$(1).md
@echo "Installed $(1)"
uninstall-$(1):
@rm -f $(AGENT_DIR)/$(1).md
@echo "Uninstalled $(1)"
endef
$(foreach name,$(PROMPT_NAMES),$(eval $(call PROMPT_RULES,$(name))))
DESC_code-style := Code style agent - enforces style and formatting standards across the codebase
DESC_code-style-enhanced := Code style with plugins - project profiling, memory, pattern search for style conventions
DESC_api := API agent - designs, implements, and documents REST and GraphQL APIs
DESC_api-enhanced := API agent with plugins - memory, search, decisions, snippets
DESC_code-review := Code review agent - analyzes code and outputs findings to REVIEW.md
DESC_code-review-enhanced := Code review with plugins - memory, search, git context, error/decision tracking
DESC_coding-agent := Coding agent - Python preferred, Node.js secondary, strict standards
DESC_coding-agent-enhanced := Coding agent with plugins - memory, search, tasks, snippets, utilities
DESC_debug := Debug agent - diagnoses and fixes bugs, errors, and unexpected behavior
DESC_debug-enhanced := Debug agent with plugins - memory, search, error tracking, snippets
DESC_document := Documentation agent - analyzes code and generates comprehensive documentation
DESC_document-enhanced := Documentation agent with plugins - memory, search, decisions, snippets
DESC_migration := Migration agent - handles framework, language, and dependency migrations
DESC_migration-enhanced := Migration agent with plugins - memory, search, decisions, snippets
DESC_optimize := Optimization agent - analyzes and fixes performance/quality issues autonomously
DESC_optimize-enhanced := Optimization with plugins - memory, search, decisions, snippets
DESC_refactor := Refactor agent - restructures code for clarity and maintainability
DESC_refactor-enhanced := Refactor agent with plugins - memory, search, decisions, snippets
DESC_security := Security agent - audits code for vulnerabilities and fixes them
DESC_security-enhanced := Security agent with plugins - memory, search, error tracking, snippets
DESC_test := Test agent - analyzes coverage gaps and writes tests autonomously
DESC_test-enhanced := Test agent with plugins - memory, search, error tracking, snippets
list:
@echo "Available agent prompts:"
@$(foreach name,$(PROMPT_NAMES),printf " %-25s %s\n" "$(name)" "$(DESC_$(name))";)
installed:
@echo "Installed agent prompts ($(AGENT_DIR)):"
@found=0; $(foreach name,$(PROMPT_NAMES),if [ -f "$(AGENT_DIR)/$(name).md" ]; then printf " %-25s %s\n" "$(name)" "$(DESC_$(name))"; found=1; fi;) if [ "$$found" = "0" ]; then echo " (none)"; fi
instructions:
@echo "To configure agent instructions for OpenCode:"
@echo ""
@echo " 1. Open your global instructions file:"
@echo " ~/.config/opencode/instructions.md"
@echo ""
@echo " 2. Append the relevant sections from this repo's instructions file:"
@echo " ./instructions.md"
@echo ""
@echo " 3. Only include sections for agents you have installed."
@echo " Enhanced agents require opencode-plugins to be installed."
@echo ""
@echo " Example:"
@echo " cat ./instructions.md >> ~/.config/opencode/instructions.md"
@echo ""
@echo " Or selectively copy the sections you need into your global file."