@maincode-ai/matilda-code 0.21.13 → 0.22.0

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 (252) hide show
  1. package/chunks/agent-IUINB66G.js +3 -0
  2. package/chunks/agent-headless-YA2RKYEZ.js +3 -0
  3. package/chunks/{askUserQuestion-BNSWGD26.js → askUserQuestion-RZYBOPLR.js} +3 -3
  4. package/chunks/ca-JKEHLTNL.js +23 -0
  5. package/chunks/chunk-225CZWD7.js +89 -0
  6. package/chunks/{chunk-MEV5XQI2.js → chunk-2XSB5XHX.js} +1 -1
  7. package/chunks/chunk-453BANK3.js +8 -0
  8. package/chunks/{chunk-6M5G5FBH.js → chunk-4UGPARBR.js} +1 -1
  9. package/chunks/{chunk-RNKDFE2S.js → chunk-5B2QERWR.js} +1 -1
  10. package/chunks/chunk-5ETLURI6.js +3 -0
  11. package/chunks/chunk-6NXVLJ3X.js +56 -0
  12. package/chunks/{chunk-QZI2ZGZY.js → chunk-7B65UIHB.js} +1 -1
  13. package/chunks/{chunk-27Q5KW3A.js → chunk-7E2YCGHS.js} +13 -13
  14. package/chunks/{chunk-DHDD5YJC.js → chunk-ARAB5QTM.js} +69 -69
  15. package/chunks/chunk-DUB7JMQV.js +13 -0
  16. package/chunks/chunk-G3F3ZCH2.js +9 -0
  17. package/chunks/chunk-GT6MSEK4.js +3 -0
  18. package/chunks/chunk-HEJO7OBH.js +3 -0
  19. package/chunks/{chunk-6T2GIM76.js → chunk-IHWAOFCQ.js} +1 -1
  20. package/chunks/chunk-ILHNCXBC.js +8 -0
  21. package/chunks/chunk-J3ZCE3TA.js +8 -0
  22. package/chunks/{chunk-AOOZREGV.js → chunk-LBQNFSZ2.js} +1 -1
  23. package/chunks/{chunk-5OHGYMKP.js → chunk-LM6OIN4B.js} +1 -1
  24. package/chunks/{chunk-EZDV7A76.js → chunk-LMZBADPW.js} +1 -1
  25. package/chunks/chunk-MGRXOZAG.js +8 -0
  26. package/chunks/chunk-NBLBE7PE.js +2609 -0
  27. package/chunks/chunk-POGNX7U3.js +31 -0
  28. package/chunks/chunk-PQZ6HKKW.js +80 -0
  29. package/chunks/chunk-QXSBPCBA.js +8 -0
  30. package/chunks/chunk-RHSUTILA.js +9 -0
  31. package/chunks/{chunk-P5TG5CON.js → chunk-RPXRN7E6.js} +1 -1
  32. package/chunks/chunk-TUKNB5CQ.js +33 -0
  33. package/chunks/chunk-UM6CLO7D.js +7 -0
  34. package/chunks/chunk-V2VUANFI.js +120 -0
  35. package/chunks/chunk-V4VILMIK.js +14 -0
  36. package/chunks/chunk-ZSGBDQXU.js +11 -0
  37. package/chunks/{computer-use-J4GAM4M6.js → computer-use-PBCWDTJR.js} +1 -1
  38. package/chunks/{cron-create-IDWSZENI.js → cron-create-PHQ43NYA.js} +1 -1
  39. package/chunks/cron-delete-7RCQIU2U.js +3 -0
  40. package/chunks/cron-list-KKNLLMNN.js +5 -0
  41. package/chunks/de-GMGNR5CZ.js +23 -0
  42. package/chunks/{devtools-XRQ4YJ5S.js → devtools-7YNCRYZV.js} +1 -1
  43. package/chunks/{chunk-OOEH6ZSV.js → dist-UWUWLWTO.js} +2 -2
  44. package/chunks/{edit-X2S2ZXRN.js → edit-ELHNQB5E.js} +1 -1
  45. package/chunks/en-3NQMLVKW.js +23 -0
  46. package/chunks/{enter-worktree-TUCGNCLO.js → enter-worktree-UZIBOBV3.js} +1 -1
  47. package/chunks/enterPlanMode-UHY3DZXE.js +18 -0
  48. package/chunks/{exit-worktree-7FLITFZI.js → exit-worktree-HLG4PDMX.js} +1 -1
  49. package/chunks/{exitPlanMode-O5UUJ3GM.js → exitPlanMode-V4HYNH3J.js} +2 -2
  50. package/chunks/fr-WS3EBB36.js +23 -0
  51. package/chunks/{getMachineId-bsd-ZYBNK2JG.js → getMachineId-bsd-ETKQTB6C.js} +1 -1
  52. package/chunks/{getMachineId-darwin-CM2MQGUI.js → getMachineId-darwin-AKNRWOWB.js} +1 -1
  53. package/chunks/{getMachineId-linux-SYE2KMCW.js → getMachineId-linux-2QSD7FTP.js} +1 -1
  54. package/chunks/{getMachineId-unsupported-6IHVG2XO.js → getMachineId-unsupported-UXSV7I24.js} +1 -1
  55. package/chunks/{getMachineId-win-S3J3JSUM.js → getMachineId-win-4MTFXGP3.js} +1 -1
  56. package/chunks/glob-C5CTWXLP.js +22 -0
  57. package/chunks/{goal-tools-YQOA6OKU.js → goal-tools-BGIWEJ3K.js} +3 -3
  58. package/chunks/{grep-VAB2VSXM.js → grep-BEFTGKHW.js} +1 -1
  59. package/chunks/ja-GBCDQ43R.js +23 -0
  60. package/chunks/keychain-token-storage-FEJZYJBB.js +3 -0
  61. package/chunks/ls-XH55NAD3.js +15 -0
  62. package/chunks/{lsp-NGLDRHZU.js → lsp-BKDCR37G.js} +1 -1
  63. package/chunks/mcp-client-GAQG7MCT.js +3 -0
  64. package/chunks/monitor-NSVUUKCM.js +32 -0
  65. package/chunks/{multipart-parser-JI75T2O5.js → multipart-parser-FKHYAVGR.js} +1 -1
  66. package/chunks/notebook-edit-AXKYC64C.js +17 -0
  67. package/chunks/openaiContentGenerator-66YY6CIM.js +47 -0
  68. package/chunks/pt-VID6J2CM.js +23 -0
  69. package/chunks/read-file-YFJMLS7V.js +3 -0
  70. package/chunks/ripGrep-BEHEB23R.js +3 -0
  71. package/chunks/ru-EB6V6EAN.js +23 -0
  72. package/chunks/scheduler-GKQOREMS.js +8 -0
  73. package/chunks/send-message-GJSEMAZB.js +8 -0
  74. package/chunks/shell-J5Q2UEXH.js +3 -0
  75. package/chunks/{skill-ETQM5NI3.js → skill-3RWNSUNE.js} +1 -1
  76. package/chunks/src-LZEU4AYF.js +5 -0
  77. package/chunks/symbol-search-4VM6J5Y4.js +19 -0
  78. package/chunks/{syntheticOutput-WZDPECYS.js → syntheticOutput-O7LEF3AM.js} +1 -1
  79. package/chunks/task-create-N4IRJBTF.js +3 -0
  80. package/chunks/{task-detach-TBAVUOTC.js → task-detach-RGNQUX3H.js} +1 -1
  81. package/chunks/task-list-Z7JUB4QK.js +9 -0
  82. package/chunks/{task-stop-HDSARSJ6.js → task-stop-L2OWK2PJ.js} +1 -1
  83. package/chunks/{task-update-MW2VT2XV.js → task-update-H5AXVXDS.js} +1 -1
  84. package/chunks/{team-create-VMYNLZCC.js → team-create-FWTIQ2FT.js} +2 -2
  85. package/chunks/team-delete-D45ALROH.js +8 -0
  86. package/chunks/todoWrite-LCQOQBI7.js +3 -0
  87. package/chunks/{tool-search-WX6FOE35.js → tool-search-X6UUCSPU.js} +1 -1
  88. package/chunks/{web-fetch-CKYBHGLF.js → web-fetch-244KUWSX.js} +17 -17
  89. package/chunks/web-search-YRZ3BZ3X.js +26 -0
  90. package/chunks/{workflow-WBSRQG3N.js → workflow-EP4AFR24.js} +2 -2
  91. package/chunks/write-file-EXWGRN4Q.js +15 -0
  92. package/cli.js +641 -678
  93. package/examples/starter/README.md +0 -3
  94. package/locales/ca.js +3 -87
  95. package/locales/de.js +3 -91
  96. package/locales/en.js +3 -91
  97. package/locales/fr.js +3 -88
  98. package/locales/ja.js +3 -92
  99. package/locales/pt.js +3 -92
  100. package/locales/ru.js +3 -91
  101. package/package.json +2 -2
  102. package/sandbox-macos-permissive-proxied.sb +1 -1
  103. package/sandbox-macos-restrictive-closed.sb +14 -1
  104. package/sandbox-macos-restrictive-open.sb +14 -1
  105. package/sandbox-macos-restrictive-proxied.sb +15 -2
  106. package/bundled/mainy/SKILL.md +0 -157
  107. package/bundled/mainy/docs/_meta.ts +0 -32
  108. package/bundled/mainy/docs/common-workflow.md +0 -571
  109. package/bundled/mainy/docs/configuration/_meta.ts +0 -7
  110. package/bundled/mainy/docs/configuration/auth.md +0 -82
  111. package/bundled/mainy/docs/configuration/matilda-ignore.md +0 -55
  112. package/bundled/mainy/docs/configuration/model-providers.md +0 -516
  113. package/bundled/mainy/docs/configuration/settings.md +0 -818
  114. package/bundled/mainy/docs/configuration/themes.md +0 -199
  115. package/bundled/mainy/docs/configuration/trusted-folders.md +0 -67
  116. package/bundled/mainy/docs/extension/_meta.ts +0 -9
  117. package/bundled/mainy/docs/extension/extension-releasing.md +0 -204
  118. package/bundled/mainy/docs/extension/getting-started-extensions.md +0 -299
  119. package/bundled/mainy/docs/extension/introduction.md +0 -338
  120. package/bundled/mainy/docs/features/_meta.ts +0 -27
  121. package/bundled/mainy/docs/features/approval-mode.md +0 -388
  122. package/bundled/mainy/docs/features/arena.md +0 -219
  123. package/bundled/mainy/docs/features/auto-mode.md +0 -308
  124. package/bundled/mainy/docs/features/channels/_meta.ts +0 -5
  125. package/bundled/mainy/docs/features/channels/overview.md +0 -328
  126. package/bundled/mainy/docs/features/channels/plugins.md +0 -87
  127. package/bundled/mainy/docs/features/channels/telegram.md +0 -120
  128. package/bundled/mainy/docs/features/code-review.md +0 -291
  129. package/bundled/mainy/docs/features/commands.md +0 -528
  130. package/bundled/mainy/docs/features/dual-output.md +0 -627
  131. package/bundled/mainy/docs/features/followup-suggestions.md +0 -109
  132. package/bundled/mainy/docs/features/headless.md +0 -448
  133. package/bundled/mainy/docs/features/hooks.md +0 -1308
  134. package/bundled/mainy/docs/features/language.md +0 -144
  135. package/bundled/mainy/docs/features/lsp.md +0 -496
  136. package/bundled/mainy/docs/features/markdown-rendering.md +0 -183
  137. package/bundled/mainy/docs/features/mcp.md +0 -423
  138. package/bundled/mainy/docs/features/memory.md +0 -185
  139. package/bundled/mainy/docs/features/sandbox.md +0 -249
  140. package/bundled/mainy/docs/features/scheduled-tasks.md +0 -139
  141. package/bundled/mainy/docs/features/skills.md +0 -347
  142. package/bundled/mainy/docs/features/status-line.md +0 -397
  143. package/bundled/mainy/docs/features/structured-output.md +0 -309
  144. package/bundled/mainy/docs/features/sub-agents.md +0 -737
  145. package/bundled/mainy/docs/features/tips.md +0 -54
  146. package/bundled/mainy/docs/features/token-caching.md +0 -29
  147. package/bundled/mainy/docs/features/tool-use-summaries.md +0 -178
  148. package/bundled/mainy/docs/features/worktree.md +0 -343
  149. package/bundled/mainy/docs/ide-integration/_meta.ts +0 -4
  150. package/bundled/mainy/docs/ide-integration/ide-companion-spec.md +0 -182
  151. package/bundled/mainy/docs/ide-integration/ide-integration.md +0 -144
  152. package/bundled/mainy/docs/integration-github-action.md +0 -241
  153. package/bundled/mainy/docs/integration-jetbrains.md +0 -81
  154. package/bundled/mainy/docs/integration-vscode.md +0 -39
  155. package/bundled/mainy/docs/integration-zed.md +0 -72
  156. package/bundled/mainy/docs/matilda-serve-deploy-local.md +0 -221
  157. package/bundled/mainy/docs/matilda-serve.md +0 -661
  158. package/bundled/mainy/docs/overview.md +0 -64
  159. package/bundled/mainy/docs/quickstart.md +0 -234
  160. package/bundled/mainy/docs/reference/_meta.ts +0 -3
  161. package/bundled/mainy/docs/reference/keyboard-shortcuts.md +0 -91
  162. package/bundled/mainy/docs/support/Uninstall.md +0 -65
  163. package/bundled/mainy/docs/support/_meta.ts +0 -6
  164. package/bundled/mainy/docs/support/tos-privacy.md +0 -94
  165. package/bundled/mainy/docs/support/troubleshooting.md +0 -127
  166. package/chunks/agent-SRAIVZEE.js +0 -3
  167. package/chunks/agent-headless-XRDOZESG.js +0 -3
  168. package/chunks/anthropicContentGenerator-LLDIKDMQ.js +0 -39
  169. package/chunks/ca-NPYL24ME.js +0 -25
  170. package/chunks/chunk-27HUYW23.js +0 -22
  171. package/chunks/chunk-2HTPVSGT.js +0 -3
  172. package/chunks/chunk-3B2HABK7.js +0 -30
  173. package/chunks/chunk-3MTZTNAU.js +0 -101
  174. package/chunks/chunk-3YLXGE6T.js +0 -8
  175. package/chunks/chunk-47XR7IMP.js +0 -8
  176. package/chunks/chunk-4F4DA5UI.js +0 -8
  177. package/chunks/chunk-4Q2SNBUH.js +0 -18
  178. package/chunks/chunk-6EQMZNIY.js +0 -8
  179. package/chunks/chunk-6I6VGTKD.js +0 -8
  180. package/chunks/chunk-DC7LAFZZ.js +0 -8
  181. package/chunks/chunk-DE3HKC2W.js +0 -9
  182. package/chunks/chunk-FWDMPRKU.js +0 -3
  183. package/chunks/chunk-G7R2XEEF.js +0 -7
  184. package/chunks/chunk-GOJCMVJJ.js +0 -8
  185. package/chunks/chunk-GTVCJCHR.js +0 -8
  186. package/chunks/chunk-IJEGHQ7Z.js +0 -32
  187. package/chunks/chunk-JCE3JAVC.js +0 -25
  188. package/chunks/chunk-KHHJYBR5.js +0 -9
  189. package/chunks/chunk-LUNDTQ3G.js +0 -8
  190. package/chunks/chunk-LWARA7JY.js +0 -37
  191. package/chunks/chunk-M53RP3YP.js +0 -31
  192. package/chunks/chunk-MTMU7JYZ.js +0 -11
  193. package/chunks/chunk-O44XK65C.js +0 -8
  194. package/chunks/chunk-OA56BXPD.js +0 -3
  195. package/chunks/chunk-PEKAUGYV.js +0 -2621
  196. package/chunks/chunk-PGUG43HG.js +0 -24
  197. package/chunks/chunk-PGXQZVLX.js +0 -8
  198. package/chunks/chunk-QKYGQLWC.js +0 -8
  199. package/chunks/chunk-QN6Y6NPA.js +0 -3
  200. package/chunks/chunk-RI54U73U.js +0 -56
  201. package/chunks/chunk-RPFSFS7Z.js +0 -39
  202. package/chunks/chunk-SDTWBD62.js +0 -8
  203. package/chunks/chunk-SOEIVSM5.js +0 -113
  204. package/chunks/chunk-SVSY6AWS.js +0 -59
  205. package/chunks/chunk-T2T2UEPY.js +0 -4
  206. package/chunks/chunk-TISQNFB5.js +0 -3
  207. package/chunks/chunk-TWJLOEAI.js +0 -31
  208. package/chunks/chunk-VI74YQQO.js +0 -8
  209. package/chunks/chunk-VYZOOSMP.js +0 -30
  210. package/chunks/chunk-W4QSMIWO.js +0 -9
  211. package/chunks/chunk-WC2VTVCE.js +0 -27
  212. package/chunks/chunk-YV3PUOBU.js +0 -65
  213. package/chunks/chunk-ZX34M2GF.js +0 -14
  214. package/chunks/contextCommand-5F5M7NA4.js +0 -3
  215. package/chunks/cron-delete-NQCDZDUI.js +0 -3
  216. package/chunks/cron-list-Z4XMC3TO.js +0 -5
  217. package/chunks/de-34YZHGC6.js +0 -25
  218. package/chunks/dist-7UYRLSLE.js +0 -3
  219. package/chunks/dist-PH6JW7XD.js +0 -42
  220. package/chunks/en-QLGMD6OS.js +0 -25
  221. package/chunks/enterPlanMode-SQEZAAIR.js +0 -18
  222. package/chunks/fileFromPath-7UCWPD4W.js +0 -3
  223. package/chunks/fr-EDNBQACJ.js +0 -25
  224. package/chunks/geminiContentGenerator-FIZFLPU3.js +0 -8
  225. package/chunks/glob-GSFTYAS2.js +0 -22
  226. package/chunks/ja-LV4RLM3M.js +0 -25
  227. package/chunks/keychain-token-storage-KQK6MNOJ.js +0 -3
  228. package/chunks/ls-IZJ3CKZY.js +0 -15
  229. package/chunks/matildaAgentContentGenerator-QQHPCFJ5.js +0 -8
  230. package/chunks/matildaContentGenerator-W7Z33ONU.js +0 -8
  231. package/chunks/matildaOAuth2-7COTQQR2.js +0 -3
  232. package/chunks/mcp-client-DXUNIEIB.js +0 -3
  233. package/chunks/monitor-4PFIGAGG.js +0 -32
  234. package/chunks/notebook-edit-MWJYAATJ.js +0 -17
  235. package/chunks/openaiContentGenerator-NDVJL6QL.js +0 -3
  236. package/chunks/pt-5SQ4DGL7.js +0 -25
  237. package/chunks/read-file-WPZKPXWA.js +0 -3
  238. package/chunks/ripGrep-7LZDZFTX.js +0 -3
  239. package/chunks/ru-7K24S53N.js +0 -25
  240. package/chunks/scheduler-DK2MVKXX.js +0 -8
  241. package/chunks/send-message-TCPX5UDU.js +0 -8
  242. package/chunks/serve-GSZPJI2O.js +0 -1026
  243. package/chunks/shell-PRS47PDP.js +0 -3
  244. package/chunks/src-UB7DZRYK.js +0 -3
  245. package/chunks/src-WZTRMETQ.js +0 -5
  246. package/chunks/symbol-search-HARHZ5AH.js +0 -19
  247. package/chunks/task-create-XRNIDT4T.js +0 -3
  248. package/chunks/task-list-Z6BDZZID.js +0 -9
  249. package/chunks/team-delete-F7QDC2TE.js +0 -8
  250. package/chunks/todoWrite-SCF5M24M.js +0 -3
  251. package/chunks/web-search-67DFNS5V.js +0 -26
  252. package/chunks/write-file-S5FAX4JJ.js +0 -15
