makefile-agent 0.3.2__tar.gz → 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/PKG-INFO +66 -38
  2. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/README.md +65 -37
  3. makefile_agent-0.3.3/make_agent/agent.py +422 -0
  4. makefile_agent-0.3.3/make_agent/agent_shell.py +143 -0
  5. makefile_agent-0.3.3/make_agent/builtin_tools/__init__.py +79 -0
  6. makefile_agent-0.3.3/make_agent/builtin_tools/agent_tools.py +219 -0
  7. makefile_agent-0.3.3/make_agent/builtin_tools/memory_tools.py +97 -0
  8. makefile_agent-0.3.3/make_agent/commands.py +92 -0
  9. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/make_agent/main.py +27 -26
  10. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/make_agent/memory.py +58 -0
  11. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/make_agent/parser.py +9 -10
  12. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/make_agent/settings.py +5 -4
  13. makefile_agent-0.3.3/make_agent/templates/orchestra.mk +71 -0
  14. makefile_agent-0.3.3/make_agent/tools.py +157 -0
  15. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/makefile_agent.egg-info/PKG-INFO +66 -38
  16. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/makefile_agent.egg-info/SOURCES.txt +5 -3
  17. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/makefile_agent.egg-info/entry_points.txt +0 -1
  18. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/pyproject.toml +2 -3
  19. makefile_agent-0.3.3/tests/test_agent.py +338 -0
  20. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/tests/test_builtin_tools.py +147 -118
  21. makefile_agent-0.3.3/tests/test_commands.py +9 -0
  22. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/tests/test_main.py +3 -1
  23. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/tests/test_memory.py +119 -32
  24. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/tests/test_parser.py +39 -8
  25. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/tests/test_settings.py +26 -0
  26. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/tests/test_tools.py +94 -92
  27. makefile_agent-0.3.2/make_agent/agent.py +0 -190
  28. makefile_agent-0.3.2/make_agent/agent_shell.py +0 -93
  29. makefile_agent-0.3.2/make_agent/builtin_tools.py +0 -380
  30. makefile_agent-0.3.2/make_agent/create_agent.py +0 -228
  31. makefile_agent-0.3.2/make_agent/templates/orchestra.mk +0 -99
  32. makefile_agent-0.3.2/make_agent/tools.py +0 -193
  33. makefile_agent-0.3.2/tests/test_agent.py +0 -163
  34. makefile_agent-0.3.2/tests/test_create_agent.py +0 -325
  35. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/LICENSE +0 -0
  36. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/make_agent/__init__.py +0 -0
  37. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/make_agent/app_dirs.py +0 -0
  38. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/makefile_agent.egg-info/dependency_links.txt +0 -0
  39. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/makefile_agent.egg-info/requires.txt +0 -0
  40. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/makefile_agent.egg-info/top_level.txt +0 -0
  41. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/setup.cfg +0 -0
  42. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/tests/test_app_dirs.py +0 -0
  43. {makefile_agent-0.3.2 → makefile_agent-0.3.3}/tests/test_e2e_smoke.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: makefile-agent
3
- Version: 0.3.2
4
- Summary: AI‑assistant‑as‑Makefile: a tool to create and manage AI agents using a simple YAML configuration.
3
+ Version: 0.3.3
4
+ Summary: AI‑assistant‑as‑Makefile: a tool to create and manage AI agents using a Makefile.
5
5
  Author: Dmitriy Sorochenkov
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/dmtr/make-agent
@@ -27,12 +27,12 @@ Dynamic: license-file
27
27
 
28
28
  An AI agent whose system prompt and tools are defined in a Makefile.
29
29
 
30
- Each Makefile target annotated with a `# <tool>` comment block becomes a callable tool. The agent invokes targets via `make`, passing parameters as `KEY=value` arguments. A `define SYSTEM_PROMPT` block sets the agent's system prompt.
30
+ Each Makefile target annotated with a `# <tool>` comment block becomes a callable tool. The agent invokes targets via `make`, injecting parameters as environment variables. A `define SYSTEM_PROMPT` block sets the agent's system prompt.
31
31
 
