@tickernelz/paperclip-pro-adapter-codex-local 2026.925.0 → 2026.925.2

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.
@@ -2,6 +2,8 @@
2
2
 
3
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
4
 
5
+ **Toolset:** `paperclipListSkills` is in the default `core` toolset. Every other tool on this page is in the `extended` toolset: it is available when the operator enables `PAPERCLIP_MCP_TOOLSETS=core,extended`; otherwise use `paperclipApiRequest`. `companyId` is optional on company-scoped tools and defaults to your company.
6
+
5
7
  ## What Exists
6
8
 
7
9
  - App-shipped catalog: a curated set of company skills in `@tickernelz/paperclip-pro-skills-catalog`, browseable and installable without leaving Paperclip.
@@ -11,8 +13,8 @@ Use this reference when a board user, CEO, or manager asks you to find a skill,
11
13
 
12
14
  The canonical model is:
13
15
 
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
+ 1. add the skill to the company library — either from the app catalog (`paperclipInstallCatalogSkill`), an external source (`paperclipImportSkill`), or a managed local skill (`paperclipCreateSkill` / `paperclipCreateSkillScanProject`)
17
+ 2. attach the company skill to the agent (`paperclipSyncAgentSkill`)
16
18
  3. optionally do step 2 during hire/create with `desiredSkills`
17
19
 
18
20
  Catalog install ≠ agent attach. Installing a catalog skill only adds the row to
@@ -26,51 +28,42 @@ set.
26
28
  - Agent skill assignment: same permission model as updating that agent
27
29
  - Team installs continue to require `agents:create` because they import or create agents in addition to attaching skills.
28
30
 
29
- ## Core Endpoints
31
+ ## Tools
30
32
 
31
33
  App-shipped catalog (read-only browse + company install):
32
34
 
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`
35
+ - `paperclipGetSkillCatalog` — browse catalog entries; each entry reports its `kind` (`bundled` or `optional`)
36
+ - `paperclipGetSkillCatalogByCatalogId` — `{ "catalogId": "<catalog-id>" }`
37
+ - resolving a catalog ref and reading catalog files have no dedicated tool: use `paperclipApiRequest` with `method: "GET"`, `path: "/skills/catalog/ref?ref=<id|key|slug>"` or `path: "/skills/catalog/<catalogId>/files?path=SKILL.md"`
38
+ - `paperclipInstallCatalogSkill` — install a catalog skill into the company
38
39
 
39
40
  Company library:
40
41
 
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`
42
+ - `paperclipListSkills` — the installed company skill library
43
+ - `paperclipGetSkill` — `{ "skillId": "<skill-id>" }`
44
+ - reading a company skill file has no dedicated tool: use `paperclipApiRequest` with `method: "GET"`, `path: "/companies/<companyId>/skills/<skillId>/files?path=SKILL.md"`
45
+ - `paperclipCreateSkill` — managed local create
46
+ - `paperclipImportSkill` — import from an external source
47
+ - `paperclipCreateSkillScanProject` — discover skills in the company project workspaces
48
+ - `paperclipListSkillUpdateStatus` / `paperclipInstallUpdateSkill` — check and apply an update
49
+ - `paperclipAuditSkill`, `paperclipResetSkill`, `paperclipDeleteSkill`
52
50
 
53
51
  Agent attach and hire/create composition:
54
52
 
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`.
53
+ - `paperclipListAgentSkills` — `{ "id": "<agent-id>" }`
54
+ - `paperclipSyncAgentSkill` — attach or detach company skills on an agent
55
+ - `paperclipCreateAgentHire` — hire with `desiredSkills`
56
+ - `paperclipCreateAgent` — direct create with `desiredSkills`
64
57
 
65
58
  ## Install A Skill Into The Company
66
59
 
67
60
  Two paths cover the common cases:
68
61
 
69
62
  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.
63
+ bundled/optional catalog) — browse it first, then install with
64
+ `paperclipInstallCatalogSkill`. No external network fetch happens.
65
+ 2. **External source** (skills.sh, GitHub, local path, or URL) — use
66
+ `paperclipImportSkill`.
74
67
 
75
68
  ### App-shipped catalog
76
69
 
@@ -78,22 +71,16 @@ Browse, inspect, and install catalog skills before reaching for an external
78
71
  source. Bundled skills are the curated defaults for any company; optional
79
72
  skills are role- or domain-specific.
80
73
 
81
- ```sh
82
- curl -sS "$PAPERCLIP_API_URL/api/skills/catalog?kind=bundled" \
83
- -H "Authorization: Bearer $PAPERCLIP_API_KEY"
74
+ Browse with `paperclipGetSkillCatalog`, inspect one entry with
75
+ `paperclipGetSkillCatalogByCatalogId`, then install:
84
76
 
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
- }'
77
+ ```json
78
+ {
79
+ "catalogSkillId": "paperclipai:bundled:software-development:github-pr-workflow"
80
+ }
94
81
  ```
