@goondocks/myco 0.20.2 → 0.21.1

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 (216) hide show
  1. package/bin/myco-run +68 -7
  2. package/dist/agent-eval-YK2VP2S4.js +356 -0
  3. package/dist/agent-eval-YK2VP2S4.js.map +1 -0
  4. package/dist/{agent-run-X25Q2A6T.js → agent-run-GEJBD2YD.js} +10 -8
  5. package/dist/{agent-run-X25Q2A6T.js.map → agent-run-GEJBD2YD.js.map} +1 -1
  6. package/dist/{agent-tasks-7B6OFERB.js → agent-tasks-5XSRGTRX.js} +10 -8
  7. package/dist/{agent-tasks-7B6OFERB.js.map → agent-tasks-5XSRGTRX.js.map} +1 -1
  8. package/dist/{chunk-OD4AA7PV.js → chunk-53RPGOEN.js} +56 -8
  9. package/dist/chunk-53RPGOEN.js.map +1 -0
  10. package/dist/chunk-54SXG5HF.js +26 -0
  11. package/dist/chunk-54SXG5HF.js.map +1 -0
  12. package/dist/{chunk-XATDZX7U.js → chunk-6ALVMIB4.js} +19 -5
  13. package/dist/{chunk-XATDZX7U.js.map → chunk-6ALVMIB4.js.map} +1 -1
  14. package/dist/{chunk-FLLBJLHM.js → chunk-6C6QZ4PM.js} +9 -5
  15. package/dist/chunk-6C6QZ4PM.js.map +1 -0
  16. package/dist/{chunk-CCRGY3QW.js → chunk-AUIXX33A.js} +24 -95
  17. package/dist/chunk-AUIXX33A.js.map +1 -0
  18. package/dist/chunk-CISWUP5W.js +101 -0
  19. package/dist/chunk-CISWUP5W.js.map +1 -0
  20. package/dist/{chunk-MYOZLMB2.js → chunk-DTWUHHFI.js} +576 -20
  21. package/dist/chunk-DTWUHHFI.js.map +1 -0
  22. package/dist/chunk-EEOJWLMP.js +582 -0
  23. package/dist/chunk-EEOJWLMP.js.map +1 -0
  24. package/dist/{chunk-XG5RRUYF.js → chunk-ENZR5NG7.js} +2 -2
  25. package/dist/{chunk-6RFZWV4R.js → chunk-FCJ5JV54.js} +1 -1
  26. package/dist/{chunk-6RFZWV4R.js.map → chunk-FCJ5JV54.js.map} +1 -1
  27. package/dist/{chunk-US4LNCAT.js → chunk-IPPMYQ2Y.js} +5 -1
  28. package/dist/chunk-IPPMYQ2Y.js.map +1 -0
  29. package/dist/{chunk-VVNL26WX.js → chunk-KTTSXYEK.js} +22 -10
  30. package/dist/chunk-KTTSXYEK.js.map +1 -0
  31. package/dist/chunk-LQIPXVDH.js +17 -0
  32. package/dist/chunk-LQIPXVDH.js.map +1 -0
  33. package/dist/{chunk-DCSGJ7W4.js → chunk-N2DGFACQ.js} +3 -3
  34. package/dist/chunk-N7Z3LUEZ.js +858 -0
  35. package/dist/chunk-N7Z3LUEZ.js.map +1 -0
  36. package/dist/{chunk-2PDWCDKY.js → chunk-NFO7BRCO.js} +10 -7
  37. package/dist/{chunk-2PDWCDKY.js.map → chunk-NFO7BRCO.js.map} +1 -1
  38. package/dist/{chunk-Q36VMZST.js → chunk-OTQH5KZW.js} +89 -38
  39. package/dist/chunk-OTQH5KZW.js.map +1 -0
  40. package/dist/chunk-OUJSQSKE.js +113 -0
  41. package/dist/chunk-OUJSQSKE.js.map +1 -0
  42. package/dist/chunk-OZ3FBAK5.js +50 -0
  43. package/dist/chunk-OZ3FBAK5.js.map +1 -0
  44. package/dist/chunk-QATYARI5.js +408 -0
  45. package/dist/chunk-QATYARI5.js.map +1 -0
  46. package/dist/{chunk-KESLPBKV.js → chunk-QDLVIW2O.js} +4 -4
  47. package/dist/{chunk-5XIVBO25.js → chunk-QLLBJEM7.js} +6 -2
  48. package/dist/chunk-QLLBJEM7.js.map +1 -0
  49. package/dist/{chunk-EVDQKYCG.js → chunk-RQSJLWP4.js} +13 -2
  50. package/dist/chunk-RQSJLWP4.js.map +1 -0
  51. package/dist/{chunk-BPRIYNLE.js → chunk-TKAJ3JVF.js} +3 -3
  52. package/dist/chunk-TSM6VESW.js +25 -0
  53. package/dist/chunk-TSM6VESW.js.map +1 -0
  54. package/dist/{chunk-6X2ERTQV.js → chunk-USVFEWYL.js} +6 -4
  55. package/dist/{chunk-6X2ERTQV.js.map → chunk-USVFEWYL.js.map} +1 -1
  56. package/dist/{chunk-JZGN33AY.js → chunk-VRI56337.js} +4 -4
  57. package/dist/chunk-X2IRGXGF.js +14103 -0
  58. package/dist/chunk-X2IRGXGF.js.map +1 -0
  59. package/dist/{chunk-FMRZ26U5.js → chunk-X3IGT5RV.js} +5 -2
  60. package/dist/{chunk-FMRZ26U5.js.map → chunk-X3IGT5RV.js.map} +1 -1
  61. package/dist/{chunk-KHT24OWC.js → chunk-YDUOSRGD.js} +8 -94
  62. package/dist/{chunk-KHT24OWC.js.map → chunk-YDUOSRGD.js.map} +1 -1
  63. package/dist/{chunk-NGROSFOH.js → chunk-Z66IT5KL.js} +14 -9
  64. package/dist/chunk-Z66IT5KL.js.map +1 -0
  65. package/dist/{cli-GGPWH4UO.js → cli-HSLIG7EX.js} +50 -43
  66. package/dist/cli-HSLIG7EX.js.map +1 -0
  67. package/dist/{client-YXQUTXVZ.js → client-Z43DNLJH.js} +4 -4
  68. package/dist/{config-OMCYHG2S.js → config-VC4ACP42.js} +6 -4
  69. package/dist/{config-OMCYHG2S.js.map → config-VC4ACP42.js.map} +1 -1
  70. package/dist/{detect-PXNM6TA7.js → detect-7NUD5B5R.js} +2 -2
  71. package/dist/{detect-providers-5KOPZ7J2.js → detect-providers-ILLQZROY.js} +4 -4
  72. package/dist/{doctor-5JXJ36KA.js → doctor-HJCWHAU4.js} +49 -16
  73. package/dist/doctor-HJCWHAU4.js.map +1 -0
  74. package/dist/executor-DO6QFC6G.js +45 -0
  75. package/dist/{init-LMYOVZAV.js → init-4KVK7W2E.js} +16 -14
  76. package/dist/{init-LMYOVZAV.js.map → init-4KVK7W2E.js.map} +1 -1
  77. package/dist/{installer-FS257JRZ.js → installer-N4UTEACX.js} +6 -4
  78. package/dist/{llm-TH4NLIRM.js → llm-AGVEF5XD.js} +5 -4
  79. package/dist/{loader-CQYTFHEW.js → loader-LX7TFRM6.js} +5 -3
  80. package/dist/{loader-NOMBJUPW.js → loader-UDNUMEDA.js} +5 -3
  81. package/dist/{main-YTBVRTBI.js → main-4J4QZZTZ.js} +2518 -656
  82. package/dist/main-4J4QZZTZ.js.map +1 -0
  83. package/dist/{open-HG2DX6RN.js → open-7TXJQM3H.js} +10 -8
  84. package/dist/{open-HG2DX6RN.js.map → open-7TXJQM3H.js.map} +1 -1
  85. package/dist/{post-compact-JSECI44W.js → post-compact-7AEFVCZS.js} +8 -8
  86. package/dist/{post-tool-use-POGPTJBA.js → post-tool-use-TZINWWDH.js} +11 -9
  87. package/dist/post-tool-use-TZINWWDH.js.map +1 -0
  88. package/dist/{post-tool-use-failure-OT7BFWQW.js → post-tool-use-failure-TCFEU2GI.js} +8 -8
  89. package/dist/{pre-compact-OXVODKH4.js → pre-compact-LO2VZCGR.js} +8 -8
  90. package/dist/{provider-check-43LAMSMH.js → provider-check-ZEV5P4KM.js} +4 -4
  91. package/dist/{registry-U4CHXK6R.js → registry-F3THYC5M.js} +6 -4
  92. package/dist/{remove-N7ZPELFU.js → remove-F77AAALE.js} +12 -10
  93. package/dist/{remove-N7ZPELFU.js.map → remove-F77AAALE.js.map} +1 -1
  94. package/dist/{restart-ADG5GBTB.js → restart-UEFDPMLT.js} +11 -9
  95. package/dist/{restart-ADG5GBTB.js.map → restart-UEFDPMLT.js.map} +1 -1
  96. package/dist/{search-AHZEUNRR.js → search-NHNVUAQQ.js} +11 -9
  97. package/dist/{search-AHZEUNRR.js.map → search-NHNVUAQQ.js.map} +1 -1
  98. package/dist/{server-AGVYZVP5.js → server-AZJSTQEK.js} +369 -270
  99. package/dist/server-AZJSTQEK.js.map +1 -0
  100. package/dist/{session-6IU4AXYP.js → session-3HLC5KOD.js} +11 -9
  101. package/dist/{session-6IU4AXYP.js.map → session-3HLC5KOD.js.map} +1 -1
  102. package/dist/{session-end-FT27DWYZ.js → session-end-FS46UARX.js} +7 -7
  103. package/dist/session-start-46KPFV2H.js +134 -0
  104. package/dist/session-start-46KPFV2H.js.map +1 -0
  105. package/dist/{setup-llm-77MP4I2G.js → setup-llm-JMWSNQ2C.js} +11 -9
  106. package/dist/{setup-llm-77MP4I2G.js.map → setup-llm-JMWSNQ2C.js.map} +1 -1
  107. package/dist/src/agent/definitions/agent.yaml +9 -5
  108. package/dist/src/agent/definitions/tasks/cortex-instructions.yaml +115 -0
  109. package/dist/src/agent/definitions/tasks/cortex-prompt-builder.yaml +67 -0
  110. package/dist/src/agent/definitions/tasks/digest-only.yaml +1 -1
  111. package/dist/src/agent/definitions/tasks/extract-only.yaml +1 -1
  112. package/dist/src/agent/definitions/tasks/review-session.yaml +10 -39
  113. package/dist/src/agent/definitions/tasks/skill-evolve.yaml +181 -25
  114. package/dist/src/agent/definitions/tasks/skill-generate.yaml +21 -7
  115. package/dist/src/agent/definitions/tasks/skill-survey.yaml +2 -6
  116. package/dist/src/agent/definitions/tasks/supersession-sweep.yaml +1 -1
  117. package/dist/src/agent/definitions/tasks/title-summary.yaml +12 -19
  118. package/dist/src/agent/definitions/tasks/{full-intelligence.yaml → vault-evolve.yaml} +74 -129
  119. package/dist/src/agent/definitions/tasks/vault-seed.yaml +370 -0
  120. package/dist/src/agent/prompts/agent.md +12 -38
  121. package/dist/src/cli.js +1 -1
  122. package/dist/src/daemon/main.js +1 -1
  123. package/dist/src/hooks/post-tool-use.js +1 -1
  124. package/dist/src/hooks/session-end.js +1 -1
  125. package/dist/src/hooks/session-start.js +1 -1
  126. package/dist/src/hooks/stop.js +1 -1
  127. package/dist/src/hooks/user-prompt-submit.js +1 -1
  128. package/dist/src/mcp/server.js +1 -1
  129. package/dist/src/symbionts/manifests/claude-code.yaml +4 -0
  130. package/dist/src/symbionts/manifests/opencode.yaml +7 -0
  131. package/dist/src/symbionts/manifests/pi.yaml +22 -0
  132. package/dist/src/symbionts/templates/agents-starter.md +1 -1
  133. package/dist/src/symbionts/templates/pi/package.json +6 -0
  134. package/dist/src/symbionts/templates/pi/plugin.ts +559 -0
  135. package/dist/{stats-NVPWOYTE.js → stats-MKMETHMA.js} +11 -9
  136. package/dist/{stats-NVPWOYTE.js.map → stats-MKMETHMA.js.map} +1 -1
  137. package/dist/{stop-ZPIKVLH4.js → stop-OUEX6KA4.js} +7 -7
  138. package/dist/{stop-failure-2PX67YJC.js → stop-failure-2BWVNZEG.js} +8 -8
  139. package/dist/{subagent-start-UUE6EHQD.js → subagent-start-J4VV6DEE.js} +8 -8
  140. package/dist/{subagent-stop-KQWWWPE6.js → subagent-stop-JMLVEPIA.js} +8 -8
  141. package/dist/{task-completed-WMHOFQ7B.js → task-completed-65CHMMKA.js} +8 -8
  142. package/dist/{team-LRZ6GTQK.js → team-U2LDKIS4.js} +7 -5
  143. package/dist/{turns-YFNI5CQC.js → turns-HU2CTZAP.js} +2 -2
  144. package/dist/ui/assets/index-BUGor9dk.js +842 -0
  145. package/dist/ui/assets/index-_OP4ifzH.css +1 -0
  146. package/dist/ui/index.html +2 -2
  147. package/dist/{update-O6V4RC4W.js → update-ZSHVXWSQ.js} +12 -10
  148. package/dist/{update-O6V4RC4W.js.map → update-ZSHVXWSQ.js.map} +1 -1
  149. package/dist/{user-prompt-submit-N36KUPHI.js → user-prompt-submit-APMO6FVU.js} +10 -9
  150. package/dist/{user-prompt-submit-N36KUPHI.js.map → user-prompt-submit-APMO6FVU.js.map} +1 -1
  151. package/dist/{verify-LXPV7NYG.js → verify-R76ZFJSZ.js} +8 -5
  152. package/dist/{verify-LXPV7NYG.js.map → verify-R76ZFJSZ.js.map} +1 -1
  153. package/dist/{version-XMPPJQHR.js → version-TXPPS3L5.js} +2 -2
  154. package/dist/version-TXPPS3L5.js.map +1 -0
  155. package/package.json +3 -1
  156. package/skills/myco/SKILL.md +16 -1
  157. package/skills/myco/references/cli-usage.md +1 -1
  158. package/skills/myco-rules/SKILL.md +94 -0
  159. package/skills/{rules → myco-rules}/references/rules-bad-example.md +1 -1
  160. package/skills/{rules → myco-rules}/references/rules-good-example.md +1 -1
  161. package/dist/chunk-4YFKBL3F.js +0 -195
  162. package/dist/chunk-4YFKBL3F.js.map +0 -1
  163. package/dist/chunk-5XIVBO25.js.map +0 -1
  164. package/dist/chunk-CCRGY3QW.js.map +0 -1
  165. package/dist/chunk-CUDIZJY7.js +0 -36
  166. package/dist/chunk-CUDIZJY7.js.map +0 -1
  167. package/dist/chunk-EVDQKYCG.js.map +0 -1
  168. package/dist/chunk-FLLBJLHM.js.map +0 -1
  169. package/dist/chunk-MYOZLMB2.js.map +0 -1
  170. package/dist/chunk-NGROSFOH.js.map +0 -1
  171. package/dist/chunk-OD4AA7PV.js.map +0 -1
  172. package/dist/chunk-Q36VMZST.js.map +0 -1
  173. package/dist/chunk-US4LNCAT.js.map +0 -1
  174. package/dist/chunk-UYMFCYBF.js +0 -2326
  175. package/dist/chunk-UYMFCYBF.js.map +0 -1
  176. package/dist/chunk-VVNL26WX.js.map +0 -1
  177. package/dist/cli-GGPWH4UO.js.map +0 -1
  178. package/dist/doctor-5JXJ36KA.js.map +0 -1
  179. package/dist/executor-HWW2QNZQ.js +0 -2472
  180. package/dist/executor-HWW2QNZQ.js.map +0 -1
  181. package/dist/main-YTBVRTBI.js.map +0 -1
  182. package/dist/post-tool-use-POGPTJBA.js.map +0 -1
  183. package/dist/server-AGVYZVP5.js.map +0 -1
  184. package/dist/session-start-LAFICHII.js +0 -189
  185. package/dist/session-start-LAFICHII.js.map +0 -1
  186. package/dist/src/agent/definitions/tasks/graph-maintenance.yaml +0 -93
  187. package/dist/ui/assets/index-C2JuNtRB.css +0 -1
  188. package/dist/ui/assets/index-JLVaQKV2.js +0 -832
  189. package/skills/myco-curate/SKILL.md +0 -86
  190. package/skills/rules/SKILL.md +0 -214
  191. /package/dist/{chunk-XG5RRUYF.js.map → chunk-ENZR5NG7.js.map} +0 -0
  192. /package/dist/{chunk-DCSGJ7W4.js.map → chunk-N2DGFACQ.js.map} +0 -0
  193. /package/dist/{chunk-KESLPBKV.js.map → chunk-QDLVIW2O.js.map} +0 -0
  194. /package/dist/{chunk-BPRIYNLE.js.map → chunk-TKAJ3JVF.js.map} +0 -0
  195. /package/dist/{chunk-JZGN33AY.js.map → chunk-VRI56337.js.map} +0 -0
  196. /package/dist/{client-YXQUTXVZ.js.map → client-Z43DNLJH.js.map} +0 -0
  197. /package/dist/{detect-PXNM6TA7.js.map → detect-7NUD5B5R.js.map} +0 -0
  198. /package/dist/{detect-providers-5KOPZ7J2.js.map → detect-providers-ILLQZROY.js.map} +0 -0
  199. /package/dist/{installer-FS257JRZ.js.map → executor-DO6QFC6G.js.map} +0 -0
  200. /package/dist/{llm-TH4NLIRM.js.map → installer-N4UTEACX.js.map} +0 -0
  201. /package/dist/{loader-CQYTFHEW.js.map → llm-AGVEF5XD.js.map} +0 -0
  202. /package/dist/{loader-NOMBJUPW.js.map → loader-LX7TFRM6.js.map} +0 -0
  203. /package/dist/{provider-check-43LAMSMH.js.map → loader-UDNUMEDA.js.map} +0 -0
  204. /package/dist/{post-compact-JSECI44W.js.map → post-compact-7AEFVCZS.js.map} +0 -0
  205. /package/dist/{post-tool-use-failure-OT7BFWQW.js.map → post-tool-use-failure-TCFEU2GI.js.map} +0 -0
  206. /package/dist/{pre-compact-OXVODKH4.js.map → pre-compact-LO2VZCGR.js.map} +0 -0
  207. /package/dist/{registry-U4CHXK6R.js.map → provider-check-ZEV5P4KM.js.map} +0 -0
  208. /package/dist/{team-LRZ6GTQK.js.map → registry-F3THYC5M.js.map} +0 -0
  209. /package/dist/{session-end-FT27DWYZ.js.map → session-end-FS46UARX.js.map} +0 -0
  210. /package/dist/{stop-ZPIKVLH4.js.map → stop-OUEX6KA4.js.map} +0 -0
  211. /package/dist/{stop-failure-2PX67YJC.js.map → stop-failure-2BWVNZEG.js.map} +0 -0
  212. /package/dist/{subagent-start-UUE6EHQD.js.map → subagent-start-J4VV6DEE.js.map} +0 -0
  213. /package/dist/{subagent-stop-KQWWWPE6.js.map → subagent-stop-JMLVEPIA.js.map} +0 -0
  214. /package/dist/{task-completed-WMHOFQ7B.js.map → task-completed-65CHMMKA.js.map} +0 -0
  215. /package/dist/{turns-YFNI5CQC.js.map → team-U2LDKIS4.js.map} +0 -0
  216. /package/dist/{version-XMPPJQHR.js.map → turns-HU2CTZAP.js.map} +0 -0
