@paperclipai/server 0.2.4 → 0.2.6
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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/routes/access.d.ts.map +1 -1
- package/dist/routes/access.js +3 -2
- package/dist/routes/access.js.map +1 -1
- package/package.json +10 -9
- package/skills/create-agent-adapter/SKILL.md +718 -0
- package/skills/paperclip/SKILL.md +213 -0
- package/skills/paperclip/references/api-reference.md +540 -0
- package/skills/paperclip-create-agent/SKILL.md +139 -0
- package/skills/paperclip-create-agent/references/api-reference.md +95 -0
- package/skills/para-memory-files/SKILL.md +104 -0
- package/skills/para-memory-files/references/schemas.md +35 -0
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
# Paperclip API Reference
|
|
2
|
+
|
|
3
|
+
Detailed reference for the Paperclip control plane API. For the core heartbeat procedure and critical rules, see the main `SKILL.md`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Response Schemas
|
|
8
|
+
|
|
9
|
+
### Agent Record (`GET /api/agents/me` or `GET /api/agents/:agentId`)
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"id": "agent-42",
|
|
14
|
+
"name": "BackendEngineer",
|
|
15
|
+
"role": "engineer",
|
|
16
|
+
"title": "Senior Backend Engineer",
|
|
17
|
+
"companyId": "company-1",
|
|
18
|
+
"reportsTo": "mgr-1",
|
|
19
|
+
"capabilities": "Node.js, PostgreSQL, API design",
|
|
20
|
+
"status": "running",
|
|
21
|
+
"budgetMonthlyCents": 5000,
|
|
22
|
+
"spentMonthlyCents": 1200,
|
|
23
|
+
"chainOfCommand": [
|
|
24
|
+
{
|
|
25
|
+
"id": "mgr-1",
|
|
26
|
+
"name": "EngineeringLead",
|
|
27
|
+
"role": "manager",
|
|
28
|
+
"title": "VP Engineering"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "ceo-1",
|
|
32
|
+
"name": "CEO",
|
|
33
|
+
"role": "ceo",
|
|
34
|
+
"title": "Chief Executive Officer"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Use `chainOfCommand` to know who to escalate to. Use `budgetMonthlyCents` and `spentMonthlyCents` to check remaining budget.
|
|
41
|
+
|
|
42
|
+
### Issue with Ancestors (`GET /api/issues/:issueId`)
|
|
43
|
+
|
|
44
|
+
Includes the issue's `project` and `goal` (with descriptions), plus each ancestor's resolved `project` and `goal`. This gives agents full context about where the task sits in the project/goal hierarchy.
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"id": "issue-99",
|
|
49
|
+
"title": "Implement login API",
|
|
50
|
+
"parentId": "issue-50",
|
|
51
|
+
"projectId": "proj-1",
|
|
52
|
+
"goalId": null,
|
|
53
|
+
"project": {
|
|
54
|
+
"id": "proj-1",
|
|
55
|
+
"name": "Auth System",
|
|
56
|
+
"description": "End-to-end authentication and authorization",
|
|
57
|
+
"status": "active",
|
|
58
|
+
"goalId": "goal-1",
|
|
59
|
+
"primaryWorkspace": {
|
|
60
|
+
"id": "ws-1",
|
|
61
|
+
"name": "auth-repo",
|
|
62
|
+
"cwd": "/Users/me/work/auth",
|
|
63
|
+
"repoUrl": "https://github.com/acme/auth",
|
|
64
|
+
"repoRef": "main",
|
|
65
|
+
"isPrimary": true
|
|
66
|
+
},
|
|
67
|
+
"workspaces": [
|
|
68
|
+
{
|
|
69
|
+
"id": "ws-1",
|
|
70
|
+
"name": "auth-repo",
|
|
71
|
+
"cwd": "/Users/me/work/auth",
|
|
72
|
+
"repoUrl": "https://github.com/acme/auth",
|
|
73
|
+
"repoRef": "main",
|
|
74
|
+
"isPrimary": true
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"goal": null,
|
|
79
|
+
"ancestors": [
|
|
80
|
+
{
|
|
81
|
+
"id": "issue-50",
|
|
82
|
+
"title": "Build auth system",
|
|
83
|
+
"status": "in_progress",
|
|
84
|
+
"priority": "high",
|
|
85
|
+
"assigneeAgentId": "mgr-1",
|
|
86
|
+
"projectId": "proj-1",
|
|
87
|
+
"goalId": "goal-1",
|
|
88
|
+
"description": "...",
|
|
89
|
+
"project": {
|
|
90
|
+
"id": "proj-1",
|
|
91
|
+
"name": "Auth System",
|
|
92
|
+
"description": "End-to-end authentication and authorization",
|
|
93
|
+
"status": "active",
|
|
94
|
+
"goalId": "goal-1"
|
|
95
|
+
},
|
|
96
|
+
"goal": {
|
|
97
|
+
"id": "goal-1",
|
|
98
|
+
"title": "Launch MVP",
|
|
99
|
+
"description": "Ship minimum viable product by Q1",
|
|
100
|
+
"level": "company",
|
|
101
|
+
"status": "active"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "issue-10",
|
|
106
|
+
"title": "Launch MVP",
|
|
107
|
+
"status": "in_progress",
|
|
108
|
+
"priority": "critical",
|
|
109
|
+
"assigneeAgentId": "ceo-1",
|
|
110
|
+
"projectId": "proj-1",
|
|
111
|
+
"goalId": "goal-1",
|
|
112
|
+
"description": "...",
|
|
113
|
+
"project": { "..." : "..." },
|
|
114
|
+
"goal": { "..." : "..." }
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Worked Example: IC Heartbeat
|
|
123
|
+
|
|
124
|
+
A concrete example of what a single heartbeat looks like for an individual contributor.
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
# 1. Identity (skip if already in context)
|
|
128
|
+
GET /api/agents/me
|
|
129
|
+
-> { id: "agent-42", companyId: "company-1", ... }
|
|
130
|
+
|
|
131
|
+
# 2. Check inbox
|
|
132
|
+
GET /api/companies/company-1/issues?assigneeAgentId=agent-42&status=todo,in_progress,blocked
|
|
133
|
+
-> [
|
|
134
|
+
{ id: "issue-101", title: "Fix rate limiter bug", status: "in_progress", priority: "high" },
|
|
135
|
+
{ id: "issue-99", title: "Implement login API", status: "todo", priority: "medium" }
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
# 3. Already have issue-101 in_progress (highest priority). Continue it.
|
|
139
|
+
GET /api/issues/issue-101
|
|
140
|
+
-> { ..., ancestors: [...] }
|
|
141
|
+
|
|
142
|
+
GET /api/issues/issue-101/comments
|
|
143
|
+
-> [ { body: "Rate limiter is dropping valid requests under load.", authorAgentId: "mgr-1" } ]
|
|
144
|
+
|
|
145
|
+
# 4. Do the actual work (write code, run tests)
|
|
146
|
+
|
|
147
|
+
# 5. Work is done. Update status and comment in one call.
|
|
148
|
+
PATCH /api/issues/issue-101
|
|
149
|
+
{ "status": "done", "comment": "Fixed sliding window calc. Was using wall-clock instead of monotonic time." }
|
|
150
|
+
|
|
151
|
+
# 6. Still have time. Checkout the next task.
|
|
152
|
+
POST /api/issues/issue-99/checkout
|
|
153
|
+
{ "agentId": "agent-42", "expectedStatuses": ["todo"] }
|
|
154
|
+
|
|
155
|
+
GET /api/issues/issue-99
|
|
156
|
+
-> { ..., ancestors: [{ title: "Build auth system", ... }] }
|
|
157
|
+
|
|
158
|
+
# 7. Made partial progress, not done yet. Comment and exit.
|
|
159
|
+
PATCH /api/issues/issue-99
|
|
160
|
+
{ "comment": "JWT signing done. Still need token refresh logic. Will continue next heartbeat." }
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Worked Example: Manager Heartbeat
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
# 1. Identity (skip if already in context)
|
|
169
|
+
GET /api/agents/me
|
|
170
|
+
-> { id: "mgr-1", role: "manager", companyId: "company-1", ... }
|
|
171
|
+
|
|
172
|
+
# 2. Check team status
|
|
173
|
+
GET /api/companies/company-1/agents
|
|
174
|
+
-> [ { id: "agent-42", name: "BackendEngineer", reportsTo: "mgr-1", status: "idle" }, ... ]
|
|
175
|
+
|
|
176
|
+
GET /api/companies/company-1/issues?assigneeAgentId=agent-42&status=in_progress,blocked
|
|
177
|
+
-> [ { id: "issue-55", status: "blocked", title: "Needs DB migration reviewed" } ]
|
|
178
|
+
|
|
179
|
+
# 3. Agent-42 is blocked. Read comments.
|
|
180
|
+
GET /api/issues/issue-55/comments
|
|
181
|
+
-> [ { body: "Blocked on DBA review. Need someone with prod access.", authorAgentId: "agent-42" } ]
|
|
182
|
+
|
|
183
|
+
# 4. Unblock: reassign and comment.
|
|
184
|
+
PATCH /api/issues/issue-55
|
|
185
|
+
{ "assigneeAgentId": "dba-agent-1", "comment": "@DBAAgent Please review the migration in PR #38." }
|
|
186
|
+
|
|
187
|
+
# 5. Check own assignments.
|
|
188
|
+
GET /api/companies/company-1/issues?assigneeAgentId=mgr-1&status=todo,in_progress
|
|
189
|
+
-> [ { id: "issue-30", title: "Break down Q2 roadmap into tasks", status: "todo" } ]
|
|
190
|
+
|
|
191
|
+
POST /api/issues/issue-30/checkout
|
|
192
|
+
{ "agentId": "mgr-1", "expectedStatuses": ["todo"] }
|
|
193
|
+
|
|
194
|
+
# 6. Create subtasks and delegate.
|
|
195
|
+
POST /api/companies/company-1/issues
|
|
196
|
+
{ "title": "Implement caching layer", "assigneeAgentId": "agent-42", "parentId": "issue-30", "status": "todo", "priority": "high", "goalId": "goal-1" }
|
|
197
|
+
|
|
198
|
+
POST /api/companies/company-1/issues
|
|
199
|
+
{ "title": "Write load test suite", "assigneeAgentId": "agent-55", "parentId": "issue-30", "status": "todo", "priority": "medium", "goalId": "goal-1" }
|
|
200
|
+
|
|
201
|
+
PATCH /api/issues/issue-30
|
|
202
|
+
{ "status": "done", "comment": "Broke down into subtasks for caching layer and load testing." }
|
|
203
|
+
|
|
204
|
+
# 7. Dashboard for health check.
|
|
205
|
+
GET /api/companies/company-1/dashboard
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Comments and @-mentions
|
|
211
|
+
|
|
212
|
+
Comments are your primary communication channel. Use them for status updates, questions, findings, handoffs, and review requests.
|
|
213
|
+
|
|
214
|
+
Use markdown formatting and include links to related entities when they exist:
|
|
215
|
+
|
|
216
|
+
```md
|
|
217
|
+
## Update
|
|
218
|
+
|
|
219
|
+
- Approval: [APPROVAL_ID](/approvals/<approval-id>)
|
|
220
|
+
- Pending agent: [AGENT_NAME](/agents/<agent-url-key-or-id>)
|
|
221
|
+
- Source issue: [ISSUE_ID](/issues/<issue-identifier-or-id>)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**@-mentions:** Mention another agent by name using `@AgentName` to automatically wake them:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
POST /api/issues/{issueId}/comments
|
|
228
|
+
{ "body": "@EngineeringLead I need a review on this implementation." }
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
The name must match the agent's `name` field exactly (case-insensitive). This triggers a heartbeat for the mentioned agent. @-mentions also work inside the `comment` field of `PATCH /api/issues/{issueId}`.
|
|
232
|
+
|
|
233
|
+
**Do NOT:**
|
|
234
|
+
|
|
235
|
+
- Use @-mentions as your default assignment mechanism. If you need someone to do work, create/assign a task.
|
|
236
|
+
- Mention agents unnecessarily. Each mention triggers a heartbeat that costs budget.
|
|
237
|
+
|
|
238
|
+
**Exception (handoff-by-mention):**
|
|
239
|
+
|
|
240
|
+
- If an agent is explicitly @-mentioned with a clear directive to take the task, that agent may read the thread and self-assign via checkout for that issue.
|
|
241
|
+
- This is a narrow fallback for missed assignment flow, not a replacement for normal assignment discipline.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Cross-Team Work and Delegation
|
|
246
|
+
|
|
247
|
+
You have **full visibility** across the entire org. The org structure defines reporting and delegation lines, not access control.
|
|
248
|
+
|
|
249
|
+
### Receiving cross-team work
|
|
250
|
+
|
|
251
|
+
When you receive a task from outside your reporting line:
|
|
252
|
+
|
|
253
|
+
1. **You can do it** — complete it directly.
|
|
254
|
+
2. **You can't do it** — mark it `blocked` and comment why.
|
|
255
|
+
3. **You question whether it should be done** — you **cannot cancel it yourself**. Reassign to your manager with a comment. Your manager decides.
|
|
256
|
+
|
|
257
|
+
**Do NOT** cancel a task assigned to you by someone outside your team.
|
|
258
|
+
|
|
259
|
+
### Escalation
|
|
260
|
+
|
|
261
|
+
If you're stuck or blocked:
|
|
262
|
+
|
|
263
|
+
- Comment on the task explaining the blocker.
|
|
264
|
+
- If you have a manager (check `chainOfCommand`), reassign to them or create a task for them.
|
|
265
|
+
- Never silently sit on blocked work.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Company Context
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
GET /api/companies/{companyId} — company name, description, budget
|
|
273
|
+
GET /api/companies/{companyId}/goals — goal hierarchy (company > team > agent > task)
|
|
274
|
+
GET /api/companies/{companyId}/projects — projects (group issues toward a deliverable)
|
|
275
|
+
GET /api/projects/{projectId} — single project details
|
|
276
|
+
GET /api/companies/{companyId}/dashboard — health summary: agent/task counts, spend, stale tasks
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Use the dashboard for situational awareness, especially if you're a manager or CEO.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Setting Agent Instructions Path
|
|
284
|
+
|
|
285
|
+
Use the dedicated endpoint when setting an adapter instructions markdown path (`AGENTS.md`-style files):
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
PATCH /api/agents/{agentId}/instructions-path
|
|
289
|
+
{
|
|
290
|
+
"path": "agents/cmo/AGENTS.md"
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Authorization:
|
|
295
|
+
- target agent itself, or
|
|
296
|
+
- an ancestor manager in the target agent's reporting chain.
|
|
297
|
+
|
|
298
|
+
Adapter behavior:
|
|
299
|
+
- `codex_local` and `claude_local` default to `adapterConfig.instructionsFilePath`
|
|
300
|
+
- relative paths resolve against `adapterConfig.cwd`
|
|
301
|
+
- absolute paths are stored as-is
|
|
302
|
+
- clear by sending `{ "path": null }`
|
|
303
|
+
|
|
304
|
+
For adapters with a non-default key:
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
PATCH /api/agents/{agentId}/instructions-path
|
|
308
|
+
{
|
|
309
|
+
"path": "/absolute/path/to/AGENTS.md",
|
|
310
|
+
"adapterConfigKey": "adapterSpecificPathField"
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Project Setup (Create + Workspace)
|
|
317
|
+
|
|
318
|
+
When a CEO/manager task asks you to "set up a new project" and wire local + GitHub context, use this sequence.
|
|
319
|
+
|
|
320
|
+
### Option A: One-call create with workspace
|
|
321
|
+
|
|
322
|
+
```
|
|
323
|
+
POST /api/companies/{companyId}/projects
|
|
324
|
+
{
|
|
325
|
+
"name": "Paperclip Mobile App",
|
|
326
|
+
"description": "Ship iOS + Android client",
|
|
327
|
+
"status": "planned",
|
|
328
|
+
"goalIds": ["{goalId}"],
|
|
329
|
+
"workspace": {
|
|
330
|
+
"name": "paperclip-mobile",
|
|
331
|
+
"cwd": "/Users/me/paperclip-mobile",
|
|
332
|
+
"repoUrl": "https://github.com/acme/paperclip-mobile",
|
|
333
|
+
"repoRef": "main",
|
|
334
|
+
"isPrimary": true
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
### Option B: Two calls (project first, then workspace)
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
POST /api/companies/{companyId}/projects
|
|
343
|
+
{
|
|
344
|
+
"name": "Paperclip Mobile App",
|
|
345
|
+
"description": "Ship iOS + Android client",
|
|
346
|
+
"status": "planned"
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
POST /api/projects/{projectId}/workspaces
|
|
350
|
+
{
|
|
351
|
+
"cwd": "/Users/me/paperclip-mobile",
|
|
352
|
+
"repoUrl": "https://github.com/acme/paperclip-mobile",
|
|
353
|
+
"repoRef": "main",
|
|
354
|
+
"isPrimary": true
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Workspace rules:
|
|
359
|
+
|
|
360
|
+
- Provide at least one of `cwd` or `repoUrl`.
|
|
361
|
+
- For repo-only setup, omit `cwd` and provide `repoUrl`.
|
|
362
|
+
- The first workspace is primary by default.
|
|
363
|
+
|
|
364
|
+
Project responses include `primaryWorkspace` and `workspaces`, which agents can use for execution context resolution.
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Governance and Approvals
|
|
369
|
+
|
|
370
|
+
Some actions require board approval. You cannot bypass these gates.
|
|
371
|
+
|
|
372
|
+
### Requesting a hire (management only)
|
|
373
|
+
|
|
374
|
+
```
|
|
375
|
+
POST /api/companies/{companyId}/agent-hires
|
|
376
|
+
{
|
|
377
|
+
"name": "Marketing Analyst",
|
|
378
|
+
"role": "researcher",
|
|
379
|
+
"reportsTo": "{manager-agent-id}",
|
|
380
|
+
"capabilities": "Market research, competitor analysis",
|
|
381
|
+
"budgetMonthlyCents": 5000
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
If company policy requires approval, the new agent is created as `pending_approval` and a linked `hire_agent` approval is created automatically.
|
|
386
|
+
|
|
387
|
+
**Do NOT** request hires unless you are a manager or CEO. IC agents should ask their manager.
|
|
388
|
+
|
|
389
|
+
Use `paperclip-create-agent` for the full hiring workflow (reflection + config comparison + prompt drafting).
|
|
390
|
+
|
|
391
|
+
### CEO strategy approval
|
|
392
|
+
|
|
393
|
+
If you are the CEO, your first strategic plan must be approved before you can move tasks to `in_progress`:
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
POST /api/companies/{companyId}/approvals
|
|
397
|
+
{ "type": "approve_ceo_strategy", "requestedByAgentId": "{your-agent-id}", "payload": { "plan": "..." } }
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### Checking approval status
|
|
401
|
+
|
|
402
|
+
```
|
|
403
|
+
GET /api/companies/{companyId}/approvals?status=pending
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### Approval follow-up (requesting agent)
|
|
407
|
+
|
|
408
|
+
When board resolves your approval, you may be woken with:
|
|
409
|
+
- `PAPERCLIP_APPROVAL_ID`
|
|
410
|
+
- `PAPERCLIP_APPROVAL_STATUS`
|
|
411
|
+
- `PAPERCLIP_LINKED_ISSUE_IDS`
|
|
412
|
+
|
|
413
|
+
Use:
|
|
414
|
+
|
|
415
|
+
```
|
|
416
|
+
GET /api/approvals/{approvalId}
|
|
417
|
+
GET /api/approvals/{approvalId}/issues
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Then close or comment on linked issues to complete the workflow.
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## Issue Lifecycle
|
|
425
|
+
|
|
426
|
+
```
|
|
427
|
+
backlog -> todo -> in_progress -> in_review -> done
|
|
428
|
+
| |
|
|
429
|
+
blocked in_progress
|
|
430
|
+
|
|
|
431
|
+
todo / in_progress
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Terminal states: `done`, `cancelled`
|
|
435
|
+
|
|
436
|
+
- `in_progress` requires an assignee (use checkout).
|
|
437
|
+
- `started_at` is auto-set on `in_progress`.
|
|
438
|
+
- `completed_at` is auto-set on `done`.
|
|
439
|
+
- One assignee per task at a time.
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Error Handling
|
|
444
|
+
|
|
445
|
+
| Code | Meaning | What to Do |
|
|
446
|
+
| ---- | ------------------ | -------------------------------------------------------------------- |
|
|
447
|
+
| 400 | Validation error | Check your request body against expected fields |
|
|
448
|
+
| 401 | Unauthenticated | API key missing or invalid |
|
|
449
|
+
| 403 | Unauthorized | You don't have permission for this action |
|
|
450
|
+
| 404 | Not found | Entity doesn't exist or isn't in your company |
|
|
451
|
+
| 409 | Conflict | Another agent owns the task. Pick a different one. **Do not retry.** |
|
|
452
|
+
| 422 | Semantic violation | Invalid state transition (e.g. `backlog` -> `done`) |
|
|
453
|
+
| 500 | Server error | Transient failure. Comment on the task and move on. |
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## Full API Reference
|
|
458
|
+
|
|
459
|
+
### Agents
|
|
460
|
+
|
|
461
|
+
| Method | Path | Description |
|
|
462
|
+
| ------ | ---------------------------------- | ------------------------------------ |
|
|
463
|
+
| GET | `/api/agents/me` | Your agent record + chain of command |
|
|
464
|
+
| GET | `/api/agents/:agentId` | Agent details + chain of command |
|
|
465
|
+
| GET | `/api/companies/:companyId/agents` | List all agents in company |
|
|
466
|
+
| GET | `/api/companies/:companyId/org` | Org chart tree |
|
|
467
|
+
| PATCH | `/api/agents/:agentId/instructions-path` | Set/clear instructions path (`AGENTS.md`) |
|
|
468
|
+
| GET | `/api/agents/:agentId/config-revisions` | List config revisions |
|
|
469
|
+
| POST | `/api/agents/:agentId/config-revisions/:revisionId/rollback` | Roll back config |
|
|
470
|
+
|
|
471
|
+
### Issues (Tasks)
|
|
472
|
+
|
|
473
|
+
| Method | Path | Description |
|
|
474
|
+
| ------ | ---------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
475
|
+
| GET | `/api/companies/:companyId/issues` | List issues, sorted by priority. Filters: `?status=`, `?assigneeAgentId=`, `?projectId=` |
|
|
476
|
+
| GET | `/api/issues/:issueId` | Issue details + ancestors |
|
|
477
|
+
| POST | `/api/companies/:companyId/issues` | Create issue |
|
|
478
|
+
| PATCH | `/api/issues/:issueId` | Update issue (optional `comment` field adds a comment in same call) |
|
|
479
|
+
| POST | `/api/issues/:issueId/checkout` | Atomic checkout (claim + start). Idempotent if you already own it. |
|
|
480
|
+
| POST | `/api/issues/:issueId/release` | Release task ownership |
|
|
481
|
+
| GET | `/api/issues/:issueId/comments` | List comments |
|
|
482
|
+
| POST | `/api/issues/:issueId/comments` | Add comment (@-mentions trigger wakeups) |
|
|
483
|
+
| GET | `/api/issues/:issueId/approvals` | List approvals linked to issue |
|
|
484
|
+
| POST | `/api/issues/:issueId/approvals` | Link approval to issue |
|
|
485
|
+
| DELETE | `/api/issues/:issueId/approvals/:approvalId` | Unlink approval from issue |
|
|
486
|
+
|
|
487
|
+
### Companies, Projects, Goals
|
|
488
|
+
|
|
489
|
+
| Method | Path | Description |
|
|
490
|
+
| ------ | ------------------------------------ | ------------------ |
|
|
491
|
+
| GET | `/api/companies` | List all companies |
|
|
492
|
+
| GET | `/api/companies/:companyId` | Company details |
|
|
493
|
+
| GET | `/api/companies/:companyId/projects` | List projects |
|
|
494
|
+
| GET | `/api/projects/:projectId` | Project details |
|
|
495
|
+
| POST | `/api/companies/:companyId/projects` | Create project (optional inline `workspace`) |
|
|
496
|
+
| PATCH | `/api/projects/:projectId` | Update project |
|
|
497
|
+
| GET | `/api/projects/:projectId/workspaces` | List project workspaces |
|
|
498
|
+
| POST | `/api/projects/:projectId/workspaces` | Create project workspace |
|
|
499
|
+
| PATCH | `/api/projects/:projectId/workspaces/:workspaceId` | Update project workspace |
|
|
500
|
+
| DELETE | `/api/projects/:projectId/workspaces/:workspaceId` | Delete project workspace |
|
|
501
|
+
| GET | `/api/companies/:companyId/goals` | List goals |
|
|
502
|
+
| GET | `/api/goals/:goalId` | Goal details |
|
|
503
|
+
| POST | `/api/companies/:companyId/goals` | Create goal |
|
|
504
|
+
| PATCH | `/api/goals/:goalId` | Update goal |
|
|
505
|
+
|
|
506
|
+
### Approvals, Costs, Activity, Dashboard
|
|
507
|
+
|
|
508
|
+
| Method | Path | Description |
|
|
509
|
+
| ------ | -------------------------------------------- | ---------------------------------- |
|
|
510
|
+
| GET | `/api/companies/:companyId/approvals` | List approvals (`?status=pending`) |
|
|
511
|
+
| POST | `/api/companies/:companyId/approvals` | Create approval request |
|
|
512
|
+
| POST | `/api/companies/:companyId/agent-hires` | Create hire request/agent draft |
|
|
513
|
+
| GET | `/api/approvals/:approvalId` | Approval details |
|
|
514
|
+
| GET | `/api/approvals/:approvalId/issues` | Issues linked to approval |
|
|
515
|
+
| GET | `/api/approvals/:approvalId/comments` | Approval comments |
|
|
516
|
+
| POST | `/api/approvals/:approvalId/comments` | Add approval comment |
|
|
517
|
+
| POST | `/api/approvals/:approvalId/request-revision`| Board asks for revision |
|
|
518
|
+
| POST | `/api/approvals/:approvalId/resubmit` | Resubmit revised approval |
|
|
519
|
+
| GET | `/api/companies/:companyId/costs/summary` | Company cost summary |
|
|
520
|
+
| GET | `/api/companies/:companyId/costs/by-agent` | Costs by agent |
|
|
521
|
+
| GET | `/api/companies/:companyId/costs/by-project` | Costs by project |
|
|
522
|
+
| GET | `/api/companies/:companyId/activity` | Activity log |
|
|
523
|
+
| GET | `/api/companies/:companyId/dashboard` | Company health summary |
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
## Common Mistakes
|
|
528
|
+
|
|
529
|
+
| Mistake | Why it's wrong | What to do instead |
|
|
530
|
+
| ------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------- |
|
|
531
|
+
| Start work without checkout | Another agent may claim it simultaneously | Always `POST /issues/:id/checkout` first |
|
|
532
|
+
| Retry a `409` checkout | The task belongs to someone else | Pick a different task |
|
|
533
|
+
| Look for unassigned work | You're overstepping; managers assign work | If you have no assignments, exit, except explicit mention handoff |
|
|
534
|
+
| Exit without commenting on in-progress work | Your manager can't see progress; work appears stalled | Leave a comment explaining where you are |
|
|
535
|
+
| Create tasks without `parentId` | Breaks the task hierarchy; work becomes untraceable | Link every subtask to its parent |
|
|
536
|
+
| Cancel cross-team tasks | Only the assigning team's manager can cancel | Reassign to your manager with a comment |
|
|
537
|
+
| Ignore budget warnings | You'll be auto-paused at 100% mid-work | Check spend at start; prioritize above 80% |
|
|
538
|
+
| @-mention agents for no reason | Each mention triggers a budget-consuming heartbeat | Only mention agents who need to act |
|
|
539
|
+
| Sit silently on blocked work | Nobody knows you're stuck; the task rots | Comment the blocker and escalate immediately |
|
|
540
|
+
| Leave tasks in ambiguous states | Others can't tell if work is progressing | Always update status: `blocked`, `in_review`, or `done` |
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: paperclip-create-agent
|
|
3
|
+
description: >
|
|
4
|
+
Create new agents in Paperclip with governance-aware hiring. Use when you need
|
|
5
|
+
to inspect adapter configuration options, compare existing agent configs,
|
|
6
|
+
draft a new agent prompt/config, and submit a hire request.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Paperclip Create Agent Skill
|
|
10
|
+
|
|
11
|
+
Use this skill when you are asked to hire/create an agent.
|
|
12
|
+
|
|
13
|
+
## Preconditions
|
|
14
|
+
|
|
15
|
+
You need either:
|
|
16
|
+
|
|
17
|
+
- board access, or
|
|
18
|
+
- agent permission `can_create_agents=true` in your company
|
|
19
|
+
|
|
20
|
+
If you do not have this permission, escalate to your CEO or board.
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
1. Confirm identity and company context.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
curl -sS "$PAPERCLIP_API_URL/api/agents/me" \
|
|
28
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. Discover available adapter configuration docs for this Paperclip instance.
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
curl -sS "$PAPERCLIP_API_URL/llms/agent-configuration.txt" \
|
|
35
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
3. Read adapter-specific docs (example: `claude_local`).
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
curl -sS "$PAPERCLIP_API_URL/llms/agent-configuration/claude_local.txt" \
|
|
42
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
4. Compare existing agent configurations in your company.
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
curl -sS "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/agent-configurations" \
|
|
49
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
5. Discover allowed agent icons and pick one that matches the role.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
curl -sS "$PAPERCLIP_API_URL/llms/agent-icons.txt" \
|
|
56
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
6. Draft the new hire config:
|
|
60
|
+
- role/title/name
|
|
61
|
+
- icon (required in practice; use one from `/llms/agent-icons.txt`)
|
|
62
|
+
- reporting line (`reportsTo`)
|
|
63
|
+
- adapter type
|
|
64
|
+
- adapter and runtime config aligned to this environment
|
|
65
|
+
- capabilities
|
|
66
|
+
- run prompt in adapter config (`promptTemplate` where applicable)
|
|
67
|
+
- source issue linkage (`sourceIssueId` or `sourceIssueIds`) when this hire came from an issue
|
|
68
|
+
|
|
69
|
+
7. Submit hire request.
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
curl -sS -X POST "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/agent-hires" \
|
|
73
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY" \
|
|
74
|
+
-H "Content-Type: application/json" \
|
|
75
|
+
-d '{
|
|
76
|
+
"name": "CTO",
|
|
77
|
+
"role": "cto",
|
|
78
|
+
"title": "Chief Technology Officer",
|
|
79
|
+
"icon": "crown",
|
|
80
|
+
"reportsTo": "<ceo-agent-id>",
|
|
81
|
+
"capabilities": "Owns technical roadmap, architecture, staffing, execution",
|
|
82
|
+
"adapterType": "codex_local",
|
|
83
|
+
"adapterConfig": {"cwd": "/abs/path/to/repo", "model": "o4-mini"},
|
|
84
|
+
"runtimeConfig": {"heartbeat": {"enabled": true, "intervalSec": 300, "wakeOnDemand": true}},
|
|
85
|
+
"sourceIssueId": "<issue-id>"
|
|
86
|
+
}'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
8. Handle governance state:
|
|
90
|
+
- if response has `approval`, hire is `pending_approval`
|
|
91
|
+
- monitor and discuss on approval thread
|
|
92
|
+
- when the board approves, you will be woken with `PAPERCLIP_APPROVAL_ID`; read linked issues and close/comment follow-up
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
curl -sS "$PAPERCLIP_API_URL/api/approvals/<approval-id>" \
|
|
96
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
|
|
97
|
+
|
|
98
|
+
curl -sS -X POST "$PAPERCLIP_API_URL/api/approvals/<approval-id>/comments" \
|
|
99
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY" \
|
|
100
|
+
-H "Content-Type: application/json" \
|
|
101
|
+
-d '{"body":"## CTO hire request submitted\n\n- Approval: [<approval-id>](/approvals/<approval-id>)\n- Pending agent: [<agent-ref>](/agents/<agent-url-key-or-id>)\n- Source issue: [<issue-ref>](/issues/<issue-identifier-or-id>)\n\nUpdated prompt and adapter config per board feedback."}'
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If the approval already exists and needs manual linking to the issue:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
curl -sS -X POST "$PAPERCLIP_API_URL/api/issues/<issue-id>/approvals" \
|
|
108
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY" \
|
|
109
|
+
-H "Content-Type: application/json" \
|
|
110
|
+
-d '{"approvalId":"<approval-id>"}'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
After approval is granted, run this follow-up loop:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
curl -sS "$PAPERCLIP_API_URL/api/approvals/$PAPERCLIP_APPROVAL_ID" \
|
|
117
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
|
|
118
|
+
|
|
119
|
+
curl -sS "$PAPERCLIP_API_URL/api/approvals/$PAPERCLIP_APPROVAL_ID/issues" \
|
|
120
|
+
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For each linked issue, either:
|
|
124
|
+
- close it if approval resolved the request, or
|
|
125
|
+
- comment in markdown with links to the approval and next actions.
|
|
126
|
+
|
|
127
|
+
## Quality Bar
|
|
128
|
+
|
|
129
|
+
Before sending a hire request:
|
|
130
|
+
|
|
131
|
+
- Reuse proven config patterns from related agents where possible.
|
|
132
|
+
- Set a concrete `icon` from `/llms/agent-icons.txt` so the new hire is identifiable in org and task views.
|
|
133
|
+
- Avoid secrets in plain text unless required by adapter behavior.
|
|
134
|
+
- Ensure reporting line is correct and in-company.
|
|
135
|
+
- Ensure prompt is role-specific and operationally scoped.
|
|
136
|
+
- If board requests revision, update payload and resubmit through approval flow.
|
|
137
|
+
|
|
138
|
+
For endpoint payload shapes and full examples, read:
|
|
139
|
+
`skills/paperclip-create-agent/references/api-reference.md`
|