95
82
 
96
- The install response records provenance (`catalogId`, `catalogKey`,
83
+ The install result records provenance (`catalogId`, `catalogKey`,
97
84
  `packageVersion`, `originHash`) on the company skill so update/audit/reset
98
85
  flows know the pinned origin. `force: true` may replace a same-key
99
86
  catalog-managed skill but never bypasses hard-stop audit findings.
@@ -115,35 +102,22 @@ Import using a **skills.sh URL**, a key-style source string, a GitHub URL, or a
115
102
 
116
103
  ### Example: skills.sh import (preferred)
117
104
 
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
- }'
105
+ `paperclipImportSkill`:
106
+
107
+ ```json
108
+ { "source": "https://skills.sh/google-labs-code/stitch-skills/design-md" }
125
109
  ```
126
110
 
127
111
  Or equivalently using the key-style string:
128
112
 
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
- }'
113
+ ```json
114
+ { "source": "google-labs-code/stitch-skills/design-md" }
136
115
  ```
137
116
 
138
117
  ### Example: GitHub import
139
118
 
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
- }'
119
+ ```json
120
+ { "source": "https://github.com/vercel-labs/agent-browser" }
147
121
  ```
148
122
 
149
123
  You can also use source strings such as:
@@ -152,31 +126,13 @@ You can also use source strings such as:
152
126
  - `vercel-labs/agent-browser/agent-browser`
153
127
  - `npx skills add https://github.com/vercel-labs/agent-browser --skill agent-browser`
154
128
 
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
- ```
129
+ If the task is to discover skills from the company project workspaces first, call `paperclipCreateSkillScanProject` with no arguments beyond the optional `companyId`.
163
130
 
164
131
  ## Inspect What Was Installed
165
132
 
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
- ```
133
+ Call `paperclipListSkills` for the library, then `paperclipGetSkill` with the
134
+ `skillId` for one entry. To read its `SKILL.md`, use `paperclipApiRequest` with
135
+ `method: "GET"`, `path: "/companies/<companyId>/skills/<skillId>/files?path=SKILL.md"`.
180
136
 
181
137
  ## Assign Skills To An Existing Agent
182
138
 
@@ -188,79 +144,43 @@ curl -sS "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/skills/<skill-i
188
144
 
189
145
  The server persists canonical company skill keys.
190
146
 
191
- The request must include a merge mode:
147
+ `paperclipSyncAgentSkill` requires a merge mode:
192
148
 
193
149
  - `add` adds the named skills and keeps every other assignment.
194
150
  - `remove` removes only the named skills.
195
151
  - `replace` overwrites the complete desired skill set. Use it only after explicit confirmation.
196
152
 
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
- }'
153
+ ```json
154
+ {
155
+ "id": "<agent-id>",
156
+ "mode": "add",
157
+ "desiredSkills": ["vercel-labs/agent-browser/agent-browser"]
158
+ }
207
159
  ```
208
160
 
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
- ```
161
+ If you need the current state first, call `paperclipListAgentSkills` with
162
+ `{ "id": "<agent-id>" }`.
215
163
 
216
164
  ## Include Skills During Hire Or Create
217
165
 
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
- ```
166
+ Use the same company skill keys or references in `desiredSkills` when hiring with `paperclipCreateAgentHire`:
236
167
 
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
- }'
168
+ ```json
169
+ {
170
+ "name": "QA Browser Agent",
171
+ "role": "qa",
172
+ "adapterType": "codex_local",
173
+ "adapterConfig": { "cwd": "/abs/path/to/repo" },
174
+ "desiredSkills": ["agent-browser"]
175
+ }
254
176
  ```
