@synapse-research/synapse 0.2.11 → 0.2.13

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 (207) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +124 -124
  3. package/dist/.next/app-path-routes-manifest.json +34 -34
  4. package/dist/.next/build-manifest.json +2 -2
  5. package/dist/.next/server/app/(dashboard)/agents/page_client-reference-manifest.js +1 -1
  6. package/dist/.next/server/app/(dashboard)/compute/page_client-reference-manifest.js +1 -1
  7. package/dist/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
  8. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
  10. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
  11. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  12. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-designs/[designUuid]/page_client-reference-manifest.js +1 -1
  13. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-designs/new/page_client-reference-manifest.js +1 -1
  14. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-designs/page_client-reference-manifest.js +1 -1
  15. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-runs/[runUuid]/page_client-reference-manifest.js +1 -1
  16. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-runs/page_client-reference-manifest.js +1 -1
  17. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiments/new/page_client-reference-manifest.js +1 -1
  18. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiments/page_client-reference-manifest.js +1 -1
  19. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/insights/page_client-reference-manifest.js +1 -1
  20. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/page_client-reference-manifest.js +1 -1
  21. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/related-works/page_client-reference-manifest.js +1 -1
  22. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/research-questions/[questionUuid]/page_client-reference-manifest.js +1 -1
  23. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/research-questions/page_client-reference-manifest.js +1 -1
  24. package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/settings/page_client-reference-manifest.js +1 -1
  25. package/dist/.next/server/app/(dashboard)/research-projects/new/page_client-reference-manifest.js +1 -1
  26. package/dist/.next/server/app/(dashboard)/research-projects/page_client-reference-manifest.js +1 -1
  27. package/dist/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  28. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  29. package/dist/.next/server/app/_not-found.html +1 -1
  30. package/dist/.next/server/app/_not-found.rsc +1 -1
  31. package/dist/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  32. package/dist/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/admin/companies/new.html +1 -1
  34. package/dist/.next/server/app/admin/companies/new.rsc +1 -1
  35. package/dist/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  36. package/dist/.next/server/app/admin/companies.html +1 -1
  37. package/dist/.next/server/app/admin/companies.rsc +1 -1
  38. package/dist/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  39. package/dist/.next/server/app/admin.html +1 -1
  40. package/dist/.next/server/app/admin.rsc +1 -1
  41. package/dist/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  42. package/dist/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  43. package/dist/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  44. package/dist/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  45. package/dist/.next/server/app/api/admin/stats/route_client-reference-manifest.js +1 -1
  46. package/dist/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  47. package/dist/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  48. package/dist/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  49. package/dist/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  50. package/dist/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  51. package/dist/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  52. package/dist/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  53. package/dist/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  54. package/dist/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  55. package/dist/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  56. package/dist/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  57. package/dist/.next/server/app/api/auth/refresh/route_client-reference-manifest.js +1 -1
  58. package/dist/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  59. package/dist/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  60. package/dist/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  61. package/dist/.next/server/app/api/compute-gpus/[uuid]/release/route_client-reference-manifest.js +1 -1
  62. package/dist/.next/server/app/api/compute-nodes/[uuid]/route_client-reference-manifest.js +1 -1
  63. package/dist/.next/server/app/api/compute-nodes/route_client-reference-manifest.js +1 -1
  64. package/dist/.next/server/app/api/compute-pools/[uuid]/route_client-reference-manifest.js +1 -1
  65. package/dist/.next/server/app/api/compute-pools/route_client-reference-manifest.js +1 -1
  66. package/dist/.next/server/app/api/documents/[uuid]/images/[filename]/route_client-reference-manifest.js +1 -1
  67. package/dist/.next/server/app/api/documents/[uuid]/images/route_client-reference-manifest.js +1 -1
  68. package/dist/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  69. package/dist/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  70. package/dist/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  71. package/dist/.next/server/app/api/experiment-designs/[uuid]/approve/route_client-reference-manifest.js +1 -1
  72. package/dist/.next/server/app/api/experiment-designs/[uuid]/close/route_client-reference-manifest.js +1 -1
  73. package/dist/.next/server/app/api/experiment-designs/[uuid]/reject/route_client-reference-manifest.js +1 -1
  74. package/dist/.next/server/app/api/experiment-designs/[uuid]/route_client-reference-manifest.js +1 -1
  75. package/dist/.next/server/app/api/experiment-runs/[uuid]/claim/route_client-reference-manifest.js +1 -1
  76. package/dist/.next/server/app/api/experiment-runs/[uuid]/dependencies/[dependsOnRunUuid]/route_client-reference-manifest.js +1 -1
  77. package/dist/.next/server/app/api/experiment-runs/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  78. package/dist/.next/server/app/api/experiment-runs/[uuid]/evaluate-criteria/route_client-reference-manifest.js +1 -1
  79. package/dist/.next/server/app/api/experiment-runs/[uuid]/registry/route_client-reference-manifest.js +1 -1
  80. package/dist/.next/server/app/api/experiment-runs/[uuid]/release/route_client-reference-manifest.js +1 -1
  81. package/dist/.next/server/app/api/experiment-runs/[uuid]/route_client-reference-manifest.js +1 -1
  82. package/dist/.next/server/app/api/experiment-runs/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  83. package/dist/.next/server/app/api/experiments/[uuid]/complete/route_client-reference-manifest.js +1 -1
  84. package/dist/.next/server/app/api/experiments/[uuid]/progress/route_client-reference-manifest.js +1 -1
  85. package/dist/.next/server/app/api/experiments/[uuid]/request-plan/route_client-reference-manifest.js +1 -1
  86. package/dist/.next/server/app/api/experiments/[uuid]/reset/route_client-reference-manifest.js +1 -1
  87. package/dist/.next/server/app/api/experiments/[uuid]/review/route.js +1 -1
  88. package/dist/.next/server/app/api/experiments/[uuid]/review/route_client-reference-manifest.js +1 -1
  89. package/dist/.next/server/app/api/experiments/[uuid]/route_client-reference-manifest.js +1 -1
  90. package/dist/.next/server/app/api/experiments/[uuid]/start/route_client-reference-manifest.js +1 -1
  91. package/dist/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  92. package/dist/.next/server/app/api/mcp/route.js +1 -1
  93. package/dist/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  94. package/dist/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  95. package/dist/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  96. package/dist/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  97. package/dist/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  98. package/dist/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  99. package/dist/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  100. package/dist/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  101. package/dist/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  102. package/dist/.next/server/app/api/onboarding/status/route_client-reference-manifest.js +1 -1
  103. package/dist/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  104. package/dist/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  105. package/dist/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  106. package/dist/.next/server/app/api/research-projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  107. package/dist/.next/server/app/api/research-projects/[uuid]/agent-activity/route_client-reference-manifest.js +1 -1
  108. package/dist/.next/server/app/api/research-projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  109. package/dist/.next/server/app/api/research-projects/[uuid]/baselines/route_client-reference-manifest.js +1 -1
  110. package/dist/.next/server/app/api/research-projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  111. package/dist/.next/server/app/api/research-projects/[uuid]/experiment-designs/[designUuid]/validate/route_client-reference-manifest.js +1 -1
  112. package/dist/.next/server/app/api/research-projects/[uuid]/experiment-designs/route_client-reference-manifest.js +1 -1
  113. package/dist/.next/server/app/api/research-projects/[uuid]/experiment-designs/summary/route_client-reference-manifest.js +1 -1
  114. package/dist/.next/server/app/api/research-projects/[uuid]/experiment-runs/dependencies/route_client-reference-manifest.js +1 -1
  115. package/dist/.next/server/app/api/research-projects/[uuid]/experiment-runs/route_client-reference-manifest.js +1 -1
  116. package/dist/.next/server/app/api/research-projects/[uuid]/experiments/route_client-reference-manifest.js +1 -1
  117. package/dist/.next/server/app/api/research-projects/[uuid]/github/branches/route_client-reference-manifest.js +1 -1
  118. package/dist/.next/server/app/api/research-projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  119. package/dist/.next/server/app/api/research-projects/[uuid]/related-works/[workUuid]/route_client-reference-manifest.js +1 -1
  120. package/dist/.next/server/app/api/research-projects/[uuid]/related-works/auto-search/complete/route_client-reference-manifest.js +1 -1
  121. package/dist/.next/server/app/api/research-projects/[uuid]/related-works/auto-search/route_client-reference-manifest.js +1 -1
  122. package/dist/.next/server/app/api/research-projects/[uuid]/related-works/deep-research/complete/route_client-reference-manifest.js +1 -1
  123. package/dist/.next/server/app/api/research-projects/[uuid]/related-works/deep-research/route_client-reference-manifest.js +1 -1
  124. package/dist/.next/server/app/api/research-projects/[uuid]/related-works/route_client-reference-manifest.js +1 -1
  125. package/dist/.next/server/app/api/research-projects/[uuid]/research-questions/route_client-reference-manifest.js +1 -1
  126. package/dist/.next/server/app/api/research-projects/[uuid]/route_client-reference-manifest.js +1 -1
  127. package/dist/.next/server/app/api/research-projects/[uuid]/synthesis/complete/route_client-reference-manifest.js +1 -1
  128. package/dist/.next/server/app/api/research-projects/[uuid]/synthesis/refresh/route_client-reference-manifest.js +1 -1
  129. package/dist/.next/server/app/api/research-projects/[uuid]/synthesis/trigger/route_client-reference-manifest.js +1 -1
  130. package/dist/.next/server/app/api/research-projects/route_client-reference-manifest.js +1 -1
  131. package/dist/.next/server/app/api/research-questions/[uuid]/claim/route_client-reference-manifest.js +1 -1
  132. package/dist/.next/server/app/api/research-questions/[uuid]/move/route_client-reference-manifest.js +1 -1
  133. package/dist/.next/server/app/api/research-questions/[uuid]/release/route_client-reference-manifest.js +1 -1
  134. package/dist/.next/server/app/api/research-questions/[uuid]/review/route_client-reference-manifest.js +1 -1
  135. package/dist/.next/server/app/api/research-questions/[uuid]/route_client-reference-manifest.js +1 -1
  136. package/dist/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  137. package/dist/.next/server/app/api/settings/integrations/route_client-reference-manifest.js +1 -1
  138. package/dist/.next/server/app/api/ssh-config/route_client-reference-manifest.js +1 -1
  139. package/dist/.next/server/app/index.html +1 -1
  140. package/dist/.next/server/app/index.rsc +1 -1
  141. package/dist/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  142. package/dist/.next/server/app/login/admin.html +1 -1
  143. package/dist/.next/server/app/login/admin.rsc +1 -1
  144. package/dist/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  145. package/dist/.next/server/app/login/callback.html +1 -1
  146. package/dist/.next/server/app/login/callback.rsc +1 -1
  147. package/dist/.next/server/app/login/page_client-reference-manifest.js +1 -1
  148. package/dist/.next/server/app/login/silent-refresh/page_client-reference-manifest.js +1 -1
  149. package/dist/.next/server/app/login/silent-refresh.html +1 -1
  150. package/dist/.next/server/app/login/silent-refresh.rsc +1 -1
  151. package/dist/.next/server/app/login.html +1 -1
  152. package/dist/.next/server/app/login.rsc +1 -1
  153. package/dist/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  154. package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
  155. package/dist/.next/server/app/research-projects/new.html +1 -1
  156. package/dist/.next/server/app/research-projects/new.rsc +1 -1
  157. package/dist/.next/server/app/research-projects.html +1 -1
  158. package/dist/.next/server/app/research-projects.rsc +1 -1
  159. package/dist/.next/server/app/settings.html +1 -1
  160. package/dist/.next/server/app/settings.rsc +1 -1
  161. package/dist/.next/server/app-paths-manifest.json +34 -34
  162. package/dist/.next/server/chunks/8499.js +1 -1
  163. package/dist/.next/server/middleware-manifest.json +1 -1
  164. package/dist/.next/server/pages/404.html +1 -1
  165. package/dist/.next/server/pages/500.html +1 -1
  166. package/dist/.next/server/server-reference-manifest.js +1 -1
  167. package/dist/.next/server/server-reference-manifest.json +1 -1
  168. package/package.json +4 -2
  169. package/dist/public/skill/SKILL.md +0 -200
  170. package/dist/public/skill/aris-synapse-sync/SKILL.md +0 -368
  171. package/dist/public/skill/package.json +0 -79
  172. package/dist/public/skill/references/00-common-tools.md +0 -253
  173. package/dist/public/skill/references/01-setup.md +0 -251
  174. package/dist/public/skill/references/02-pm-workflow.md +0 -584
  175. package/dist/public/skill/references/03-developer-workflow.md +0 -325
  176. package/dist/public/skill/references/04-admin-workflow.md +0 -328
  177. package/dist/public/skill/references/06-claude-code-agent-teams.md +0 -233
  178. package/dist/public/synapse-plugin/.claude-plugin/plugin.json +0 -20
  179. package/dist/public/synapse-plugin/.mcp.json +0 -11
  180. package/dist/public/synapse-plugin/bin/on-pre-enter-plan.sh +0 -26
  181. package/dist/public/synapse-plugin/bin/on-pre-exit-plan.sh +0 -22
  182. package/dist/public/synapse-plugin/bin/on-pre-spawn-agent.sh +0 -64
  183. package/dist/public/synapse-plugin/bin/on-session-end.sh +0 -39
  184. package/dist/public/synapse-plugin/bin/on-session-start.sh +0 -283
  185. package/dist/public/synapse-plugin/bin/on-subagent-start.sh +0 -233
  186. package/dist/public/synapse-plugin/bin/on-subagent-stop.sh +0 -80
  187. package/dist/public/synapse-plugin/bin/on-task-completed.sh +0 -66
  188. package/dist/public/synapse-plugin/bin/on-teammate-idle.sh +0 -47
  189. package/dist/public/synapse-plugin/bin/on-user-prompt.sh +0 -57
  190. package/dist/public/synapse-plugin/bin/synapse-api.sh +0 -387
  191. package/dist/public/synapse-plugin/bin/test-syntax.sh +0 -85
  192. package/dist/public/synapse-plugin/hooks/hooks.json +0 -105
  193. package/dist/public/synapse-plugin/skills/autonomy/SKILL.md +0 -140
  194. package/dist/public/synapse-plugin/skills/experiments/SKILL.md +0 -87
  195. package/dist/public/synapse-plugin/skills/research/SKILL.md +0 -58
  196. package/dist/public/synapse-plugin/skills/sessions/SKILL.md +0 -174
  197. package/dist/public/synapse-plugin/skills/setup/SKILL.md +0 -73
  198. package/dist/public/synapse-plugin/skills/synapse/SKILL.md +0 -144
  199. package/dist/public/synapse-plugin/skills/synapse/package.json +0 -49
  200. package/dist/public/synapse-plugin/skills/synapse/references/00-common-tools.md +0 -107
  201. package/dist/public/synapse-plugin/skills/synapse/references/01-setup.md +0 -112
  202. package/dist/public/synapse-plugin/skills/synapse/references/02-research-workflow.md +0 -145
  203. package/dist/public/synapse-plugin/skills/synapse/references/03-experiment-workflow.md +0 -319
  204. package/dist/public/synapse-plugin/skills/synapse/references/04-autonomous-loop.md +0 -223
  205. package/dist/public/synapse-plugin/skills/synapse/references/05-session-sub-agent.md +0 -251
  206. /package/dist/.next/static/{duLVRogIrNQ1Tarxga53z → VlyiqgSt6DSLuCX7rlcKa}/_buildManifest.js +0 -0
  207. /package/dist/.next/static/{duLVRogIrNQ1Tarxga53z → VlyiqgSt6DSLuCX7rlcKa}/_ssgManifest.js +0 -0
