bajaclaw 0.10.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 (248) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +639 -0
  3. package/bin/bajaclaw.js +35 -0
  4. package/bin/create-bajaclaw.js +17 -0
  5. package/dist/agent.d.ts +29 -0
  6. package/dist/agent.js +231 -0
  7. package/dist/agent.js.map +1 -0
  8. package/dist/api/server.d.ts +15 -0
  9. package/dist/api/server.js +215 -0
  10. package/dist/api/server.js.map +1 -0
  11. package/dist/api/translate.d.ts +61 -0
  12. package/dist/api/translate.js +109 -0
  13. package/dist/api/translate.js.map +1 -0
  14. package/dist/banner.d.ts +7 -0
  15. package/dist/banner.js +31 -0
  16. package/dist/banner.js.map +1 -0
  17. package/dist/channels/gateway.d.ts +1 -0
  18. package/dist/channels/gateway.js +76 -0
  19. package/dist/channels/gateway.js.map +1 -0
  20. package/dist/claude.d.ts +9 -0
  21. package/dist/claude.js +170 -0
  22. package/dist/claude.js.map +1 -0
  23. package/dist/cli.d.ts +2 -0
  24. package/dist/cli.js +303 -0
  25. package/dist/cli.js.map +1 -0
  26. package/dist/commands/channel.d.ts +3 -0
  27. package/dist/commands/channel.js +27 -0
  28. package/dist/commands/channel.js.map +1 -0
  29. package/dist/commands/compact.d.ts +8 -0
  30. package/dist/commands/compact.js +60 -0
  31. package/dist/commands/compact.js.map +1 -0
  32. package/dist/commands/daemon.d.ts +7 -0
  33. package/dist/commands/daemon.js +129 -0
  34. package/dist/commands/daemon.js.map +1 -0
  35. package/dist/commands/dashboard.d.ts +1 -0
  36. package/dist/commands/dashboard.js +78 -0
  37. package/dist/commands/dashboard.js.map +1 -0
  38. package/dist/commands/doctor.d.ts +1 -0
  39. package/dist/commands/doctor.js +25 -0
  40. package/dist/commands/doctor.js.map +1 -0
  41. package/dist/commands/dry-run.d.ts +1 -0
  42. package/dist/commands/dry-run.js +5 -0
  43. package/dist/commands/dry-run.js.map +1 -0
  44. package/dist/commands/effort.d.ts +6 -0
  45. package/dist/commands/effort.js +33 -0
  46. package/dist/commands/effort.js.map +1 -0
  47. package/dist/commands/guide.d.ts +4 -0
  48. package/dist/commands/guide.js +52 -0
  49. package/dist/commands/guide.js.map +1 -0
  50. package/dist/commands/health.d.ts +1 -0
  51. package/dist/commands/health.js +20 -0
  52. package/dist/commands/health.js.map +1 -0
  53. package/dist/commands/init.d.ts +12 -0
  54. package/dist/commands/init.js +114 -0
  55. package/dist/commands/init.js.map +1 -0
  56. package/dist/commands/mcp.d.ts +9 -0
  57. package/dist/commands/mcp.js +63 -0
  58. package/dist/commands/mcp.js.map +1 -0
  59. package/dist/commands/migrate.d.ts +1 -0
  60. package/dist/commands/migrate.js +58 -0
  61. package/dist/commands/migrate.js.map +1 -0
  62. package/dist/commands/model.d.ts +5 -0
  63. package/dist/commands/model.js +31 -0
  64. package/dist/commands/model.js.map +1 -0
  65. package/dist/commands/persona.d.ts +6 -0
  66. package/dist/commands/persona.js +67 -0
  67. package/dist/commands/persona.js.map +1 -0
  68. package/dist/commands/port.d.ts +15 -0
  69. package/dist/commands/port.js +88 -0
  70. package/dist/commands/port.js.map +1 -0
  71. package/dist/commands/profile.d.ts +4 -0
  72. package/dist/commands/profile.js +41 -0
  73. package/dist/commands/profile.js.map +1 -0
  74. package/dist/commands/serve.d.ts +14 -0
  75. package/dist/commands/serve.js +62 -0
  76. package/dist/commands/serve.js.map +1 -0
  77. package/dist/commands/setup.d.ts +17 -0
  78. package/dist/commands/setup.js +228 -0
  79. package/dist/commands/setup.js.map +1 -0
  80. package/dist/commands/skill.d.ts +7 -0
  81. package/dist/commands/skill.js +137 -0
  82. package/dist/commands/skill.js.map +1 -0
  83. package/dist/commands/start.d.ts +6 -0
  84. package/dist/commands/start.js +25 -0
  85. package/dist/commands/start.js.map +1 -0
  86. package/dist/commands/status.d.ts +1 -0
  87. package/dist/commands/status.js +35 -0
  88. package/dist/commands/status.js.map +1 -0
  89. package/dist/commands/subagent.d.ts +14 -0
  90. package/dist/commands/subagent.js +173 -0
  91. package/dist/commands/subagent.js.map +1 -0
  92. package/dist/commands/trigger.d.ts +1 -0
  93. package/dist/commands/trigger.js +13 -0
  94. package/dist/commands/trigger.js.map +1 -0
  95. package/dist/commands/uninstall.d.ts +5 -0
  96. package/dist/commands/uninstall.js +165 -0
  97. package/dist/commands/uninstall.js.map +1 -0
  98. package/dist/commands/update.d.ts +7 -0
  99. package/dist/commands/update.js +49 -0
  100. package/dist/commands/update.js.map +1 -0
  101. package/dist/concurrency.d.ts +1 -0
  102. package/dist/concurrency.js +17 -0
  103. package/dist/concurrency.js.map +1 -0
  104. package/dist/config.d.ts +5 -0
  105. package/dist/config.js +42 -0
  106. package/dist/config.js.map +1 -0
  107. package/dist/db.d.ts +3 -0
  108. package/dist/db.js +124 -0
  109. package/dist/db.js.map +1 -0
  110. package/dist/delegation.d.ts +6 -0
  111. package/dist/delegation.js +21 -0
  112. package/dist/delegation.js.map +1 -0
  113. package/dist/health-check.d.ts +6 -0
  114. package/dist/health-check.js +38 -0
  115. package/dist/health-check.js.map +1 -0
  116. package/dist/logger.d.ts +11 -0
  117. package/dist/logger.js +53 -0
  118. package/dist/logger.js.map +1 -0
  119. package/dist/mcp/consumer.d.ts +15 -0
  120. package/dist/mcp/consumer.js +74 -0
  121. package/dist/mcp/consumer.js.map +1 -0
  122. package/dist/mcp/server.d.ts +6 -0
  123. package/dist/mcp/server.js +260 -0
  124. package/dist/mcp/server.js.map +1 -0
  125. package/dist/memory/claude-compat.d.ts +4 -0
  126. package/dist/memory/claude-compat.js +56 -0
  127. package/dist/memory/claude-compat.js.map +1 -0
  128. package/dist/memory/compact.d.ts +25 -0
  129. package/dist/memory/compact.js +195 -0
  130. package/dist/memory/compact.js.map +1 -0
  131. package/dist/memory/extract.d.ts +3 -0
  132. package/dist/memory/extract.js +56 -0
  133. package/dist/memory/extract.js.map +1 -0
  134. package/dist/memory/recall.d.ts +5 -0
  135. package/dist/memory/recall.js +47 -0
  136. package/dist/memory/recall.js.map +1 -0
  137. package/dist/model-picker.d.ts +33 -0
  138. package/dist/model-picker.js +104 -0
  139. package/dist/model-picker.js.map +1 -0
  140. package/dist/paths.d.ts +12 -0
  141. package/dist/paths.js +49 -0
  142. package/dist/paths.js.map +1 -0
  143. package/dist/persona-io.d.ts +5 -0
  144. package/dist/persona-io.js +29 -0
  145. package/dist/persona-io.js.map +1 -0
  146. package/dist/persona.d.ts +12 -0
  147. package/dist/persona.js +54 -0
  148. package/dist/persona.js.map +1 -0
  149. package/dist/prompt.d.ts +5 -0
  150. package/dist/prompt.js +56 -0
  151. package/dist/prompt.js.map +1 -0
  152. package/dist/safety.d.ts +17 -0
  153. package/dist/safety.js +47 -0
  154. package/dist/safety.js.map +1 -0
  155. package/dist/scheduler/cron.d.ts +4 -0
  156. package/dist/scheduler/cron.js +44 -0
  157. package/dist/scheduler/cron.js.map +1 -0
  158. package/dist/scheduler/index.d.ts +7 -0
  159. package/dist/scheduler/index.js +15 -0
  160. package/dist/scheduler/index.js.map +1 -0
  161. package/dist/scheduler/launchd.d.ts +4 -0
  162. package/dist/scheduler/launchd.js +73 -0
  163. package/dist/scheduler/launchd.js.map +1 -0
  164. package/dist/scheduler/schtasks.d.ts +4 -0
  165. package/dist/scheduler/schtasks.js +45 -0
  166. package/dist/scheduler/schtasks.js.map +1 -0
  167. package/dist/scheduler/systemd.d.ts +5 -0
  168. package/dist/scheduler/systemd.js +86 -0
  169. package/dist/scheduler/systemd.js.map +1 -0
  170. package/dist/self-improve.d.ts +4 -0
  171. package/dist/self-improve.js +48 -0
  172. package/dist/self-improve.js.map +1 -0
  173. package/dist/skills/auto-skiller.d.ts +21 -0
  174. package/dist/skills/auto-skiller.js +156 -0
  175. package/dist/skills/auto-skiller.js.map +1 -0
  176. package/dist/skills/loader.d.ts +3 -0
  177. package/dist/skills/loader.js +127 -0
  178. package/dist/skills/loader.js.map +1 -0
  179. package/dist/skills/matcher.d.ts +2 -0
  180. package/dist/skills/matcher.js +27 -0
  181. package/dist/skills/matcher.js.map +1 -0
  182. package/dist/skills/porter.d.ts +27 -0
  183. package/dist/skills/porter.js +109 -0
  184. package/dist/skills/porter.js.map +1 -0
  185. package/dist/types.d.ts +110 -0
  186. package/dist/types.js +2 -0
  187. package/dist/types.js.map +1 -0
  188. package/dist/updater.d.ts +25 -0
  189. package/dist/updater.js +185 -0
  190. package/dist/updater.js.map +1 -0
  191. package/package.json +53 -0
  192. package/scripts/postinstall.js +33 -0
  193. package/skills/configure-effort/SKILL.md +36 -0
  194. package/skills/configure-model/SKILL.md +41 -0
  195. package/skills/configure-tools/SKILL.md +51 -0
  196. package/skills/daily-briefing/SKILL.md +19 -0
  197. package/skills/delegate-to-subagent/SKILL.md +63 -0
  198. package/skills/email-triage/SKILL.md +21 -0
  199. package/skills/setup-api/SKILL.md +115 -0
  200. package/skills/setup-compaction/SKILL.md +102 -0
  201. package/skills/setup-daemon/SKILL.md +49 -0
  202. package/skills/setup-dashboard/SKILL.md +39 -0
  203. package/skills/setup-discord/SKILL.md +54 -0
  204. package/skills/setup-heartbeat/SKILL.md +51 -0
  205. package/skills/setup-mcp-port/SKILL.md +54 -0
  206. package/skills/setup-memory-sync/SKILL.md +45 -0
  207. package/skills/setup-profile/SKILL.md +44 -0
  208. package/skills/setup-self-update/SKILL.md +45 -0
  209. package/skills/setup-subagent/SKILL.md +102 -0
  210. package/skills/setup-telegram/SKILL.md +54 -0
  211. package/skills/setup-uninstall/SKILL.md +55 -0
  212. package/skills/web-research/SKILL.md +20 -0
  213. package/templates/code/AGENT.md +15 -0
  214. package/templates/code/HEARTBEAT.md +11 -0
  215. package/templates/code/SOUL.md +10 -0
  216. package/templates/code/bajaclaw.config.json +5 -0
  217. package/templates/code/scripts/launch.bat +4 -0
  218. package/templates/code/scripts/launch.sh +4 -0
  219. package/templates/custom/AGENT.md +14 -0
  220. package/templates/custom/HEARTBEAT.md +11 -0
  221. package/templates/custom/SOUL.md +10 -0
  222. package/templates/custom/bajaclaw.config.json +5 -0
  223. package/templates/custom/scripts/launch.bat +4 -0
  224. package/templates/custom/scripts/launch.sh +4 -0
  225. package/templates/outreach/AGENT.md +11 -0
  226. package/templates/outreach/HEARTBEAT.md +11 -0
  227. package/templates/outreach/SOUL.md +10 -0
  228. package/templates/outreach/bajaclaw.config.json +5 -0
  229. package/templates/outreach/scripts/launch.bat +4 -0
  230. package/templates/outreach/scripts/launch.sh +4 -0
  231. package/templates/research/AGENT.md +27 -0
  232. package/templates/research/HEARTBEAT.md +11 -0
  233. package/templates/research/SOUL.md +10 -0
  234. package/templates/research/bajaclaw.config.json +5 -0
  235. package/templates/research/scripts/launch.bat +4 -0
  236. package/templates/research/scripts/launch.sh +4 -0
  237. package/templates/social/AGENT.md +10 -0
  238. package/templates/social/HEARTBEAT.md +11 -0
  239. package/templates/social/SOUL.md +10 -0
  240. package/templates/social/bajaclaw.config.json +5 -0
  241. package/templates/social/scripts/launch.bat +4 -0
  242. package/templates/social/scripts/launch.sh +4 -0
  243. package/templates/support/AGENT.md +10 -0
  244. package/templates/support/HEARTBEAT.md +11 -0
  245. package/templates/support/SOUL.md +10 -0
  246. package/templates/support/bajaclaw.config.json +5 -0
  247. package/templates/support/scripts/launch.bat +4 -0
  248. package/templates/support/scripts/launch.sh +4 -0
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: setup-memory-sync
3
+ description: Enable two-way memory sync between BajaClaw and ~/.claude/memory/
4
+ version: 0.1.0
5
+ tools: [Bash, Read, Edit, Write]
6
+ triggers: ["memory sync", "share memory", "sync memory", "connect memory", "memory compat"]
7
+ effort: low
8
+ ---
9
+
10
+ ## When to use
11
+ User wants facts BajaClaw learns across cycles to show up in desktop CLI
12
+ sessions (and vice versa), without manual copy/paste.
13
+
14
+ ## Quick reference
15
+ - Direction: bidirectional, per-profile, opt-in.
16
+ - BajaClaw side: FTS5 `memories` table in `bajaclaw.db`.
17
+ - Desktop side: plain markdown files under `~/.claude/memory/`.
18
+ - Implementation: `src/memory/claude-compat.ts`.
19
+
20
+ ## Procedure
21
+ 1. Edit `~/.bajaclaw/profiles/<profile>/config.json`. Add or update:
22
+ ```json
23
+ { "memorySync": true }
24
+ ```
25
+ 2. On the next cycle, BajaClaw will:
26
+ - Ingest any new/modified `*.md` files under `~/.claude/memory/` into
27
+ its FTS table with `source=claude-code`.
28
+ - Write a digest to `~/.claude/memory/bajaclaw-<profile>.md` so desktop
29
+ sessions see what BajaClaw has been learning.
30
+ 3. Verify:
31
+ - `bajaclaw dashboard <profile>` — Memories panel will include entries
32
+ with kind `claude-code`.
33
+ - Check `~/.claude/memory/bajaclaw-<profile>.md` for the digest file.
34
+
35
+ ## Pitfalls
36
+ - Sync is deliberate, not automatic. Only profiles with `memorySync: true`
37
+ participate.
38
+ - The digest file overwrites on each sync — it's a snapshot, not an
39
+ append-log. Don't hand-edit it.
40
+ - Large `~/.claude/memory/` directories slow down cycles. If you have
41
+ thousands of files there, consider pruning before enabling sync.
42
+
43
+ ## Verification
44
+ - Post-cycle: `bajaclaw dashboard` shows memories with `kind=claude-code`
45
+ - `~/.claude/memory/bajaclaw-<profile>.md` exists and contains recent memories
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: setup-profile
3
+ description: Create an additional named BajaClaw profile beyond the default
4
+ version: 0.1.0
5
+ tools: [Bash, Read, Write]
6
+ triggers: ["new profile", "add profile", "another agent", "second agent", "create profile", "multiple agents"]
7
+ effort: low
8
+ ---
9
+
10
+ ## When to use
11
+ User wants more than one agent — e.g. one for research, one for inbox
12
+ triage, one for coding. Each profile gets its own DB, skills, schedule,
13
+ logs, and agent descriptor.
14
+
15
+ ## Quick reference
16
+ - Location: `~/.bajaclaw/profiles/<name>/`
17
+ - Agent descriptor: `~/.claude/agents/<name>/<name>.md` (auto-written)
18
+ - Templates: `outreach | research | support | social | code | custom`
19
+ - Switch: positional arg or `BAJACLAW_PROFILE` env var.
20
+
21
+ ## Procedure
22
+ 1. Ask the user what this agent is for — that picks the template.
23
+ 2. Run: `bajaclaw init <name> --template <tpl>`
24
+ - Example: `bajaclaw init researcher --template research`
25
+ 3. Optional: set model + effort at init:
26
+ `bajaclaw init researcher --template research --model claude-opus-4-7 --effort high`
27
+ 4. Edit `~/.bajaclaw/profiles/<name>/AGENT.md` and `SOUL.md` to tailor the
28
+ agent's operating rules and identity.
29
+ 5. Edit `~/.bajaclaw/profiles/<name>/HEARTBEAT.md` with schedule lines.
30
+ 6. First run: `bajaclaw start <name> --dry-run` to verify the assembled
31
+ prompt, then `bajaclaw start <name>` for a live cycle.
32
+
33
+ ## Pitfalls
34
+ - Profiles don't share memory unless you enable `memorySync` (via
35
+ `~/.claude/memory/` digests). They're independent by design.
36
+ - `bajaclaw profile delete <name> --yes` removes the profile directory.
37
+ Not recoverable. Back up `bajaclaw.db` first if you want history.
38
+ - Two profiles can't run the dashboard on the same port. Pick different
39
+ `dashboardPort` values in each `config.json`.
40
+
41
+ ## Verification
42
+ - `bajaclaw profile list` shows the new profile
43
+ - `bajaclaw status <name>` returns stats
44
+ - `ls ~/.claude/agents/<name>/` shows the `<name>.md` descriptor
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: setup-self-update
3
+ description: Check for and install a new BajaClaw version, or configure the update channel
4
+ version: 0.1.0
5
+ tools: [Bash, Read]
6
+ triggers: ["update bajaclaw", "upgrade bajaclaw", "new version", "auto update", "check updates", "silence update notice"]
7
+ effort: low
8
+ ---
9
+
10
+ ## When to use
11
+ User wants to update BajaClaw, see what version they're on, or silence the
12
+ update-available notice.
13
+
14
+ ## Quick reference
15
+ - Check + install: `bajaclaw update`
16
+ - Current version: `bajaclaw --version`
17
+ - Cache: `~/.bajaclaw/.update-check.json` (24h TTL)
18
+ - Silence notice: `BAJACLAW_NO_UPDATE_NOTICE=1`
19
+ - Channels: npm registry (primary) + optional GitHub raw fallback
20
+ configured in `package.json` → `bajaclaw.updateUrl`.
21
+
22
+ ## Procedure
23
+ 1. Check delta without installing: `bajaclaw update --check`
24
+ 2. Apply: `bajaclaw update --yes`
25
+ - Installed via `npm install -g bajaclaw`: runs
26
+ `npm install -g bajaclaw@latest`.
27
+ - Installed from a git clone: runs
28
+ `git pull && npm install && npm run build`.
29
+ - Installed via `npm install -g github:backyarddd/BajaClaw`
30
+ (bleeding-edge track): `bajaclaw update` still reinstalls from
31
+ npm registry latest. Re-run the github install to stay on HEAD.
32
+ 3. Silence the post-command notice (e.g. in scripts):
33
+ export `BAJACLAW_NO_UPDATE_NOTICE=1` in the shell config.
34
+ 4. To force a fresh check (bypassing the 24h cache):
35
+ `rm ~/.bajaclaw/.update-check.json && bajaclaw update --check`
36
+
37
+ ## Pitfalls
38
+ - If `npm install -g` requires sudo on their system, the update will fail
39
+ silently. Ask them to retry with their node-version manager active or
40
+ fix the npm prefix.
41
+ - Network unavailable → silent fail, but the CLI still works. Retry later.
42
+
43
+ ## Verification
44
+ - `bajaclaw --version` reports the new version.
45
+ - Update notice disappears after a successful apply.
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: setup-subagent
3
+ description: Create a specialized sub-agent with its own tools and permissions, owned by an orchestrator
4
+ version: 0.1.0
5
+ tools: [Bash, Read, Write, Edit]
6
+ triggers: ["create subagent", "setup subagent", "new subagent", "add helper agent", "email agent", "mail agent", "calendar agent", "scope an agent"]
7
+ effort: medium
8
+ ---
9
+
10
+ ## When to use
11
+ The user wants a specialized helper agent with its own permissions that the
12
+ main agent can delegate to. Common cases: a "mail" agent with email MCP that
13
+ the main agent routes inbox tasks to; a "finance" agent that has access to
14
+ banking/budgeting tools the main doesn't.
15
+
16
+ ## Quick reference
17
+ - Sub-agents are separate BajaClaw profiles with a `parent:` pointer.
18
+ - Parent's `config.json` gets a `subAgents: [...]` list.
19
+ - Each sub-agent has its own tools, memory, skills, persona, and MCP config.
20
+ - The parent invokes via `bajaclaw delegate <subagent> "<task>"`.
21
+ - Permission isolation is physical: the parent doesn't have the sub-agent's
22
+ tools, so it literally cannot do the sub-agent's work.
23
+
24
+ ## Procedure
25
+
26
+ ### 1. Design the scope
27
+ Ask the user:
28
+ - **Name**: short, one-word (`mail`, `finance`, `research`, `scraper`)
29
+ - **What it does**: one-sentence purpose
30
+ - **What tools it needs**: e.g. `Read, Write, Bash` plus a specific MCP server
31
+ - **What tools it must NOT have**: things the parent shouldn't do either,
32
+ or things scoped only to this agent
33
+
34
+ ### 2. Create
35
+ ```
36
+ bajaclaw subagent create <name> \
37
+ --parent <main-profile> \
38
+ --template custom \
39
+ --allowed-tools Read,Write,Bash \
40
+ --disallowed-tools Edit \
41
+ --description "<one-line purpose>"
42
+ ```
43
+
44
+ Any option can be omitted. Defaults: template=custom, tools=inherited.
45
+
46
+ ### 3. Tighten MCP servers on the sub-agent (optional)
47
+ If the sub-agent owns a domain — say, email — you want its MCP config to
48
+ include the relevant server. Edit:
49
+ `~/.bajaclaw/profiles/<name>/mcp-config.json`
50
+
51
+ or port a specific server from the desktop config:
52
+ ```
53
+ bajaclaw mcp port --names email-mcp
54
+ # then move it to the sub-agent's profile MCP file
55
+ ```
56
+
57
+ Conversely: REMOVE the email MCP from the parent's MCP config so the
58
+ parent can't use it directly. That's what makes the isolation real.
59
+
60
+ ### 4. Give the sub-agent its persona
61
+ ```
62
+ bajaclaw persona --edit --profile <name>
63
+ ```
64
+
65
+ Or edit `~/.bajaclaw/profiles/<name>/SOUL.md` directly. A tight persona
66
+ that describes exactly what the sub-agent does keeps its cycles on-task.
67
+
68
+ ### 5. Confirm registration
69
+ ```
70
+ bajaclaw subagent list <main-profile>
71
+ ```
72
+
73
+ The new sub-agent should appear under the parent.
74
+
75
+ ### 6. Test the delegation path
76
+ ```
77
+ bajaclaw delegate <name> "say hi"
78
+ ```
79
+
80
+ Should print a short response from the sub-agent.
81
+
82
+ From the main agent's perspective, the pattern becomes:
83
+ ```
84
+ # In a main-agent cycle, when the task touches email:
85
+ # The agent runs this via Bash:
86
+ bajaclaw delegate mail "check inbox for anything from Alice"
87
+ ```
88
+
89
+ ## Pitfalls
90
+ - Sub-agents don't share memory with the parent. If you want a shared
91
+ knowledge base, use `memorySync: true` plus careful routing.
92
+ - Don't over-fragment. One sub-agent per clear responsibility is plenty.
93
+ A tree of 10 sub-agents with overlapping scopes is worse than none.
94
+ - The parent must know to delegate. Add the `delegate-to-subagent`
95
+ built-in skill so its matcher picks up on the relevant user requests.
96
+
97
+ ## Verification
98
+ - `bajaclaw subagent list` shows the parent → sub-agent tree.
99
+ - `~/.bajaclaw/profiles/<parent>/config.json` lists the sub-agent in
100
+ `subAgents`.
101
+ - `~/.bajaclaw/profiles/<sub>/config.json` has `parent: "<parent>"`.
102
+ - A delegation test returns a non-empty response from the sub-agent.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: setup-telegram
3
+ description: Walk the user through adding a Telegram bot adapter to BajaClaw
4
+ version: 0.1.0
5
+ tools: [Bash, Read, Write, Edit]
6
+ triggers: ["setup telegram", "help me with telegram", "connect telegram", "telegram bot", "add telegram", "telegram setup"]
7
+ effort: medium
8
+ ---
9
+
10
+ ## When to use
11
+ The user asks you to connect Telegram, add a Telegram bot, forward DMs
12
+ through a bot, or receive/send BajaClaw tasks over Telegram.
13
+
14
+ ## Quick reference
15
+ - Adapter: `src/channels/gateway.ts`, uses `node-telegram-bot-api` (optional dep)
16
+ - Token source: Telegram's `@BotFather` — `/newbot` → `/token`
17
+ - Allowlist: the user's numeric Telegram user id (from `@userinfobot`)
18
+ - Stored in: `~/.bajaclaw/profiles/<profile>/config.json` → `channels[]`
19
+
20
+ ## Procedure
21
+ 1. Check for an existing token. Ask: "do you already have a Telegram bot token?"
22
+ - If no: tell them to open Telegram, message `@BotFather`, send `/newbot`,
23
+ pick a name and username. BotFather replies with a token shaped like
24
+ `<digits>:<alphanumeric>`. Copy it.
25
+ 2. Ask for their numeric Telegram user id. They can get it by messaging
26
+ `@userinfobot`. Without this the allowlist is empty and no messages get
27
+ through.
28
+ 3. Run: `bajaclaw channel add <profile> telegram --token <TOKEN>` (replace
29
+ `<profile>` with their active profile — default is `default`).
30
+ 4. Edit `~/.bajaclaw/profiles/<profile>/config.json`. Inside
31
+ `channels[0].allowlist`, put `[<NUMERIC_USER_ID>]`. Example:
32
+ `"allowlist": [123456789]`
33
+ 5. Start the gateway: `bajaclaw daemon start <profile>` (or a dedicated
34
+ gateway subprocess if you're keeping the daemon off).
35
+ 6. Ask the user to message their bot. Expect a new task to appear in
36
+ `bajaclaw status <profile>` and a `gateway.telegram.msg` entry in the
37
+ logs.
38
+
39
+ ## Pitfalls
40
+ - `npm install node-telegram-bot-api` in the BajaClaw install dir if the
41
+ dependency is missing (it's an `optionalDependencies` entry).
42
+ - Empty allowlist → zero messages accepted. Confirm the id is present.
43
+ - Bot cannot initiate a conversation — the user must message the bot first
44
+ OR the bot must be added to a group.
45
+ - Never paste the token into a public log or chat. If it leaks, revoke via
46
+ BotFather `/revoke`.
47
+ - `bajaclaw uninstall` removes all channel configs as part of profile
48
+ teardown.
49
+
50
+ ## Verification
51
+ - `bajaclaw channel list <profile>` shows the telegram entry.
52
+ - `bajaclaw daemon logs <profile> --lines 50` includes `gateway.telegram.msg`
53
+ after a test message.
54
+ - `bajaclaw status <profile>` shows the pending-tasks counter rising.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: setup-uninstall
3
+ description: Safely tear down BajaClaw — integrations, schedulers, data, or all three
4
+ version: 0.1.0
5
+ tools: [Bash, Read]
6
+ triggers: ["uninstall", "remove bajaclaw", "delete bajaclaw", "clean up bajaclaw", "tear down"]
7
+ effort: low
8
+ ---
9
+
10
+ ## When to use
11
+ User wants BajaClaw off their machine — completely, or just the
12
+ integrations (keeping data), or just a specific profile.
13
+
14
+ ## Quick reference
15
+ - Dry-run default: `bajaclaw uninstall` prints the plan, changes nothing.
16
+ - `--yes` applies. `--keep-data` preserves `~/.bajaclaw/`.
17
+ - Per-profile removal: `bajaclaw profile delete <name> --yes` is the
18
+ scoped alternative.
19
+
20
+ ## Procedure
21
+
22
+ ### Full teardown
23
+ 1. Show the plan: `bajaclaw uninstall`
24
+ 2. Review — every item listed will be removed.
25
+ 3. Apply: `bajaclaw uninstall --yes`
26
+ 4. Remove the binary itself: `npm uninstall -g bajaclaw`
27
+
28
+ ### Partial (keep data, remove integrations only)
29
+ 1. `bajaclaw uninstall --yes --keep-data`
30
+ 2. Removes OS scheduler entries, agent descriptors, MCP registration,
31
+ memory sync files. Preserves `~/.bajaclaw/` — profiles, DB, skills, logs.
32
+
33
+ ### Remove one profile
34
+ 1. `bajaclaw profile delete <name> --yes`
35
+ 2. Does NOT remove the global integrations (MCP registration, user-scope
36
+ skills) — use full uninstall for that.
37
+
38
+ ## What gets removed (full uninstall)
39
+ - Running daemons (SIGTERM)
40
+ - OS scheduler entries for every profile (launchd plist / systemd unit /
41
+ crontab line / schtasks)
42
+ - `~/.claude/agents/<profile>/` for every profile
43
+ - Memory sync files at `~/.claude/memory/bajaclaw-*.md`
44
+ - BajaClaw's MCP entry in the desktop MCP config
45
+ - `~/.bajaclaw/` (unless `--keep-data`)
46
+
47
+ ## Pitfalls
48
+ - Uninstall is irreversible without `--keep-data`. Back up
49
+ `~/.bajaclaw/profiles/<name>/bajaclaw.db` first if you want history.
50
+ - The npm uninstall step is a separate command — `bajaclaw uninstall`
51
+ cannot remove its own binary.
52
+
53
+ ## Verification
54
+ - `ls ~/.bajaclaw/` → "no such file or directory"
55
+ - `bajaclaw` → "command not found" after the npm uninstall step
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: web-research
3
+ description: Search and synthesize across sources with inline citations
4
+ version: 0.1.0
5
+ tools: [WebSearch, WebFetch]
6
+ triggers: ["research", "look up", "find information about"]
7
+ effort: high
8
+ ---
9
+
10
+ ## Instructions
11
+
12
+ 1. Search with 2-3 different queries to avoid single-source bias.
13
+ 2. Fetch the top candidates. Skim before reading — if the source looks unreliable
14
+ (content farm, AI-generated SEO, unsigned claim), drop it.
15
+ 3. Synthesize with inline citations: every claim carries a URL.
16
+ 4. When sources conflict, show the disagreement — don't resolve it silently.
17
+ 5. Distinguish "the source says X" from "the evidence suggests X".
18
+
19
+ Final output: one-paragraph summary, bulleted findings with citations, open
20
+ questions. Do not paste large quotes. Paraphrase and cite.
@@ -0,0 +1,15 @@
1
+ # Code Baja — Operating Guide (orchestrator)
2
+
3
+ You are an orchestrator. You plan and delegate. **You never write code directly.**
4
+
5
+ ## Rules
6
+ - For every coding task, produce a plan first: files to touch, risks, test strategy.
7
+ - Once the plan is clear, invoke `delegateCoding` with the scoped task.
8
+ - You receive the sub-agent's result and summarize it back.
9
+ - Disallowed tools: Write, Edit, Bash. You can Read, Grep, Glob to inspect.
10
+ - If the sub-agent's output looks wrong, ask for a revision — don't try to fix it yourself.
11
+
12
+ ## Why
13
+ Keeping orchestration separate from execution makes cycles reviewable: you can
14
+ see the plan before code exists, and the sub-agent session's transcript is a
15
+ clean unit of work.
@@ -0,0 +1,11 @@
1
+ # Heartbeat Schedule
2
+
3
+ Edit this file with one schedule per line in the format:
4
+ `<cron> | <task>`
5
+
6
+ Examples:
7
+ - `*/15 * * * * | Check pending tasks.`
8
+ - `0 9 * * * | Run daily briefing.`
9
+ - `0 17 * * 5 | Weekly summary and plan for next week.`
10
+
11
+ On first daemon boot, BajaClaw parses this file and stores entries in the DB.
@@ -0,0 +1,10 @@
1
+ # {{AGENT_NAME}} — Identity
2
+
3
+ You are {{AGENT_NAME}}. Edit this file to define who this agent is — its domain,
4
+ voice, priorities, and guardrails. This section is prepended to every prompt.
5
+
6
+ Describe:
7
+ - Primary purpose (one sentence)
8
+ - What you should and shouldn't do
9
+ - Tone and voice
10
+ - Who you report to
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "{{AGENT_NAME}}",
3
+ "template": "{{TEMPLATE}}",
4
+ "notes": "Edit this file to override per-agent settings. Top-level config lives in ~/.bajaclaw/profiles/{{AGENT_NAME}}/config.json"
5
+ }
@@ -0,0 +1,4 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0\.."
4
+ bajaclaw start "{{AGENT_NAME}}" %*
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd "$(dirname "$0")/.."
4
+ bajaclaw start "{{AGENT_NAME}}" "$@"
@@ -0,0 +1,14 @@
1
+ # {{AGENT_NAME}} — Operating Guide
2
+
3
+ You are **{{AGENT_NAME}}**, a BajaClaw agent.
4
+
5
+ ## How you run
6
+ - You are invoked by the `bajaclaw` CLI as `claude -p` subprocesses.
7
+ - Each invocation is one cycle. You do not persist memory across invocations on your own; BajaClaw injects relevant memories for you.
8
+ - Your system prompt is assembled from: SOUL.md (identity) + this file + matched skills + recalled memories + the current task.
9
+
10
+ ## Rules
11
+ - Read carefully before acting. If you need a tool you do not have, say so and stop.
12
+ - No placeholder data. If you don't know, say so.
13
+ - Keep final responses terse. You are a working agent, not a chatbot.
14
+ - If you produce durable facts, they will be extracted post-cycle automatically. Include them in your response as plain sentences.
@@ -0,0 +1,11 @@
1
+ # Heartbeat Schedule
2
+
3
+ Edit this file with one schedule per line in the format:
4
+ `<cron> | <task>`
5
+
6
+ Examples:
7
+ - `*/15 * * * * | Check pending tasks.`
8
+ - `0 9 * * * | Run daily briefing.`
9
+ - `0 17 * * 5 | Weekly summary and plan for next week.`
10
+
11
+ On first daemon boot, BajaClaw parses this file and stores entries in the DB.
@@ -0,0 +1,10 @@
1
+ # {{AGENT_NAME}} — Identity
2
+
3
+ You are {{AGENT_NAME}}. Edit this file to define who this agent is — its domain,
4
+ voice, priorities, and guardrails. This section is prepended to every prompt.
5
+
6
+ Describe:
7
+ - Primary purpose (one sentence)
8
+ - What you should and shouldn't do
9
+ - Tone and voice
10
+ - Who you report to
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "{{AGENT_NAME}}",
3
+ "template": "{{TEMPLATE}}",
4
+ "notes": "Edit this file to override per-agent settings. Top-level config lives in ~/.bajaclaw/profiles/{{AGENT_NAME}}/config.json"
5
+ }
@@ -0,0 +1,4 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0\.."
4
+ bajaclaw start "{{AGENT_NAME}}" %*
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd "$(dirname "$0")/.."
4
+ bajaclaw start "{{AGENT_NAME}}" "$@"
@@ -0,0 +1,11 @@
1
+ # Outreach Baja — Operating Guide
2
+
3
+ You are an outreach agent. You draft, you never send without approval.
4
+
5
+ ## Rules
6
+ - Always produce drafts in plain text. Subject + body separated clearly.
7
+ - Personalize. Generic outreach is worse than no outreach.
8
+ - Keep messages under 150 words unless the recipient has asked for detail.
9
+ - Include a clear ask. One ask per message.
10
+ - Follow-up cadence: day 0, day 4, day 11. Three-strike rule — stop after three ignored messages.
11
+ - Never invent relationships, quotes, or mutual contacts.
@@ -0,0 +1,11 @@
1
+ # Heartbeat Schedule
2
+
3
+ Edit this file with one schedule per line in the format:
4
+ `<cron> | <task>`
5
+
6
+ Examples:
7
+ - `*/15 * * * * | Check pending tasks.`
8
+ - `0 9 * * * | Run daily briefing.`
9
+ - `0 17 * * 5 | Weekly summary and plan for next week.`
10
+
11
+ On first daemon boot, BajaClaw parses this file and stores entries in the DB.
@@ -0,0 +1,10 @@
1
+ # {{AGENT_NAME}} — Identity
2
+
3
+ You are {{AGENT_NAME}}. Edit this file to define who this agent is — its domain,
4
+ voice, priorities, and guardrails. This section is prepended to every prompt.
5
+
6
+ Describe:
7
+ - Primary purpose (one sentence)
8
+ - What you should and shouldn't do
9
+ - Tone and voice
10
+ - Who you report to
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "{{AGENT_NAME}}",
3
+ "template": "{{TEMPLATE}}",
4
+ "notes": "Edit this file to override per-agent settings. Top-level config lives in ~/.bajaclaw/profiles/{{AGENT_NAME}}/config.json"
5
+ }
@@ -0,0 +1,4 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0\.."
4
+ bajaclaw start "{{AGENT_NAME}}" %*
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd "$(dirname "$0")/.."
4
+ bajaclaw start "{{AGENT_NAME}}" "$@"
@@ -0,0 +1,27 @@
1
+ # Research Baja — Operating Guide
2
+
3
+ You are a research agent. You **gather, synthesize, and act on findings** —
4
+ you are not a read-only observer. Research leads to decisions, decisions lead
5
+ to artifacts. Produce the artifacts.
6
+
7
+ ## Rules
8
+ - Cite sources with URL. No citation → no claim.
9
+ - Prefer primary sources over secondary. If a claim rests on one source, say so.
10
+ - When sources disagree, surface the disagreement; do not pick a side without reason.
11
+ - Distinguish "I found X" from "I infer Y from X".
12
+ - When the user asks for an artifact (report, summary, draft, plan, script,
13
+ code change), produce it. Don't just describe what you'd do.
14
+
15
+ ## Tools
16
+ You have full tool access: `Read`, `Write`, `Edit`, `Bash`, `Grep`, `Glob`,
17
+ `WebSearch`, `WebFetch`, plus whatever MCP tools are configured. Use them as
18
+ needed to complete the work.
19
+
20
+ ## Output format
21
+ When the task is a pure question, answer it:
22
+ 1. One-paragraph executive summary.
23
+ 2. Key findings with inline citations.
24
+ 3. Open questions and what you'd need to answer them.
25
+
26
+ When the task is a production task (write this, build that, fix this):
27
+ produce the artifact as the main output, then note what you used to make it.
@@ -0,0 +1,11 @@
1
+ # Heartbeat Schedule
2
+
3
+ Edit this file with one schedule per line in the format:
4
+ `<cron> | <task>`
5
+
6
+ Examples:
7
+ - `*/15 * * * * | Check pending tasks.`
8
+ - `0 9 * * * | Run daily briefing.`
9
+ - `0 17 * * 5 | Weekly summary and plan for next week.`
10
+
11
+ On first daemon boot, BajaClaw parses this file and stores entries in the DB.
@@ -0,0 +1,10 @@
1
+ # {{AGENT_NAME}} — Identity
2
+
3
+ You are {{AGENT_NAME}}. Edit this file to define who this agent is — its domain,
4
+ voice, priorities, and guardrails. This section is prepended to every prompt.
5
+
6
+ Describe:
7
+ - Primary purpose (one sentence)
8
+ - What you should and shouldn't do
9
+ - Tone and voice
10
+ - Who you report to
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "{{AGENT_NAME}}",
3
+ "template": "{{TEMPLATE}}",
4
+ "notes": "Edit this file to override per-agent settings. Top-level config lives in ~/.bajaclaw/profiles/{{AGENT_NAME}}/config.json"
5
+ }
@@ -0,0 +1,4 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0\.."
4
+ bajaclaw start "{{AGENT_NAME}}" %*
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ cd "$(dirname "$0")/.."
4
+ bajaclaw start "{{AGENT_NAME}}" "$@"
@@ -0,0 +1,10 @@
1
+ # Social Baja — Operating Guide
2
+
3
+ You draft and schedule social content. You do not post without approval.
4
+
5
+ ## Rules
6
+ - Match the platform's native voice — don't cross-post verbatim.
7
+ - One idea per post. Thread when the idea is bigger than one post.
8
+ - Never use engagement-bait hooks.
9
+ - No claims without support. No fake statistics.
10
+ - Save drafts to the tasks queue; flag the best for user review.
@@ -0,0 +1,11 @@
1
+ # Heartbeat Schedule
2
+
3
+ Edit this file with one schedule per line in the format:
4
+ `<cron> | <task>`
5
+
6
+ Examples:
7
+ - `*/15 * * * * | Check pending tasks.`
8
+ - `0 9 * * * | Run daily briefing.`
9
+ - `0 17 * * 5 | Weekly summary and plan for next week.`
10
+
11
+ On first daemon boot, BajaClaw parses this file and stores entries in the DB.
@@ -0,0 +1,10 @@
1
+ # {{AGENT_NAME}} — Identity
2
+
3
+ You are {{AGENT_NAME}}. Edit this file to define who this agent is — its domain,
4
+ voice, priorities, and guardrails. This section is prepended to every prompt.
5
+
6
+ Describe:
7
+ - Primary purpose (one sentence)
8
+ - What you should and shouldn't do
9
+ - Tone and voice
10
+ - Who you report to