255
177
 
178
+ For direct create without approval, pass the same arguments to `paperclipCreateAgent`.
179
+
256
180
  ## Notes
257
181
 
258
182
  - 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`.
183
+ - If a reference is missing or ambiguous, the tool returns a `422` error and nothing was installed or assigned.
260
184
  - 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`
185
+ - Whole-package company import/export has no dedicated tool. Use `paperclipApiRequest` with `method: "POST"` and one of `path: "/companies/<companyId>/imports/preview"`, `path: "/companies/<companyId>/imports/apply"`, `path: "/companies/<companyId>/exports/preview"`, `path: "/companies/<companyId>/exports"`.
266
186
  - 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.
@@ -2,18 +2,19 @@
2
2
 
3
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
4
 
5
+ All tools in this file are in the default `core` toolset.
6
+
5
7
  ## Discover the Workspace
6
8
 
7
- Start from the issue, not from memory:
9
+ Start from the issue, not from memory. Call `paperclipGetIssueWorkspaceRuntime` with the issue:
8
10
 
9
- ```sh
10
- curl -sS -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
11
- "$PAPERCLIP_API_URL/api/issues/$PAPERCLIP_TASK_ID/heartbeat-context"
11
+ ```json
12
+ { "issueId": "PAP-1135" }
12
13
  ```
13
14
 
14
- Read `currentExecutionWorkspace`:
15
+ Read `currentExecutionWorkspace` in the result:
15
16
 
16
- - `id` — execution workspace id for control endpoints
17
+ - `id` — execution workspace id used by workspace-scoped tools
17
18
  - `cwd` / `branchName` — local checkout context
18
19
  - `status` / `closedAt` — whether the workspace is usable
19
20
  - `runtimeServices[]` — current services, including `serviceName`, `status`, `healthStatus`, `url`, `port`, and `runtimeServiceId`
@@ -22,35 +23,17 @@ If `currentExecutionWorkspace` is `null`, the issue does not currently have a re
22
23
 
23
24
  ## Control Services
24
25
 
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 '{}'
26
+ Prefer Paperclip-managed runtime service controls over manual `pnpm dev &` or ad-hoc background processes. The tool keeps service state, URLs, logs, and ownership visible to other agents and the board.
27
+
28
+ `paperclipControlIssueWorkspaceServices` resolves the issue's workspace for you. Pass `issueId` and `action`:
29
+
30
+ ```json
31
+ { "issueId": "PAP-1135", "action": "start" }
32
+ { "issueId": "PAP-1135", "action": "restart" }
33
+ { "issueId": "PAP-1135", "action": "stop" }
51
34
  ```
52
35
 
53
- To target a configured service, pass one of:
36
+ `start` waits for the configured readiness checks. To target one configured service instead of all of them, add exactly one of:
54
37
 
55
38
  ```json
56
39
  { "workspaceCommandId": "web" }
@@ -58,23 +41,25 @@ To target a configured service, pass one of:
58
41
  { "serviceIndex": 0 }
