@tickernelz/paperclip-pro-adapter-codex-local 2026.925.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 (268) hide show
  1. package/LICENSE +22 -0
  2. package/dist/cli/format-event.d.ts +2 -0
  3. package/dist/cli/format-event.d.ts.map +1 -0
  4. package/dist/cli/format-event.js +218 -0
  5. package/dist/cli/format-event.js.map +1 -0
  6. package/dist/cli/index.d.ts +2 -0
  7. package/dist/cli/index.d.ts.map +1 -0
  8. package/dist/cli/index.js +2 -0
  9. package/dist/cli/index.js.map +1 -0
  10. package/dist/cli/quota-probe.d.ts +3 -0
  11. package/dist/cli/quota-probe.d.ts.map +1 -0
  12. package/dist/cli/quota-probe.js +104 -0
  13. package/dist/cli/quota-probe.js.map +1 -0
  14. package/dist/index.d.ts +21 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +155 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/index.test.d.ts +2 -0
  19. package/dist/index.test.d.ts.map +1 -0
  20. package/dist/index.test.js +58 -0
  21. package/dist/index.test.js.map +1 -0
  22. package/dist/server/acp.d.ts +30 -0
  23. package/dist/server/acp.d.ts.map +1 -0
  24. package/dist/server/acp.js +532 -0
  25. package/dist/server/acp.js.map +1 -0
  26. package/dist/server/acp.test.d.ts +2 -0
  27. package/dist/server/acp.test.d.ts.map +1 -0
  28. package/dist/server/acp.test.js +1087 -0
  29. package/dist/server/acp.test.js.map +1 -0
  30. package/dist/server/adapter-auth-promotion.d.ts +102 -0
  31. package/dist/server/adapter-auth-promotion.d.ts.map +1 -0
  32. package/dist/server/adapter-auth-promotion.js +210 -0
  33. package/dist/server/adapter-auth-promotion.js.map +1 -0
  34. package/dist/server/adapter-auth-promotion.test.d.ts +2 -0
  35. package/dist/server/adapter-auth-promotion.test.d.ts.map +1 -0
  36. package/dist/server/adapter-auth-promotion.test.js +658 -0
  37. package/dist/server/adapter-auth-promotion.test.js.map +1 -0
  38. package/dist/server/auth-check.d.ts +8 -0
  39. package/dist/server/auth-check.d.ts.map +1 -0
  40. package/dist/server/auth-check.js +8 -0
  41. package/dist/server/auth-check.js.map +1 -0
  42. package/dist/server/auth-precedence.d.ts +16 -0
  43. package/dist/server/auth-precedence.d.ts.map +1 -0
  44. package/dist/server/auth-precedence.js +20 -0
  45. package/dist/server/auth-precedence.js.map +1 -0
  46. package/dist/server/auth-precedence.test.d.ts +2 -0
  47. package/dist/server/auth-precedence.test.d.ts.map +1 -0
  48. package/dist/server/auth-precedence.test.js +100 -0
  49. package/dist/server/auth-precedence.test.js.map +1 -0
  50. package/dist/server/codex-args.d.ts +13 -0
  51. package/dist/server/codex-args.d.ts.map +1 -0
  52. package/dist/server/codex-args.js +76 -0
  53. package/dist/server/codex-args.js.map +1 -0
  54. package/dist/server/codex-args.test.d.ts +2 -0
  55. package/dist/server/codex-args.test.d.ts.map +1 -0
  56. package/dist/server/codex-args.test.js +243 -0
  57. package/dist/server/codex-args.test.js.map +1 -0
  58. package/dist/server/codex-auth-cache.d.ts +206 -0
  59. package/dist/server/codex-auth-cache.d.ts.map +1 -0
  60. package/dist/server/codex-auth-cache.js +501 -0
  61. package/dist/server/codex-auth-cache.js.map +1 -0
  62. package/dist/server/codex-auth-cache.test.d.ts +2 -0
  63. package/dist/server/codex-auth-cache.test.d.ts.map +1 -0
  64. package/dist/server/codex-auth-cache.test.js +497 -0
  65. package/dist/server/codex-auth-cache.test.js.map +1 -0
  66. package/dist/server/codex-auth-copyback.d.ts +53 -0
  67. package/dist/server/codex-auth-copyback.d.ts.map +1 -0
  68. package/dist/server/codex-auth-copyback.js +123 -0
  69. package/dist/server/codex-auth-copyback.js.map +1 -0
  70. package/dist/server/codex-auth-copyback.test.d.ts +2 -0
  71. package/dist/server/codex-auth-copyback.test.d.ts.map +1 -0
  72. package/dist/server/codex-auth-copyback.test.js +507 -0
  73. package/dist/server/codex-auth-copyback.test.js.map +1 -0
  74. package/dist/server/codex-auth-merge-decision.cjs +170 -0
  75. package/dist/server/codex-auth-merge-decision.d.ts +22 -0
  76. package/dist/server/codex-auth-merge-decision.d.ts.map +1 -0
  77. package/dist/server/codex-auth-merge-decision.js +58 -0
  78. package/dist/server/codex-auth-merge-decision.js.map +1 -0
  79. package/dist/server/codex-auth-merge-decision.test.d.ts +2 -0
  80. package/dist/server/codex-auth-merge-decision.test.d.ts.map +1 -0
  81. package/dist/server/codex-auth-merge-decision.test.js +230 -0
  82. package/dist/server/codex-auth-merge-decision.test.js.map +1 -0
  83. package/dist/server/codex-auth-merge-extract.sh +73 -0
  84. package/dist/server/codex-auth-merge-scripts.d.ts +21 -0
  85. package/dist/server/codex-auth-merge-scripts.d.ts.map +1 -0
  86. package/dist/server/codex-auth-merge-scripts.js +40 -0
  87. package/dist/server/codex-auth-merge-scripts.js.map +1 -0
  88. package/dist/server/codex-auth-merge.test.d.ts +2 -0
  89. package/dist/server/codex-auth-merge.test.d.ts.map +1 -0
  90. package/dist/server/codex-auth-merge.test.js +714 -0
  91. package/dist/server/codex-auth-merge.test.js.map +1 -0
  92. package/dist/server/codex-auth-seed-write.d.ts +30 -0
  93. package/dist/server/codex-auth-seed-write.d.ts.map +1 -0
  94. package/dist/server/codex-auth-seed-write.js +41 -0
  95. package/dist/server/codex-auth-seed-write.js.map +1 -0
  96. package/dist/server/codex-home.d.ts +162 -0
  97. package/dist/server/codex-home.d.ts.map +1 -0
  98. package/dist/server/codex-home.js +771 -0
  99. package/dist/server/codex-home.js.map +1 -0
  100. package/dist/server/codex-home.test.d.ts +2 -0
  101. package/dist/server/codex-home.test.d.ts.map +1 -0
  102. package/dist/server/codex-home.test.js +1183 -0
  103. package/dist/server/codex-home.test.js.map +1 -0
  104. package/dist/server/config-schema.d.ts +3 -0
  105. package/dist/server/config-schema.d.ts.map +1 -0
  106. package/dist/server/config-schema.js +67 -0
  107. package/dist/server/config-schema.js.map +1 -0
  108. package/dist/server/device-login-export.d.ts +56 -0
  109. package/dist/server/device-login-export.d.ts.map +1 -0
  110. package/dist/server/device-login-export.js +230 -0
  111. package/dist/server/device-login-export.js.map +1 -0
  112. package/dist/server/device-login-export.test.d.ts +2 -0
  113. package/dist/server/device-login-export.test.d.ts.map +1 -0
  114. package/dist/server/device-login-export.test.js +245 -0
  115. package/dist/server/device-login-export.test.js.map +1 -0
  116. package/dist/server/device-login-parse.d.ts +20 -0
  117. package/dist/server/device-login-parse.d.ts.map +1 -0
  118. package/dist/server/device-login-parse.js +155 -0
  119. package/dist/server/device-login-parse.js.map +1 -0
  120. package/dist/server/device-login-parse.test.d.ts +2 -0
  121. package/dist/server/device-login-parse.test.d.ts.map +1 -0
  122. package/dist/server/device-login-parse.test.js +269 -0
  123. package/dist/server/device-login-parse.test.js.map +1 -0
  124. package/dist/server/device-login-runner.d.ts +69 -0
  125. package/dist/server/device-login-runner.d.ts.map +1 -0
  126. package/dist/server/device-login-runner.js +109 -0
  127. package/dist/server/device-login-runner.js.map +1 -0
  128. package/dist/server/device-login-runner.test.d.ts +2 -0
  129. package/dist/server/device-login-runner.test.d.ts.map +1 -0
  130. package/dist/server/device-login-runner.test.js +201 -0
  131. package/dist/server/device-login-runner.test.js.map +1 -0
  132. package/dist/server/engine-availability.test.d.ts +2 -0
  133. package/dist/server/engine-availability.test.d.ts.map +1 -0
  134. package/dist/server/engine-availability.test.js +41 -0
  135. package/dist/server/engine-availability.test.js.map +1 -0
  136. package/dist/server/execute.acp-fallback.test.d.ts +2 -0
  137. package/dist/server/execute.acp-fallback.test.d.ts.map +1 -0
  138. package/dist/server/execute.acp-fallback.test.js +123 -0
  139. package/dist/server/execute.acp-fallback.test.js.map +1 -0
  140. package/dist/server/execute.auth-precedence.test.d.ts +2 -0
  141. package/dist/server/execute.auth-precedence.test.d.ts.map +1 -0
  142. package/dist/server/execute.auth-precedence.test.js +137 -0
  143. package/dist/server/execute.auth-precedence.test.js.map +1 -0
  144. package/dist/server/execute.auth.test.d.ts +2 -0
  145. package/dist/server/execute.auth.test.d.ts.map +1 -0
  146. package/dist/server/execute.auth.test.js +197 -0
  147. package/dist/server/execute.auth.test.js.map +1 -0
  148. package/dist/server/execute.d.ts +40 -0
  149. package/dist/server/execute.d.ts.map +1 -0
  150. package/dist/server/execute.js +1290 -0
  151. package/dist/server/execute.js.map +1 -0
  152. package/dist/server/execute.remote.test.d.ts +2 -0
  153. package/dist/server/execute.remote.test.d.ts.map +1 -0
  154. package/dist/server/execute.remote.test.js +556 -0
  155. package/dist/server/execute.remote.test.js.map +1 -0
  156. package/dist/server/execute.stderr-error.test.d.ts +2 -0
  157. package/dist/server/execute.stderr-error.test.d.ts.map +1 -0
  158. package/dist/server/execute.stderr-error.test.js +142 -0
  159. package/dist/server/execute.stderr-error.test.js.map +1 -0
  160. package/dist/server/execute.test.d.ts +2 -0
  161. package/dist/server/execute.test.d.ts.map +1 -0
  162. package/dist/server/execute.test.js +240 -0
  163. package/dist/server/execute.test.js.map +1 -0
  164. package/dist/server/index.d.ts +18 -0
  165. package/dist/server/index.d.ts.map +1 -0
  166. package/dist/server/index.js +71 -0
  167. package/dist/server/index.js.map +1 -0
  168. package/dist/server/output-inactivity-monitor.d.ts +62 -0
  169. package/dist/server/output-inactivity-monitor.d.ts.map +1 -0
  170. package/dist/server/output-inactivity-monitor.integration.test.d.ts +2 -0
  171. package/dist/server/output-inactivity-monitor.integration.test.d.ts.map +1 -0
  172. package/dist/server/output-inactivity-monitor.integration.test.js +136 -0
  173. package/dist/server/output-inactivity-monitor.integration.test.js.map +1 -0
  174. package/dist/server/output-inactivity-monitor.js +112 -0
  175. package/dist/server/output-inactivity-monitor.js.map +1 -0
  176. package/dist/server/output-inactivity-monitor.test.d.ts +2 -0
  177. package/dist/server/output-inactivity-monitor.test.d.ts.map +1 -0
  178. package/dist/server/output-inactivity-monitor.test.js +284 -0
  179. package/dist/server/output-inactivity-monitor.test.js.map +1 -0
  180. package/dist/server/parse.d.ts +51 -0
  181. package/dist/server/parse.d.ts.map +1 -0
  182. package/dist/server/parse.js +261 -0
  183. package/dist/server/parse.js.map +1 -0
  184. package/dist/server/parse.test.d.ts +2 -0
  185. package/dist/server/parse.test.d.ts.map +1 -0
  186. package/dist/server/parse.test.js +186 -0
  187. package/dist/server/parse.test.js.map +1 -0
  188. package/dist/server/process-activity-monitor.d.ts +21 -0
  189. package/dist/server/process-activity-monitor.d.ts.map +1 -0
  190. package/dist/server/process-activity-monitor.js +103 -0
  191. package/dist/server/process-activity-monitor.js.map +1 -0
  192. package/dist/server/process-activity-monitor.test.d.ts +2 -0
  193. package/dist/server/process-activity-monitor.test.d.ts.map +1 -0
  194. package/dist/server/process-activity-monitor.test.js +82 -0
  195. package/dist/server/process-activity-monitor.test.js.map +1 -0
  196. package/dist/server/quota-spawn-error.test.d.ts +2 -0
  197. package/dist/server/quota-spawn-error.test.d.ts.map +1 -0
  198. package/dist/server/quota-spawn-error.test.js +174 -0
  199. package/dist/server/quota-spawn-error.test.js.map +1 -0
  200. package/dist/server/quota.d.ts +66 -0
  201. package/dist/server/quota.d.ts.map +1 -0
  202. package/dist/server/quota.js +511 -0
  203. package/dist/server/quota.js.map +1 -0
  204. package/dist/server/runtime-config.d.ts +11 -0
  205. package/dist/server/runtime-config.d.ts.map +1 -0
  206. package/dist/server/runtime-config.js +380 -0
  207. package/dist/server/runtime-config.js.map +1 -0
  208. package/dist/server/runtime-config.test.d.ts +2 -0
  209. package/dist/server/runtime-config.test.d.ts.map +1 -0
  210. package/dist/server/runtime-config.test.js +367 -0
  211. package/dist/server/runtime-config.test.js.map +1 -0
  212. package/dist/server/skills.d.ts +8 -0
  213. package/dist/server/skills.d.ts.map +1 -0
  214. package/dist/server/skills.js +26 -0
  215. package/dist/server/skills.js.map +1 -0
  216. package/dist/server/test.d.ts +3 -0
  217. package/dist/server/test.d.ts.map +1 -0
  218. package/dist/server/test.js +458 -0
  219. package/dist/server/test.js.map +1 -0
  220. package/dist/server/test.remote.test.d.ts +2 -0
  221. package/dist/server/test.remote.test.d.ts.map +1 -0
  222. package/dist/server/test.remote.test.js +396 -0
  223. package/dist/server/test.remote.test.js.map +1 -0
  224. package/dist/ui/build-config.d.ts +5 -0
  225. package/dist/ui/build-config.d.ts.map +1 -0
  226. package/dist/ui/build-config.js +229 -0
  227. package/dist/ui/build-config.js.map +1 -0
  228. package/dist/ui/build-config.test.d.ts +2 -0
  229. package/dist/ui/build-config.test.d.ts.map +1 -0
  230. package/dist/ui/build-config.test.js +272 -0
  231. package/dist/ui/build-config.test.js.map +1 -0
  232. package/dist/ui/index.d.ts +4 -0
  233. package/dist/ui/index.d.ts.map +1 -0
  234. package/dist/ui/index.js +8 -0
  235. package/dist/ui/index.js.map +1 -0
  236. package/dist/ui/parse-stdout.d.ts +3 -0
  237. package/dist/ui/parse-stdout.d.ts.map +1 -0
  238. package/dist/ui/parse-stdout.js +265 -0
  239. package/dist/ui/parse-stdout.js.map +1 -0
  240. package/dist/ui/parse-stdout.test.d.ts +2 -0
  241. package/dist/ui/parse-stdout.test.d.ts.map +1 -0
  242. package/dist/ui/parse-stdout.test.js +77 -0
  243. package/dist/ui/parse-stdout.test.js.map +1 -0
  244. package/package.json +61 -0
  245. package/skills/agentmail/SKILL.md +70 -0
  246. package/skills/paperclip/SKILL.md +712 -0
  247. package/skills/paperclip/references/api-reference.md +1675 -0
  248. package/skills/paperclip/references/artifacts.md +158 -0
  249. package/skills/paperclip/references/cases.md +295 -0
  250. package/skills/paperclip/references/company-skills.md +266 -0
  251. package/skills/paperclip/references/issue-workspaces.md +80 -0
  252. package/skills/paperclip/references/routines.md +231 -0
  253. package/skills/paperclip/references/workflows.md +141 -0
  254. package/skills/paperclip/scripts/paperclip-upload-artifact.sh +592 -0
  255. package/skills/paperclip-board/SKILL.md +619 -0
  256. package/skills/paperclip-converting-plans-to-tasks/SKILL.md +60 -0
  257. package/skills/paperclip-create-agent/SKILL.md +179 -0
  258. package/skills/paperclip-create-agent/references/agent-instruction-templates.md +123 -0
  259. package/skills/paperclip-create-agent/references/agents/coder.md +64 -0
  260. package/skills/paperclip-create-agent/references/agents/qa.md +88 -0
  261. package/skills/paperclip-create-agent/references/agents/securityengineer.md +135 -0
  262. package/skills/paperclip-create-agent/references/agents/uxdesigner.md +115 -0
  263. package/skills/paperclip-create-agent/references/api-reference.md +110 -0
  264. package/skills/paperclip-create-agent/references/baseline-role-guide.md +168 -0
  265. package/skills/paperclip-create-agent/references/draft-review-checklist.md +95 -0
  266. package/skills/para-memory-files/SKILL.md +100 -0
  267. package/skills/para-memory-files/references/schemas.md +35 -0
  268. package/skills/slack/SKILL.md +65 -0