32
32
  ## Installation
33
33
 
34
34
  ```
35
- uv pip install .
35
+ pip install makefile-agent
36
36
  ```
37
37
 
38
38
  Requires Python 3.11+ and a working `make` binary. Uses [any-llm-sdk](https://pypi.org/project/any-llm-sdk/) for model access, so any API keys (e.g. `ANTHROPIC_API_KEY`) must be set in the environment.
@@ -51,28 +51,37 @@ ANTHROPIC_API_KEY=<key> uv run make_agent [run] [-f FILE] [--model MODEL] [--pro
51
51
  - `--agent-model MODEL` — model used when running specialist agents via `run_agent` (default: same as `--model`)
52
52
  - `--with-memory` — enable persistent conversation memory (see [Memory](#memory))
53
53
  - `--disable-builtin-tools TOOLS` — comma-separated built-in tool names to disable, or `all`
54
- - `--max-tool-output CHARS` — truncate tool stdout to this many characters; `0` = unlimited (default: 20000)
54
+ - `--max-tool-output CHARS` — truncate tool stdout to this many characters; `0` = unlimited (default: 16000)
55
55
  - `--max-tokens N` — max tokens in the model response (default: 4096)
56
+ - `--reasoning-effort EFFORT` — reasoning effort level: `none|minimal|low|medium|high|xhigh|auto` (default: `auto`)
56
57
  - `--max-retries N` — max retry attempts on rate limit errors (default: 5)
57
58
  - `--tool-timeout SECONDS` — timeout for each tool subprocess (default: 600)
58
- - `--debug` — write all messages to `~/.make-agent/<project>/logs/make-agent.log`
59
+ - `--loglevel LEVEL` — set logging level to DEBUG, INFO, WARNING, ERROR, or CRITICAL (default: INFO)
59
60
 
60
- Without `--prompt`, the agent starts an interactive REPL. Type `exit`, `quit`, or press Ctrl-D to leave.
61
+ Without `--prompt`, the agent starts an interactive REPL. Use `/exit` or `/quit` (or press Ctrl-D) to leave.
62
+
63
+ Interactive shell commands:
64
+
65
+ - `/help` — show available shell commands
66
+ - `/export` — export the current conversation to `conversation-<timestamp>.html`
67
+ - `/stats` — show token usage totals for this session (when memory is enabled)
61
68
 
62
69
  ### First run — setup wizard
63
70
 
64
- If no `settings.yaml` exists for the project and no Makefile is found automatically, the agent prompts you to create one:
71
+ If no `settings.yaml` exists for the project and no Makefile is found automatically, the agent starts a setup wizard:
65
72
 
66
73
  ```
67
74
  No settings.yaml found for this project.
68
75
  Let's create one. Press Enter to accept the default shown in brackets.
69
76
 
70
- Makefile path [Makefile]: ./my-agent.mk
71
- Model [anthropic/claude-haiku-4-5-20251001]:
77
+ Created ~/.make-agent/Users_alice_proj_myapp/agents/orchestra.mk
78
+ Model (required): anthropic/claude-haiku-4-5-20251001
72
79
 
73
80
  Saved settings to ~/.make-agent/Users_alice_proj_myapp/settings.yaml
74
81
  ```
75
82
 
83
+ If specialist agents already exist in the agents directory, the wizard asks you to choose one instead of creating `orchestra.mk`.
84
+
76
85
  ## Project settings
77
86
 
78
87
  All per-project data is stored under `~/.make-agent/`:
@@ -84,7 +93,7 @@ All per-project data is stored under `~/.make-agent/`:
84
93
  ├── memory.db # conversation history (when memory is enabled)
85
94
  ├── agents/ # specialist agent .mk files
86
95
  └── logs/
87
- └── make-agent.log # debug log (written when --debug is set)
96
+ └── make-agent.log # log output at the selected --loglevel
88
97
  ```
89
98
 
90
99
  The **project slug** is the absolute path of the working directory with the leading `/` stripped and remaining `/` replaced by `_`.
@@ -95,10 +104,11 @@ The **project slug** is the absolute path of the working directory with the lead
95
104
  model: anthropic/claude-haiku-4-5-20251001
96
105
  makefile: ./my-agent.mk
97
106
  memory: true # optional — enable persistent memory
98
- agent_model: anthropic/claude-opus-4-5 # optional — model for run_agent calls
107
+ reasoning_effort: low # optional — none|minimal|low|medium|high|xhigh|auto
99
108
  ```
100
109
 
101
110
  All fields are optional. CLI flags always take precedence over `settings.yaml` values.
111
+ Use `--agent-model` if you want specialists called via `run_agent` to use a different model than the main agent.
102
112
 
103
113
  ## Makefile format
104
114
 
@@ -114,27 +124,30 @@ endef
114
124
  # @param DIR string The directory path to list
115
125
  # </tool>
116
126
  list-files:
117
- @ls -la $(DIR)
127
+ @ls -la "$$DIR"
118
128
 
119
129
  # <tool>
120
130
  # Greet someone.
121
131
  # @param NAME string The name to greet
122
132
  # </tool>
123
133
  greet:
124
- @echo "Hello, $(NAME)!"
134
+ @echo "Hello, $$NAME!"
125
135
  ```
126
136
 
127
137
  ### Special comment blocks
128
138
 
129
139
  - `define SYSTEM_PROMPT ... endef` sets the system prompt passed to the model. The content is raw text — no `#` prefix needed. `endef` must be on its own line with no indentation.
140
+ - `define DESCRIPTION ... endef` is optional metadata used by `list_agent` to describe a specialist.
130
141
  - `# <tool> ... # </tool>` marks the following target as an LLM-callable tool. Lines starting with `# @param NAME type description` declare parameters (JSON Schema primitives: `string`, `number`, `integer`, `boolean`). All other lines form the tool description.
131
142
 
132
- ### Parameters and `$(PARAM_FILE)`
143
+ ### Parameters and `$$PARAM`
133
144
 
134
- Every declared parameter automatically gets two Make variables injected at call time:
145
+ Every declared parameter is injected as an environment variable. Recipes
146
+ access it with shell syntax — `$$PARAM` in a Make recipe becomes `$PARAM` for
147
+ the shell:
135
148
 
136
- - `$(PARAM)` — the value as a Make variable with shell-escaped value. Convenient for single-line values.
137
- - `$(PARAM_FILE)` — path to a temp file containing the full, unescaped value. Use this for multiline content or when the value might contain shell metacharacters.
149
+ - `$$PARAM` — canonical form, works for both single-line and multiline values.
150
+ - `$(PARAM)` — also works for simple single-line values (Make auto-imports env vars).
138
151
 
139
152
  ```makefile
140
153
  # <tool>
@@ -143,7 +156,7 @@ Every declared parameter automatically gets two Make variables injected at call
143
156
  # @param CONTENT string Content to write (may be multiline)
144
157
  # </tool>
145
158
  write-file:
146
- @cat "$(CONTENT_FILE)" > "$(FILE_PATH)"
159
+ @printf '%s' "$$CONTENT" > "$$FILE_PATH"
147
160
  ```
148
161
 
149
162
  Targets without a `# <tool>` block are invisible to the model.
@@ -156,11 +169,18 @@ Every agent automatically receives four built-in tools alongside its Makefile-de
156
169
  |---|---|
157
170
  | `list_agent` | Scan the agents directory and return each specialist's name and description |
158
171
  | `validate_agent` | Parse and validate a named specialist's Makefile, reporting any errors |
159
- | `create_agent` | Generate a new `.mk` file from a YAML spec and save it to the agents directory |
172
+ | `create_agent` | Create or overwrite a specialist `.mk` file from a raw Makefile string |
160
173
  | `run_agent` | Delegate a task to a specialist agent and return its output |
161
174
 
162
175
  The agents directory defaults to `~/.make-agent/<project>/agents/` and can be changed with `--agents-dir`.
163
176
 
177
+ You can disable built-ins per Makefile with `DISABLED_BUILTINS`:
178
+
179
+ ```makefile
180
+ DISABLED_BUILTINS = run_agent,validate_agent
181
+ # or: DISABLED_BUILTINS = all
182
+ ```
183
+
164
184
  ## Memory
165
185
 
166
186
  Agents can persist every conversation turn to a local SQLite database and search it in future sessions.
@@ -194,7 +214,7 @@ When memory is enabled, three additional built-in tools are injected:
194
214
 
195
215
  | Tool | What it does |
196
216
  |---|---|
197
- | `get_recent_messages(limit)` | Return the N most recent messages in chronological order |
217
+ | `get_recent_messages(limit, from_date, to_date)` | Return recent messages in chronological order (optionally date-filtered) |
198
218
  | `search_user_memory(query, limit, from_date, to_date)` | FTS5 keyword search over past user messages |
199
219
  | `search_agent_memory(query, limit, from_date, to_date)` | FTS5 keyword search over past agent replies |
200
220
 
@@ -224,25 +244,28 @@ For every task the orchestrator:
224
244
  2. Delegates to an existing specialist with `run_agent`, or designs and saves a new one with `create_agent` first.
225
245
  3. Improves any specialist by calling `create_agent` with the same name — it overwrites the previous version.
226
246
 
227
- ### YAML spec for `create_agent`
247
+ ### Raw Makefile payload for `create_agent`
228
248
 
229
- ```yaml
230
- system_prompt: "You are a specialist that searches source code for patterns."
231
- tools:
232
- - name: search-files
233
- description: Search files for a text pattern and return matching lines.
234
- params:
235
- - name: PATTERN
236
- type: string
237
- description: The text pattern to search for
238
- - name: DIR
239
- type: string
240
- description: The directory to search in
241
- recipe:
242
- - '@grep -rn "$(PATTERN)" "$(DIR)" || echo "No matches found"'
243
- ```
249
+ ```makefile
250
+ define SYSTEM_PROMPT
251
+ You are a specialist that searches source code for patterns.
252
+ endef
253
+
254
+ # Optional but recommended: shown by list_agent
255
+ define DESCRIPTION
256
+ Searches files for a text pattern and returns matches.
257
+ endef
258
+
259
+ .PHONY: search-files
244
260
 
245
- `make-agent-create` converts this spec into a standard `make-agent` Makefile.
261
+ # <tool>
262
+ # Search files for a text pattern and return matching lines.
263
+ # @param PATTERN string The text pattern to search for
264
+ # @param DIR string The directory to search in
265
+ # </tool>
266
+ search-files:
267
+ @grep -rn "$$PATTERN" "$$DIR" || echo "No matches found"
268
+ ```
246
269
 
247
270
  ## Example
248
271
 
@@ -258,6 +281,11 @@ make_agent -f examples/orchestra.mk
258
281
  | `os-info` | `uname -a` |
259
282
  | `current-date` | `date` |
260
283
 
284
+ Additional specialist examples are available in:
285
+
286
+ - `examples/file-explorer.mk`
287
+ - `examples/file-editor.mk`
288
+
261
289
  ## Running tests
262
290
 
263
291
  ```
@@ -2,12 +2,12 @@
2
2
 
3
3
  An AI agent whose system prompt and tools are defined in a Makefile.
4
4
 
5
- Each Makefile target annotated with a `# <tool>` comment block becomes a callable tool. The agent invokes targets via `make`, passing parameters as `KEY=value` arguments. A `define SYSTEM_PROMPT` block sets the agent's system prompt.
5
+ Each Makefile target annotated with a `# <tool>` comment block becomes a callable tool. The agent invokes targets via `make`, injecting parameters as environment variables. A `define SYSTEM_PROMPT` block sets the agent's system prompt.
6
6
 
7
7
  ## Installation
8
8
 
9
9
  ```
10
- uv pip install .
10
+ pip install makefile-agent
11
11
  ```
12
12
 
13
13
  Requires Python 3.11+ and a working `make` binary. Uses [any-llm-sdk](https://pypi.org/project/any-llm-sdk/) for model access, so any API keys (e.g. `ANTHROPIC_API_KEY`) must be set in the environment.
@@ -26,28 +26,37 @@ ANTHROPIC_API_KEY=<key> uv run make_agent [run] [-f FILE] [--model MODEL] [--pro
26
26
  - `--agent-model MODEL` — model used when running specialist agents via `run_agent` (default: same as `--model`)
27
27
  - `--with-memory` — enable persistent conversation memory (see [Memory](#memory))
28
28
  - `--disable-builtin-tools TOOLS` — comma-separated built-in tool names to disable, or `all`
29
- - `--max-tool-output CHARS` — truncate tool stdout to this many characters; `0` = unlimited (default: 20000)
29
+ - `--max-tool-output CHARS` — truncate tool stdout to this many characters; `0` = unlimited (default: 16000)
30
30
  - `--max-tokens N` — max tokens in the model response (default: 4096)
31
+ - `--reasoning-effort EFFORT` — reasoning effort level: `none|minimal|low|medium|high|xhigh|auto` (default: `auto`)
31
32
  - `--max-retries N` — max retry attempts on rate limit errors (default: 5)
32
33
  - `--tool-timeout SECONDS` — timeout for each tool subprocess (default: 600)
33
- - `--debug` — write all messages to `~/.make-agent/<project>/logs/make-agent.log`
34
+ - `--loglevel LEVEL` — set logging level to DEBUG, INFO, WARNING, ERROR, or CRITICAL (default: INFO)
34
35
 
35
- Without `--prompt`, the agent starts an interactive REPL. Type `exit`, `quit`, or press Ctrl-D to leave.
36
+ Without `--prompt`, the agent starts an interactive REPL. Use `/exit` or `/quit` (or press Ctrl-D) to leave.
37
+
38
+ Interactive shell commands:
39
+
40
+ - `/help` — show available shell commands
41
+ - `/export` — export the current conversation to `conversation-<timestamp>.html`
42
+ - `/stats` — show token usage totals for this session (when memory is enabled)
36
43
 
37
44
  ### First run — setup wizard
38
45
 
39
- If no `settings.yaml` exists for the project and no Makefile is found automatically, the agent prompts you to create one:
46
+ If no `settings.yaml` exists for the project and no Makefile is found automatically, the agent starts a setup wizard:
40
47
 
41
48
  ```
42
49
  No settings.yaml found for this project.
43
50
  Let's create one. Press Enter to accept the default shown in brackets.
44
51
 
45
- Makefile path [Makefile]: ./my-agent.mk
46
- Model [anthropic/claude-haiku-4-5-20251001]:
52
+ Created ~/.make-agent/Users_alice_proj_myapp/agents/orchestra.mk
53
+ Model (required): anthropic/claude-haiku-4-5-20251001
47
54
 
48
55
  Saved settings to ~/.make-agent/Users_alice_proj_myapp/settings.yaml
49
56
  ```
50
57
 
58
+ If specialist agents already exist in the agents directory, the wizard asks you to choose one instead of creating `orchestra.mk`.
59
+
51
60
  ## Project settings
52
61
 
53
62
  All per-project data is stored under `~/.make-agent/`:
@@ -59,7 +68,7 @@ All per-project data is stored under `~/.make-agent/`:
59
68
  ├── memory.db # conversation history (when memory is enabled)
60
69
  ├── agents/ # specialist agent .mk files
61
70
  └── logs/
62
- └── make-agent.log # debug log (written when --debug is set)
71
+ └── make-agent.log # log output at the selected --loglevel
63
72
  ```
64
73
 
65
74
  The **project slug** is the absolute path of the working directory with the leading `/` stripped and remaining `/` replaced by `_`.
@@ -70,10 +79,11 @@ The **project slug** is the absolute path of the working directory with the lead
70
79
  model: anthropic/claude-haiku-4-5-20251001
71
80
  makefile: ./my-agent.mk
72
81
  memory: true # optional — enable persistent memory
73
- agent_model: anthropic/claude-opus-4-5 # optional — model for run_agent calls
82
+ reasoning_effort: low # optional — none|minimal|low|medium|high|xhigh|auto
74
83
  ```
75
84
 
76
85
  All fields are optional. CLI flags always take precedence over `settings.yaml` values.
86
+ Use `--agent-model` if you want specialists called via `run_agent` to use a different model than the main agent.
77
87
 
78
88
  ## Makefile format
79
89
 
@@ -89,27 +99,30 @@ endef
89
99
  # @param DIR string The directory path to list
90
100
  # </tool>
91
101
  list-files:
92
- @ls -la $(DIR)
102
+ @ls -la "$$DIR"
93
103
 
94
104
  # <tool>
95
105
  # Greet someone.
96
106
  # @param NAME string The name to greet
97
107
  # </tool>
98
108
  greet:
99
- @echo "Hello, $(NAME)!"
109
+ @echo "Hello, $$NAME!"
100
110
  ```
101
111
 
102
112
  ### Special comment blocks
103
113
 
104
114
  - `define SYSTEM_PROMPT ... endef` sets the system prompt passed to the model. The content is raw text — no `#` prefix needed. `endef` must be on its own line with no indentation.
115
+ - `define DESCRIPTION ... endef` is optional metadata used by `list_agent` to describe a specialist.
105
116
  - `# <tool> ... # </tool>` marks the following target as an LLM-callable tool. Lines starting with `# @param NAME type description` declare parameters (JSON Schema primitives: `string`, `number`, `integer`, `boolean`). All other lines form the tool description.
106
117
 
107
- ### Parameters and `$(PARAM_FILE)`
118
+ ### Parameters and `$$PARAM`
108
119
 
109
- Every declared parameter automatically gets two Make variables injected at call time:
120
+ Every declared parameter is injected as an environment variable. Recipes
121
+ access it with shell syntax — `$$PARAM` in a Make recipe becomes `$PARAM` for
122
+ the shell:
110
123
 
111
- - `$(PARAM)` — the value as a Make variable with shell-escaped value. Convenient for single-line values.
112
- - `$(PARAM_FILE)` — path to a temp file containing the full, unescaped value. Use this for multiline content or when the value might contain shell metacharacters.
124
+ - `$$PARAM` — canonical form, works for both single-line and multiline values.
125
+ - `$(PARAM)` — also works for simple single-line values (Make auto-imports env vars).
113
126
 
114
127
  ```makefile
115
128
  # <tool>
@@ -118,7 +131,7 @@ Every declared parameter automatically gets two Make variables injected at call
118
131
  # @param CONTENT string Content to write (may be multiline)
119
132
  # </tool>
120
133
  write-file:
121
- @cat "$(CONTENT_FILE)" > "$(FILE_PATH)"
134
+ @printf '%s' "$$CONTENT" > "$$FILE_PATH"
122
135
  ```
123
136
 
124
137
  Targets without a `# <tool>` block are invisible to the model.
@@ -131,11 +144,18 @@ Every agent automatically receives four built-in tools alongside its Makefile-de
131
144
  |---|---|
132
145
  | `list_agent` | Scan the agents directory and return each specialist's name and description |
133
146
  | `validate_agent` | Parse and validate a named specialist's Makefile, reporting any errors |
134
- | `create_agent` | Generate a new `.mk` file from a YAML spec and save it to the agents directory |
147
+ | `create_agent` | Create or overwrite a specialist `.mk` file from a raw Makefile string |
135
148
  | `run_agent` | Delegate a task to a specialist agent and return its output |
136
149
 
137
150
  The agents directory defaults to `~/.make-agent/<project>/agents/` and can be changed with `--agents-dir`.
138
151
 
152
+ You can disable built-ins per Makefile with `DISABLED_BUILTINS`:
153
+
154
+ ```makefile
155
+ DISABLED_BUILTINS = run_agent,validate_agent
156
+ # or: DISABLED_BUILTINS = all
157
+ ```
158
+
139
159
  ## Memory
140
160
 
141
161
  Agents can persist every conversation turn to a local SQLite database and search it in future sessions.
@@ -169,7 +189,7 @@ When memory is enabled, three additional built-in tools are injected:
169
189
 
170
190
  | Tool | What it does |
171
191
  |---|---|
172
- | `get_recent_messages(limit)` | Return the N most recent messages in chronological order |
192
+ | `get_recent_messages(limit, from_date, to_date)` | Return recent messages in chronological order (optionally date-filtered) |
173
193
  | `search_user_memory(query, limit, from_date, to_date)` | FTS5 keyword search over past user messages |
174
194
  | `search_agent_memory(query, limit, from_date, to_date)` | FTS5 keyword search over past agent replies |
175
195
 
@@ -199,25 +219,28 @@ For every task the orchestrator:
199
219
  2. Delegates to an existing specialist with `run_agent`, or designs and saves a new one with `create_agent` first.
200
220
  3. Improves any specialist by calling `create_agent` with the same name — it overwrites the previous version.
201
221
 
202
- ### YAML spec for `create_agent`
222
+ ### Raw Makefile payload for `create_agent`
203
223
 
204
- ```yaml
205
- system_prompt: "You are a specialist that searches source code for patterns."
206
- tools:
207
- - name: search-files
208
- description: Search files for a text pattern and return matching lines.
209
- params:
210
- - name: PATTERN
211
- type: string
212
- description: The text pattern to search for
213
- - name: DIR
214
- type: string
215
- description: The directory to search in
216
- recipe:
217
- - '@grep -rn "$(PATTERN)" "$(DIR)" || echo "No matches found"'
218
- ```
219
-
220
- `make-agent-create` converts this spec into a standard `make-agent` Makefile.
224
+ ```makefile
225
+ define SYSTEM_PROMPT
226
+ You are a specialist that searches source code for patterns.
227
+ endef
228
+
229
+ # Optional but recommended: shown by list_agent
230
+ define DESCRIPTION
231
+ Searches files for a text pattern and returns matches.
232
+ endef
233
+
234
+ .PHONY: search-files
235
+
236
+ # <tool>
237
+ # Search files for a text pattern and return matching lines.
238
+ # @param PATTERN string The text pattern to search for
239
+ # @param DIR string The directory to search in
240
+ # </tool>
241
+ search-files:
242
+ @grep -rn "$$PATTERN" "$$DIR" || echo "No matches found"
243
+ ```
221
244
 
222
245
  ## Example
223
246
 
@@ -233,6 +256,11 @@ make_agent -f examples/orchestra.mk
233
256
  | `os-info` | `uname -a` |
234
257
  | `current-date` | `date` |
235
258
 
259
+ Additional specialist examples are available in:
260
+
261
+ - `examples/file-explorer.mk`
262
+ - `examples/file-editor.mk`
263
+
236
264
  ## Running tests
237
265
 
238
266
  ```