@@ -1,233 +0,0 @@
1
- # Claude Code Agent Teams + Synapse Integration
2
-
3
- ## Overview
4
-
5
- This guide explains how to run **Claude Code Agent Teams** (swarm mode) with Synapse for full work observability. In this setup, a Team Lead agent orchestrates multiple sub-agents, each working on Synapse tasks in parallel.
6
-
7
- ### Two-Layer Architecture
8
-
9
- Claude Code Agent Teams and Synapse serve different purposes:
10
-
11
- | Layer | System | Purpose |
12
- |-------|--------|---------|
13
- | **Orchestration** | Claude Code Agent Teams | Spawning sub-agents, internal task dispatch, inter-agent messaging |
14
- | **Work Tracking** | Synapse | Task lifecycle (claim → in_progress → to_verify → done), activity stream |
15
-
16
- ```
17
- ┌─────────────────────────────────────────────────────────┐
18
- │ Claude Code Agent Teams (Orchestration) │
19
- │ │
20
- │ Team Lead ──spawn──> Sub-Agent A ──spawn──> Sub-Agent B│
21
- │ │ │ │ │
22
- │ TeamCreate Task tool Task tool │
23
- │ TaskCreate SendMessage SendMessage│
24
- │ TaskList/Update │
25
- └───────┬──────────────────┬──────────────────────┬───────┘
26
- │ │ │
27
- ▼ ▼ ▼
28
- ┌─────────────────────────────────────────────────────────┐
29
- │ Synapse (Work Tracking & Observability) │
30
- │ │
31
- │ Task A ← Sub-Agent A Task B ← Sub-Agent B │
32
- │ ├─ update_task(in_progress) ├─ update_task │
33
- │ ├─ report_work ├─ report_work │
34
- │ └─ submit_for_verify └─ submit_for_verify │
35
- │ │
36
- │ UI: Kanban board, Task Detail, Activity stream │
37
- └─────────────────────────────────────────────────────────┘
38
- ```
39
-
40
- ---
41
-
42
- ## MCP Access for Sub-Agents
43
-
44
- Sub-agents spawned via Claude Code's `Task` tool can access Synapse MCP tools **if the MCP server is configured at the project level** (in `.claude/settings.json` or `.mcp.json`). This is the recommended setup.
45
-
46
- If MCP is configured at the user level (`~/.claude/settings.json`), sub-agents may not have access. In that case, move the Synapse MCP config to the project level:
47
-
48
- ```json
49
- // .mcp.json (project root)
50
- {
51
- "mcpServers": {
52
- "synapse": {
53
- "type": "streamable-http",
54
- "url": "<BASE_URL>/api/mcp",
55
- "headers": {
56
- "Authorization": "Bearer syn_xxxxxxxxxxxx"
57
- }
58
- }
59
- }
60
- }
61
- ```
62
-
63
- ---
64
-
65
- ## Complete Workflow
66
-
67
- ### Phase 1: Team Lead — Plan & Prepare
68
-
69
- ```
70
- # 1. Check in to Synapse
71
- synapse_checkin()
72
-
73
- # 2. Understand the project and available tasks
74
- synapse_get_project({ projectUuid: "<project-uuid>" })
75
- synapse_list_tasks({ projectUuid: "<project-uuid>", status: "assigned" })
76
-
77
- # 3. Read task details to plan work distribution
78
- synapse_get_task({ taskUuid: "<task-A-uuid>" })
79
- synapse_get_task({ taskUuid: "<task-B-uuid>" })
80
- ```
81
-
82
- ### Phase 2: Team Lead — Create Claude Code Team & Spawn Sub-Agents
83
-
84
- Pass Synapse task UUIDs in the prompt to each sub-agent.
85
-
86
- ```python
87
- # 1. Create a Claude Code team
88
- TeamCreate({ team_name: "feature-x", description: "Implementing feature X" })
89
-
90
- # 2. Create internal tasks for tracking
91
- TaskCreate({ subject: "Frontend: build user form", description: "synapse:task:<task-A-uuid>" })
92
- TaskCreate({ subject: "Backend: create API endpoints", description: "synapse:task:<task-B-uuid>" })
93
-
94
- # 3. Spawn sub-agents — pass task UUIDs in the prompt
95
- Task({
96
- subagent_type: "general-purpose",
97
- team_name: "feature-x",
98
- name: "frontend-worker",
99
- prompt: """
100
- You are a Developer Agent working with Synapse.
101
-
102
- Your Synapse task UUID: task-A-uuid
103
- Project UUID: project-uuid
104
-
105
- Synapse workflow (do this FIRST before any coding):
106
- 1. synapse_update_task({ taskUuid: "task-A-uuid", status: "in_progress" })
107
-
108
- Then implement the frontend user form component...
109
-
110
- When done:
111
- 2. synapse_report_work({ taskUuid: "task-A-uuid", report: "..." })
112
- 3. synapse_submit_for_verify({ taskUuid: "task-A-uuid", summary: "..." })
113
- """
114
- })
115
- ```
116
-
117
- ### Phase 3: Sub-Agent — Execute Work
118
-
119
- Each sub-agent follows this sequence autonomously:
120
-
121
- ```
122
- # === Synapse Setup (FIRST, before any coding) ===
123
-
124
- # 1. Move task to in_progress
125
- synapse_update_task({
126
- taskUuid: "<my-task-uuid>",
127
- status: "in_progress"
128
- })
129
-
130
- # === Do the actual work (coding, testing, etc.) ===
131
- # ...write code, run tests, create commits...
132
-
133
- # === Progress reporting (periodically during work) ===
134
-
135
- # 2. Report progress
136
- synapse_report_work({
137
- taskUuid: "<my-task-uuid>",
138
- report: "Completed user form component.\n- Files: src/components/UserForm.tsx\n- Commit: abc123"
139
- })
140
-
141
- # === Completion ===
142
-
143
- # 3. Submit for verification
144
- synapse_submit_for_verify({
145
- taskUuid: "<my-task-uuid>",
146
- summary: "Implemented user form with validation.\nFiles: ...\nAll tests passing."
147
- })
148
-
149
- # 4. Notify team lead via Claude Code messaging
150
- SendMessage({ type: "message", recipient: "team-lead", content: "Task complete", summary: "Frontend task done" })
151
- ```
152
-
153
- ### Phase 4: Team Lead — Verify, Unblock & Close
154
-
155
- The Team Lead monitors until all Synapse tasks reach `to_verify` or `done`. **Task verification (to_verify → done) is an Admin responsibility** — if you have admin role, verify tasks promptly to unblock downstream dependencies. `to_verify` does NOT resolve dependencies — only `done` does.
156
-
157
- > **Note:** If you are using the Synapse Plugin for Claude Code, the TaskCompleted hook will automatically remind you each time a sub-agent finishes — showing the task's acceptance criteria status and any blocked downstream tasks.
158
-
159
- ```
160
- # 1. Periodically check Synapse task status
161
- synapse_list_tasks({ projectUuid: "<project-uuid>" })
162
-
163
- # 2. Clean up Claude Code team
164
- # Send shutdown requests to sub-agents, then TeamDelete
165
- ```
166
-
167
- ---
168
-
169
- ## Handling Task Dependencies (DAG)
170
-
171
- When Synapse tasks have dependencies (Task B depends on Task A), the Team Lead must coordinate the execution order.
172
-
173
- > **Server-side enforcement**: `synapse_update_task(status: "in_progress")` will automatically reject if any `dependsOn` task is not `done` or `closed`. The error includes detailed blocker info (title, status, assignee). Sub-agents do NOT need to manually poll dependency status — the server enforces it.
174
-
175
- **Recommended: Wave-based sequential spawning**
176
- - Use `synapse_get_unblocked_tasks` to find tasks ready to start (all deps resolved)
177
- - Spawn sub-agents only for unblocked tasks (Wave 1)
178
- - When Wave 1 tasks complete, check for newly unblocked tasks (Wave 2)
179
- - Repeat until all tasks are done
180
-
181
- **Alternative: Spawn all, server rejects blocked ones**
182
- - Spawn all sub-agents immediately
183
- - Sub-agents that try to move blocked tasks to `in_progress` will receive a clear error with blocker details
184
- - Those sub-agents can then use `synapse_get_unblocked_tasks` to find other work, or wait and retry
185
-
186
- ---
187
-
188
- ## Multiple Tasks Per Sub-Agent
189
-
190
- A single sub-agent can work on multiple Synapse tasks sequentially. The Team Lead passes multiple task UUIDs, and the sub-agent processes them in order:
191
-
192
- ```python
193
- Task({
194
- name: "full-stack-worker",
195
- prompt: """
196
- Your Synapse tasks (work in order):
197
- 1. task-schema-uuid — Create database schema
198
- 2. task-api-uuid — Implement API endpoints (depends on #1)
199
- 3. task-tests-uuid — Write integration tests (depends on #2)
200
-
201
- For EACH task:
202
- - synapse_update_task(in_progress) → work → synapse_report_work → synapse_submit_for_verify
203
- """
204
- })
205
- ```
206
-
207
- ---
208
-
209
- ## Troubleshooting
210
-
211
- ### Sub-agent can't access Synapse MCP tools
212
- - Verify MCP is configured at project level (`.mcp.json` or `.claude/settings.json`), not just user level
213
- - Verify the API key in the MCP config has `developer_agent` role
214
-
215
- ### Task stuck in wrong status
216
- - If a sub-agent crashed before completing, the task may be stuck in `in_progress`
217
- - Team Lead can spawn a new sub-agent to continue, or use `synapse_update_task` to reset status
218
-
219
- ---
220
-
221
- ## Quick Reference
222
-
223
- | Step | Who | Claude Code Tool | Synapse Tool |
224
- |------|-----|-----------------|-------------|
225
- | Plan work | Team Lead | — | `synapse_checkin`, `synapse_list_tasks` |
226
- | Create team | Team Lead | `TeamCreate` | — |
227
- | Spawn workers | Team Lead | `Task` (with task UUIDs in prompt) | — |
228
- | Start work | Sub-Agent | — | `synapse_update_task(in_progress)` |
229
- | Report progress | Sub-Agent | — | `synapse_report_work` |
230
- | Complete task | Sub-Agent | — | `synapse_submit_for_verify` |
231
- | Notify lead | Sub-Agent | `SendMessage` | — |
232
- | Monitor | Team Lead | `TaskList` | `synapse_list_tasks` |
233
- | Shutdown | Team Lead | `SendMessage(shutdown_request)` + `TeamDelete` | — |
@@ -1,20 +0,0 @@
1
- {
2
- "name": "synapse",
3
- "description": "Synapse research orchestration plugin for Claude Code. Connects AI agents to Synapse for experiment execution, literature search, progress reporting, and autonomous research loops.",
4
- "version": "0.7.0",
5
- "author": {
6
- "name": "Vincentwei1021"
7
- },
8
- "homepage": "https://github.com/Vincentwei1021/Synapse",
9
- "repository": "https://github.com/Vincentwei1021/Synapse",
10
- "license": "AGPL-3.0",
11
- "keywords": [
12
- "synapse",
13
- "research",
14
- "orchestration",
15
- "mcp",
16
- "experiments",
17
- "ai-agents",
18
- "literature-search"
19
- ]
20
- }
@@ -1,11 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "synapse": {
4
- "type": "http",
5
- "url": "${SYNAPSE_URL}/api/mcp",
6
- "headers": {
7
- "Authorization": "Bearer ${SYNAPSE_API_KEY}"
8
- }
9
- }
10
- }
11
- }
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env bash
2
- # on-pre-enter-plan.sh — PreToolUse hook for EnterPlanMode
3
- # Injects guidance for the current ResearchQuestion -> Experiment workflow.
4
- #
5
- # Output: JSON with additionalContext
6
-
7
- set -euo pipefail
8
-
9
- [ -z "${SYNAPSE_URL:-}" ] && exit 0
10
-
11
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
12
- API="${SCRIPT_DIR}/synapse-api.sh"
13
-
14
- CONTEXT="[Synapse Planning Workflow]
15
- When planning implementation, follow the current Synapse research lifecycle:
16
- 1. Identify the Research Project and, if needed, the relevant Research Question
17
- 2. Create or refine Experiment records directly for the work that should be executed
18
- 3. Break work into clear Experiment units with title, description, compute needs, and expected outcome
19
- 4. Keep new work in the Experiment pipeline (`draft` -> `pending_review` -> `pending_start` -> `in_progress` -> `completed`)
20
- 5. Do NOT route new work through Experiment Design or Experiment Run unless you are intentionally handling legacy compatibility surfaces
21
-
22
- When planning sub-agent work distribution:
23
- - The Synapse Plugin auto-manages session lifecycle — do NOT plan to create sessions manually.
24
- - Plan which Synapse experiment UUIDs each sub-agent should execute — that is what the prompt should pass."
25
-
26
- "$API" hook-output "Synapse: plan mode — use the Experiment workflow" "$CONTEXT" "PreToolUse"
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env bash
2
- # on-pre-exit-plan.sh — PreToolUse hook for ExitPlanMode
3
- # Reminds the agent to exit planning with Experiment records, not legacy drafts.
4
- #
5
- # Output: JSON with additionalContext
6
-
7
- set -euo pipefail
8
-
9
- [ -z "${SYNAPSE_URL:-}" ] && exit 0
10
-
11
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
12
- API="${SCRIPT_DIR}/synapse-api.sh"
13
-
14
- CONTEXT="[Synapse Pre-Implementation Check]
15
- Before exiting plan mode, ensure:
16
- 1. The work is represented as one or more current Synapse Experiments
17
- 2. Each Experiment has enough detail to execute without relying on legacy Experiment Design drafts
18
- 3. New human-created execution work is ready for the modern Experiment pipeline (usually `pending_start`, unless you intentionally keep it as `draft`)
19
- 4. Any sub-agent plan names the Experiment UUID each worker should execute
20
- If no Experiment exists yet, create or propose one before implementing."
21
-
22
- "$API" hook-output "" "$CONTEXT" "PreToolUse"
@@ -1,64 +0,0 @@
1
- #!/usr/bin/env bash
2
- # on-pre-spawn-agent.sh — PreToolUse hook for Task (spawning sub-agents)
3
- # 1. Captures agent name + type from tool_input and writes a per-agent pending file
4
- # (SubagentStart will claim this file atomically via mv)
5
- # 2. Reminds Team Lead to pass Synapse experiment UUIDs to sub-agents.
6
- #
7
- # Concurrency safety: Each PreToolUse writes a separate file under .synapse/pending/
8
- # so parallel spawns never contend on a shared file. SubagentStart claims files
9
- # atomically with mv (only one process can successfully mv a given file).
10
- #
11
- # Output: JSON with additionalContext
12
-
13
- set -euo pipefail
14
-
15
- [ -z "${SYNAPSE_URL:-}" ] && exit 0
16
-
17
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
18
- API="${SCRIPT_DIR}/synapse-api.sh"
19
-
20
- # Read event from stdin to check agent type
21
- EVENT=""
22
- if [ ! -t 0 ]; then
23
- EVENT=$(cat)
24
- fi
25
-
26
- # Try to extract subagent_type and name from the tool input
27
- AGENT_TYPE=""
28
- AGENT_NAME=""
29
- if [ -n "$EVENT" ]; then
30
- AGENT_TYPE=$(echo "$EVENT" | jq -r '.tool_input.subagent_type // .input.subagent_type // empty' 2>/dev/null) || true
31
- AGENT_NAME=$(echo "$EVENT" | jq -r '.tool_input.name // .input.name // empty' 2>/dev/null) || true
32
- fi
33
-
34
- # Skip non-worker types — no need to remind for Explore/Plan agents
35
- case "$(printf '%s' "$AGENT_TYPE" | tr '[:upper:]' '[:lower:]')" in
36
- explore|plan|haiku|claude-code-guide|statusline-setup)
37
- exit 0
38
- ;;
39
- esac
40
-
41
- # Write a per-agent pending file for SubagentStart to claim.
42
- # SubagentStart only receives agent_id + agent_type — not the name.
43
- # CC sometimes uses the agent name as agent_type, so we store both.
44
- #
45
- # Each spawn gets its own file — no shared state, no concurrency issues.
46
- # File name is the agent name (or a unique fallback if name is empty).
47
- # SubagentStart claims by mv (atomic on same filesystem).
48
- #
49
- # CC may internally spawn cleanup agents that bypass PreToolUse:Task —
50
- # SubagentStart skips those if no pending file matches.
51
- PENDING_DIR="${CLAUDE_PROJECT_DIR:-.}/.synapse/pending"
52
- mkdir -p "$PENDING_DIR"
53
-
54
- # Use agent name as filename; fall back to timestamp-based unique name
55
- PENDING_NAME="${AGENT_NAME:-unknown-$(date +%s%N)}"
56
- printf '{"name":"%s","type":"%s","ts":"%s"}\n' \
57
- "${AGENT_NAME:-}" "${AGENT_TYPE:-}" "$(date -u +%Y-%m-%dT%H:%M:%S.%3NZ)" \
58
- > "${PENDING_DIR}/${PENDING_NAME}"
59
-
60
- CONTEXT="[Synapse Plugin — Sub-agent Spawn]
61
- Session auto-managed by plugin. Do NOT call synapse_create_session.
62
- Pass the Synapse experiment UUID in the sub-agent prompt. Current Experiment workflow instructions will be auto-injected by the SubagentStart hook."
63
-
64
- "$API" hook-output "" "$CONTEXT" "PreToolUse"
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env bash
2
- # on-session-end.sh — SessionEnd hook
3
- # Fires when Claude Code session ends.
4
- # Cleans up the .synapse/ directory if all sessions are closed and state is empty.
5
-
6
- set -euo pipefail
7
-
8
- STATE_DIR="${CLAUDE_PROJECT_DIR:-.}/.synapse"
9
-
10
- # Nothing to clean up
11
- if [ ! -d "$STATE_DIR" ]; then
12
- exit 0
13
- fi
14
-
15
- # Safety check: don't delete if there are still active session files
16
- SESSIONS_DIR="${STATE_DIR}/sessions"
17
- if [ -d "$SESSIONS_DIR" ]; then
18
- REMAINING=0
19
- for f in "$SESSIONS_DIR"/*.json; do
20
- [ -f "$f" ] || continue
21
- REMAINING=$((REMAINING + 1))
22
- done
23
- if [ "$REMAINING" -gt 0 ]; then
24
- exit 0
25
- fi
26
- fi
27
-
28
- # Safety check: don't delete if state.json has meaningful content
29
- if [ -f "${STATE_DIR}/state.json" ]; then
30
- if command -v jq &>/dev/null; then
31
- KEY_COUNT=$(jq 'length' "${STATE_DIR}/state.json" 2>/dev/null) || KEY_COUNT=0
32
- if [ "$KEY_COUNT" -gt 0 ]; then
33
- exit 0
34
- fi
35
- fi
36
- fi
37
-
38
- # All clear — remove .synapse/ directory
39
- rm -rf "$STATE_DIR"