@@ -1,86 +0,0 @@
1
- ---
2
- name: myco-curate
3
- description: >-
4
- Trigger the Myco intelligence agent to process unprocessed session data,
5
- extract observations, and maintain the vault knowledge graph
6
- user-invocable: true
7
- allowed-tools: Bash
8
- ---
9
-
10
- # Myco Curate — Run the Intelligence Agent
11
-
12
- This skill triggers an intelligence agent run via the daemon API. The intelligence agent processes unprocessed prompt batches, extracts observations (spores), and maintains the vault's knowledge graph.
13
-
14
- ## Arguments
15
-
16
- The user may provide:
17
- - **task name** — which intelligence task to run (e.g., "full-intelligence", "extraction-only")
18
- - **instruction** — free-text instruction to guide the agent's focus
19
-
20
- Parse the user's message for these. Both are optional.
21
-
22
- ## Step 1: Resolve Daemon Port
23
-
24
- Read the daemon.json file to find the running daemon's port:
25
-
26
- ```bash
27
- cat "$(node ${CLAUDE_PLUGIN_ROOT}/dist/src/cli.js stats 2>/dev/null | grep -oP 'path: \K.*' || echo ~/.myco/vaults/myco)/daemon.json" 2>/dev/null
28
- ```
29
-
30
- If that fails, use the vault directory from the environment. The daemon.json contains `{ "pid": ..., "port": ... }`. Extract the `port` value.
31
-
32
- If the daemon is not running, tell the user:
33
-
34
- > "The Myco daemon is not running. Start a new session or run `node ${CLAUDE_PLUGIN_ROOT}/dist/src/cli.js restart` to start it."
35
-
36
- ## Step 2: Trigger Agent Run
37
-
38
- Send a POST request to the daemon API:
39
-
40
- ```bash
41
- curl -s -X POST http://localhost:<port>/api/agent/run \
42
- -H 'Content-Type: application/json' \
43
- -d '{"task": "<task-name-or-null>", "instruction": "<instruction-or-null>"}'
44
- ```
45
-
46
- Omit `task` and `instruction` fields from the JSON body if they were not provided by the user.
47
-
48
- Report the response to the user. The response will be `{ "ok": true, "message": "Intelligence agent started" }`.
49
-
50
- ## Step 3: Check Run Status
51
-
52
- The intelligence agent runs in the background. To check its progress, poll the runs endpoint:
53
-
54
- ```bash
55
- curl -s http://localhost:<port>/api/agent/runs?limit=1
56
- ```
57
-
58
- This returns the most recent run. Show the user:
59
- - **Run ID** — the unique identifier
60
- - **Status** — pending, running, completed, failed, or skipped
61
- - **Task** — which task was executed
62
- - **Tokens used** — total tokens consumed (if completed)
63
- - **Cost** — USD cost (if completed)
64
- - **Error** — error message (if failed)
65
-
66
- If the run is still `running`, tell the user they can check again later or wait.
67
-
68
- ## Step 4: Show Reports (if completed)
69
-
70
- If the run completed, fetch the decision reports:
71
-
72
- ```bash
73
- curl -s http://localhost:<port>/api/agent/runs/<run-id>/reports
74
- ```
75
-
76
- Summarize the reports for the user:
77
- - How many actions were taken
78
- - What types of actions (extraction, consolidation, supersession, etc.)
79
- - Key observations or decisions made
80
-
81
- ## Constraints
82
-
83
- - Always use the daemon API, never call the executor directly from the skill.
84
- - The intelligence agent runs asynchronously — the POST returns immediately.
85
- - If the user asks for a specific task, pass it in the `task` field.
86
- - If the user provides natural language guidance, pass it in the `instruction` field.
@@ -1,214 +0,0 @@
1
- ---
2
- name: rules
3
- description: >-
4
- Use when creating, auditing, or improving project rules files (CLAUDE.md,
5
- AGENTS.md). Helps write specific, enforceable rules that agents actually
6
- follow. Also triggered proactively when Myco detects recurring patterns
7
- that should become project rules.
8
- allowed-tools: Read, Edit, Write, Bash, Grep, Glob
9
- user-invocable: true
10
- ---
11
-
12
- # Rules — Project Rules File Management
13
-
14
- Write, audit, and improve project rules files (CLAUDE.md, AGENTS.md) so agents follow them consistently. Rules files are the project's system prompt — they define invariants every agent must follow every time.
15
-
16
- ## When to Use
17
-
18
- - **Creating a new rules file** for a project that doesn't have one
19
- - **Auditing an existing rules file** that agents seem to ignore
20
- - **Adding a rule** when you identify a pattern that should be standardized
21
- - **Proactively** when Myco detects recurring observations that suggest a missing rule
22
-
23
- ## What Belongs in a Rules File
24
-
25
- Rules files contain **project invariants** — things every agent must follow every time, regardless of context.
26
-
27
- | Belongs in Rules File | Does NOT Belong |
28
- |----------------------|-----------------|
29
- | Hard constraints: "All API routes go through `src/routes/`" | Situational context (use Myco context injection) |
30
- | Golden paths: step-by-step standard procedures | Decision rationale (use Myco spore) |
31
- | Quality gates: specific commands that must pass | Code documentation (that's the codebase) |
32
- | Non-goals: what the project is NOT | Anything starting with "try to" or "when possible" |
33
-
34
- **The test:** If it's an invariant that applies to every session on every branch, it's a rule. If it depends on what you're working on, it's context — let Myco inject it.
35
-
36
- ## Multi-Agent File Topology
37
-
38
- Myco supports 6 coding agents. Each has its own instruction file format, but **`AGENTS.md` is the canonical source of truth** for all project rules.
39
-
40
- ### File hierarchy
41
-
42
- | File | Purpose | Who reads it |
43
- |------|---------|-------------|
44
- | `AGENTS.md` | **Canonical rules** — all architecture, conventions, golden paths | Codex, VS Code Copilot, Gemini CLI, Windsurf, Cursor, OpenCode |
45
- | `CLAUDE.md` | Thin stub pointing to `AGENTS.md` + Claude-specific overrides | Claude Code |
46
- | `GEMINI.md` | Thin stub pointing to `AGENTS.md` + Gemini-specific overrides | Gemini CLI |
47
- | `.github/copilot-instructions.md` | Thin stub pointing to `AGENTS.md` | VS Code Copilot |
48
-
49
- ### Rules for placement
50
-
51
- - **All rules go in `AGENTS.md`** unless they are genuinely agent-specific (e.g., "Use Claude Code agent teams for X")
52
- - Agent-specific files MUST start with a reference to `AGENTS.md` as the source of truth
53
- - Never duplicate rules across files — if it applies to all agents, it belongs in `AGENTS.md`
54
- - If a project has `CLAUDE.md` with substantial rules but no `AGENTS.md`, suggest migrating the rules to `AGENTS.md` and replacing `CLAUDE.md` with a thin stub
55
-
56
- ## Rule Writing Principles
57
-
58
- These principles apply whether you're writing new rules or auditing existing ones.
59
-
60
- ### Every rule must be specific enough to violate
61
-
62
- - Bad: "Write clean code"
63
- - Good: "Functions MUST NOT exceed 50 lines"
64
-
65
- ### Use RFC 2119 language
66
-
67
- | Keyword | Meaning | Example |
68
- |---------|---------|---------|
69
- | **MUST** | Absolute requirement, no exceptions | "All endpoints MUST validate input with Zod" |
70
- | **SHOULD** | Strong recommendation, exceptions need justification | "Services SHOULD be stateless" |
71
- | **MAY** | Optional, recognized pattern | "Teams MAY use dependency injection" |
72
-
73
- Anything weaker than MAY is not a rule. Remove it or strengthen it.
74
-
75
- ### Anchor to real paths
76
-
77
- - Bad: "Put tests near the code"
78
- - Good: "Tests MUST be at `tests/<module>.test.ts` mirroring `src/<module>.ts`"
79
-
80
- ### Define deviation lanes for SHOULD rules
81
-
82
- - "Functions SHOULD NOT exceed 50 lines. Exception: generated code in `src/generated/`."
83
-
84
- ### No loopholes
85
-
86
- These phrases give agents permission to skip the rule: "when possible", "try to", "consider", "if needed", "as appropriate". Remove them or rephrase as SHOULD with explicit exceptions.
87
-
88
- ## Required Sections
89
-
90
- A well-formed rules file has these sections. Not all are required for every project, but the skill checks for their absence.
91
-
92
- ### 1. Project Identity
93
-
94
- What this project is, in one sentence. The anchor everything else hangs on.
95
-
96
- ### 2. Non-Goals
97
-
98
- What this project is NOT. Prevents agents from "improving" things outside scope. Example: "This is NOT a general-purpose framework. Do not add extensibility points or plugin systems."
99
-
100
- ### 3. Architecture Invariants
101
-
102
- Hard rules about project structure, anchored to real file paths. Example: "All database queries MUST go through `src/db/queries.ts`. No raw SQL in route handlers."
103
-
104
- ### 4. Golden Paths
105
-
106
- Step-by-step standard procedures for common operations: add a feature, fix a bug, add a test. Not vibes — a checklist an agent can follow literally. Point to a canonical file to copy.
107
-
108
- ### 5. Quality Gates
109
-
110
- Specific commands that must pass before work is done. Example: "Before committing: `npm run lint && npm test && npx tsc --noEmit`"
111
-
112
- ## Audit Workflow
113
-
114
- ### Step 1: Discover existing rules files
115
-
116
- Scan the project root for:
117
- - `AGENTS.md` (canonical — should exist in every Myco project)
118
- - `CLAUDE.md` (Claude Code stub/overrides)
119
- - `GEMINI.md` (Gemini CLI stub/overrides)
120
- - `.github/copilot-instructions.md` (VS Code Copilot stub)
121
-
122
- Report what exists. If `AGENTS.md` doesn't exist, offer to create it. If `CLAUDE.md` has substantial rules but `AGENTS.md` doesn't exist, offer to migrate.
123
-
124
- ### Step 2: Run audit checks
125
-
126
- For each rules file found, check:
127
-
128
- | Check | What It Catches | Severity |
129
- |-------|----------------|----------|
130
- | Missing sections | No non-goals, no quality gates, etc. | Important |
131
- | Vague rules | "Follow best practices", "keep it clean", "when possible" | Critical |
132
- | Unanchored rules | References to structure without real file paths | Important |
133
- | Contradictions | Two rules that conflict with each other | Critical |
134
- | Bloat | Rules duplicating what linter/tsconfig/CI already enforces | Minor |
135
- | Missing golden path | Common operations with no documented standard way | Important |
136
- | Stale anchors | Rules referencing files/paths that no longer exist | Critical |
137
-
138
- Detect missing golden paths by checking project signals: `package.json` → should have "add dependency" path, `src/routes/` → should have "add endpoint" path, test framework → should have "add test" path. Also ask the developer what common operations they perform.
139
-
140
- ### Step 3: Check Myco observations (if available)
141
-
142
- Query `myco_search` for recurring observations related to the project. Look for:
143
- - Gotchas that recur 3+ times (same mistake across sessions)
144
- - Decisions that state "we should always/never do X"
145
- - Bug fixes where the root cause was violating an unwritten convention
146
-
147
- These are rule candidates. Surface them to the developer.
148
-
149
- ### Step 4: Present findings
150
-
151
- Report findings ranked by severity (critical first). For each finding:
152
- - What the problem is
153
- - Why agents exploit it
154
- - Specific fix text (the exact rule to add, modify, or remove)
155
-
156
- The developer approves fixes individually or in batch.
157
-
158
- ### Step 5: Apply approved fixes
159
-
160
- Edit the rules file with approved changes. Never auto-commit — the developer reviews the diff.
161
-
162
- ## Add Rule Workflow
163
-
164
- ### From a developer request
165
-
166
- 1. Developer describes the rule they want
167
- 2. Craft the rule: specific, anchored, RFC 2119 language
168
- 3. Determine placement:
169
- - **`AGENTS.md`** — All rules that any agent should follow (architecture, golden paths, conventions, quality gates). This is the default.
170
- - **`CLAUDE.md`** — Only Claude Code-specific rules (agent team patterns, Claude-specific tool conventions)
171
- - **`GEMINI.md`** — Only Gemini CLI-specific rules
172
- - **`.github/copilot-instructions.md`** — Only VS Code Copilot-specific rules
173
- - If only `CLAUDE.md` exists with agent-agnostic rules, suggest creating `AGENTS.md` and migrating rules there
174
- - If `AGENTS.md` doesn't exist, create it as the canonical file
175
- 4. Find the correct section (invariant, golden path, quality gate, etc.)
176
- 5. Insert the rule
177
- 6. Developer reviews the diff
178
-
179
- ### Rule Crafting Example
180
-
181
- Raw observation: "better-sqlite3 WASM build fails on Node 22 ARM — must use native build"
182
-
183
- Bad rule: "Be careful with sqlite builds"
184
-
185
- Good rule: "better-sqlite3 MUST be installed with native bindings, not WASM. The WASM build fails on Node 22 ARM. Run `npm install better-sqlite3 --build-from-source` if the default install produces WASM artifacts."
186
-
187
- ### From a Myco observation
188
-
189
- 1. Myco surfaces a pattern: "Your team has hit 3 gotchas about X. Should this become a rule?"
190
- 2. If the developer approves:
191
- - Craft the rule from the observation
192
- - The rule states the **what** — the observation (in Myco spore) stores the **why**
193
- - Place it in the correct file and section
194
- 3. If the developer dismisses: the observation stays as context, not a rule
195
-
196
- ### Myco-managed operational rule example
197
-
198
- When a project uses Myco-managed capture behavior, encode that intent as an explicit rule instead of letting agents infer from `.gitignore` alone.
199
-
200
- - Good: "When `capture.ignore_plan_dirs_in_git` is enabled, agents MUST treat custom `capture.plan_dirs` as intentionally gitignored after capture into Myco. Agents MUST NOT force-add files from those directories unless the user explicitly asks."
201
-
202
- ### What stays as a spore, NOT a rule
203
-
204
- Reject promotion for:
205
- - One-off gotchas unlikely to recur (< 3 occurrences)
206
- - Decision rationale (the rule states what; spore stores why)
207
- - Branch-specific or time-limited knowledge
208
- - Anything that would only matter during a specific initiative
209
-
210
- ## References
211
-
212
- For examples of well-written and poorly-written rules files:
213
- - `references/rules-good-example.md` — All five sections done right
214
- - `references/rules-bad-example.md` — Every anti-pattern annotated with fixes