@@ -1,737 +0,0 @@
1
- # Subagents
2
-
3
- Subagents are specialized AI assistants that handle specific types of tasks within Matilda Code. They allow you to delegate focused work to AI agents that are configured with task-specific prompts, tools, and behaviors.
4
-
5
- ## What are Subagents?
6
-
7
- Subagents are independent AI assistants that:
8
-
9
- - **Specialize in specific tasks** - Each Subagent is configured with a focused system prompt for particular types of work
10
- - **Have separate context** - They maintain their own conversation history, separate from your main chat
11
- - **Use controlled tools** - You can configure which tools each Subagent has access to
12
- - **Work autonomously** - Once given a task, they work independently until completion or failure
13
- - **Provide detailed feedback** - You can see their progress, tool usage, and execution statistics in real-time
14
-
15
- ## Fork Subagent
16
-
17
- In addition to named subagents, Matilda Code supports **forking** — selected explicitly with `subagent_type: "fork"` (available in interactive sessions). A fork inherits the parent's full conversation context and runs detached in the background. Omitting `subagent_type` does **not** fork; it launches the general-purpose subagent, which runs to completion and returns its result inline.
18
-
19
- ### How Fork Differs from Named Subagents
20
-
21
- | | Named Subagent | Fork Subagent |
22
- | ------------- | --------------------------------- | ----------------------------------------------------- |
23
- | Context | Starts fresh, no parent history | Inherits parent's full conversation history |
24
- | System prompt | Uses its own configured prompt | Uses parent's exact system prompt (for cache sharing) |
25
- | Execution | Blocks the parent until done | Runs in background, parent continues immediately |
26
- | Use case | Specialized tasks (testing, docs) | Parallel tasks that need the current context |
27
-
28
- ### When Fork is Used
29
-
30
- The AI automatically uses fork when it needs to:
31
-
32
- - Run multiple research tasks in parallel (e.g., "investigate module A, B, and C")
33
- - Perform background work while continuing the main conversation
34
- - Delegate tasks that require understanding of the current conversation context
35
-
36
- ### Prompt Cache Sharing
37
-
38
- All forks share the parent's exact API request prefix (system prompt, tools, conversation history), enabling Matilda-compatible prompt cache hits. When 3 forks run in parallel, the shared prefix is cached once and reused — saving 80%+ token costs compared to independent subagents.
39
-
40
- ### Recursive Fork Prevention
41
-
42
- Fork children cannot create further forks. This is enforced at runtime — if a fork attempts to spawn another fork, it receives an error instructing it to execute tasks directly.
43
-
44
- ### Current Limitations
45
-
46
- - **No result feedback**: Fork results are reflected in the UI progress display but are not automatically fed back into the main conversation. The parent AI sees a placeholder message and cannot act on the fork's output.
47
- - **No worktree isolation**: Forks share the parent's working directory. Concurrent file modifications from multiple forks may conflict.
48
-
49
- ## Key Benefits
50
-
51
- - **Task Specialization**: Create agents optimized for specific workflows (testing, documentation, refactoring, etc.)
52
- - **Context Isolation**: Keep specialized work separate from your main conversation
53
- - **Context Inheritance**: Fork subagents inherit the full conversation for context-heavy parallel tasks
54
- - **Prompt Cache Sharing**: Fork subagents share the parent's cache prefix, reducing token costs
55
- - **Reusability**: Save and reuse agent configurations across projects and sessions
56
- - **Controlled Access**: Limit which tools each agent can use for security and focus
57
- - **Progress Visibility**: Monitor agent execution with real-time progress updates
58
-
59
- ## How Subagents Work
60
-
61
- 1. **Configuration**: You create Subagents configurations that define their behavior, tools, and system prompts
62
- 2. **Delegation**: The main AI can automatically delegate tasks to appropriate Subagents — or fork itself (`subagent_type: "fork"`) when it wants to inherit the full conversation context and discard the intermediate output
63
- 3. **Execution**: Subagents work independently, using their configured tools to complete tasks
64
- 4. **Results**: They return results and execution summaries back to the main conversation
65
-
66
- ## Getting Started
67
-
68
- ### Quick Start
69
-
70
- 1. **Create your first Subagent**:
71
-
72
- `/agents create`
73
-
74
- Follow the guided wizard to create a specialized agent.
75
-
76
- 2. **Manage existing agents**:
77
-
78
- `/agents manage`
79
-
80
- View and manage your configured Subagents.
81
-
82
- 3. **Use Subagents automatically**: Simply ask the main AI to perform tasks that match your Subagents' specializations. The AI will automatically delegate appropriate work.
83
-
84
- ### Example Usage
85
-
86
- ```
87
- User: "Please write comprehensive tests for the authentication module"
88
- AI: I'll delegate this to your testing specialist Subagents.
89
- [Delegates to "testing-expert" Subagents]
90
- [Shows real-time progress of test creation]
91
- [Returns with completed test files and execution summary]`
92
- ```
93
-
94
- ## Management
95
-
96
- ### CLI Commands
97
-
98
- Subagents are managed through the `/agents` slash command and its subcommands:
99
-
100
- **Usage:**:`/agents create`。Creates a new Subagent through a guided step wizard.
101
-
102
- **Usage:**:`/agents manage`。Opens an interactive management dialog for viewing and managing existing Subagents.
103
-
104
- ### Storage Locations
105
-
106
- Subagents are stored as Markdown files in multiple locations:
107
-
108
- - **Project-level**: `.matilda/agents/` (highest precedence)
109
- - **User-level**: `~/.matilda/agents/` (fallback)
110
- - **Extension-level**: Provided by installed extensions
111
-
112
- This allows you to have project-specific agents, personal agents that work across all projects, and extension-provided agents that add specialized capabilities.
113
-
114
- ### Extension Subagents
115
-
116
- Extensions can provide custom subagents that become available when the extension is enabled. These agents are stored in the extension's `agents/` directory and follow the same format as personal and project agents.
117
-
118
- Extension subagents:
119
-
120
- - Are automatically discovered when the extension is enabled
121
- - Appear in the `/agents manage` dialog under "Extension Agents" section
122
- - Cannot be edited directly (edit the extension source instead)
123
- - Follow the same configuration format as user-defined agents
124
-
125
- To see which extensions provide subagents, check the extension's `matilda-extension.json` file for an `agents` field.
126
-
127
- ### File Format
128
-
129
- Subagents are configured using Markdown files with YAML frontmatter. This format is human-readable and easy to edit with any text editor.
130
-
131
- #### Basic Structure
132
-
133
- ```
134
- ---
135
- name: agent-name
136
- description: Brief description of when and how to use this agent
137
- model: inherit # Optional: inherit, fast, modelId, or authType:modelId
138
- approvalMode: auto-edit # Optional: default, plan, auto-edit, yolo, bubble
139
- tools: # Optional: allowlist of tools
140
- - tool1
141
- - tool2
142
- disallowedTools: # Optional: blocklist of tools
143
- - tool3
144
- ---
145
-
146
- System prompt content goes here.
147
- Multiple paragraphs are supported.
148
- ```
149
-
150
- #### Model Selection
151
-
152
- Use the optional `model` frontmatter field to control which model a subagent uses:
153
-
154
- - `inherit`: Use the same model as the main conversation.
155
- - Omit the field: Same as `inherit`.
156
- - `fast`: Use the configured `fastModel`. If no valid fast model is configured,
157
- the subagent falls back to `inherit`.
158
- - `glm-5`: Use that model ID. Matilda Code first checks the main conversation's
159
- auth type; if the model is not available there, it can resolve the model from
160
- another configured provider.
161
- - `openai:gpt-4o`: Use an explicit provider and model ID. This is useful when a
162
- subagent should run on a model registered under a different auth type from the
163
- main conversation.
164
-
165
- For example:
166
-
167
- ```
168
- ---
169
- name: fast-reviewer
170
- description: Reviews small diffs with the configured fast model
171
- model: fast
172
- tools:
173
- - read_file
174
- - grep_search
175
- ---
176
- ```
177
-
178
- ```
179
- ---
180
- name: openai-researcher
181
- description: Uses an OpenAI-compatible provider for research tasks
182
- model: openai:gpt-4o
183
- tools:
184
- - read_file
185
- - grep_search
186
- - glob
187
- ---
188
- ```
189
-
190
- The `fast` selector uses the same `fastModel` setting configured in
191
- `settings.json` or with `/model --fast`. That setting may itself refer to a
192
- model under another configured auth type, such as `openai:deepseek-v4-flash`.
193
- When the selector resolves to another auth type, Matilda Code creates a dedicated
194
- runtime provider for that subagent request and sends the provider only the bare
195
- model ID.
196
-
197
- #### Permission Mode
198
-
199
- Use the optional `approvalMode` frontmatter field to control how a subagent's tool calls are approved. Valid values:
200
-
201
- - `default`: Tools require interactive approval (same as the main session default)
202
- - `plan`: Analyze-only mode — the agent plans but does not execute changes
203
- - `auto-edit`: Tools are auto-approved without prompting (recommended for most agents)
204
- - `yolo`: All tools auto-approved, including potentially destructive ones
205
- - `bubble`: Background-agent tool approvals are surfaced in the parent session
206
-
207
- If you omit this field, the subagent's permission mode is determined automatically:
208
-
209
- - If the parent session is in **yolo** or **auto-edit** mode, the subagent inherits that mode. A permissive parent stays permissive.
210
- - If the parent session is in **plan** mode, the subagent stays in plan mode. An analyze-only session cannot mutate files through a delegated agent.
211
- - If the parent session is in **default** mode (in a trusted folder), the subagent gets **auto-edit** so it can work autonomously.
212
-
213
- When you do set `approvalMode`, the parent's permissive modes still take priority. For example, if the parent is in yolo mode, a subagent with `approvalMode: plan` will still run in yolo mode.
214
-
215
- ```
216
- ---
217
- name: cautious-reviewer
218
- description: Reviews code without making changes
219
- approvalMode: plan
220
- tools:
221
- - read_file
222
- - grep_search
223
- - glob
224
- ---
225
-
226
- You are a code reviewer. Analyze the code and report findings.
227
- Do not modify any files.
228
- ```
229
-
230
- #### Tool Configuration
231
-
232
- Use `tools` and `disallowedTools` to control which tools a subagent can access.
233
-
234
- **`tools` (allowlist):** When specified, the subagent can only use the listed tools. When omitted, the subagent inherits all available tools from the parent session.
235
-
236
- ```
237
- ---
238
- name: reader
239
- description: Read-only agent for code exploration
240
- tools:
241
- - read_file
242
- - grep_search
243
- - glob
244
- - list_directory
245
- ---
246
- ```
247
-
248
- **`disallowedTools` (blocklist):** When specified, the listed tools are removed from the subagent's tool pool. This is useful when you want "everything except X" without listing every permitted tool.
249
-
250
- ```
251
- ---
252
- name: safe-worker
253
- description: Agent that cannot modify files
254
- disallowedTools:
255
- - write_file
256
- - edit
257
- - run_shell_command
258
- ---
259
- ```
260
-
261
- If both `tools` and `disallowedTools` are set, the allowlist is applied first, then the blocklist removes from that set.
262
-
263
- **MCP tools** follow the same rules. If a subagent has no `tools` list, it inherits all MCP tools from the parent session. If a subagent has an explicit `tools` list, it only gets MCP tools that are explicitly named in that list.
264
-
265
- The `disallowedTools` field supports MCP server-level patterns:
266
-
267
- - `mcp__server__tool_name` — blocks a specific MCP tool
268
- - `mcp__server` — blocks all tools from that MCP server
269
-
270
- ```
271
- ---
272
- name: no-slack
273
- description: Agent without Slack access
274
- disallowedTools:
275
- - mcp__slack
276
- ---
277
- ```
278
-
279
- #### Claude Code Compatibility Fields
280
-
281
- Matilda Code accepts the Claude Code 2.1.168 frontmatter fields below so you
282
- can drop a CC agent file into `.matilda/agents/` and have the supported fields
283
- parse identically. Optional fields with invalid values are silently dropped
284
- at parse time rather than rejected — the same lenient posture CC uses.
285
-
286
- | Field | Type | Notes |
287
- | ---------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
288
- | `permissionMode` | enum string | `acceptEdits`, `auto`, `bypassPermissions`, `default`, `dontAsk`, `plan`. Mapped to `approvalMode` at parse time; when both are set, the explicit `approvalMode` wins. |
289
- | `maxTurns` | positive integer | Caps the agent's turn budget. Wired into `runConfig.max_turns` at runtime; when both are set, the top-level field wins. The legacy nested value is pruned from the on-disk file on save to avoid two sources of truth. |
290
- | `color` | enum string | Display color. Allowlist: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan` (mirrors CC's `_Y`). The legacy matilda sentinel `auto` is preserved for backward compatibility. Other values are silently dropped on parse. |
291
- | `mcpServers` | record of specs | Per-agent MCP server overrides. Merged with the session-level MCP server set when the agent spawns; on key collision the agent's spec wins (matching CC's `scope: 'agent'` semantics). Malformed entries are dropped per-key with a warning rather than failing the whole agent. |
292
- | `hooks` | record of arrays | Per-agent hooks. Keys are CC hook event names (`PreToolUse`, `PostToolUse`, `UserPromptSubmit`, …); values are arrays of `{ matcher?, hooks: [...] }` definitions in the same shape as `settings.json`'s `hooks` field. Registered while the agent runs, removed when it stops. |
293
-
294
- Example with all of the above:
295
-
296
- ```
297
- ---
298
- name: rigorous-reviewer
299
- description: Deep code review with a turn cap
300
- permissionMode: plan
301
- maxTurns: 50
302
- color: cyan
303
- tools:
304
- - read_file
305
- - grep_search
306
- - glob
307
- mcpServers:
308
- filesystem:
309
- type: stdio
310
- command: node
311
- args: [/usr/local/lib/mcp-fs/server.js]
312
- hooks:
313
- PreToolUse:
314
- - matcher: Bash
315
- hooks:
316
- - type: command
317
- command: echo "review-agent about to run a shell command"
318
- ---
319
-
320
- You are a code reviewer. Analyze the code thoroughly and report findings
321
- ordered by severity.
322
- ```
323
-
324
- The remaining CC frontmatter fields — `effort`, `skills`, `initialPrompt`,
325
- `memory`, `isolation` — are documented in the declarative-agent design doc
326
- and land in follow-up PRs once the prerequisite infrastructure exists
327
- (`effort` needs a model-layer parameter; `memory` needs a scoped memory
328
- subsystem; `--agent` CLI flag enables `initialPrompt`; etc.).
329
-
330
- > **`hooks` v1 limitation.** While a subagent declaring `hooks` is running,
331
- > its hook entries fire for every matching event in the session, not only
332
- > for that subagent's own tool calls. If two subagents with different
333
- > per-agent hook sets run concurrently, both sets fire for both agents.
334
- > Per-agent scope filtering at hook-firing time is left to a follow-up;
335
- > for v1, prefer per-agent hooks that are safe to fire globally for the
336
- > duration of the agent's run (e.g. logging) over hooks that mutate
337
- > behavior.
338
-
339
- #### Example Usage
340
-
341
- ```
342
- ---
343
- name: project-documenter
344
- description: Creates project documentation and README files
345
- ---
346
-
347
- You are a documentation specialist.
348
-
349
- Focus on creating clear, comprehensive documentation that helps both
350
- new contributors and end users understand the project.
351
- ```
352
-
353
- ## Using Subagents Effectively
354
-
355
- ### Automatic Delegation
356
-
357
- Matilda Code proactively delegates tasks based on:
358
-
359
- - The task description in your request
360
- - The description field in Subagents configurations
361
- - Current context and available tools
362
-
363
- To encourage more proactive Subagents use, include phrases like "use PROACTIVELY" or "MUST BE USED" in your description field.
364
-
365
- ### Explicit Invocation
366
-
367
- Request a specific Subagent by mentioning it in your command:
368
-
369
- ```
370
- Let the testing-expert Subagents create unit tests for the payment module
371
- Have the documentation-writer Subagents update the API reference
372
- Get the react-specialist Subagents to optimize this component's performance
373
- ```
374
-
375
- ## Examples
376
-
377
- ### Development Workflow Agents
378
-
379
- #### Testing Specialist
380
-
381
- Perfect for comprehensive test creation and test-driven development.
382
-
383
- ```
384
- ---
385
- name: testing-expert
386
- description: Writes comprehensive unit tests, integration tests, and handles test automation with best practices
387
- tools:
388
- - read_file
389
- - write_file
390
- - read_many_files
391
- - run_shell_command
392
- ---
393
-
394
- You are a testing specialist focused on creating high-quality, maintainable tests.
395
-
396
- Your expertise includes:
397
-
398
- - Unit testing with appropriate mocking and isolation
399
- - Integration testing for component interactions
400
- - Test-driven development practices
401
- - Edge case identification and comprehensive coverage
402
- - Performance and load testing when appropriate
403
-
404
- For each testing task:
405
-
406
- 1. Analyze the code structure and dependencies
407
- 2. Identify key functionality, edge cases, and error conditions
408
- 3. Create comprehensive test suites with descriptive names
409
- 4. Include proper setup/teardown and meaningful assertions
410
- 5. Add comments explaining complex test scenarios
411
- 6. Ensure tests are maintainable and follow DRY principles
412
-
413
- Always follow testing best practices for the detected language and framework.
414
- Focus on both positive and negative test cases.
415
- ```
416
-
417
- **Use Cases:**
418
-
419
- - “Write unit tests for the authentication service”
420
- - “Create integration tests for the payment processing workflow”
421
- - “Add test coverage for edge cases in the data validation module”
422
-
423
- #### Documentation Writer
424
-
425
- Specialized in creating clear, comprehensive documentation.
426
-
427
- ```
428
- ---
429
- name: documentation-writer
430
- description: Creates comprehensive documentation, README files, API docs, and user guides
431
- tools:
432
- - read_file
433
- - write_file
434
- - read_many_files
435
- ---
436
-
437
- You are a technical documentation specialist.
438
-
439
- Your role is to create clear, comprehensive documentation that serves both
440
- developers and end users. Focus on:
441
-
442
- **For API Documentation:**
443
-
444
- - Clear endpoint descriptions with examples
445
- - Parameter details with types and constraints
446
- - Response format documentation
447
- - Error code explanations
448
- - Authentication requirements
449
-
450
- **For User Documentation:**
451
-
452
- - Step-by-step instructions with screenshots when helpful
453
- - Installation and setup guides
454
- - Configuration options and examples
455
- - Troubleshooting sections for common issues
456
- - FAQ sections based on common user questions
457
-
458
- **For Developer Documentation:**
459
-
460
- - Architecture overviews and design decisions
461
- - Code examples that actually work
462
- - Contributing guidelines
463
- - Development environment setup
464
-
465
- Always verify code examples and ensure documentation stays current with
466
- the actual implementation. Use clear headings, bullet points, and examples.
467
- ```
468
-
469
- **Use Cases:**
470
-
471
- - “Create API documentation for the user management endpoints”
472
- - “Write a comprehensive README for this project”
473
- - “Document the deployment process with troubleshooting steps”
474
-
475
- #### Code Reviewer
476
-
477
- Focused on code quality, security, and best practices.
478
-
479
- ```
480
- ---
481
- name: code-reviewer
482
- description: Reviews code for best practices, security issues, performance, and maintainability
483
- tools:
484
- - read_file
485
- - read_many_files
486
- ---
487
-
488
- You are an experienced code reviewer focused on quality, security, and maintainability.
489
-
490
- Review criteria:
491
-
492
- - **Code Structure**: Organization, modularity, and separation of concerns
493
- - **Performance**: Algorithmic efficiency and resource usage
494
- - **Security**: Vulnerability assessment and secure coding practices
495
- - **Best Practices**: Language/framework-specific conventions
496
- - **Error Handling**: Proper exception handling and edge case coverage
497
- - **Readability**: Clear naming, comments, and code organization
498
- - **Testing**: Test coverage and testability considerations
499
-
500
- Provide constructive feedback with:
501
-
502
- 1. **Critical Issues**: Security vulnerabilities, major bugs
503
- 2. **Important Improvements**: Performance issues, design problems
504
- 3. **Minor Suggestions**: Style improvements, refactoring opportunities
505
- 4. **Positive Feedback**: Well-implemented patterns and good practices
506
-
507
- Focus on actionable feedback with specific examples and suggested solutions.
508
- Prioritize issues by impact and provide rationale for recommendations.
509
- ```
510
-
511
- **Use Cases:**
512
-
513
- - “Review this authentication implementation for security issues”
514
- - “Check the performance implications of this database query logic”
515
- - “Evaluate the code structure and suggest improvements”
516
-
517
- ### Technology-Specific Agents
518
-
519
- #### React Specialist
520
-
521
- Optimized for React development, hooks, and component patterns.
522
-
523
- ```
524
- ---
525
- name: react-specialist
526
- description: Expert in React development, hooks, component patterns, and modern React best practices
527
- tools:
528
- - read_file
529
- - write_file
530
- - read_many_files
531
- - run_shell_command
532
- ---
533
-
534
- You are a React specialist with deep expertise in modern React development.
535
-
536
- Your expertise covers:
537
-
538
- - **Component Design**: Functional components, custom hooks, composition patterns
539
- - **State Management**: useState, useReducer, Context API, and external libraries
540
- - **Performance**: React.memo, useMemo, useCallback, code splitting
541
- - **Testing**: React Testing Library, Jest, component testing strategies
542
- - **TypeScript Integration**: Proper typing for props, hooks, and components
543
- - **Modern Patterns**: Suspense, Error Boundaries, Concurrent Features
544
-
545
- For React tasks:
546
-
547
- 1. Use functional components and hooks by default
548
- 2. Implement proper TypeScript typing
549
- 3. Follow React best practices and conventions
550
- 4. Consider performance implications
551
- 5. Include appropriate error handling
552
- 6. Write testable, maintainable code
553
-
554
- Always stay current with React best practices and avoid deprecated patterns.
555
- Focus on accessibility and user experience considerations.
556
- ```
557
-
558
- **Use Cases:**
559
-
560
- - “Create a reusable data table component with sorting and filtering”
561
- - “Implement a custom hook for API data fetching with caching”
562
- - “Refactor this class component to use modern React patterns”
563
-
564
- #### Python Expert
565
-
566
- Specialized in Python development, frameworks, and best practices.
567
-
568
- ```
569
- ---
570
- name: python-expert
571
- description: Expert in Python development, frameworks, testing, and Python-specific best practices
572
- tools:
573
- - read_file
574
- - write_file
575
- - read_many_files
576
- - run_shell_command
577
- ---
578
-
579
- You are a Python expert with deep knowledge of the Python ecosystem.
580
-
581
- Your expertise includes:
582
-
583
- - **Core Python**: Pythonic patterns, data structures, algorithms
584
- - **Frameworks**: Django, Flask, FastAPI, SQLAlchemy
585
- - **Testing**: pytest, unittest, mocking, test-driven development
586
- - **Data Science**: pandas, numpy, matplotlib, jupyter notebooks
587
- - **Async Programming**: asyncio, async/await patterns
588
- - **Package Management**: pip, poetry, virtual environments
589
- - **Code Quality**: PEP 8, type hints, linting with pylint/flake8
590
-
591
- For Python tasks:
592
-
593
- 1. Follow PEP 8 style guidelines
594
- 2. Use type hints for better code documentation
595
- 3. Implement proper error handling with specific exceptions
596
- 4. Write comprehensive docstrings
597
- 5. Consider performance and memory usage
598
- 6. Include appropriate logging
599
- 7. Write testable, modular code
600
-
601
- Focus on writing clean, maintainable Python code that follows community standards.
602
- ```
603
-
604
- **Use Cases:**
605
-
606
- - “Create a FastAPI service for user authentication with JWT tokens”
607
- - “Implement a data processing pipeline with pandas and error handling”
608
- - “Write a CLI tool using argparse with comprehensive help documentation”
609
-
610
- ## Best Practices
611
-
612
- ### Design Principles
613
-
614
- #### Single Responsibility Principle
615
-
616
- Each Subagent should have a clear, focused purpose.
617
-
618
- **✅ Good:**
619
-
620
- ```
621
- ---
622
- name: testing-expert
623
- description: Writes comprehensive unit tests and integration tests
624
- ---
625
- ```
626
-
627
- **❌ Avoid:**
628
-
629
- ```
630
- ---
631
- name: general-helper
632
- description: Helps with testing, documentation, code review, and deployment
633
- ---
634
- ```
635
-
636
- **Why:** Focused agents produce better results and are easier to maintain.
637
-
638
- #### Clear Specialization
639
-
640
- Define specific expertise areas rather than broad capabilities.
641
-
642
- **✅ Good:**
643
-
644
- ```
645
- ---
646
- name: react-performance-optimizer
647
- description: Optimizes React applications for performance using profiling and best practices
648
- ---
649
- ```
650
-
651
- **❌ Avoid:**
652
-
653
- ```
654
- ---
655
- name: frontend-developer
656
- description: Works on frontend development tasks
657
- ---
658
- ```
659
-
660
- **Why:** Specific expertise leads to more targeted and effective assistance.
661
-
662
- #### Actionable Descriptions
663
-
664
- Write descriptions that clearly indicate when to use the agent.
665
-
666
- **✅ Good:**
667
-
668
- ```
669
- description: Reviews code for security vulnerabilities, performance issues, and maintainability concerns
670
- ```
671
-
672
- **❌ Avoid:**
673
-
674
- ```
675
- description: A helpful code reviewer
676
- ```
677
-
678
- **Why:** Clear descriptions help the main AI choose the right agent for each task.
679
-
680
- ### Configuration Best Practices
681
-
682
- #### System Prompt Guidelines
683
-
684
- **Be Specific About Expertise:**
685
-
686
- ```
687
- You are a Python testing specialist with expertise in:
688
-
689
- - pytest framework and fixtures
690
- - Mock objects and dependency injection
691
- - Test-driven development practices
692
- - Performance testing with pytest-benchmark
693
- ```
694
-
695
- **Include Step-by-Step Approaches:**
696
-
697
- ```
698
- For each testing task:
699
-
700
- 1. Analyze the code structure and dependencies
701
- 2. Identify key functionality and edge cases
702
- 3. Create comprehensive test suites with clear naming
703
- 4. Include setup/teardown and proper assertions
704
- 5. Add comments explaining complex test scenarios
705
- ```
706
-
707
- **Specify Output Standards:**
708
-
709
- ```
710
- Always follow these standards:
711
-
712
- - Use descriptive test names that explain the scenario
713
- - Include both positive and negative test cases
714
- - Add docstrings for complex test functions
715
- - Ensure tests are independent and can run in any order
716
- ```
717
-
718
- ## Security Considerations
719
-
720
- - **Tool Restrictions**: Use `tools` to limit which tools a subagent can access, or `disallowedTools` to block specific tools while inheriting everything else
721
- - **Permission Mode**: Subagents inherit their parent's permission mode by default. Plan-mode sessions cannot escalate to auto-edit through delegated agents. Privileged modes (auto-edit, yolo) are blocked in untrusted folders.
722
- - **Provider Selection**: A subagent with `model: authType:modelId`, or
723
- `model: fast` where `fastModel` resolves to another auth type, sends that
724
- subagent's model requests to the selected provider. Make sure that provider is
725
- appropriate for the subagent's task and data.
726
- - **Sandboxing**: All tool execution follows the same security model as direct tool use
727
- - **Audit Trail**: All Subagents actions are logged and visible in real-time
728
- - **Access Control**: Project and user-level separation provides appropriate boundaries
729
- - **Sensitive Information**: Avoid including secrets or credentials in agent configurations
730
- - **Production Environments**: Consider separate agents for production vs development environments
731
-
732
- ## Limits
733
-
734
- The following soft warnings apply to Subagent configurations (no hard limits are enforced):
735
-
736
- - **Description Field**: A warning is shown for descriptions exceeding 1,000 characters
737
- - **System Prompt**: A warning is shown for system prompts exceeding 10,000 characters