@jive-sh/skill-sync 0.11.0-latest-darwin-x64 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/README.md +346 -0
  2. package/bin/package.json +1 -0
  3. package/bin/skill-sync +34 -0
  4. package/bin/skill-sync-daemon +34 -0
  5. package/dist/daemons/skill-sync-daemon.js +664 -0
  6. package/dist/daemons/skill-sync-daemon.js.map +1 -0
  7. package/dist/entrypoints/skill-sync.js +7 -0
  8. package/dist/entrypoints/skill-sync.js.map +1 -0
  9. package/dist/index.js +10 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/internal/agents/agent-tool.js +102 -0
  12. package/dist/internal/agents/agent-tool.js.map +1 -0
  13. package/dist/internal/agents/claude.js +424 -0
  14. package/dist/internal/agents/claude.js.map +1 -0
  15. package/dist/internal/agents/codex.js +270 -0
  16. package/dist/internal/agents/codex.js.map +1 -0
  17. package/dist/internal/agents/command.js +219 -0
  18. package/dist/internal/agents/command.js.map +1 -0
  19. package/dist/internal/agents/grok.js +170 -0
  20. package/dist/internal/agents/grok.js.map +1 -0
  21. package/dist/internal/agents/index.js +70 -0
  22. package/dist/internal/agents/index.js.map +1 -0
  23. package/dist/internal/cli.js +218 -0
  24. package/dist/internal/cli.js.map +1 -0
  25. package/dist/internal/comment-watch/held.js +14 -0
  26. package/dist/internal/comment-watch/held.js.map +1 -0
  27. package/dist/internal/comment-watch/key.js +4 -0
  28. package/dist/internal/comment-watch/key.js.map +1 -0
  29. package/dist/internal/comment-watch/message.js +37 -0
  30. package/dist/internal/comment-watch/message.js.map +1 -0
  31. package/dist/internal/comment-watch/paths.js +16 -0
  32. package/dist/internal/comment-watch/paths.js.map +1 -0
  33. package/dist/internal/comment-watch/platform.js +66 -0
  34. package/dist/internal/comment-watch/platform.js.map +1 -0
  35. package/dist/internal/comment-watch/protocol.js +124 -0
  36. package/dist/internal/comment-watch/protocol.js.map +1 -0
  37. package/dist/internal/comment-watch/recent.js +27 -0
  38. package/dist/internal/comment-watch/recent.js.map +1 -0
  39. package/dist/internal/comment-watch/replies.js +28 -0
  40. package/dist/internal/comment-watch/replies.js.map +1 -0
  41. package/dist/internal/comment-watch/service.js +174 -0
  42. package/dist/internal/comment-watch/service.js.map +1 -0
  43. package/dist/internal/comment-watch/settings.js +66 -0
  44. package/dist/internal/comment-watch/settings.js.map +1 -0
  45. package/dist/internal/comment-watch/source/github-pull-requests/conversations.js +85 -0
  46. package/dist/internal/comment-watch/source/github-pull-requests/conversations.js.map +1 -0
  47. package/dist/internal/comment-watch/source/github-pull-requests/impl.js +276 -0
  48. package/dist/internal/comment-watch/source/github-pull-requests/impl.js.map +1 -0
  49. package/dist/internal/comment-watch/source/github-pull-requests/queries.js +97 -0
  50. package/dist/internal/comment-watch/source/github-pull-requests/queries.js.map +1 -0
  51. package/dist/internal/comment-watch/source/google-doc/doc.js +57 -0
  52. package/dist/internal/comment-watch/source/google-doc/doc.js.map +1 -0
  53. package/dist/internal/comment-watch/source/google-doc/impl.js +190 -0
  54. package/dist/internal/comment-watch/source/google-doc/impl.js.map +1 -0
  55. package/dist/internal/comment-watch/source/http-api.js +74 -0
  56. package/dist/internal/comment-watch/source/http-api.js.map +1 -0
  57. package/dist/internal/comment-watch/source/interface.js +48 -0
  58. package/dist/internal/comment-watch/source/interface.js.map +1 -0
  59. package/dist/internal/comment-watch/source/sign-in.js +40 -0
  60. package/dist/internal/comment-watch/source/sign-in.js.map +1 -0
  61. package/dist/internal/comment-watch/source/sources.js +15 -0
  62. package/dist/internal/comment-watch/source/sources.js.map +1 -0
  63. package/dist/internal/comment-watch/store/impl.js +242 -0
  64. package/dist/internal/comment-watch/store/impl.js.map +1 -0
  65. package/dist/internal/comment-watch/store/interface.js +10 -0
  66. package/dist/internal/comment-watch/store/interface.js.map +1 -0
  67. package/dist/internal/comment-watch/t3.js +49 -0
  68. package/dist/internal/comment-watch/t3.js.map +1 -0
  69. package/dist/internal/comment-watch/watching.js +65 -0
  70. package/dist/internal/comment-watch/watching.js.map +1 -0
  71. package/dist/internal/comment-watch/workflow/comment-watch.js +19 -0
  72. package/dist/internal/comment-watch/workflow/comment-watch.js.map +1 -0
  73. package/dist/internal/comment-watch/workflow/deliver.js +104 -0
  74. package/dist/internal/comment-watch/workflow/deliver.js.map +1 -0
  75. package/dist/internal/comment-watch/workflow/find.js +67 -0
  76. package/dist/internal/comment-watch/workflow/find.js.map +1 -0
  77. package/dist/internal/comment-watch/workflow/post-once.js +66 -0
  78. package/dist/internal/comment-watch/workflow/post-once.js.map +1 -0
  79. package/dist/internal/comment-watch/workflow/post.js +40 -0
  80. package/dist/internal/comment-watch/workflow/post.js.map +1 -0
  81. package/dist/internal/config.js +131 -0
  82. package/dist/internal/config.js.map +1 -0
  83. package/dist/internal/control.js +113 -0
  84. package/dist/internal/control.js.map +1 -0
  85. package/dist/internal/daemon-control/impl.js +80 -0
  86. package/dist/internal/daemon-control/impl.js.map +1 -0
  87. package/dist/internal/daemon-control/interface.js +4 -0
  88. package/dist/internal/daemon-control/interface.js.map +1 -0
  89. package/dist/internal/folders.js +47 -0
  90. package/dist/internal/folders.js.map +1 -0
  91. package/dist/internal/local-skills.js +43 -0
  92. package/dist/internal/local-skills.js.map +1 -0
  93. package/dist/internal/path.js +36 -0
  94. package/dist/internal/path.js.map +1 -0
  95. package/dist/internal/server.js +80 -0
  96. package/dist/internal/server.js.map +1 -0
  97. package/dist/internal/skill-check.js +83 -0
  98. package/dist/internal/skill-check.js.map +1 -0
  99. package/dist/internal/skill-refinement/evals/cases.js +143 -0
  100. package/dist/internal/skill-refinement/evals/cases.js.map +1 -0
  101. package/dist/internal/skill-refinement/evals/opus-action-judge-original.json +350 -0
  102. package/dist/internal/skill-refinement/evals/opus-judge-original.json +165 -0
  103. package/dist/internal/skill-refinement/feedback/import-legacy.js +13 -0
  104. package/dist/internal/skill-refinement/feedback/import-legacy.js.map +1 -0
  105. package/dist/internal/skill-refinement/feedback/intake.js +52 -0
  106. package/dist/internal/skill-refinement/feedback/intake.js.map +1 -0
  107. package/dist/internal/skill-refinement/feedback/managed-intake.js +19 -0
  108. package/dist/internal/skill-refinement/feedback/managed-intake.js.map +1 -0
  109. package/dist/internal/skill-refinement/feedback/outbox.js +44 -0
  110. package/dist/internal/skill-refinement/feedback/outbox.js.map +1 -0
  111. package/dist/internal/skill-refinement/jev/impl.js +63 -0
  112. package/dist/internal/skill-refinement/jev/impl.js.map +1 -0
  113. package/dist/internal/skill-refinement/jev/interface.js +6 -0
  114. package/dist/internal/skill-refinement/jev/interface.js.map +1 -0
  115. package/dist/internal/skill-refinement/managed-daemon.js +30 -0
  116. package/dist/internal/skill-refinement/managed-daemon.js.map +1 -0
  117. package/dist/internal/skill-refinement/managed-worker-credentials.js +60 -0
  118. package/dist/internal/skill-refinement/managed-worker-credentials.js.map +1 -0
  119. package/dist/internal/skill-refinement/managed-worker-files.js +25 -0
  120. package/dist/internal/skill-refinement/managed-worker-files.js.map +1 -0
  121. package/dist/internal/skill-refinement/managed-worker-loop.js +36 -0
  122. package/dist/internal/skill-refinement/managed-worker-loop.js.map +1 -0
  123. package/dist/internal/skill-refinement/organization-site.js +13 -0
  124. package/dist/internal/skill-refinement/organization-site.js.map +1 -0
  125. package/dist/internal/skill-refinement/paths.js +62 -0
  126. package/dist/internal/skill-refinement/paths.js.map +1 -0
  127. package/dist/internal/skill-refinement/platform.js +67 -0
  128. package/dist/internal/skill-refinement/platform.js.map +1 -0
  129. package/dist/internal/skill-refinement/service.js +365 -0
  130. package/dist/internal/skill-refinement/service.js.map +1 -0
  131. package/dist/internal/skill-refinement/skills/skill-text.js +219 -0
  132. package/dist/internal/skill-refinement/skills/skill-text.js.map +1 -0
  133. package/dist/internal/skill-refinement/workflow/retry.js +44 -0
  134. package/dist/internal/skill-refinement/workflow/retry.js.map +1 -0
  135. package/dist/internal/skill-refinement/workflow/skill-refinement.js +690 -0
  136. package/dist/internal/skill-refinement/workflow/skill-refinement.js.map +1 -0
  137. package/dist/internal/skill-refinement/writer/impl.js +2 -0
  138. package/dist/internal/skill-refinement/writer/impl.js.map +1 -0
  139. package/dist/internal/skill-refinement/writer/interface.js +2 -0
  140. package/dist/internal/skill-refinement/writer/interface.js.map +1 -0
  141. package/dist/internal/sync.js +182 -0
  142. package/dist/internal/sync.js.map +1 -0
  143. package/dist/internal/wire.js +31 -0
  144. package/dist/internal/wire.js.map +1 -0
  145. package/dist/internal/writer/claude.js +84 -0
  146. package/dist/internal/writer/claude.js.map +1 -0
  147. package/dist/internal/writer/codex.js +102 -0
  148. package/dist/internal/writer/codex.js.map +1 -0
  149. package/dist/internal/writer/interface.js +6 -0
  150. package/dist/internal/writer/interface.js.map +1 -0
  151. package/dist/internal/writer/live.js +13 -0
  152. package/dist/internal/writer/live.js.map +1 -0
  153. package/dist/internal/writer/reset.js +38 -0
  154. package/dist/internal/writer/reset.js.map +1 -0
  155. package/dist/internal/writer/selection.js +79 -0
  156. package/dist/internal/writer/selection.js.map +1 -0
  157. package/package.json +45 -11
  158. package/postinstall.cjs +663 -0
  159. package/src/daemons/skill-sync-daemon.ts +677 -0
  160. package/src/entrypoints/skill-sync.ts +12 -0
  161. package/src/index.ts +15 -0
  162. package/src/internal/agents/agent-tool.ts +149 -0
  163. package/src/internal/agents/claude.ts +442 -0
  164. package/src/internal/agents/codex.ts +288 -0
  165. package/src/internal/agents/command.ts +257 -0
  166. package/src/internal/agents/grok.ts +174 -0
  167. package/src/internal/agents/index.ts +74 -0
  168. package/src/internal/cli.ts +249 -0
  169. package/src/internal/comment-watch/held.ts +20 -0
  170. package/src/internal/comment-watch/key.ts +5 -0
  171. package/src/internal/comment-watch/message.ts +39 -0
  172. package/src/internal/comment-watch/paths.ts +17 -0
  173. package/src/internal/comment-watch/platform.ts +69 -0
  174. package/src/internal/comment-watch/protocol.ts +140 -0
  175. package/src/internal/comment-watch/recent.ts +26 -0
  176. package/src/internal/comment-watch/replies.ts +28 -0
  177. package/src/internal/comment-watch/service.ts +198 -0
  178. package/src/internal/comment-watch/settings.ts +82 -0
  179. package/src/internal/comment-watch/source/github-pull-requests/conversations.ts +111 -0
  180. package/src/internal/comment-watch/source/github-pull-requests/impl.ts +291 -0
  181. package/src/internal/comment-watch/source/github-pull-requests/queries.ts +113 -0
  182. package/src/internal/comment-watch/source/google-doc/doc.ts +76 -0
  183. package/src/internal/comment-watch/source/google-doc/impl.ts +198 -0
  184. package/src/internal/comment-watch/source/http-api.ts +93 -0
  185. package/src/internal/comment-watch/source/interface.ts +116 -0
  186. package/src/internal/comment-watch/source/sign-in.ts +45 -0
  187. package/src/internal/comment-watch/source/sources.ts +20 -0
  188. package/src/internal/comment-watch/store/impl.ts +268 -0
  189. package/src/internal/comment-watch/store/interface.ts +83 -0
  190. package/src/internal/comment-watch/t3.ts +68 -0
  191. package/src/internal/comment-watch/watching.ts +122 -0
  192. package/src/internal/comment-watch/workflow/comment-watch.ts +34 -0
  193. package/src/internal/comment-watch/workflow/deliver.ts +115 -0
  194. package/src/internal/comment-watch/workflow/find.ts +78 -0
  195. package/src/internal/comment-watch/workflow/post-once.ts +72 -0
  196. package/src/internal/comment-watch/workflow/post.ts +56 -0
  197. package/src/internal/config.ts +172 -0
  198. package/src/internal/control.ts +165 -0
  199. package/src/internal/daemon-control/impl.ts +94 -0
  200. package/src/internal/daemon-control/interface.ts +46 -0
  201. package/src/internal/folders.ts +50 -0
  202. package/src/internal/local-skills.ts +58 -0
  203. package/src/internal/path.ts +32 -0
  204. package/src/internal/server.ts +76 -0
  205. package/src/internal/skill-check.ts +97 -0
  206. package/src/internal/skill-refinement/evals/cases.ts +167 -0
  207. package/src/internal/skill-refinement/evals/opus-action-judge-original.json +350 -0
  208. package/src/internal/skill-refinement/evals/opus-judge-original.json +165 -0
  209. package/src/internal/skill-refinement/feedback/import-legacy.ts +16 -0
  210. package/src/internal/skill-refinement/feedback/intake.ts +66 -0
  211. package/src/internal/skill-refinement/feedback/managed-intake.ts +19 -0
  212. package/src/internal/skill-refinement/feedback/outbox.ts +50 -0
  213. package/src/internal/skill-refinement/jev/impl.ts +76 -0
  214. package/src/internal/skill-refinement/jev/interface.ts +56 -0
  215. package/src/internal/skill-refinement/managed-daemon.ts +38 -0
  216. package/src/internal/skill-refinement/managed-worker-credentials.ts +59 -0
  217. package/src/internal/skill-refinement/managed-worker-files.ts +24 -0
  218. package/src/internal/skill-refinement/managed-worker-loop.ts +46 -0
  219. package/src/internal/skill-refinement/organization-site.ts +15 -0
  220. package/src/internal/skill-refinement/paths.ts +87 -0
  221. package/src/internal/skill-refinement/platform.ts +71 -0
  222. package/src/internal/skill-refinement/service.ts +418 -0
  223. package/src/internal/skill-refinement/skills/skill-text.ts +292 -0
  224. package/src/internal/skill-refinement/workflow/retry.ts +61 -0
  225. package/src/internal/skill-refinement/workflow/skill-refinement.ts +777 -0
  226. package/src/internal/skill-refinement/writer/impl.ts +1 -0
  227. package/src/internal/skill-refinement/writer/interface.ts +1 -0
  228. package/src/internal/sync.ts +216 -0
  229. package/src/internal/wire.ts +439 -0
  230. package/src/internal/writer/claude.ts +98 -0
  231. package/src/internal/writer/codex.ts +93 -0
  232. package/src/internal/writer/interface.ts +48 -0
  233. package/src/internal/writer/live.ts +19 -0
  234. package/src/internal/writer/reset.ts +34 -0
  235. package/src/internal/writer/selection.ts +84 -0
  236. package/multi-call-binary +0 -4
