@fro.bot/systematic 2.33.3 → 3.0.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.
- package/ATTRIBUTIONS.md +1 -1
- package/agents/design/design-iterator.md +1 -0
- package/agents/research/best-practices-researcher.md +6 -8
- package/agents/review/pattern-recognition-specialist.md +1 -1
- package/agents/workflow/systematic-implementer.md +1 -0
- package/dist/cli.js +348 -53
- package/dist/{index-vyzhzvap.js → index-yskzf7vh.js} +587 -386
- package/dist/index.js +100 -155
- package/dist/lib/agent-overlays.d.ts +0 -1
- package/dist/lib/agent-resolver.d.ts +28 -0
- package/dist/lib/bootstrap.d.ts +8 -1
- package/dist/lib/bundled-names.d.ts +3 -3
- package/dist/lib/pi-delegate-session.d.ts +31 -0
- package/dist/lib/pi-delegate-tool.d.ts +42 -0
- package/dist/lib/removed-names.d.ts +3 -3
- package/dist/lib/setup.d.ts +36 -0
- package/dist/lib/skill-loader.d.ts +1 -2
- package/dist/lib/skill-resolver.d.ts +39 -0
- package/dist/lib/skill-tool.d.ts +2 -11
- package/dist/lib/skills.d.ts +1 -9
- package/dist/lib/source-model-defaults.d.ts +1 -1
- package/dist/pi.d.ts +7 -0
- package/dist/pi.js +3641 -0
- package/dist/schemas/systematic-config.schema.json +47 -242
- package/package.json +29 -6
- package/skills/ce-brainstorm/references/handoff.md +5 -26
- package/skills/ce-brainstorm/references/universal-brainstorming.md +0 -1
- package/skills/ce-compound/SKILL.md +8 -12
- package/skills/ce-ideate/references/post-ideation-workflow.md +21 -85
- package/skills/ce-plan/SKILL.md +6 -6
- package/skills/ce-plan/references/deepening-workflow.md +6 -7
- package/skills/ce-plan/references/plan-handoff.md +1 -17
- package/skills/ce-plan/references/universal-planning.md +0 -4
- package/skills/ce-review/SKILL.md +10 -19
- package/skills/ce-review/references/persona-catalog.md +2 -7
- package/skills/ce-review/references/review-output-template.md +0 -1
- package/skills/ce-work/SKILL.md +1 -1
- package/skills/deepen-plan/SKILL.md +6 -7
- package/skills/document-review/SKILL.md +2 -2
- package/skills/git-commit-push-pr/SKILL.md +1 -2
- package/skills/lfg/SKILL.md +1 -1
- package/skills/onboarding/SKILL.md +1 -12
- package/skills/orchestrating-subagents/SKILL.md +2 -2
- package/skills/slfg/SKILL.md +2 -3
- package/skills/test-browser/SKILL.md +2 -2
- package/skills/todos/SKILL.md +239 -0
- package/skills/writing-skills/SKILL.md +102 -1
- package/skills/{writing-systematic-skills → writing-skills}/references/foundation-conventions.md +5 -5
- package/agents/design/design-implementation-reviewer.md +0 -95
- package/agents/design/figma-design-sync.md +0 -173
- package/agents/docs/ankane-readme-writer.md +0 -51
- package/agents/review/cli-agent-readiness-reviewer.md +0 -418
- package/agents/review/data-integrity-guardian.md +0 -72
- package/agents/review/data-migration-expert.md +0 -99
- package/agents/review/dhh-rails-reviewer.md +0 -46
- package/agents/review/julik-frontend-races-reviewer.md +0 -49
- package/agents/review/kieran-python-reviewer.md +0 -47
- package/agents/review/kieran-rails-reviewer.md +0 -47
- package/agents/review/performance-oracle.md +0 -112
- package/agents/review/schema-drift-detector.md +0 -143
- package/agents/review/security-sentinel.md +0 -95
- package/agents/workflow/lint.md +0 -17
- package/dist/lib/converter.d.ts +0 -14
- package/skills/andrew-kane-gem-writer/SKILL.md +0 -184
- package/skills/andrew-kane-gem-writer/references/database-adapters.md +0 -231
- package/skills/andrew-kane-gem-writer/references/module-organization.md +0 -121
- package/skills/andrew-kane-gem-writer/references/rails-integration.md +0 -183
- package/skills/andrew-kane-gem-writer/references/resources.md +0 -119
- package/skills/andrew-kane-gem-writer/references/testing-patterns.md +0 -261
- package/skills/changelog/SKILL.md +0 -139
- package/skills/claude-permissions-optimizer/SKILL.md +0 -166
- package/skills/claude-permissions-optimizer/scripts/extract-commands.mjs +0 -655
- package/skills/claude-permissions-optimizer/scripts/normalize.mjs +0 -151
- package/skills/dhh-rails-style/SKILL.md +0 -186
- package/skills/dhh-rails-style/references/architecture.md +0 -653
- package/skills/dhh-rails-style/references/controllers.md +0 -303
- package/skills/dhh-rails-style/references/frontend.md +0 -510
- package/skills/dhh-rails-style/references/gems.md +0 -266
- package/skills/dhh-rails-style/references/models.md +0 -359
- package/skills/dhh-rails-style/references/testing.md +0 -338
- package/skills/dspy-ruby/SKILL.md +0 -737
- package/skills/dspy-ruby/assets/config-template.rb +0 -187
- package/skills/dspy-ruby/assets/module-template.rb +0 -300
- package/skills/dspy-ruby/assets/signature-template.rb +0 -221
- package/skills/dspy-ruby/references/core-concepts.md +0 -674
- package/skills/dspy-ruby/references/observability.md +0 -366
- package/skills/dspy-ruby/references/optimization.md +0 -603
- package/skills/dspy-ruby/references/providers.md +0 -418
- package/skills/dspy-ruby/references/toolsets.md +0 -502
- package/skills/every-style-editor/SKILL.md +0 -135
- package/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +0 -529
- package/skills/feature-video/SKILL.md +0 -383
- package/skills/gemini-imagegen/SKILL.md +0 -237
- package/skills/gemini-imagegen/requirements.txt +0 -2
- package/skills/gemini-imagegen/scripts/compose_images.py +0 -157
- package/skills/gemini-imagegen/scripts/edit_image.py +0 -144
- package/skills/gemini-imagegen/scripts/gemini_images.py +0 -263
- package/skills/gemini-imagegen/scripts/generate_image.py +0 -133
- package/skills/gemini-imagegen/scripts/multi_turn_chat.py +0 -216
- package/skills/generate_command/SKILL.md +0 -164
- package/skills/orchestrating-swarms/SKILL.md +0 -1723
- package/skills/proof/SKILL.md +0 -291
- package/skills/proof/references/hitl-review.md +0 -368
- package/skills/rclone/SKILL.md +0 -150
- package/skills/rclone/scripts/check_setup.sh +0 -60
- package/skills/setup/SKILL.md +0 -22
- package/skills/test-xcode/SKILL.md +0 -214
- package/skills/todo-create/SKILL.md +0 -109
- package/skills/todo-resolve/SKILL.md +0 -68
- package/skills/todo-triage/SKILL.md +0 -70
- package/skills/writing-systematic-skills/SKILL.md +0 -119
- /package/skills/{todo-create → todos}/assets/todo-template.md +0 -0
package/skills/proof/SKILL.md
DELETED
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: proof
|
|
3
|
-
description: Create, edit, comment on, share, and run human-in-the-loop iteration loops over markdown documents via Proof's web API. Use when asked to "proof", "share a doc", "create a proof doc", "comment on a document", "suggest edits", "review in proof", "iterate on this doc in proof", "HITL this doc", "sync a Proof doc to local", when a caller needs an HITL review loop over a local markdown file (e.g., ce-brainstorm, ce-ideate, or ce-plan handoff), or when given a proofeditor.ai URL. Prefer this skill for any workflow whose output is a Proof URL or that uses a Proof doc as the review surface, even when not named explicitly.
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- WebFetch
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Proof - Collaborative Markdown Editor
|
|
12
|
-
|
|
13
|
-
Proof is a collaborative document editor for humans and agents. It supports two modes:
|
|
14
|
-
|
|
15
|
-
1. **Web API** - Create and edit shared documents via HTTP (no install needed)
|
|
16
|
-
2. **Local Bridge** - Drive the macOS Proof app via localhost:9847
|
|
17
|
-
|
|
18
|
-
## Identity and Attribution
|
|
19
|
-
|
|
20
|
-
Every write to a Proof doc must be attributed. Two fields carry the agent's identity:
|
|
21
|
-
|
|
22
|
-
- **Machine ID (`by` on every op, `X-Agent-Id` header):** `ai:systematic` — stable, lowercase-hyphenated, machine-parseable. Appears in marks, events, and the API response.
|
|
23
|
-
- **Display name (`name` on `POST /presence`):** `Systematic` — human-readable, shown in Proof's presence chips and comment-author badges.
|
|
24
|
-
|
|
25
|
-
Set the display name once per doc session by posting to presence with the `X-Agent-Id` header; Proof binds the name to that agent ID for the session. These values are the defaults for any caller of this skill; callers running HITL review (`references/hitl-review.md`) may pass a different `identity` pair if a distinct sub-agent should own the doc. Do not use `ai:compound` or other ad-hoc variants — identity stays uniform unless a caller explicitly overrides it.
|
|
26
|
-
|
|
27
|
-
## Human-in-the-Loop Review Mode
|
|
28
|
-
|
|
29
|
-
When a caller (e.g., `ce-brainstorm`, `ce-plan`) needs to upload a local markdown doc, collect structured human feedback in Proof, and sync the final doc back to disk, load `references/hitl-review.md` for the full loop spec: invocation contract, mark classification (change / question / objection / ambiguous), idempotent ingest passes, exception-based terminal reporting, and end-sync atomic write.
|
|
30
|
-
|
|
31
|
-
## Web API (Primary for Sharing)
|
|
32
|
-
|
|
33
|
-
### Create a Shared Document
|
|
34
|
-
|
|
35
|
-
No authentication required. Returns a shareable URL with access token.
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
curl -X POST https://www.proofeditor.ai/share/markdown \
|
|
39
|
-
-H "Content-Type: application/json" \
|
|
40
|
-
-d '{"title":"My Doc","markdown":"# Hello\n\nContent here."}'
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**Response format:**
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"slug": "abc123",
|
|
47
|
-
"tokenUrl": "https://www.proofeditor.ai/d/abc123?token=xxx",
|
|
48
|
-
"accessToken": "xxx",
|
|
49
|
-
"ownerSecret": "yyy",
|
|
50
|
-
"_links": {
|
|
51
|
-
"state": "https://www.proofeditor.ai/api/agent/abc123/state",
|
|
52
|
-
"ops": "https://www.proofeditor.ai/api/agent/abc123/ops"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Use the `tokenUrl` as the shareable link. The `_links` give you the exact API paths.
|
|
58
|
-
|
|
59
|
-
### Read a Shared Document
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
curl -s "https://www.proofeditor.ai/api/agent/{slug}/state" \
|
|
63
|
-
-H "x-share-token: <token>"
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Edit a Shared Document
|
|
67
|
-
|
|
68
|
-
All operations go to `POST https://www.proofeditor.ai/api/agent/{slug}/ops`
|
|
69
|
-
|
|
70
|
-
**Note:** Use the `/api/agent/{slug}/ops` path (from `_links` in create response), NOT `/api/documents/{slug}/ops`.
|
|
71
|
-
|
|
72
|
-
**Authentication for protected docs:**
|
|
73
|
-
- Header: `x-share-token: <token>` or `Authorization: Bearer <token>`
|
|
74
|
-
- Token comes from the URL parameter: `?token=xxx` or the `accessToken` from create response
|
|
75
|
-
- Header: `X-Agent-Id: ai:systematic` (required for presence; include on ops for consistent attribution)
|
|
76
|
-
|
|
77
|
-
**Wire-format reminder.** `/api/agent/{slug}/ops` uses a top-level `type` field; `/api/agent/{slug}/edit/v2` uses an `operations` array where each entry has `op`. Do not mix — sending `op` to `/ops` returns 422.
|
|
78
|
-
|
|
79
|
-
**Every mutation requires a `baseToken`.** Read it from `/state.mutationBase.token` (or `/snapshot.mutationBase.token`) immediately before each write, and include it in the request body. On `BASE_TOKEN_REQUIRED` or `STALE_BASE`, re-read and retry once. See the baseToken recipe in `references/hitl-review.md`.
|
|
80
|
-
|
|
81
|
-
**`Idempotency-Key` header** is recommended on every mutation for safe automation retries; required when `/state.contract.idempotencyRequired` is true.
|
|
82
|
-
|
|
83
|
-
**Comment on text:**
|
|
84
|
-
```json
|
|
85
|
-
{"type": "comment.add", "quote": "text to comment on", "by": "ai:systematic", "text": "Your comment here", "baseToken": "<token>"}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Reply to a comment:**
|
|
89
|
-
```json
|
|
90
|
-
{"type": "comment.reply", "markId": "<id>", "by": "ai:systematic", "text": "Reply text", "baseToken": "<token>"}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**Resolve / unresolve a comment:**
|
|
94
|
-
```json
|
|
95
|
-
{"type": "comment.resolve", "markId": "<id>", "by": "ai:systematic", "baseToken": "<token>"}
|
|
96
|
-
{"type": "comment.unresolve", "markId": "<id>", "by": "ai:systematic", "baseToken": "<token>"}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**Suggest a replacement (pending — user must accept/reject):**
|
|
100
|
-
```json
|
|
101
|
-
{"type": "suggestion.add", "kind": "replace", "quote": "original text", "by": "ai:systematic", "content": "replacement text", "baseToken": "<token>"}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
**Suggest and immediately apply (tracked but committed — user can reject to revert):**
|
|
105
|
-
```json
|
|
106
|
-
{"type": "suggestion.add", "kind": "replace", "quote": "original text", "by": "ai:systematic", "content": "replacement text", "status": "accepted", "baseToken": "<token>"}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
`status: "accepted"` creates the suggestion mark and commits the change in one call. The mark persists as an audit trail with per-edit attribution and a reject-to-revert affordance. Works with `kind: "insert" | "delete" | "replace"`.
|
|
110
|
-
|
|
111
|
-
**Accept or reject an existing suggestion:**
|
|
112
|
-
```json
|
|
113
|
-
{"type": "suggestion.accept", "markId": "<id>", "by": "ai:systematic", "baseToken": "<token>"}
|
|
114
|
-
{"type": "suggestion.reject", "markId": "<id>", "by": "ai:systematic", "baseToken": "<token>"}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
`suggestion.resolve` is not supported — use accept or reject instead.
|
|
118
|
-
|
|
119
|
-
**Bulk rewrite (whole-doc replacement):**
|
|
120
|
-
```json
|
|
121
|
-
{"type": "rewrite.apply", "content": "full new markdown", "by": "ai:systematic", "baseToken": "<token>"}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
**Block-level edits via `/edit/v2`** (separate endpoint, separate shape):
|
|
125
|
-
```bash
|
|
126
|
-
curl -X POST "https://www.proofeditor.ai/api/agent/{slug}/edit/v2" \
|
|
127
|
-
-H "Content-Type: application/json" \
|
|
128
|
-
-H "x-share-token: <token>" \
|
|
129
|
-
-H "X-Agent-Id: ai:systematic" \
|
|
130
|
-
-H "Idempotency-Key: <uuid>" \
|
|
131
|
-
-d '{
|
|
132
|
-
"by": "ai:systematic",
|
|
133
|
-
"baseToken": "mt1:<token>",
|
|
134
|
-
"operations": [
|
|
135
|
-
{"op": "replace_block", "ref": "b3", "block": {"markdown": "Updated paragraph."}},
|
|
136
|
-
{"op": "insert_after", "ref": "b3", "block": {"markdown": "## New section"}}
|
|
137
|
-
]
|
|
138
|
-
}'
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Supported `op` kinds inside `operations`: `replace_block`, `insert_before`, `insert_after`, `delete_block`, `replace_range` (uses `fromRef` + `toRef`), `find_replace_in_block` (takes `occurrence: "first" | "all"`). Read `/snapshot` to get stable block `ref` IDs and the `mutationBase.token`.
|
|
142
|
-
|
|
143
|
-
**Editing while a client is connected is fine.** `/edit/v2`, `suggestion.add` (including `status: "accepted"`), and all comment ops work during active collab. Only `rewrite.apply` is blocked by `LIVE_CLIENTS_PRESENT` — it would clobber in-flight Yjs edits.
|
|
144
|
-
|
|
145
|
-
**When the loop breaks.** If a mutation keeps failing after a fresh read and one retry, or state across reads looks inconsistent, call `POST https://www.proofeditor.ai/api/bridge/report_bug` with the failing request ID, slug, and raw response. The server enriches and files an issue.
|
|
146
|
-
|
|
147
|
-
### Known Limitations (Web API)
|
|
148
|
-
|
|
149
|
-
- Bridge-style endpoints (`/d/{slug}/bridge/*`) require client version headers (`x-proof-client-version`, `x-proof-client-build`, `x-proof-client-protocol`) and return 426 CLIENT_UPGRADE_REQUIRED without them. Use `/api/agent/{slug}/ops` instead.
|
|
150
|
-
|
|
151
|
-
## Local Bridge (macOS App)
|
|
152
|
-
|
|
153
|
-
Requires Proof.app running. Bridge at `http://localhost:9847`.
|
|
154
|
-
|
|
155
|
-
**Required headers:**
|
|
156
|
-
- `X-Agent-Id: claude` (identity for presence)
|
|
157
|
-
- `Content-Type: application/json`
|
|
158
|
-
- `X-Window-Id: <uuid>` (when multiple docs open)
|
|
159
|
-
|
|
160
|
-
### Key Endpoints
|
|
161
|
-
|
|
162
|
-
| Method | Endpoint | Purpose |
|
|
163
|
-
|--------|----------|---------|
|
|
164
|
-
| GET | `/windows` | List open documents |
|
|
165
|
-
| GET | `/state` | Read markdown, cursor, word count |
|
|
166
|
-
| GET | `/marks` | List all suggestions and comments |
|
|
167
|
-
| POST | `/marks/suggest-replace` | `{"quote":"old","by":"ai:systematic","content":"new"}` |
|
|
168
|
-
| POST | `/marks/suggest-insert` | `{"quote":"after this","by":"ai:systematic","content":"insert"}` |
|
|
169
|
-
| POST | `/marks/suggest-delete` | `{"quote":"delete this","by":"ai:systematic"}` |
|
|
170
|
-
| POST | `/marks/comment` | `{"quote":"text","by":"ai:systematic","text":"comment"}` |
|
|
171
|
-
| POST | `/marks/reply` | `{"markId":"<id>","by":"ai:systematic","text":"reply"}` |
|
|
172
|
-
| POST | `/marks/resolve` | `{"markId":"<id>","by":"ai:systematic"}` |
|
|
173
|
-
| POST | `/marks/accept` | `{"markId":"<id>"}` |
|
|
174
|
-
| POST | `/marks/reject` | `{"markId":"<id>"}` |
|
|
175
|
-
| POST | `/rewrite` | `{"content":"full markdown","by":"ai:systematic"}` |
|
|
176
|
-
| POST | `/presence` | `{"status":"reading","summary":"..."}` |
|
|
177
|
-
| GET | `/events/pending` | Poll for user actions |
|
|
178
|
-
|
|
179
|
-
### Presence Statuses
|
|
180
|
-
|
|
181
|
-
`thinking`, `reading`, `idle`, `acting`, `waiting`, `completed`
|
|
182
|
-
|
|
183
|
-
## Workflow: Review a Shared Document
|
|
184
|
-
|
|
185
|
-
When given a Proof URL like `https://www.proofeditor.ai/d/abc123?token=xxx`:
|
|
186
|
-
|
|
187
|
-
1. Extract the slug (`abc123`) and token from the URL
|
|
188
|
-
2. Read the document state via the API
|
|
189
|
-
3. Add comments or suggest edits using the ops endpoint
|
|
190
|
-
4. The author sees changes in real-time
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
# Read
|
|
194
|
-
curl -s "https://www.proofeditor.ai/api/agent/abc123/state" \
|
|
195
|
-
-H "x-share-token: xxx"
|
|
196
|
-
|
|
197
|
-
# Get baseToken for the next mutation
|
|
198
|
-
BASE=$(curl -s "https://www.proofeditor.ai/api/agent/abc123/state" \
|
|
199
|
-
-H "x-share-token: xxx" | jq -r '.mutationBase.token')
|
|
200
|
-
|
|
201
|
-
# Comment
|
|
202
|
-
curl -X POST "https://www.proofeditor.ai/api/agent/abc123/ops" \
|
|
203
|
-
-H "Content-Type: application/json" \
|
|
204
|
-
-H "x-share-token: xxx" \
|
|
205
|
-
-H "X-Agent-Id: ai:systematic" \
|
|
206
|
-
-d "$(jq -n --arg base "$BASE" '{type:"comment.add",quote:"text",by:"ai:systematic",text:"comment",baseToken:$base}')"
|
|
207
|
-
|
|
208
|
-
# Suggest edit (tracked, pending)
|
|
209
|
-
curl -X POST "https://www.proofeditor.ai/api/agent/abc123/ops" \
|
|
210
|
-
-H "Content-Type: application/json" \
|
|
211
|
-
-H "x-share-token: xxx" \
|
|
212
|
-
-H "X-Agent-Id: ai:systematic" \
|
|
213
|
-
-d "$(jq -n --arg base "$BASE" '{type:"suggestion.add",kind:"replace",quote:"old",by:"ai:systematic",content:"new",baseToken:$base}')"
|
|
214
|
-
|
|
215
|
-
# Suggest and immediately apply (tracked, committed)
|
|
216
|
-
curl -X POST "https://www.proofeditor.ai/api/agent/abc123/ops" \
|
|
217
|
-
-H "Content-Type: application/json" \
|
|
218
|
-
-H "x-share-token: xxx" \
|
|
219
|
-
-H "X-Agent-Id: ai:systematic" \
|
|
220
|
-
-d "$(jq -n --arg base "$BASE" '{type:"suggestion.add",kind:"replace",quote:"old",by:"ai:systematic",content:"new",status:"accepted",baseToken:$base}')"
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
## Workflow: Create and Share a New Document
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
# 1. Create
|
|
227
|
-
RESPONSE=$(curl -s -X POST https://www.proofeditor.ai/share/markdown \
|
|
228
|
-
-H "Content-Type: application/json" \
|
|
229
|
-
-d '{"title":"My Doc","markdown":"# Title\n\nContent here."}')
|
|
230
|
-
|
|
231
|
-
# 2. Extract URL and token
|
|
232
|
-
URL=$(echo "$RESPONSE" | jq -r '.tokenUrl')
|
|
233
|
-
SLUG=$(echo "$RESPONSE" | jq -r '.slug')
|
|
234
|
-
TOKEN=$(echo "$RESPONSE" | jq -r '.accessToken')
|
|
235
|
-
|
|
236
|
-
# 3. Bind display name via presence
|
|
237
|
-
curl -s -X POST "https://www.proofeditor.ai/api/agent/$SLUG/presence" \
|
|
238
|
-
-H "Content-Type: application/json" \
|
|
239
|
-
-H "x-share-token: $TOKEN" \
|
|
240
|
-
-H "X-Agent-Id: ai:systematic" \
|
|
241
|
-
-d '{"name":"Systematic","status":"reading","summary":"Uploaded doc"}'
|
|
242
|
-
|
|
243
|
-
# 4. Share the URL
|
|
244
|
-
echo "$URL"
|
|
245
|
-
|
|
246
|
-
# 5. Make edits using the ops endpoint (baseToken required)
|
|
247
|
-
BASE=$(curl -s "https://www.proofeditor.ai/api/agent/$SLUG/state" \
|
|
248
|
-
-H "x-share-token: $TOKEN" | jq -r '.mutationBase.token')
|
|
249
|
-
curl -X POST "https://www.proofeditor.ai/api/agent/$SLUG/ops" \
|
|
250
|
-
-H "Content-Type: application/json" \
|
|
251
|
-
-H "x-share-token: $TOKEN" \
|
|
252
|
-
-H "X-Agent-Id: ai:systematic" \
|
|
253
|
-
-d "$(jq -n --arg base "$BASE" '{type:"comment.add",quote:"Content here",by:"ai:systematic",text:"Added a note",baseToken:$base}')"
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
## Workflow: Pull a Proof Doc to Local
|
|
257
|
-
|
|
258
|
-
Sync the current Proof doc state to a local markdown file. Used by:
|
|
259
|
-
|
|
260
|
-
- HITL review end-sync (`references/hitl-review.md` Phase 5) when the doc originated from a local file
|
|
261
|
-
- Ad-hoc snapshots of a Proof doc to disk (before closing the tab, archiving, handing off)
|
|
262
|
-
- Refreshing a local working copy against the live Proof version
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
SLUG=<slug>
|
|
266
|
-
TOKEN=<accessToken>
|
|
267
|
-
LOCAL=<absolute-path>
|
|
268
|
-
|
|
269
|
-
# One read to a temp file — avoids passing markdown through $(...), which would strip trailing newlines.
|
|
270
|
-
STATE_TMP=$(mktemp)
|
|
271
|
-
curl -s "https://www.proofeditor.ai/api/agent/$SLUG/state" \
|
|
272
|
-
-H "x-share-token: $TOKEN" > "$STATE_TMP"
|
|
273
|
-
REVISION=$(jq -r '.revision' "$STATE_TMP")
|
|
274
|
-
|
|
275
|
-
# Atomic write: stream .markdown bytes directly to a temp sibling, then rename.
|
|
276
|
-
TMP="${LOCAL}.proof-sync.$$"
|
|
277
|
-
jq -jr '.markdown' "$STATE_TMP" > "$TMP" && mv "$TMP" "$LOCAL"
|
|
278
|
-
rm "$STATE_TMP"
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
`jq -jr` (`-j` no trailing newline, `-r` raw string) streams the markdown bytes straight to the temp file without going through a shell variable, so trailing newlines survive intact. `mv` within the same filesystem is atomic — a crashed write leaves the original untouched rather than a half-written file.
|
|
282
|
-
|
|
283
|
-
**Confirm before writing when the pull isn't directly asked for.** If a workflow ends up pulling as a side-effect of a different action (e.g., HITL review completion), surface the impending write with a short confirm like "Sync reviewed doc to `<localPath>`?" A silent overwrite is surprising — the user may have forgotten the local file exists in that session, or expected Proof to stay canonical until they explicitly asked to pull.
|
|
284
|
-
|
|
285
|
-
## Safety
|
|
286
|
-
|
|
287
|
-
- Use `/state` content as source of truth before editing
|
|
288
|
-
- During active collab use `edit/v2` (direct block changes) or `suggestion.add` (tracked changes); reserve `rewrite.apply` for no-client scenarios since it's blocked by `LIVE_CLIENTS_PRESENT` when anyone is connected
|
|
289
|
-
- Don't span table cells in a single replace
|
|
290
|
-
- Always include `by: "ai:systematic"` on every op and `X-Agent-Id: ai:systematic` in headers for consistent attribution
|
|
291
|
-
- Read a fresh `baseToken` before every mutation; on `STALE_BASE`, re-read and retry once
|