59
42
  ```
60
43
 
61
- The response includes an updated `workspace.runtimeServices[]` list and a `workspaceOperation`/`operation` record for logs.
44
+ The result includes an updated `workspace.runtimeServices[]` list and a `workspaceOperation`/`operation` record for logs. Treat that returned service state as the confirmation that the control actually applied; if the service you asked for is not in the result with the expected `status`, read the runtime again before claiming it is running.
62
45
 
63
46
  ## Read the URL
64
47
 
65
48
  After `start` or `restart`, read the service URL from:
66
49
 
67
- - response `workspace.runtimeServices[].url`
68
- - or a fresh `GET /api/issues/:issueId/heartbeat-context` response at `currentExecutionWorkspace.runtimeServices[].url`
50
+ - the control result at `workspace.runtimeServices[].url`
51
+ - or a fresh `paperclipGetIssueWorkspaceRuntime` call at `currentExecutionWorkspace.runtimeServices[].url`
69
52
 
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.
53
+ To block until a service is actually up, call `paperclipWaitForIssueWorkspaceService`:
71
54
 
72
- ## MCP Tools
55
+ ```json
56
+ { "issueId": "PAP-1135", "serviceName": "web", "timeoutSeconds": 120 }
57
+ ```
73
58
 
74
- When the Paperclip MCP tools are available, prefer these issue-scoped tools:
59
+ Select the service by `serviceName` or `runtimeServiceId`. `timeoutSeconds` is optional (default 60, maximum 300). The tool returns once the service is running and reports its URL when one is exposed.
60
+
61
+ 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.
75
62
 
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.
63
+ ## Workspace-Scoped Read
79
64
 
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.
65
+ When you already hold an execution workspace id — for example from another agent's comment — `paperclipGetExecutionWorkspace` with `{ "id": "<execution-workspace-id>" }` returns that workspace and its runtime services. Prefer the issue-scoped tools above when you start from an issue: they resolve the workspace id for you.
@@ -9,6 +9,8 @@ A routine has:
9
9
  - A catch-up policy (what to do with missed scheduled runs)
10
10
  - An activity gate policy (whether quiet scheduled ticks should be skipped)
11
11
 
12
+ **Toolset:** the routine tools are in the `extended` toolset. They are available when the operator enables `PAPERCLIP_MCP_TOOLSETS=core,extended`; otherwise use `paperclipApiRequest` for the same operations.
13
+
12
14
  **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
15
 
14
16
  ---
@@ -26,15 +28,16 @@ Paused routines do not fire. Archived routines do not fire and cannot be unarchi
26
28
 
27
29
  ## Creating a Routine
28
30
 
29
- ```
30
- POST /api/companies/{companyId}/routines
31
+ `paperclipCreateRoutine` — `companyId` is optional and defaults to your company.
32
+
33
+ ```json
31
34
  {
32
35
  "title": "Weekly CEO briefing",
33
36
  "description": "Compile status report and post to Slack",
34
37
  "assigneeAgentId": "{agentId}",
35
38
  "projectId": "{projectId}",
36
- "goalId": "{goalId}", // optional
37
- "parentIssueId": "{issueId}", // optional — parent for run issues
39
+ "goalId": "{goalId}",
40
+ "parentIssueId": "{issueId}",
38
41
  "priority": "medium",
39
42
  "status": "active",
40
43
  "concurrencyPolicy": "coalesce_if_active",
@@ -59,6 +62,8 @@ POST /api/companies/{companyId}/routines
59
62
  | `activityGatePolicy` | no | `always` (default) or `require_external_activity`; see below |
60
63
  | `activityGateScope` | no | `company` (default) or `project`; see below |
61
64
 
65
+ The result is the created routine. Read its `id` from there for triggers and runs.
66
+
62
67
  ---
63
68
 
64
69
  ## Concurrency Policies
@@ -106,7 +111,7 @@ The gate excludes activity generated by the routine's own dispatched run issues,
106
111
 
107
112
  ### Example: skip quiet nights
108
113
 
109
- This hourly watcher runs after company activity, follows up while delegated work continues, and stops consuming runs once the company settles overnight:
114
+ This hourly watcher runs after company activity, follows up while delegated work continues, and stops consuming runs once the company settles overnight. Create it with `paperclipCreateRoutine`:
110
115
 
111
116
  ```json