package/README.md ADDED
@@ -0,0 +1,346 @@
1
+ # @jive-sh/skill-sync
2
+
3
+ Keeps the skills you choose identical across every Claude, Codex and Grok skills folder on every machine
4
+ you work on.
5
+
6
+ A daemon finds each agent home on the machine (Claude's `~/.claude` and every `~/.claude-<name>`, Grok's
7
+ `~/.grok` and every `~/.grok-<name>` (each a `GROK_HOME`), and Codex's `~/.agents`, counted as soon as
8
+ either `~/.agents` or `~/.codex` exists; anything named `*.lock` is
9
+ another program's lock and is ignored, as a home and as a file or folder inside a skills folder) and syncs the `skills`
10
+ folder in each through a Cloudflare Worker: file index in D1, contents in R2 addressed by hash. `skill-sync login` asks the daemon to sign in and prints a
11
+ `skill-sync.jive.sh` page, opening it in your browser when the machine has one. You approve there with your
12
+ jive.sh passkey (from any passkey manager, such as Google Password Manager), on that computer or any other,
13
+ such as your phone, so a server with no browser signs in the same way. The daemon then collects a per-machine
14
+ token from the service with a secret only it holds, never through the CLI or the page. The daemon keeps it in `~/.jive/skill-sync-token.json` and starts syncing, and it
15
+ stays signed in through restarts, reboots and upgrades until you run `skill-sync logout` or revoke the
16
+ token.
17
+
18
+ ```
19
+ skill-sync login sign this machine in with your passkey; the daemon starts syncing
20
+ skill-sync logout revoke this machine's token and stop syncing
21
+ skill-sync list list the skills that sync, as the server holds them (needs a sign-in)
22
+ skill-sync add <skill> put a skill on the synced list, as ticking it on the dashboard does
23
+ skill-sync show <skill> print a synced skill's description and where its copies are on this machine
24
+ skill-sync feedback <slug> <file> hand one feedback item to this machine's skill refinement workflow
25
+ skill-sync watching list what this machine watches for comments, and when each was last read (--json for the same as JSON)
26
+ skill-sync reply <comment> <file> post an agent's words, held in a file, once, as the answer to a comment it was told of
27
+ skill-sync upgrade upgrade with the package manager that installed it
28
+ skill-sync version print the installed version
29
+ ```
30
+
31
+ Tab completes every command. After `show` it lists the synced skills and after `add` the skills in the
32
+ detected folders that `add` would accept and that are not synced yet, both asked of the daemon when Tab is
33
+ pressed. Tab never starts the daemon: when none is running, or it does not answer within 3 seconds, Tab shows why
34
+ instead. Installing or upgrading turns Tab completion on in your shell; `skill-sync --remove-completion` turns
35
+ it off.
36
+
37
+ Everything else — which folders sync, unticking skills, renaming computers — is on the
38
+ dashboard.
39
+
40
+ ## Adding a skill from an agent
41
+
42
+ An agent that writes a new skill meant for every project runs `skill-sync add <skill>` in the same step,
43
+ so nobody has to tick it. `<skill>` is the skill's folder name. Running it again changes nothing. It is
44
+ refused, with the reason, unless:
45
+
46
+ - the skill is in a folder skill-sync detects (above). A skill in a project's own `.claude/skills`,
47
+ `.agents/skills` or `.grok/skills` is specific to that project and never syncs. That is the only sign of
48
+ a project-specific skill skill-sync can read; one written into a home folder but about one project is
49
+ not caught.
50
+ - its `SKILL.md` starts with frontmatter whose `name` is the folder name and whose `description` is not
51
+ empty.
52
+ - the name is lowercase letters and digits in hyphen-joined words, at most 64 characters.
53
+
54
+ The skill's files upload from the folders holding it that are ticked on the dashboard; if none is, the
55
+ command says so.
56
+
57
+ The daemon registers itself to start at login when the package is installed. It also keeps skill-sync up
58
+ to date: every 5 minutes it asks the package manager that installed it (bun, pnpm, yarn or npm, with that
59
+ manager's own registry settings) whether a newer version is published, installs it the same way, and
60
+ restarts on it, still signed in. `skill-sync upgrade` does the same at once.
61
+
62
+ ## The dashboard
63
+
64
+ `https://skill-sync.jive.sh/` shows, live, the latest version published on npm, and three tabs (the address keeps the
65
+ one open, `#accounts`, `#computers` or `#refinement`):
66
+
67
+ - **Accounts**: a table with one row per Claude, Codex and Grok account on the running computers.
68
+ An account its tool can name (Claude's organization, Codex's email) is one row however many computers use
69
+ it. Each limit gets a column with the share used and the time to its reset; then each computer's own use of
70
+ the account over the last 30 days, and when the limits were read. See [Account usage](#account-usage).
71
+ - **Skills & computers**: the synced skills, with the shared version of each and where it was last edited; then each
72
+ machine (renameable), whether its daemon is running and which version it runs, and its skills folders, one line
73
+ each with its checkbox, state and counts (synced, not synced, and how many synced skills differ here). Opening a
74
+ folder lists its skills and their files. A daemon older than the published version is marked "update pending"; it
75
+ upgrades itself within 5 minutes.
76
+ - **Skill refinement**: each machine's skill refinement workflow (below), drawn by
77
+ [`@jive-sh/workflow-platform`](https://www.npmjs.com/package/@jive-sh/workflow-platform)'s own dashboard: its queue,
78
+ where each run is and every step's tokens, spend and time over the last day, with − / + for its run and agent limits,
79
+ which go to that machine's daemon. An offline machine shows what it last reported; one that runs no workflow says why;
80
+ one whose last report came from skill-sync before 0.8.0, on the platform's older report shape, says to upgrade it.
81
+
82
+ Every file shows the first 8 characters of its SHA-256, amber when a folder's copy differs from the synced
83
+ one. The page reloads itself when a new version of the service is deployed.
84
+
85
+ The server holds one list of skills to sync. Every enabled folder on every machine pushes and pulls
86
+ exactly the skills on that list, and never touches any other skill. A skill's checkbox adds it to the
87
+ list or removes it, for every machine at once. A folder's checkbox turns syncing on or off for that
88
+ folder; a folder seen for the first time starts off, so nothing is written into a folder until you tick it. Both are stored on the server, so they apply at once
89
+ and survive a reinstall.
90
+
91
+ A folder that lacks a listed skill gets a copy. Deleting a listed skill in any folder deletes it in every
92
+ folder and takes it off the list; unticking it instead stops syncing and leaves every copy where it is.
93
+
94
+ ## The latest edit wins
95
+
96
+ Every file carries the time it was last edited: on a machine, its modification time; on the server, the
97
+ edit time of the version it holds. Whenever two copies of a file differ, the one edited later replaces
98
+ the other, on the server and in every folder. Nothing is merged and nothing is set aside. A deletion
99
+ counts as an edit made when the daemon noticed it.
100
+
101
+ Edit times come from each machine's clock, so a machine whose clock is far off can win or lose against
102
+ edits it should not.
103
+
104
+ ## Account usage
105
+
106
+ An account is a folder in your home directory: `~/.claude` and each `~/.claude-<name>` for Claude (each a
107
+ `CLAUDE_CONFIG_DIR`), `~/.codex` and each `~/.codex-<name>` for Codex (each a `CODEX_HOME`), `~/.grok` and each
108
+ `~/.grok-<name>` for Grok (each a `GROK_HOME`). The daemon reads two things about each, and sends them to the
109
+ dashboard when they change.
110
+
111
+ **The account's limits**, which its provider counts across every computer. The daemon asks the tool's own CLI,
112
+ at most every five minutes per account. The CLI is signed in to the account and makes the call; skill-sync
113
+ reads no credential file, and only the numbers and the account's email leave the machine.
114
+
115
+ - **Claude**: `claude auth status` (who is signed in) and `claude -p /usage --no-session-persistence` (the
116
+ session, weekly and per-model weekly limits). Neither starts a model turn, and the second saves no session.
117
+ Usage credits spent beyond the plan are not in `/usage`'s output, so they show only when the CLI could not be
118
+ asked (below).
119
+ - **Codex**: `codex app-server`, the JSON-RPC interface Codex's editors and desktop app use: `account/read` and
120
+ `account/rateLimits/read`.
121
+ - **Grok**: `grok agent stdio`, asked `_x.ai/billing`, the request Grok's own `/usage` screen makes. Grok has no
122
+ command that says who is signed in, so its accounts show as unidentified.
123
+
124
+ The daemon runs with the service manager's PATH, not your shell's, so it looks for `claude` and `codex` on PATH,
125
+ then in the folders installers put them in (`~/.local/bin`, `~/.bun/bin`, npm's and nvm's global folders,
126
+ Homebrew's), then, for Codex, inside the ChatGPT and Codex desktop apps and Codex's editor extension (VS Code,
127
+ Cursor or Windsurf, locally or on a machine they reach over SSH), which each ship one. When a CLI is not found
128
+ or fails, the limits are what the tool last recorded on this machine, and the dashboard's hover on their age
129
+ says so and why: for Claude, the plan usage it keeps in the account's `.claude.json`; for Codex, the limits it
130
+ recorded with its latest turn in its session files. Those are as old as the tool's last use of the account. An
131
+ account using Amazon Bedrock or an API key has no plan limits.
132
+
133
+ **This machine's use** of the account over the last 30 days, from the files the tool writes:
134
+
135
+ - **Claude**: Claude Code's own estimate of each session's cost at list price, which it saves in the session's
136
+ file under `projects/` when the session ends, is cleared, resumed or forked, summed over sessions active in
137
+ the period (Claude Code deletes older session files by default). A running session counts as of its last
138
+ save, and your provider's bill can differ from list price. The row says Bedrock when the account's
139
+ `settings.json` sets `CLAUDE_CODE_USE_BEDROCK` or `CLAUDE_CODE_USE_MANTLE` in its `env`, or its sessions used
140
+ Bedrock model IDs.
141
+ - **Codex**: the tokens its sessions active in the period used, cached input included, from the running total
142
+ Codex records in its session files.
143
+ - **Grok**: what `grok usage <session-id>` reports, summed over sessions active in the period. A session's
144
+ totals include history it inherited by resume or fork, so a fork counts that part twice.
145
+
146
+ The daemon sends each session's figure with the session's id, and the dashboard counts every session once. A
147
+ session found on several computers, because its files were copied or synced between them, counts on the computer
148
+ where it was last active, so a session resumed elsewhere moves there with its whole cost. When the computers agree
149
+ on that time, as they do for copied files, it counts on the computer that reported it first, which is where it ran.
150
+
151
+ A limit whose reset time has passed since the reading shows no number, since the new window's use is not known
152
+ yet. None of these outputs is a published format: when a tool changes one, the row says "unknown" and why,
153
+ rather than showing a wrong number. Daemons before 0.7.0 send usage in a shape the dashboard no longer takes,
154
+ so their accounts are not shown until they upgrade themselves.
155
+
156
+ ## Skill refinement
157
+
158
+ The daemon runs the `autonomous-skill-refinement` skill's workflow: each feedback item an agent hands over becomes a
159
+ tested change to the synced skills, installed into this machine's skills folder, which then syncs everywhere. The
160
+ skill's `SKILL.md` holds the rules each step follows; the workflow itself is in `src/internal/skill-refinement/`.
161
+
162
+ - **Handing feedback over:** `skill-sync feedback <slug> <file>`, a few words naming the item and a file holding his
163
+ exact words and what drew them. The daemon adds it to the workflow's intake and the next run takes it.
164
+ - **Where it works from:** the copy of the skill in an agent account folder (`~/.claude-alex/skills/…`): the one in
165
+ `SKILL_REFINEMENT_CLAUDE_CONFIG_DIR` when that is set, else the one whose `.local/` already holds the workflow's
166
+ database, else the first Claude account's. Its `.local/` holds the queue, run files and databases; skill-sync never
167
+ syncs a name starting with a dot, so they stay on the machine. The intakes of every copy on the machine are read.
168
+ - **Models:** Jev, with the key in `TYPESAFE_API_KEY` or the skill folder's `typesafe-api-key` file, classifies and
169
+ judges; Opus drafts and writes the A/B replies through the `claude` CLI, found as for account usage, on the account
170
+ that holds the copy.
171
+ - **Taking over from another runner:** while another live process runs the workflow on the same data (the
172
+ `skill-refinement.service` a machine had before, or a copy started by hand), the daemon waits and checks every
173
+ minute, so stopping that process hands the work over. It reads that from the engine's own runner records.
174
+ - **Managed worker:** the daemon asks the sibling Jive daemon for short-lived grants for the configured `jive-sh`
175
+ deployment. Before cutover, a machine without a grant keeps feedback in its local intake. The worker bundles the
176
+ managed workflow with its own runtime, so the local picker uses workflow-platform 0.7 and its existing SQLite files. A confirmed
177
+ managed installation of feedback acknowledged to this machine allows it to drain active local runs and copy the
178
+ pending intake into the managed outbox in one transaction. The original intake files and SQLite history stay on
179
+ the machine.
180
+ - **The platform's own workflow beside it:** the daemon also runs workflow-platform's Retention every hour, first 5
181
+ minutes after it starts. It deletes a finished run's step records once they are 7 days old and none of their step's
182
+ newest 10,000 runs, so a machine's refinement history is kept whole until it passes 10,000 runs.
183
+ - **When a failed item runs again:** an item whose run ends without an install waits until something it runs on
184
+ changes (its text, a skill, Draft or the judge). A failure of a service outside it changes none of those, so it carries
185
+ a retry time instead: a Claude usage limit at the reset its message states (an hour on when it states none), any other
186
+ failure of Jev or the generative model an hour on. The daemon checks every minute and runs the item again once that
187
+ time passes, once per failure (`src/internal/skill-refinement/workflow/retry.ts`). A run Claude or Jev could not do at
188
+ all (a usage or rate limit, an overload, Jev unreachable, a 408, 429 or 5xx from it, or the model unknown to it) fails
189
+ with the workflow platform's `OutsideServiceUnavailable`, so it is no try toward the platform's block after 10 failed
190
+ tries; any other failure of either is one.
191
+ - **Edits made while a run works:** a run takes minutes, and the skill it changes can be edited meanwhile, by hand or
192
+ by another machine's install pulled here. Install applies the winner's exact replacements to the skill's text as it
193
+ is then, so every edit outside the lines the winner replaces is kept, and runs the rule-deletion check again on that
194
+ text. It first waits up to two minutes for this copy to pull an edit the server lists but this copy lacks, and writes
195
+ only if the text is still the one it built on; an edit landing during the write, or another machine's later edit
196
+ replacing it afterwards, makes it install again on the new text, up to three times. When an edit has changed the
197
+ lines the winner replaces, nothing is installed, and the item's next run drafts on the new text. Still open:
198
+ skill-sync keeps the later of two edits to a file, so a `history.md` entry two machines append within one sync cycle
199
+ loses one of them, and two machines can pick the same A/B case number.
200
+ - A machine with no copy of the skill, or no `claude` CLI, runs no workflow; the dashboard says which.
201
+
202
+ ## Comment watch
203
+
204
+ Leave a comment on a pull request or in a Google Doc, and an agent answers it there. On a machine whose settings name
205
+ somewhere to watch, the daemon finds each new comment of yours, shows 👀 on it, hands it once to the T3 thread that answers
206
+ it, and posts the thread's answer once. A machine whose settings name nothing runs none of this and makes no files for it.
207
+
208
+ **Talking to it.** You and the agents post from one account, so what a post says is how they are told apart: every agent's
209
+ post starts with `🤖:`, and a post that does is never taken for yours. A Doc reply that is exactly "..." is an agent's too:
210
+ another automation on your account posts it to say it saw a comment, so it is never an order, and the daemon never deletes it.
211
+
212
+ - **On a pull request,** a comment, review or line comment of yours that tags `@clanker` is for the agent. Any capitals and any
213
+ place in your words count. Not in a longer name (`@clankers`, `x@clanker.io`), a quoted line, or code.
214
+ - **In a Doc,** every comment and reply of yours on a watched subtab is, with or without the tag. Text typed in the Doc
215
+ itself is not read.
216
+ - **A change waits for you.** The agent replies with its plan, starting `🤖: **Plan**`, and stops. On a pull request, 👍 the
217
+ plan to approve it, or 👎 it to stop it until your next comment. In a Doc, reply "yes" to approve it. The daemon then
218
+ posts "🤖: Plan is approved, working on it...", which the agent edits into "🤖: Done in" and a link when it is done.
219
+ - **👀** shows as soon as a comment is found, and goes once the agent's reply to that comment is posted: a reaction on a pull
220
+ request, and the reply "🤖: 👀" in a Doc. A reply to a later comment takes none off an earlier one. One that never goes
221
+ says no answer came.
222
+
223
+ **Setting it up.** Add `commentWatch` to `~/.jive/skill-sync.json`, beside what is there. The daemon reads it when it starts,
224
+ so restart the daemon after an edit, then check it with `skill-sync watching` (below):
225
+
226
+ ```json
227
+ {
228
+ "commentWatch": {
229
+ "tag": "clanker",
230
+ "sources": [
231
+ {
232
+ "kind": "google-doc",
233
+ "document": "<the Doc's id>",
234
+ "tabs": [{ "tab": "<a tab's id>", "project": "<a T3 project's id>" }],
235
+ "tokenCommand": ["<a program>", "<its arguments>"]
236
+ },
237
+ {
238
+ "kind": "github-pull-requests",
239
+ "repositories": ["<owner>/<name>"],
240
+ "authors": ["<a login>"]
241
+ }
242
+ ]
243
+ }
244
+ }
245
+ ```
246
+
247
+ - **`tag`** (optional, `clanker`) is the name that tags the agent on a pull request, without its @.
248
+ - **`document`** and **`tabs`**: open the tab you want watched and copy both from its address,
249
+ `https://docs.google.com/document/d/<document>/edit?tab=<tab>`. A subtab is named itself, and watching a tab doesn't watch
250
+ the subtabs under it. Renaming or moving a tab changes nothing here. `project` is the T3 project whose command thread
251
+ answers what is left there.
252
+ - **`tokenCommand`** prints a Google access token for the account the machine reads and posts as. It is run without a shell,
253
+ when a token is needed and again when Google refuses the one it gave. `quotaProject` (optional) is the Google Cloud project
254
+ the Docs API counts the reads against.
255
+ - **`repositories`** and **`authors`**: the open pull requests these people wrote there. GitHub is read and answered as `gh` is
256
+ signed in (`gh auth token`).
257
+
258
+ Then say where T3 is told, in `~/.jive/comment-watch-t3.json`. Anyone who has one of these addresses can wake its thread, so
259
+ make the file readable by you alone:
260
+
261
+ ```json
262
+ { "router": "<a T3 webhook>", "projects": { "<a T3 project's id>": "<a T3 webhook>" } }
263
+ ```
264
+
265
+ A T3 webhook wakes one thread. A project's own, under `projects` (optional), is its command thread's. Everything else goes
266
+ to `router`, the thread that passes a delivery on: to the pull request's thread, starting one where there is none, or to
267
+ the project's command thread. Set the task's replay key to `{{body.deliveryId}}`, which drops a delivery sent again. The body:
268
+
269
+ | Field | Holds |
270
+ | --- | --- |
271
+ | `kind` | `thread-prompt` |
272
+ | `deliveryId` | the delivery's id, the same each time it is sent |
273
+ | `message` | what to give the answering thread, whole |
274
+ | `prUrl` | the pull request's link, or empty |
275
+ | `projectId` | the T3 project's id, or empty |
276
+ | `agent` | what to start a new thread on, `claude` or `codex`: the first that can work on this machine now, or empty |
277
+
278
+ A key the daemon doesn't know, a place named twice, a file it can't read or no T3 webhook leaves nothing watched, and
279
+ `skill-sync watching` says why.
280
+
281
+ **Checking it.** `skill-sync watching` asks the running daemon what it is really watching, whatever the file says now:
282
+
283
+ ```
284
+ <the Doc's title> read <when> <link>
285
+ <tab> › <subtab> read <when> <link>
286
+ <tab> › <subtab> failing since <when>: the Doc has no such subtab; last read <when> <link>
287
+ <owner>/<name> read <when> <link>
288
+ <author> read <when> <link>
289
+ <an open pull request's title> #<number> read <when> <link>
290
+ <author> (no open pull requests) read <when> <link>
291
+ <author> failing since <when>: GitHub has no such account; never read <link>
292
+ ```
293
+
294
+ Every name is the one Google or GitHub gave at the last good read, and every line says when that was and, while its reads
295
+ fail, since when and why. Everything the settings name is a line, also what matches nothing. With no daemon running it says
296
+ so and exits 1; it starts none. `--json` gives the same, times in ISO 8601.
297
+
298
+ **Answering, for an agent.** A delivery holds each comment, its link and the command that answers it,
299
+ `skill-sync reply <comment> <file>`. The file holds only the words: the command adds `🤖:`, links what they answer where
300
+ GitHub doesn't thread replies, and takes the tag out, so nothing the watch posts holds it. Run again with the same words, it
301
+ posts nothing more. It refuses, with why, a plan in the same reply as an answer, any words for a rejected plan or for a
302
+ conversation whose newest word from you is a 👎, and words too long to post: a Doc's posts hold 2,048 bytes, which is
303
+ Google's limit. For an approved plan it edits the acknowledgement. Sent while the daemon starts, it waits for the watch.
304
+
305
+ **What it makes sure of:**
306
+
307
+ - **Each comment once.** Every source is read every 30 seconds and as the daemon starts. What was there when a subtab, or an
308
+ author in a repository, was first watched is not new. A read that fails (no answer, a limit reached, an expired sign-in)
309
+ moves nothing and holds up no other source; the next read starts where the last good one ended. An edit to a Doc comment
310
+ is not a new one, and a comment on a whole Doc is on no subtab, so it is only counted in the step's record. A pull request
311
+ that closes is read one last time.
312
+ - **Each delivery once.** A delivery is recorded before T3 is told, and sent again under the same id until T3 takes it. An
313
+ approved plan is delivered once its acknowledgement is posted; one whose acknowledgement the place refused is not
314
+ delivered at all. A 👍 taken back and given again is the same approval, so it is acknowledged and delivered once.
315
+ - **Each reply once.** Before it posts, it records that it is about to, and the posts with the same words already there. After
316
+ a post whose answer it never got, or a daemon stopped there, it waits a minute, reads the conversation and takes a post
317
+ with those words that wasn't there before for its own. One the service can't take now is tried again; one it won't take is
318
+ refused, with why.
319
+ - **Never itself.** A post starting with `🤖:` is an agent's, whichever account it is from, and so is a reply that is exactly
320
+ "..." and one this machine posted whose `🤖:` someone has since edited away.
321
+ - **👀 is worked out again at each read,** with nothing stored, so a restart never shows it twice or leaves it behind. One that
322
+ can't be shown is tried again and holds up nothing.
323
+ - **A cheap read.** One GraphQL query covers every repository and author: which pull requests changed, and the reactions on
324
+ open plans. A pull request's comments are read only when it changed.
325
+ - **Where it keeps things:** `~/.jive/comment-watch/`, apart from skill refinement's: a database of what was found, told and
326
+ posted, the workflow engine's own, and, until each is told or posted, its words.
327
+
328
+ The workflow is `src/internal/comment-watch/`, on the workflow platform: **Comment watch**, made of **Find comments**, **Deliver
329
+ comments** and **Post reply**. A kind of place is one implementation of `ICommentSource` (`source/interface.ts`).
330
+
331
+ ## Configuration
332
+
333
+ `~/.jive/skill-sync.json` holds the endpoint and the machine name, written on first run, and what the machine watches (above)
334
+ where you add it.
335
+ `~/.jive/skill-sync-token.json` holds this machine's token while it is signed in. It is an ordinary file,
336
+ so anything that can read your home directory can copy the token; signing out, or the server rejecting the
337
+ token, deletes it.
338
+
339
+ Each token is issued to one machine, and the server records everything sent with it (folders, edits, account
340
+ readings) as that machine's. A token copied onto another computer, as when you copy your home folder to a new
341
+ one, is refused there: the server answers that the token belongs to the machine it was issued to, and that
342
+ computer's daemon stops syncing and reporting, logs which machine the token belongs to, and answers `list`,
343
+ `add` and `logout` with the same explanation. Run `skill-sync login` on it to sign it in as itself. Do not run
344
+ `skill-sync logout` there: it would revoke the other machine's token. The daemon refuses to, and so does the
345
+ server. The CLI reaches the daemon over `~/.jive/skill-sync.sock` (a named pipe on Windows),
346
+ which only your user can open.
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
package/bin/skill-sync ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Every command's file in a built package's bin/, the same for every command: it is the command its own file name says.
5
+ *
6
+ * On macOS and Linux it runs once. It has the package's postinstall.cjs replace it (and every other command's file)
7
+ * with a hard link to the real program, which the package manager skips when it does not run postinstall (Bun, for a
8
+ * package it does not trust), then runs the program with what was typed. On Windows a command starts through its .cmd
9
+ * shim, which always runs this file, so it runs the program every time and sets up again only when the commands are
10
+ * stale.
11
+ *
12
+ * CommonJS for the reason postinstall.cjs gives: bin/package.json makes this extensionless file CommonJS.
13
+ */
14
+ const { spawnSync } = require("child_process");
15
+ const { realpathSync } = require("fs");
16
+ const { basename, dirname, join } = require("path");
17
+
18
+ // The real path: reached through a link in a bin directory, the package is wherever the link points.
19
+ const launcherPath = realpathSync(__filename);
20
+ const packageDir = dirname(dirname(launcherPath));
21
+ const postinstall = require(join(packageDir, "postinstall.cjs"));
22
+
23
+ if (process.platform !== "win32" || !postinstall.commandsAreCurrent({ packageDir })) {
24
+ // A shell's, a launcher's or the user's own call to the completion code is left to do its job alone.
25
+ const setUpCompletion = !postinstall.COMPLETION_FLAGS.includes(process.argv[2]);
26
+ postinstall.setUp({ packageDir, repairOnly: false, setUpCompletion });
27
+ }
28
+
29
+ const result = spawnSync(postinstall.commandTarget({ packageDir, command: basename(launcherPath) }), process.argv.slice(2), { stdio: "inherit" });
30
+ if (result.error) {
31
+ console.error(result.error.message);
32
+ process.exit(1);
33
+ }
34
+ process.exit(result.status === null ? 1 : result.status);
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Every command's file in a built package's bin/, the same for every command: it is the command its own file name says.
5
+ *
6
+ * On macOS and Linux it runs once. It has the package's postinstall.cjs replace it (and every other command's file)
7
+ * with a hard link to the real program, which the package manager skips when it does not run postinstall (Bun, for a
8
+ * package it does not trust), then runs the program with what was typed. On Windows a command starts through its .cmd
9
+ * shim, which always runs this file, so it runs the program every time and sets up again only when the commands are
10
+ * stale.
11
+ *
12
+ * CommonJS for the reason postinstall.cjs gives: bin/package.json makes this extensionless file CommonJS.
13
+ */
14
+ const { spawnSync } = require("child_process");
15
+ const { realpathSync } = require("fs");
16
+ const { basename, dirname, join } = require("path");
17
+
18
+ // The real path: reached through a link in a bin directory, the package is wherever the link points.
19
+ const launcherPath = realpathSync(__filename);
20
+ const packageDir = dirname(dirname(launcherPath));
21
+ const postinstall = require(join(packageDir, "postinstall.cjs"));
22
+
23
+ if (process.platform !== "win32" || !postinstall.commandsAreCurrent({ packageDir })) {
24
+ // A shell's, a launcher's or the user's own call to the completion code is left to do its job alone.
25
+ const setUpCompletion = !postinstall.COMPLETION_FLAGS.includes(process.argv[2]);
26
+ postinstall.setUp({ packageDir, repairOnly: false, setUpCompletion });
27
+ }
28
+
29
+ const result = spawnSync(postinstall.commandTarget({ packageDir, command: basename(launcherPath) }), process.argv.slice(2), { stdio: "inherit" });
30
+ if (result.error) {
31
+ console.error(result.error.message);
32
+ process.exit(1);
33
+ }
34
+ process.exit(result.status === null ? 1 : result.status);