@@ -0,0 +1,266 @@
1
+ # Company Skills Workflow
2
+
3
+ Use this reference when a board user, CEO, or manager asks you to find a skill, install it into the company library, or assign it to an agent.
4
+
5
+ ## What Exists
6
+
7
+ - App-shipped catalog: a curated set of company skills in `@tickernelz/paperclip-pro-skills-catalog`, browseable and installable without leaving Paperclip.
8
+ - Company skill library: install, inspect, update, audit, reset, and read company skills for the whole company.
9
+ - Agent skill assignment: add or remove company skills on an existing agent.
10
+ - Hire/create composition: pass `desiredSkills` when creating or hiring an agent so the same assignment model applies immediately.
11
+
12
+ The canonical model is:
13
+
14
+ 1. add the skill to the company library — either from the app catalog (`skills install`), an external source (`skills import`), or a managed local skill (`skills create`/`skills scan-projects`)
15
+ 2. attach the company skill to the agent (`skills agent sync`)
16
+ 3. optionally do step 2 during hire/create with `desiredSkills`
17
+
18
+ Catalog install ≠ agent attach. Installing a catalog skill only adds the row to
19
+ `company_skills`. The agent will not use it until you sync the agent's desired
20
+ set.
21
+
22
+ ## Permission Model
23
+
24
+ - Company skill reads: any same-company actor
25
+ - Company skill mutations: open to same-company actors by default. Missing `skills:create` grants and `canCreateSkills` settings do not deny ordinary skill work; only an explicit company skill policy restriction does. Core safety and company-boundary checks always remain enforced.
26
+ - Agent skill assignment: same permission model as updating that agent
27
+ - Team installs continue to require `agents:create` because they import or create agents in addition to attaching skills.
28
+
29
+ ## Core Endpoints
30
+
31
+ App-shipped catalog (read-only browse + company install):
32
+
33
+ - `GET /api/skills/catalog`
34
+ - `GET /api/skills/catalog/:catalogId`
35
+ - `GET /api/skills/catalog/ref?ref=<id|key|slug>`
36
+ - `GET /api/skills/catalog/:catalogId/files?path=SKILL.md`
37
+ - `POST /api/companies/:companyId/skills/install-catalog`
38
+
39
+ Company library:
40
+
41
+ - `GET /api/companies/:companyId/skills`
42
+ - `GET /api/companies/:companyId/skills/:skillId`
43
+ - `GET /api/companies/:companyId/skills/:skillId/files?path=SKILL.md`
44
+ - `POST /api/companies/:companyId/skills` (managed local create)
45
+ - `POST /api/companies/:companyId/skills/import`
46
+ - `POST /api/companies/:companyId/skills/scan-projects`
47
+ - `GET /api/companies/:companyId/skills/:skillId/update-status`
48
+ - `POST /api/companies/:companyId/skills/:skillId/install-update`
49
+ - `POST /api/companies/:companyId/skills/:skillId/audit`
50
+ - `POST /api/companies/:companyId/skills/:skillId/reset`
51
+ - `DELETE /api/companies/:companyId/skills/:skillId`
52
+
53
+ Agent attach and hire/create composition:
54
+
55
+ - `GET /api/agents/:agentId/skills`
56
+ - `POST /api/agents/:agentId/skills/sync`
57
+ - `POST /api/companies/:companyId/agent-hires`
58
+ - `POST /api/companies/:companyId/agents`
59
+
60
+ If a board user, CEO, or manager is driving locally, prefer the
61
+ `paperclip-pro skills` CLI documented in `doc/CLI.md` — it wraps every endpoint
62
+ above, accepts company skill or catalog refs by `id`/`key`/`slug`, and prints
63
+ the same JSON these endpoints return when called with `--json`.
64
+
65
+ ## Install A Skill Into The Company
66
+
67
+ Two paths cover the common cases:
68
+
69
+ 1. **App-shipped catalog** (preferred when the right skill exists in the
70
+ bundled/optional catalog) — browse it first, then install with the catalog
71
+ install endpoint. No external network fetch happens.
72
+ 2. **External source** (skills.sh, GitHub, local path, or URL) — use the
73
+ import endpoint below.
74
+
75
+ ### App-shipped catalog
76
+
77
+ Browse, inspect, and install catalog skills before reaching for an external
78
+ source. Bundled skills are the curated defaults for any company; optional
79
+ skills are role- or domain-specific.
80
+
81
+ ```sh
82
+ curl -sS "$PAPERCLIP_API_URL/api/skills/catalog?kind=bundled" \
83
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY"
84
+
85
+ curl -sS "$PAPERCLIP_API_URL/api/skills/catalog/ref?ref=github-pr-workflow" \
86
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY"
87
+
88
+ curl -sS -X POST "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills/install-catalog" \
89
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
90
+ -H "Content-Type: application/json" \
91
+ -d '{
92
+ "catalogSkillId": "paperclipai:bundled:software-development:github-pr-workflow"
93
+ }'
94
+ ```
95
+
96
+ The install response records provenance (`catalogId`, `catalogKey`,
97
+ `packageVersion`, `originHash`) on the company skill so update/audit/reset
98
+ flows know the pinned origin. `force: true` may replace a same-key
99
+ catalog-managed skill but never bypasses hard-stop audit findings.
100
+
101
+ ### External source import
102
+
103
+ Import using a **skills.sh URL**, a key-style source string, a GitHub URL, or a local path.
104
+
105
+ ### Source types (in order of preference)
106
+
107
+ | Source format | Example | When to use |
108
+ |---|---|---|
109
+ | **skills.sh URL** | `https://skills.sh/google-labs-code/stitch-skills/design-md` | When a user gives you a `skills.sh` link. This is the managed skill registry — **always prefer it when available**. |
110
+ | **Key-style string** | `google-labs-code/stitch-skills/design-md` | Shorthand for the same skill — `org/repo/skill-name` format. Equivalent to the skills.sh URL. |
111
+ | **GitHub URL** | `https://github.com/vercel-labs/agent-browser` | When the skill is in a GitHub repo but not on skills.sh. |
112
+ | **Local path** | `/abs/path/to/skill-dir` | When the skill is on disk (dev/testing only). |
113
+
114
+ **Critical:** If a user gives you a `https://skills.sh/...` URL, use that URL or its key-style equivalent (`org/repo/skill-name`) as the `source`. Do **not** convert it to a GitHub URL — skills.sh is the managed registry and the source of truth for versioning, discovery, and updates.
115
+
116
+ ### Example: skills.sh import (preferred)
117
+
118
+ ```sh
119
+ curl -sS -X POST "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills/import" \
120
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
121
+ -H "Content-Type: application/json" \
122
+ -d '{
123
+ "source": "https://skills.sh/google-labs-code/stitch-skills/design-md"
124
+ }'
125
+ ```
126
+
127
+ Or equivalently using the key-style string:
128
+
129
+ ```sh
130
+ curl -sS -X POST "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills/import" \
131
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
132
+ -H "Content-Type: application/json" \
133
+ -d '{
134
+ "source": "google-labs-code/stitch-skills/design-md"
135
+ }'
136
+ ```
137
+
138
+ ### Example: GitHub import
139
+
140
+ ```sh
141
+ curl -sS -X POST "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills/import" \
142
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
143
+ -H "Content-Type: application/json" \
144
+ -d '{
145
+ "source": "https://github.com/vercel-labs/agent-browser"
146
+ }'
147
+ ```
148
+
149
+ You can also use source strings such as:
150
+
151
+ - `google-labs-code/stitch-skills/design-md`
152
+ - `vercel-labs/agent-browser/agent-browser`
153
+ - `npx skills add https://github.com/vercel-labs/agent-browser --skill agent-browser`
154
+
155
+ If the task is to discover skills from the company project workspaces first:
156
+
157
+ ```sh
158
+ curl -sS -X POST "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills/scan-projects" \
159
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
160
+ -H "Content-Type: application/json" \
161
+ -d '{}'
162
+ ```
163
+
164
+ ## Inspect What Was Installed
165
+
166
+ ```sh
167
+ curl -sS "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills" \
168
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY"
169
+ ```
170
+
171
+ Read the skill entry and its `SKILL.md`:
172
+
173
+ ```sh
174
+ curl -sS "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills/<skill-id>" \
175
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY"
176
+
177
+ curl -sS "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills/<skill-id>/files?path=SKILL.md" \
178
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY"
179
+ ```
180
+
181
+ ## Assign Skills To An Existing Agent
182
+
183
+ `desiredSkills` accepts:
184
+
185
+ - exact company skill key
186
+ - exact company skill id
187
+ - exact slug when it is unique in the company
188
+
189
+ The server persists canonical company skill keys.
190
+
191
+ The request must include a merge mode:
192
+
193
+ - `add` adds the named skills and keeps every other assignment.
194
+ - `remove` removes only the named skills.
195
+ - `replace` overwrites the complete desired skill set. Use it only after explicit confirmation.
196
+
197
+ ```sh
198
+ curl -sS -X POST "$PAPERCLIP_API_URL/api/agents/<agent-id>/skills/sync" \
199
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
200
+ -H "Content-Type: application/json" \
201
+ -d '{
202
+ "mode": "add",
203
+ "desiredSkills": [
204
+ "vercel-labs/agent-browser/agent-browser"
205
+ ]
206
+ }'
207
+ ```
208
+
209
+ If you need the current state first:
210
+
211
+ ```sh
212
+ curl -sS "$PAPERCLIP_API_URL/api/agents/<agent-id>/skills" \
213
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY"
214
+ ```
215
+
216
+ ## Include Skills During Hire Or Create
217
+
218
+ Use the same company skill keys or references in `desiredSkills` when hiring or creating an agent:
219
+
220
+ ```sh
221
+ curl -sS -X POST "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/agent-hires" \
222
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
223
+ -H "Content-Type: application/json" \
224
+ -d '{
225
+ "name": "QA Browser Agent",
226
+ "role": "qa",
227
+ "adapterType": "codex_local",
228
+ "adapterConfig": {
229
+ "cwd": "/abs/path/to/repo"
230
+ },
231
+ "desiredSkills": [
232
+ "agent-browser"
233
+ ]
234
+ }'
235
+ ```
236
+
237
+ For direct create without approval:
238
+
239
+ ```sh
240
+ curl -sS -X POST "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/agents" \
241
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
242
+ -H "Content-Type: application/json" \
243
+ -d '{
244
+ "name": "QA Browser Agent",
245
+ "role": "qa",
246
+ "adapterType": "codex_local",
247
+ "adapterConfig": {
248
+ "cwd": "/abs/path/to/repo"
249
+ },
250
+ "desiredSkills": [
251
+ "agent-browser"
252
+ ]
253
+ }'
254
+ ```
255
+
256
+ ## Notes
257
+
258
+ - Built-in Paperclip runtime skills are still added automatically when required by the adapter.
259
+ - If a reference is missing or ambiguous, the API returns `422`.
260
+ - Prefer linking back to the relevant issue, approval, and agent when you comment about skill changes.
261
+ - Use company portability routes when you need whole-package import/export, not just a skill:
262
+ - `POST /api/companies/:companyId/imports/preview`
263
+ - `POST /api/companies/:companyId/imports/apply`
264
+ - `POST /api/companies/:companyId/exports/preview`
265
+ - `POST /api/companies/:companyId/exports`
266
+ - Use skill-only import when the task is specifically to add a skill to the company library without importing the surrounding company/team/package structure.
@@ -0,0 +1,80 @@
1
+ # Issue Workspace Runtime Controls
2
+
3
+ Use this reference when an issue has an isolated execution workspace and you need to inspect or run that workspace's services, especially for QA/browser verification.
4
+
5
+ ## Discover the Workspace
6
+
7
+ Start from the issue, not from memory:
8
+
9
+ ```sh
10
+ curl -sS -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
11
+ "$PAPERCLIP_API_URL/api/issues/$PAPERCLIP_TASK_ID/heartbeat-context"
12
+ ```
13
+
14
+ Read `currentExecutionWorkspace`:
15
+
16
+ - `id` — execution workspace id for control endpoints
17
+ - `cwd` / `branchName` — local checkout context
18
+ - `status` / `closedAt` — whether the workspace is usable
19
+ - `runtimeServices[]` — current services, including `serviceName`, `status`, `healthStatus`, `url`, `port`, and `runtimeServiceId`
20
+
21
+ If `currentExecutionWorkspace` is `null`, the issue does not currently have a realized execution workspace. For child/follow-up work, create the child with `parentId` or use `inheritExecutionWorkspaceFromIssueId` so Paperclip preserves workspace continuity.
22
+
23
+ ## Control Services
24
+
25
+ Prefer Paperclip-managed runtime service controls over manual `pnpm dev &` or ad-hoc background processes. These endpoints keep service state, URLs, logs, and ownership visible to other agents and the board.
26
+
27
+ ```sh
28
+ # Start all configured services; waits for configured readiness checks.
29
+ curl -sS -X POST \
30
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
31
+ -H "X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID" \
32
+ -H "Content-Type: application/json" \
33
+ "$PAPERCLIP_API_URL/api/execution-workspaces/<workspace-id>/runtime-services/start" \
34
+ -d '{}'
35
+
36
+ # Restart all configured services.
37
+ curl -sS -X POST \
38
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
39
+ -H "X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID" \
40
+ -H "Content-Type: application/json" \
41
+ "$PAPERCLIP_API_URL/api/execution-workspaces/<workspace-id>/runtime-services/restart" \
42
+ -d '{}'
43
+
44
+ # Stop all running services.
45
+ curl -sS -X POST \
46
+ -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
47
+ -H "X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID" \
48
+ -H "Content-Type: application/json" \
49
+ "$PAPERCLIP_API_URL/api/execution-workspaces/<workspace-id>/runtime-services/stop" \
50
+ -d '{}'
51
+ ```
52
+
53
+ To target a configured service, pass one of:
54
+
55
+ ```json
56
+ { "workspaceCommandId": "web" }
57
+ { "runtimeServiceId": "<runtime-service-id>" }
58
+ { "serviceIndex": 0 }
59
+ ```
60
+
61
+ The response includes an updated `workspace.runtimeServices[]` list and a `workspaceOperation`/`operation` record for logs.
62
+
63
+ ## Read the URL
64
+
65
+ After `start` or `restart`, read the service URL from:
66
+
67
+ - response `workspace.runtimeServices[].url`
68
+ - or a fresh `GET /api/issues/:issueId/heartbeat-context` response at `currentExecutionWorkspace.runtimeServices[].url`
69
+
70
+ For QA/browser checks, use the service whose `status` is `running` and whose `healthStatus` is not `unhealthy`. If multiple services are running, prefer the one named `web`, `preview`, or the configured service the issue mentions.
71
+
72
+ ## MCP Tools
73
+
74
+ When the Paperclip MCP tools are available, prefer these issue-scoped tools:
75
+
76
+ - `paperclipGetIssueWorkspaceRuntime` — reads `currentExecutionWorkspace` and service URLs for an issue.
77
+ - `paperclipControlIssueWorkspaceServices` — starts, stops, or restarts the current issue workspace services.
78
+ - `paperclipWaitForIssueWorkspaceService` — waits until a selected service is running and returns its URL when exposed.
79
+
80
+ These tools resolve the issue's workspace id for you, so QA agents do not need to know the lower-level execution workspace endpoint first.
@@ -0,0 +1,231 @@
1
+ # Paperclip Routines
2
+
3
+ Routines are recurring tasks. Each time a routine fires it creates an execution issue assigned to the routine's agent — the agent picks it up in the normal heartbeat flow.
4
+
5
+ A routine has:
6
+ - One assigned agent and one project
7
+ - One or more triggers (`schedule`, `webhook`, or `api`)
8
+ - A concurrency policy (what to do when a previous run is still active)
9
+ - A catch-up policy (what to do with missed scheduled runs)
10
+ - An activity gate policy (whether quiet scheduled ticks should be skipped)
11
+
12
+ **Authorization:** Agents can read all routines in their company but can only create or manage routines assigned to themselves. Board operators have full access, including reassignment.
13
+
14
+ ---
15
+
16
+ ## Lifecycle
17
+
18
+ ```
19
+ active <-> paused
20
+ active -> archived (terminal — cannot be reactivated)
21
+ ```
22
+
23
+ Paused routines do not fire. Archived routines do not fire and cannot be unarchived.
24
+
25
+ ---
26
+
27
+ ## Creating a Routine
28
+
29
+ ```
30
+ POST /api/companies/{companyId}/routines
31
+ {
32
+ "title": "Weekly CEO briefing",
33
+ "description": "Compile status report and post to Slack",
34
+ "assigneeAgentId": "{agentId}",
35
+ "projectId": "{projectId}",
36
+ "goalId": "{goalId}", // optional
37
+ "parentIssueId": "{issueId}", // optional — parent for run issues
38
+ "priority": "medium",
39
+ "status": "active",
40
+ "concurrencyPolicy": "coalesce_if_active",
41
+ "catchUpPolicy": "skip_missed",
42
+ "activityGatePolicy": "always",
43
+ "activityGateScope": "company"
44
+ }
45
+ ```
46
+
47
+ | Field | Required | Notes |
48
+ |-------|----------|-------|
49
+ | `title` | yes | Max 200 chars |
50
+ | `description` | no | Human-readable description of the routine |
51
+ | `assigneeAgentId` | yes | Agents: must be themselves |
52
+ | `projectId` | yes | |
53
+ | `goalId` | no | Inherited by run issues |
54
+ | `parentIssueId` | no | Run issues become children of this issue |
55
+ | `priority` | no | `critical` `high` `medium` (default) `low` |
56
+ | `status` | no | `active` (default) `paused` `archived` |
57
+ | `concurrencyPolicy` | no | See below |
58
+ | `catchUpPolicy` | no | See below |
59
+ | `activityGatePolicy` | no | `always` (default) or `require_external_activity`; see below |
60
+ | `activityGateScope` | no | `company` (default) or `project`; see below |
61
+
62
+ ---
63
+
64
+ ## Concurrency Policies
65
+
66
+ Controls what happens when a trigger fires while the previous run issue is still open or active.
67
+
68
+ | Policy | Behaviour |
69
+ |--------|-----------|
70
+ | `coalesce_if_active` **(default)** | New run is marked `coalesced` and linked to the existing active run — no new issue created |
71
+ | `skip_if_active` | New run is marked `skipped` and linked to the existing active run — no new issue created |
72
+ | `always_enqueue` | Always create a new issue regardless of active runs |
73
+
74
+ ---
75
+
76
+ ## Catch-Up Policies
77
+
78
+ Controls what happens with scheduled runs that were missed, for example during server downtime.
79
+
80
+ | Policy | Behaviour |
81
+ |--------|-----------|
82
+ | `skip_missed` **(default)** | Missed runs are dropped |
83
+ | `enqueue_missed_with_cap` | Missed runs are enqueued, capped at 25 |
84
+
85
+ ---
86
+
87
+ ## Activity-Gated Scheduled Runs
88
+
89
+ `activityGatePolicy` controls whether a **schedule trigger** runs when the system has been quiet. It does not gate manual, API, or webhook runs.
90
+
91
+ | Policy | Behaviour |
92
+ |--------|-----------|
93
+ | `always` **(default)** | Run on every scheduled tick |
94
+ | `require_external_activity` | Run only when qualifying activity occurred after this routine's last dispatched, non-skipped run |
95
+
96
+ `activityGateScope` selects where qualifying activity is checked:
97
+
98
+ | Scope | Behaviour |
99
+ |-------|-----------|
100
+ | `company` **(default)** | Activity anywhere in the routine's company can wake it |
101
+ | `project` | Only activity attributed to the routine's project can wake it |
102
+
103
+ The activity window starts at the `triggeredAt` time of the last dispatched run. A routine that has never dispatched always runs once. Runs skipped for quiet activity do not advance the window, so one later qualifying event still wakes the next scheduled tick.
104
+
105
+ The gate excludes activity generated by the routine's own dispatched run issues, scheduler bookkeeping for that routine, and pure-read actions such as issue read/unread changes and inbox archive/unarchive actions. Work performed by other agents on tasks the routine delegated is external activity and wakes the routine on its next tick.
106
+
107
+ ### Example: skip quiet nights
108
+
109
+ This hourly watcher runs after company activity, follows up while delegated work continues, and stops consuming runs once the company settles overnight:
110
+
111
+ ```json
112
+ {
113
+ "title": "Hourly work watcher",
114
+ "description": "Review recent work and follow up on delegated tasks",
115
+ "assigneeAgentId": "{agentId}",
116
+ "projectId": "{projectId}",
117
+ "activityGatePolicy": "require_external_activity",
118
+ "activityGateScope": "company"
119
+ }
120
+ ```
121
+
122
+ Add a schedule trigger with `cronExpression: "0 * * * *"`. The first tick runs. Later ticks run only after qualifying company activity since the last dispatched run; quiet skipped ticks keep the original activity window open.
123
+
124
+ ---
125
+
126
+ ## Adding Triggers
127
+
128
+ A routine can have multiple triggers of different kinds.
129
+
130
+ All trigger kinds accept an optional `label` field (max 120 chars), which is useful for distinguishing multiple triggers of the same kind on one routine.
131
+
132
+ ```
133
+ POST /api/routines/{routineId}/triggers
134
+ ```
135
+
136
+ ### Schedule (cron)
137
+
138
+ ```json
139
+ {
140
+ "kind": "schedule",
141
+ "cronExpression": "0 9 * * 1",
142
+ "timezone": "Europe/Amsterdam"
143
+ }
144
+ ```
145
+
146
+ - `cronExpression`: standard 5-field cron syntax
147
+ - `timezone`: IANA timezone string (for example `UTC` or `America/New_York`)
148
+ - The server computes `nextRunAt` automatically
149
+
150
+ ### Webhook
151
+
152
+ ```json
153
+ {
154
+ "kind": "webhook",
155
+ "signingMode": "hmac_sha256",
156
+ "replayWindowSec": 300
157
+ }
158
+ ```
159
+
160
+ - `signingMode`: `bearer` (default) or `hmac_sha256`
161
+ - `replayWindowSec`: 30-86400 (default 300)
162
+ - Response includes the webhook URL (`publicId`-based) and the signing secret
163
+ - Fire externally: `POST /api/routine-triggers/public/{publicId}/fire`
164
+ - Bearer: `Authorization: Bearer <secret>`
165
+ - HMAC: `X-Paperclip-Signature` + `X-Paperclip-Timestamp` headers
166
+
167
+ ### API (manual only)
168
+
169
+ ```json
170
+ {
171
+ "kind": "api"
172
+ }
173
+ ```
174
+
175
+ No configuration. Fire via the manual run endpoint.
176
+
177
+ ---
178
+
179
+ ## Updating and Deleting Triggers
180
+
181
+ ```
182
+ PATCH /api/routine-triggers/{triggerId}
183
+ { "enabled": false, "cronExpression": "0 10 * * 1" }
184
+
185
+ DELETE /api/routine-triggers/{triggerId}
186
+ ```
187
+
188
+ To rotate a webhook secret (the old secret is immediately invalidated):
189
+
190
+ ```
191
+ POST /api/routine-triggers/{triggerId}/rotate-secret
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Manual Run
197
+
198
+ Fires a run immediately, bypassing the schedule. Concurrency policy still applies.
199
+
200
+ ```
201
+ POST /api/routines/{routineId}/run
202
+ {
203
+ "source": "manual",
204
+ "triggerId": "{triggerId}", // optional — attributes run to a specific trigger
205
+ "payload": { "context": "..." }, // optional — passed to the run issue
206
+ "idempotencyKey": "unique-key" // optional — prevents duplicate runs
207
+ }
208
+ ```
209
+
210
+ ---
211
+
212
+ ## Updating a Routine
213
+
214
+ All create fields are updatable. Agents cannot reassign a routine to another agent.
215
+
216
+ ```
217
+ PATCH /api/routines/{routineId}
218
+ { "status": "paused", "title": "New title" }
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Reading Routines and Runs
224
+
225
+ ```
226
+ GET /api/companies/{companyId}/routines
227
+ GET /api/routines/{routineId}
228
+ GET /api/routines/{routineId}/runs?limit=50
229
+ ```
230
+
231
+ Use the generic API endpoint tables in `skills/paperclip/references/api-reference.md` when you need a full cross-domain reference. Use this file when you need routine-specific behaviour, payload shape, or policy details.