112
117
  {
@@ -127,19 +132,18 @@ Add a schedule trigger with `cronExpression: "0 * * * *"`. The first tick runs.
127
132
 
128
133
  A routine can have multiple triggers of different kinds.
129
134
 
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
+ `paperclipCreateRoutineTrigger` takes the routine as `id` and the trigger configuration nested under `body`. 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.
135
136
 
136
137
  ### Schedule (cron)
137
138
 
138
139
  ```json
139
140
  {
140
- "kind": "schedule",
141
- "cronExpression": "0 9 * * 1",
142
- "timezone": "Europe/Amsterdam"
141
+ "id": "{routineId}",
142
+ "body": {
143
+ "kind": "schedule",
144
+ "cronExpression": "0 9 * * 1",
145
+ "timezone": "Europe/Amsterdam"
146
+ }
143
147
  }
144
148
  ```
145
149
 
@@ -151,81 +155,85 @@ POST /api/routines/{routineId}/triggers
151
155
 
152
156
  ```json
153
157
  {
154
- "kind": "webhook",
155
- "signingMode": "hmac_sha256",
156
- "replayWindowSec": 300
158
+ "id": "{routineId}",
159
+ "body": {
160
+ "kind": "webhook",
161
+ "signingMode": "hmac_sha256",
162
+ "replayWindowSec": 300
163
+ }
157
164
  }
158
165
  ```
159
166
 
160
167
  - `signingMode`: `bearer` (default) or `hmac_sha256`
161
168
  - `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>`
169
+ - The result includes the webhook URL (`publicId`-based) and the signing secret
170
+ - External systems fire that returned URL directly:
171
+ - Bearer: `Authorization` header carrying the returned secret
165
172
  - HMAC: `X-Paperclip-Signature` + `X-Paperclip-Timestamp` headers
166
173
 
167
174
  ### API (manual only)
168
175
 
169
176
  ```json
170
177
  {
171
- "kind": "api"
178
+ "id": "{routineId}",
179
+ "body": { "kind": "api" }
172
180
  }
173
181
  ```
174
182
 
175
- No configuration. Fire via the manual run endpoint.
183
+ No configuration. Fire it with the manual run tool below.
176
184
 
177
185
  ---
178
186
 
179
187
  ## Updating and Deleting Triggers
180
188
 
181
- ```
182
- PATCH /api/routine-triggers/{triggerId}
183
- { "enabled": false, "cronExpression": "0 10 * * 1" }
189
+ `paperclipUpdateRoutineTrigger` takes the trigger as `id`:
184
190
 
185
- DELETE /api/routine-triggers/{triggerId}
191
+ ```json
192
+ { "id": "{triggerId}", "enabled": false, "cronExpression": "0 10 * * 1" }
186
193
  ```
187
194
 
188
- To rotate a webhook secret (the old secret is immediately invalidated):
195
+ `paperclipDeleteRoutineTrigger` takes the trigger as `id`:
189
196
 
197
+ ```json
198
+ { "id": "{triggerId}" }
190
199
  ```
191
- POST /api/routine-triggers/{triggerId}/rotate-secret
192
- ```
200
+
201
+ Rotating a webhook secret has no dedicated tool. Use `paperclipApiRequest` with `method: "POST"`, `path: "/routine-triggers/{triggerId}/rotate-secret"`. The old secret is immediately invalidated.
193
202
 
194
203
  ---
195
204
 
196
205
  ## Manual Run
197
206
 
198
- Fires a run immediately, bypassing the schedule. Concurrency policy still applies.
207
+ `paperclipRunRoutine` fires a run immediately, bypassing the schedule. Concurrency policy still applies.
199
208
 
200
- ```
201
- POST /api/routines/{routineId}/run
209
+ ```json
202
210
  {
211
+ "id": "{routineId}",
203
212
  "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
213
+ "triggerId": "{triggerId}",
214
+ "payload": { "context": "..." },
215
+ "idempotencyKey": "unique-key"
207
216
  }
208
217
  ```
209
218
 
219
+ `triggerId` attributes the run to a specific trigger, `payload` is passed to the run issue, and `idempotencyKey` prevents duplicate runs. All three are optional.
220
+
210
221
  ---
211
222
 
212
223
  ## Updating a Routine
213
224
 
214
- All create fields are updatable. Agents cannot reassign a routine to another agent.
225
+ All create fields are updatable with `paperclipUpdateRoutine`. Agents cannot reassign a routine to another agent.
215
226
 
216
- ```
217
- PATCH /api/routines/{routineId}
218
- { "status": "paused", "title": "New title" }
227
+ ```json
228
+ { "id": "{routineId}", "status": "paused", "title": "New title" }
219
229
  ```
220
230
 
221
231
  ---
222
232
 
223
233
  ## Reading Routines and Runs
224
234
 
225
- ```
226
- GET /api/companies/{companyId}/routines
227
- GET /api/routines/{routineId}
228
- GET /api/routines/{routineId}/runs?limit=50
229
- ```
235
+ - `paperclipListRoutines` — routines in the company; `companyId` defaults to yours
236
+ - `paperclipGetRoutine` — `{ "id": "{routineId}" }`
237
+ - `paperclipListRoutineRuns` — `{ "id": "{routineId}" }`
230
238
 
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.
239
+ Use `paperclipApiRequest` when a routine operation has no dedicated tool. Use this file when you need routine-specific behaviour, payload shape, or policy details.