@freibergergarcia/phone-a-friend 2.1.0 → 2.2.1
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/.claude-plugin/plugin.json +1 -1
- package/README.md +66 -44
- package/commands/curiosity-engine.md +92 -24
- package/commands/phone-a-friend.md +112 -17
- package/commands/phone-a-team.md +157 -26
- package/dist/index.js +390 -69
- package/package.json +3 -2
- package/skills/curiosity-engine/COMMAND.opencode.md +28 -0
- package/skills/curiosity-engine/SKILL.md +384 -0
- package/skills/phone-a-friend/COMMAND.opencode.md +34 -0
- package/skills/phone-a-friend/SKILL.md +372 -0
package/README.md
CHANGED
|
@@ -20,21 +20,22 @@ Relay tasks to any backend, spin up multi-model teams, or run persistent multi-a
|
|
|
20
20
|
|
|
21
21
|
| Mode | What it does | Best for |
|
|
22
22
|
|------|-------------|----------|
|
|
23
|
-
| **Relay** | One-shot delegation to Codex, Gemini, Ollama, or
|
|
23
|
+
| **Relay** | One-shot delegation to Codex, Gemini, Ollama, Claude, or OpenCode | Quick second opinions, code reviews, analysis |
|
|
24
24
|
| **Team** | Iterative multi-backend refinement over N rounds | Collaborative review, converging on a solution |
|
|
25
25
|
| **Agentic** | Persistent multi-agent sessions with @mention routing | Autonomous collaboration, adversarial review, deep analysis |
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### TUI Dashboard
|
|
27
|
+
### Host parity
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
| Feature | Claude Code | OpenCode |
|
|
30
|
+
|---|:---:|:---:|
|
|
31
|
+
| `/phone-a-friend` (single-backend relay) | ✓ | ✓ |
|
|
32
|
+
| `/curiosity-engine` (Q&A rally) | ✓ | ✓ |
|
|
33
|
+
| `/phone-a-team` (iterative multi-model team) | ✓ | — |
|
|
34
|
+
| Plugin marketplace install | ✓ | — |
|
|
35
|
+
| CLI plugin install (`phone-a-friend plugin install --<host>`) | ✓ | ✓ |
|
|
36
|
+
| Skill auto-discovery | ✓ | ✓ |
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<img src="https://raw.githubusercontent.com/freibergergarcia/phone-a-friend/main/assets/web-dashboard.gif" alt="Web dashboard" width="700">
|
|
36
|
-
|
|
37
|
-
</div>
|
|
38
|
+
OpenCode users can replicate `/phone-a-team` by running repeated `/phone-a-friend` calls and synthesizing manually.
|
|
38
39
|
|
|
39
40
|
## Quick Start
|
|
40
41
|
|
|
@@ -44,6 +45,7 @@ Relay tasks to any backend, spin up multi-model teams, or run persistent multi-a
|
|
|
44
45
|
- [Codex CLI](https://developers.openai.com/codex/quickstart/)
|
|
45
46
|
- [Gemini CLI](https://github.com/google-gemini/gemini-cli)
|
|
46
47
|
- [Ollama](https://ollama.com/download)
|
|
48
|
+
- [OpenCode](https://opencode.ai/docs)
|
|
47
49
|
|
|
48
50
|
**Install:**
|
|
49
51
|
|
|
@@ -52,30 +54,33 @@ npm install -g @freibergergarcia/phone-a-friend
|
|
|
52
54
|
phone-a-friend # first run shows a guided menu — choose Setup
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
The setup wizard detects your backends,
|
|
57
|
+
The setup wizard detects your backends, offers to install detected host integrations, and verifies everything works.
|
|
56
58
|
|
|
57
59
|
**Claude Code marketplace (commands and skills only):**
|
|
58
60
|
|
|
59
|
-
If you use [Claude Code](https://docs.anthropic.com/en/docs/claude-code/setup),
|
|
60
|
-
you can install directly from the marketplace:
|
|
61
|
-
|
|
62
61
|
```
|
|
63
62
|
/plugin marketplace add freibergergarcia/phone-a-friend
|
|
64
63
|
/plugin install phone-a-friend@phone-a-friend-marketplace
|
|
65
64
|
```
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
To update: `/plugin marketplace update phone-a-friend-marketplace` then `/plugin update phone-a-friend@phone-a-friend-marketplace`.
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
> [!NOTE]
|
|
69
|
+
> Marketplace install ships only the slash commands and skills. For the full CLI (agentic mode, TUI, web dashboard), install via `npm install -g @freibergergarcia/phone-a-friend`.
|
|
70
|
+
|
|
71
|
+
**OpenCode commands and skills:**
|
|
72
|
+
|
|
73
|
+
If you use [OpenCode](https://opencode.ai/docs), install the same Phone-a-Friend skills plus thin slash-command shims into your OpenCode config:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
phone-a-friend plugin install --opencode
|
|
72
77
|
```
|
|
73
78
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
This installs to `~/.config/opencode/skills/` and `~/.config/opencode/commands/` (or `$XDG_CONFIG_HOME/opencode/...`). From OpenCode, ask naturally, for example:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
Ask Codex through phone-a-friend for a short sanity review of this repo; do not edit files.
|
|
83
|
+
```
|
|
79
84
|
|
|
80
85
|
**From source:**
|
|
81
86
|
|
|
@@ -86,7 +91,7 @@ npm install && npm run build
|
|
|
86
91
|
./dist/index.js # first run guides you through setup
|
|
87
92
|
```
|
|
88
93
|
|
|
89
|
-
Then from Claude Code, just talk naturally — the
|
|
94
|
+
Then from Claude Code or OpenCode, just talk naturally — the host integration loads the skills automatically:
|
|
90
95
|
|
|
91
96
|
```
|
|
92
97
|
Ask Gemini to review the error handling in relay.ts
|
|
@@ -98,10 +103,10 @@ Build a team with Claude and Ollama. Have them review the website copy,
|
|
|
98
103
|
loop through 3 rounds, and converge on final suggestions.
|
|
99
104
|
```
|
|
100
105
|
|
|
101
|
-
No slash commands needed
|
|
106
|
+
No slash commands needed once the host integration is installed (see [Host parity](#host-parity) for which slash commands work in which host).
|
|
102
107
|
|
|
103
108
|
> [!TIP]
|
|
104
|
-
> **
|
|
109
|
+
> **Claude Code power-user setup:** Run in [**tmux**](https://formulae.brew.sh/formula/tmux) with [**bypass permissions**](https://docs.anthropic.com/en/docs/claude-code/security) (`⏵⏵`) and [**Agent Teams**](https://docs.anthropic.com/en/docs/claude-code/agent-teams) to watch agents work in parallel split panes. Pair with **phone-a-friend agentic mode** for fully autonomous sessions.
|
|
105
110
|
|
|
106
111
|
## CLI Usage
|
|
107
112
|
|
|
@@ -117,7 +122,9 @@ phone-a-friend --to ollama --prompt "Explain this function"
|
|
|
117
122
|
phone-a-friend --to opencode --prompt "Audit this repo" --model qwen3-coder # Local agentic (OpenCode + Ollama)
|
|
118
123
|
phone-a-friend --to claude --prompt "Review this code" --stream # Stream tokens live
|
|
119
124
|
phone-a-friend --to codex --prompt "Audit the auth module" --quiet # Run silently, save result
|
|
120
|
-
phone-a-friend --to
|
|
125
|
+
phone-a-friend --to opencode --prompt "Explain this" --fast # Skip OpenCode plugins (faster)
|
|
126
|
+
phone-a-friend --to codex --prompt "Review my fix" --include-diff # Append `git diff HEAD` to the prompt
|
|
127
|
+
phone-a-friend --to codex --prompt "Quick question" --no-include-diff # Override defaults.include_diff = true
|
|
121
128
|
```
|
|
122
129
|
|
|
123
130
|
### Structured output
|
|
@@ -141,7 +148,7 @@ phone-a-friend --to codex --prompt "Review the auth module" --session auth-revie
|
|
|
141
148
|
phone-a-friend --to codex --prompt "Now fix those issues" --session auth-review
|
|
142
149
|
```
|
|
143
150
|
|
|
144
|
-
Sessions work reliably with Claude, Codex, and OpenCode. Ollama replays history (may hit token limits on long conversations). Gemini
|
|
151
|
+
Sessions work reliably with Claude, Codex, and OpenCode. Ollama replays history (may hit token limits on long conversations). Gemini sessions are currently unsupported.
|
|
145
152
|
|
|
146
153
|
### Job tracking
|
|
147
154
|
|
|
@@ -164,6 +171,11 @@ phone-a-friend --to codex --review --base develop # Review against a specific b
|
|
|
164
171
|
phone-a-friend --to opencode --review # Review with local model (reads repo via tools)
|
|
165
172
|
```
|
|
166
173
|
|
|
174
|
+
`--review` is the diff-scoped review mode (uses the backend's native review path when available). For ad-hoc prompts where you want the working-tree diff appended, use `--include-diff` with normal prompt mode. To override a `defaults.include_diff = true` config setting on a single call, use `--no-include-diff` (or set `PHONE_A_FRIEND_INCLUDE_DIFF=false` in the environment for older binaries).
|
|
175
|
+
|
|
176
|
+
> [!TIP]
|
|
177
|
+
> Don't paste code into `--prompt` just to review it — the backend can read the repo directly via `--repo "$PWD"` (default: current working directory). Pasting risks leaking uncommitted edits and burns tokens for content the backend can fetch itself.
|
|
178
|
+
|
|
167
179
|
### Agentic
|
|
168
180
|
|
|
169
181
|
Spawn multiple agents that collaborate via @mentions (see [Agentic Mode](#agentic-mode) below):
|
|
@@ -180,24 +192,33 @@ phone-a-friend agentic dashboard # Launch web dashboard (localhost:777
|
|
|
180
192
|
```bash
|
|
181
193
|
phone-a-friend # Interactive TUI dashboard (TTY only)
|
|
182
194
|
phone-a-friend setup # Guided setup wizard
|
|
183
|
-
phone-a-friend doctor # Health check all backends
|
|
195
|
+
phone-a-friend doctor # Health check all backends + host install status
|
|
196
|
+
phone-a-friend plugin install --claude # Install Claude Code plugin
|
|
197
|
+
phone-a-friend plugin install --opencode # Install OpenCode commands and skills
|
|
184
198
|
phone-a-friend config show # Show resolved config
|
|
185
199
|
phone-a-friend config edit # Open in $EDITOR
|
|
186
200
|
```
|
|
187
201
|
|
|
202
|
+
`doctor` reports CLI backends, local backends (Ollama), host integration status (Claude / OpenCode plugin install state), and a summary count. The OpenCode CLI is treated as optional: if you only use Claude Code and don't have OpenCode installed, doctor will not flag that as a degraded state.
|
|
203
|
+
|
|
188
204
|
## Backends
|
|
189
205
|
|
|
190
|
-
| Backend | Type | Streaming |
|
|
191
|
-
|
|
192
|
-
| **Codex** | CLI subprocess | No |
|
|
193
|
-
| **Gemini** | CLI subprocess | No |
|
|
194
|
-
| **Ollama** | HTTP API | Yes (NDJSON) |
|
|
195
|
-
| **Claude** | CLI subprocess | Yes (JSON) |
|
|
206
|
+
| Backend | Type | Streaming |
|
|
207
|
+
|---------|------|-----------|
|
|
208
|
+
| **Codex** | CLI subprocess | No |
|
|
209
|
+
| **Gemini** | CLI subprocess | No |
|
|
210
|
+
| **Ollama** | HTTP API | Yes (NDJSON) |
|
|
211
|
+
| **Claude** | CLI subprocess | Yes (JSON) |
|
|
212
|
+
| **OpenCode** | CLI subprocess | Yes (NDJSON) |
|
|
196
213
|
|
|
197
214
|
Ollama configuration via environment variables:
|
|
198
215
|
- `OLLAMA_HOST` -- custom host (default: `http://localhost:11434`)
|
|
199
216
|
- `OLLAMA_MODEL` -- default model (overridden by `--model` flag)
|
|
200
217
|
|
|
218
|
+
Phone-a-friend environment variables:
|
|
219
|
+
- `PHONE_A_FRIEND_INCLUDE_DIFF=false` -- disable diff inclusion globally (equivalent to `--no-include-diff` on every call).
|
|
220
|
+
- `PHONE_A_FRIEND_HOST=opencode` -- mark the calling process as OpenCode for the recursion guard (set automatically by the OpenCode shims).
|
|
221
|
+
|
|
201
222
|
OpenCode configuration via TOML:
|
|
202
223
|
```toml
|
|
203
224
|
[backends.opencode]
|
|
@@ -241,14 +262,6 @@ phone-a-friend agentic dashboard # default: localhost:7777
|
|
|
241
262
|
phone-a-friend agentic dashboard --port 8080
|
|
242
263
|
```
|
|
243
264
|
|
|
244
|
-
**How it works:**
|
|
245
|
-
|
|
246
|
-
1. The orchestrator spawns each agent with the initial prompt and a unique name (e.g., `ada.reviewer`, `fern.critic`)
|
|
247
|
-
2. Agents respond and `@mention` other agents (or `@all` / `@user`)
|
|
248
|
-
3. The orchestrator routes messages to the targeted agents
|
|
249
|
-
4. Agents reply in subsequent turns, building on accumulated context
|
|
250
|
-
5. The session ends when agents converge (no new messages), hit the turn limit, or time out
|
|
251
|
-
|
|
252
265
|
**What you get:**
|
|
253
266
|
|
|
254
267
|
- **Live web dashboard** -- watch agents collaborate in real time at `localhost:7777` (SSE-powered)
|
|
@@ -266,11 +279,20 @@ Full usage guide, examples, CLI reference, and configuration details:
|
|
|
266
279
|
|
|
267
280
|
## Uninstall
|
|
268
281
|
|
|
282
|
+
**npm install:**
|
|
283
|
+
|
|
269
284
|
```bash
|
|
270
285
|
npm uninstall -g @freibergergarcia/phone-a-friend
|
|
271
286
|
```
|
|
272
287
|
|
|
273
|
-
|
|
288
|
+
Automatically removes the Claude Code plugin (CLI-installed), OpenCode commands and skills, and the `~/.config/phone-a-friend` directory (config, sessions, jobs).
|
|
289
|
+
|
|
290
|
+
**Claude Code marketplace:**
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
/plugin uninstall phone-a-friend@phone-a-friend-marketplace
|
|
294
|
+
/plugin marketplace remove phone-a-friend-marketplace
|
|
295
|
+
```
|
|
274
296
|
|
|
275
297
|
## Contributing
|
|
276
298
|
|
|
@@ -1,15 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: curiosity-engine
|
|
3
|
-
description: Structured Q&A rally between
|
|
3
|
+
description: Structured Q&A rally between the host orchestrating model and a backend model. Both sides must always reply with ANSWER: and QUESTION:. Seeded by topic, runs for N rounds.
|
|
4
4
|
argument-hint: --topic "<topic>" [--rounds N] [--backend codex|gemini|ollama]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# /curiosity-engine
|
|
8
8
|
|
|
9
|
-
A structured ping-pong Q&A game between
|
|
9
|
+
A structured ping-pong Q&A game between the host orchestrating model (the
|
|
10
|
+
agent running this skill — Claude in Claude Code, the OpenCode model in
|
|
11
|
+
OpenCode) and a backend model.
|
|
10
12
|
Both sides MUST produce an ANSWER: and a QUESTION: every round.
|
|
11
13
|
The game is seeded with a topic and runs for N rounds (default 3, max 6).
|
|
12
14
|
|
|
15
|
+
## Execution rules
|
|
16
|
+
|
|
17
|
+
- The host model running this skill is the orchestrator. It serves the
|
|
18
|
+
opening question and answers each round directly. Do NOT call
|
|
19
|
+
`phone-a-friend --to claude` (or any other backend) to generate the
|
|
20
|
+
orchestrator's questions or answers — that would relay the orchestrator
|
|
21
|
+
role to a different model.
|
|
22
|
+
- One backend per relay call. Never pass comma-separated values to `--to`
|
|
23
|
+
(e.g. `phone-a-friend --to codex,gemini`).
|
|
24
|
+
- `curiosity-engine` is a host slash command / Agent Skill, not a PaF CLI
|
|
25
|
+
subcommand. Never run `phone-a-friend curiosity-engine`.
|
|
26
|
+
- `--backend` is an argument to this skill, not a PaF CLI flag. Do not pass
|
|
27
|
+
`--backend` to `phone-a-friend`.
|
|
28
|
+
- Suppress the working-tree diff on every binary-mode relay (see "Diff
|
|
29
|
+
suppression" below). Curiosity rounds are seeded with self-contained
|
|
30
|
+
prompts; the diff would be noise.
|
|
31
|
+
- Do NOT dump repo files or git output (`git show`, `git diff`,
|
|
32
|
+
`git status`, etc.) into the relay prompt. Curiosity rounds are seeded
|
|
33
|
+
with self-contained prompts; if the round needs file context,
|
|
34
|
+
repo-aware backends (codex, gemini) can read the repo via
|
|
35
|
+
`--repo "$PWD"`. For `ollama` (no repo file access), pick a repo-aware
|
|
36
|
+
backend instead, or ask before sending a minimal excerpt. Inlining
|
|
37
|
+
repo content can leak uncommitted edits or committed secrets and is
|
|
38
|
+
not needed for a Q&A rally. The opening question and round
|
|
39
|
+
transcripts are narrative context that the orchestrator generates and
|
|
40
|
+
inlines into the relay prompt; that is the intended use, not file
|
|
41
|
+
dumping.
|
|
42
|
+
|
|
13
43
|
## Inputs
|
|
14
44
|
|
|
15
45
|
- Arguments: `$ARGUMENTS`
|
|
@@ -52,6 +82,35 @@ Request:
|
|
|
52
82
|
No "Additional Context" section is needed for curiosity-engine (prompts are
|
|
53
83
|
self-contained).
|
|
54
84
|
|
|
85
|
+
Note: do NOT pass PaF flags like `--no-include-diff`, `--fast`, or
|
|
86
|
+
`--session` in direct mode. They are CLI flags on the `phone-a-friend`
|
|
87
|
+
binary; the underlying backend CLIs do not accept them.
|
|
88
|
+
|
|
89
|
+
## Diff suppression
|
|
90
|
+
|
|
91
|
+
`/curiosity-engine` rounds use self-contained prompts; the working-tree diff
|
|
92
|
+
would be irrelevant noise. PaF reads `defaults.include_diff` from user
|
|
93
|
+
config, so without explicit suppression a user with `include_diff = true`
|
|
94
|
+
would silently leak the diff into every relay round.
|
|
95
|
+
|
|
96
|
+
The cleanest flag is `--no-include-diff`, added in phone-a-friend v2.2.0.
|
|
97
|
+
Older binaries reject the flag with `unknown option '--no-include-diff'`.
|
|
98
|
+
Probe once before Round 1, then reuse the gate across every binary-mode
|
|
99
|
+
relay (initial round, follow-up rounds, and the schema re-prompt):
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
if phone-a-friend relay --help 2>/dev/null | grep -q -- '--no-include-diff'; then
|
|
103
|
+
PAF_NO_DIFF="--no-include-diff"
|
|
104
|
+
else
|
|
105
|
+
export PHONE_A_FRIEND_INCLUDE_DIFF=false
|
|
106
|
+
PAF_NO_DIFF=""
|
|
107
|
+
fi
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Append `$PAF_NO_DIFF` to every binary-mode `phone-a-friend` invocation in
|
|
111
|
+
the steps below. The env var fallback works in v1.7.2 and later; the
|
|
112
|
+
explicit flag is preferred when available.
|
|
113
|
+
|
|
55
114
|
## Step 1 — Parse Arguments
|
|
56
115
|
|
|
57
116
|
Extract `--topic`, `--rounds`, and `--backend` from `$ARGUMENTS`.
|
|
@@ -102,24 +161,29 @@ If `RELAY_MODE = binary`, the binary handles model selection internally.
|
|
|
102
161
|
|
|
103
162
|
## Step 3 — Serve Round 1
|
|
104
163
|
|
|
105
|
-
|
|
164
|
+
The orchestrating agent (the host model running this skill) serves first.
|
|
165
|
+
It produces the opening move directly, without relaying to any backend:
|
|
106
166
|
|
|
107
167
|
```
|
|
108
168
|
ANSWER: N/A — I'm serving first.
|
|
109
|
-
QUESTION: <
|
|
169
|
+
QUESTION: <orchestrator's opening question on TOPIC — make it genuinely curious and specific>
|
|
110
170
|
```
|
|
111
171
|
|
|
112
172
|
Display to user:
|
|
113
173
|
```
|
|
114
174
|
--- Round 1 of <MAX_ROUNDS> | Topic: <TOPIC> ---
|
|
115
|
-
🤖
|
|
175
|
+
🤖 <orchestrator> QUESTION: <question>
|
|
116
176
|
```
|
|
117
177
|
|
|
178
|
+
`<orchestrator>` is the host model's display label (e.g., "Claude" in
|
|
179
|
+
Claude Code, the OpenCode model name in OpenCode). Pick one that the user
|
|
180
|
+
will recognize.
|
|
181
|
+
|
|
118
182
|
Then relay to backend:
|
|
119
183
|
|
|
120
184
|
**Binary mode** (`RELAY_MODE = binary`):
|
|
121
185
|
```bash
|
|
122
|
-
phone-a-friend --to <BACKEND> --repo "$PWD" --sandbox read-only --fast [--model <model>] --prompt "<relay-prompt>"
|
|
186
|
+
phone-a-friend --to <BACKEND> --repo "$PWD" --sandbox read-only --fast $PAF_NO_DIFF [--model <model>] --prompt "<relay-prompt>"
|
|
123
187
|
```
|
|
124
188
|
|
|
125
189
|
**Direct mode** (`RELAY_MODE = direct`):
|
|
@@ -137,17 +201,17 @@ curl -s http://localhost:11434/api/chat -H "Content-Type: application/json" \
|
|
|
137
201
|
Where `<relay-prompt>` is:
|
|
138
202
|
|
|
139
203
|
```
|
|
140
|
-
You are playing The Curiosity Engine — a structured Q&A rally with
|
|
204
|
+
You are playing The Curiosity Engine — a structured Q&A rally with another agent.
|
|
141
205
|
Topic: <TOPIC>
|
|
142
206
|
Round: 1 of <MAX_ROUNDS>
|
|
143
207
|
|
|
144
|
-
|
|
208
|
+
The orchestrating agent's question for you:
|
|
145
209
|
<QUESTION>
|
|
146
210
|
|
|
147
211
|
You MUST respond in EXACTLY this format — no exceptions, no extra text:
|
|
148
212
|
|
|
149
|
-
ANSWER: <your answer to
|
|
150
|
-
QUESTION: <a new question for
|
|
213
|
+
ANSWER: <your answer to the orchestrator's question, 2-4 sentences>
|
|
214
|
+
QUESTION: <a new question for the orchestrator on the same topic, that you are genuinely curious about>
|
|
151
215
|
|
|
152
216
|
Do not add any text before ANSWER: or after the QUESTION line.
|
|
153
217
|
```
|
|
@@ -175,7 +239,7 @@ Send one correction relay if `ANSWER:` or `QUESTION:` is missing:
|
|
|
175
239
|
|
|
176
240
|
**Binary mode** (`RELAY_MODE = binary`):
|
|
177
241
|
```bash
|
|
178
|
-
phone-a-friend --to <BACKEND> --repo "$PWD" --sandbox read-only --fast [--model <model>] --prompt "<re-prompt>"
|
|
242
|
+
phone-a-friend --to <BACKEND> --repo "$PWD" --sandbox read-only --fast $PAF_NO_DIFF [--model <model>] --prompt "<re-prompt>"
|
|
179
243
|
```
|
|
180
244
|
|
|
181
245
|
**Direct mode** (`RELAY_MODE = direct`):
|
|
@@ -197,7 +261,7 @@ Your previous response did not follow the required format.
|
|
|
197
261
|
You MUST respond with EXACTLY this structure:
|
|
198
262
|
|
|
199
263
|
ANSWER: <your answer>
|
|
200
|
-
QUESTION: <your question for
|
|
264
|
+
QUESTION: <your question for the orchestrator>
|
|
201
265
|
|
|
202
266
|
No other text. Try again.
|
|
203
267
|
```
|
|
@@ -219,34 +283,38 @@ Display backend's response:
|
|
|
219
283
|
|
|
220
284
|
If this was the final round (ROUND == MAX_ROUNDS) → jump to Step 6 (Synthesis).
|
|
221
285
|
|
|
222
|
-
Otherwise, increment ROUND.
|
|
286
|
+
Otherwise, increment ROUND. The orchestrating agent (the host model)
|
|
287
|
+
now responds directly — no relay:
|
|
223
288
|
|
|
224
289
|
```
|
|
225
|
-
🤖
|
|
226
|
-
|
|
290
|
+
🤖 <orchestrator> ANSWER: <orchestrator's genuine answer to backend's question, 2-4 sentences>
|
|
291
|
+
QUESTION: <orchestrator's new question for backend on TOPIC>
|
|
227
292
|
```
|
|
228
293
|
|
|
229
|
-
Relay
|
|
294
|
+
Relay the orchestrator's question to backend using this template (same
|
|
295
|
+
structure as Step 3, substituting current values, and reusing
|
|
296
|
+
`$PAF_NO_DIFF` for binary mode):
|
|
230
297
|
|
|
231
298
|
```
|
|
232
|
-
You are playing The Curiosity Engine — a structured Q&A rally with
|
|
299
|
+
You are playing The Curiosity Engine — a structured Q&A rally with another agent.
|
|
233
300
|
Topic: <TOPIC>
|
|
234
301
|
Round: <ROUND> of <MAX_ROUNDS>
|
|
235
302
|
|
|
236
|
-
|
|
303
|
+
The orchestrating agent's question for you:
|
|
237
304
|
<QUESTION>
|
|
238
305
|
|
|
239
306
|
You MUST respond in EXACTLY this format — no exceptions, no extra text:
|
|
240
307
|
|
|
241
|
-
ANSWER: <your answer to
|
|
242
|
-
QUESTION: <a new question for
|
|
308
|
+
ANSWER: <your answer to the orchestrator's question, 2-4 sentences>
|
|
309
|
+
QUESTION: <a new question for the orchestrator on the same topic, that you are genuinely curious about>
|
|
243
310
|
|
|
244
311
|
Do not add any text before ANSWER: or after the QUESTION line.
|
|
245
312
|
```
|
|
246
313
|
|
|
247
314
|
Repeat Step 4 and Step 5 until MAX_ROUNDS reached or early termination.
|
|
248
315
|
|
|
249
|
-
**
|
|
316
|
+
**Orchestrator discipline:** the host model ALWAYS provides both ANSWER:
|
|
317
|
+
and QUESTION: — never skips either field, never breaks the schema itself.
|
|
250
318
|
|
|
251
319
|
## Step 6 — Final Synthesis
|
|
252
320
|
|
|
@@ -274,7 +342,7 @@ Present the full session summary:
|
|
|
274
342
|
|
|
275
343
|
### Most Interesting Exchange
|
|
276
344
|
|
|
277
|
-
<
|
|
345
|
+
<orchestrator picks the sharpest Q&A pair from the transcript and explains in 2-3 sentences why it was the most interesting — what tension, insight, or surprise it revealed>
|
|
278
346
|
|
|
279
347
|
---
|
|
280
348
|
|
|
@@ -295,7 +363,7 @@ When BACKEND=gemini, the relay command must include `--model`:
|
|
|
295
363
|
|
|
296
364
|
**Binary mode:**
|
|
297
365
|
```bash
|
|
298
|
-
phone-a-friend --to gemini --model gemini-2.5-flash --repo "$PWD" --sandbox read-only --fast --prompt "<relay-prompt>"
|
|
366
|
+
phone-a-friend --to gemini --model gemini-2.5-flash --repo "$PWD" --sandbox read-only --fast $PAF_NO_DIFF --prompt "<relay-prompt>"
|
|
299
367
|
```
|
|
300
368
|
|
|
301
369
|
**Direct mode:**
|
|
@@ -309,7 +377,7 @@ Do NOT use aliases like `auto`, `pro`, or `flash` — always use the full model
|
|
|
309
377
|
## Constraints
|
|
310
378
|
|
|
311
379
|
- MAX_ROUNDS clamped to [1, 6]. Never exceed.
|
|
312
|
-
- Both sides must always produce ANSWER: and QUESTION:.
|
|
380
|
+
- Both sides must always produce ANSWER: and QUESTION:. The orchestrator never breaks the schema.
|
|
313
381
|
- One re-prompt allowed per round on schema violation. Two strikes = early termination.
|
|
314
382
|
- No nested curiosity-engine sessions.
|
|
315
383
|
- phone-a-friend is used as a black box — do not modify its internals.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: phone-a-friend
|
|
3
|
-
description:
|
|
3
|
+
description: Ask Codex, Gemini, Claude, or Ollama for a second opinion through the phone-a-friend CLI while preserving the user's request in --prompt.
|
|
4
4
|
argument-hint: [optional review focus]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,7 +10,34 @@ Use this command after an assistant reply you want reviewed by another AI.
|
|
|
10
10
|
|
|
11
11
|
## Goal
|
|
12
12
|
|
|
13
|
-
Send compact task context + the latest assistant reply to a backend (Codex,
|
|
13
|
+
Send compact task context + the latest assistant reply to a backend (Codex,
|
|
14
|
+
Gemini, Claude, or Ollama) using `phone-a-friend`, then bring the feedback back
|
|
15
|
+
into the current conversation.
|
|
16
|
+
|
|
17
|
+
## Execution rules
|
|
18
|
+
|
|
19
|
+
- Preserve the user's actual request in `--prompt`. Do not drop it.
|
|
20
|
+
- Do not run a bare `phone-a-friend --to <backend> --review` unless the user
|
|
21
|
+
explicitly asks to review the current diff, branch changes, or staged changes.
|
|
22
|
+
- If the user asks for a repo sanity check, architecture opinion, plan critique,
|
|
23
|
+
or general second opinion, use normal prompt mode with `--repo "$PWD"`.
|
|
24
|
+
- If the user says not to edit files, keep that instruction in `--prompt`.
|
|
25
|
+
- Suppress the working-tree diff by default (see "Diff suppression" below);
|
|
26
|
+
only include the diff when the user explicitly asked to review the diff,
|
|
27
|
+
branch changes, or staged changes.
|
|
28
|
+
- One backend per call. Never pass comma-separated values to `--to` (e.g.
|
|
29
|
+
`phone-a-friend --to codex,gemini`). To consult multiple models, run
|
|
30
|
+
separate `phone-a-friend` calls. The `/phone-a-team` slash command
|
|
31
|
+
orchestrates that for you in Claude Code.
|
|
32
|
+
- `curiosity-engine` is a host slash command / Agent Skill, not a PaF CLI
|
|
33
|
+
subcommand. Never run `phone-a-friend curiosity-engine`. Same shape rule
|
|
34
|
+
applies to any other slash command: never invoke them as PaF
|
|
35
|
+
subcommands (e.g. `phone-a-friend phone-a-team`).
|
|
36
|
+
- `--backend` is a `/phone-a-team` skill argument, not a PaF CLI flag. Do
|
|
37
|
+
not pass `--backend` to `phone-a-friend`.
|
|
38
|
+
- Do NOT dump repo files or git output into `--context-file` or
|
|
39
|
+
`--context-text`. Repo-aware backends read files via `--repo "$PWD"`
|
|
40
|
+
using their own tools. See "Context hygiene" below.
|
|
14
41
|
|
|
15
42
|
## Inputs
|
|
16
43
|
|
|
@@ -53,9 +80,65 @@ Additional Context:
|
|
|
53
80
|
<context-payload>
|
|
54
81
|
```
|
|
55
82
|
|
|
56
|
-
In direct mode, also verify the backend CLI is available (`command -v codex`
|
|
57
|
-
`command -v gemini`) before calling it. If not found, tell the user how
|
|
58
|
-
install it and stop.
|
|
83
|
+
In direct mode, also verify the backend CLI is available (`command -v codex`
|
|
84
|
+
or `command -v gemini`) before calling it. If not found, tell the user how
|
|
85
|
+
to install it and stop.
|
|
86
|
+
|
|
87
|
+
Note: do NOT pass PaF flags like `--no-include-diff`, `--fast`, or
|
|
88
|
+
`--session` in direct mode. Those are CLI flags on the `phone-a-friend`
|
|
89
|
+
binary; the underlying backend CLIs do not accept them.
|
|
90
|
+
|
|
91
|
+
## Context hygiene
|
|
92
|
+
|
|
93
|
+
Do not generate `--context-file` or `--context-text` from repository files,
|
|
94
|
+
`git show`, `git diff`, `git status`, or other local file/git output. Do
|
|
95
|
+
not create temp files just to pass repo content. For repo-aware backends
|
|
96
|
+
(codex, gemini, claude, opencode), pass `--repo "$PWD"` and let the
|
|
97
|
+
backend inspect files with its own tools.
|
|
98
|
+
|
|
99
|
+
`--context-file` and `--context-text` are reserved for **narrative
|
|
100
|
+
context that is not already in the repo** — for example: conversation
|
|
101
|
+
history that the backend cannot see, your own analysis, user constraints,
|
|
102
|
+
prior model output you want reviewed. These remain valid and useful.
|
|
103
|
+
|
|
104
|
+
Inlining repo content is wasteful, can leak tracked uncommitted edits or
|
|
105
|
+
committed secrets into the relay payload, and bypasses the backend's
|
|
106
|
+
normal file-access controls.
|
|
107
|
+
|
|
108
|
+
Backend exception: `ollama` has `localFileAccess: false` and cannot read
|
|
109
|
+
the repo on its own. For Ollama specifically, ask the user before sending
|
|
110
|
+
file content, and send a minimal excerpt rather than bulk-dumping files
|
|
111
|
+
or git output.
|
|
112
|
+
|
|
113
|
+
## Diff suppression
|
|
114
|
+
|
|
115
|
+
PaF reads `defaults.include_diff` from user config. If a user has
|
|
116
|
+
`include_diff = true` set, every relay would silently leak the working-tree
|
|
117
|
+
diff into the prompt. To prevent that, every binary-mode relay must suppress
|
|
118
|
+
the diff explicitly.
|
|
119
|
+
|
|
120
|
+
The cleanest flag is `--no-include-diff`, which was added in
|
|
121
|
+
phone-a-friend v2.2.0 (the same release that introduced this command).
|
|
122
|
+
Older binaries reject the flag with `unknown option '--no-include-diff'`.
|
|
123
|
+
Probe once at the start of the workflow, then reuse the gate:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
if phone-a-friend relay --help 2>/dev/null | grep -q -- '--no-include-diff'; then
|
|
127
|
+
PAF_NO_DIFF="--no-include-diff"
|
|
128
|
+
else
|
|
129
|
+
export PHONE_A_FRIEND_INCLUDE_DIFF=false
|
|
130
|
+
PAF_NO_DIFF=""
|
|
131
|
+
fi
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Then append `$PAF_NO_DIFF` to every binary-mode `phone-a-friend` invocation.
|
|
135
|
+
The env var fallback works in v1.7.2 and later; the explicit flag is
|
|
136
|
+
preferred when available because it doesn't leak the override into child
|
|
137
|
+
processes.
|
|
138
|
+
|
|
139
|
+
Only when the user explicitly asked to review the diff, branch changes, or
|
|
140
|
+
staged changes, swap `$PAF_NO_DIFF` for `--include-diff` (and prefer
|
|
141
|
+
`phone-a-friend ... --review` for branch-level reviews).
|
|
59
142
|
|
|
60
143
|
## Workflow
|
|
61
144
|
|
|
@@ -85,12 +168,17 @@ I'm working on this task and got the above response. Please review it and return
|
|
|
85
168
|
|
|
86
169
|
**Binary mode** (`RELAY_MODE = binary`):
|
|
87
170
|
```bash
|
|
88
|
-
phone-a-friend --to codex --repo "$PWD" --prompt "<relay-prompt>" --context-text "<context-payload>" [--fast] [--session <id>]
|
|
171
|
+
phone-a-friend --to codex --repo "$PWD" --prompt "<relay-prompt>" --context-text "<context-payload>" $PAF_NO_DIFF [--fast] [--session <id>]
|
|
89
172
|
# For gemini, always include --model (see "Gemini Model Priority" below).
|
|
90
173
|
# Do NOT pass --session to gemini — it will error (see "Session continuity" below):
|
|
91
|
-
phone-a-friend --to gemini --repo "$PWD" --prompt "<relay-prompt>" --context-text "<context-payload>" --model <model> [--fast]
|
|
174
|
+
phone-a-friend --to gemini --repo "$PWD" --prompt "<relay-prompt>" --context-text "<context-payload>" --model <model> $PAF_NO_DIFF [--fast]
|
|
92
175
|
```
|
|
93
176
|
|
|
177
|
+
`$PAF_NO_DIFF` comes from the probe in "Diff suppression" above. It
|
|
178
|
+
resolves to `--no-include-diff` on new binaries and an empty string on
|
|
179
|
+
stale binaries (with `PHONE_A_FRIEND_INCLUDE_DIFF=false` exported as
|
|
180
|
+
the fallback).
|
|
181
|
+
|
|
94
182
|
See "Speed optimization" and "Session continuity" below for when to
|
|
95
183
|
include `--fast` and `--session`.
|
|
96
184
|
|
|
@@ -106,7 +194,9 @@ I'm working on this task and got the above response. Please review it and return
|
|
|
106
194
|
"Direct call reference" section, substituting `<relay-prompt>` and
|
|
107
195
|
`<context-payload>` into the template.
|
|
108
196
|
|
|
109
|
-
Note: `--fast
|
|
197
|
+
Note: `--fast`, `--session`, and `--no-include-diff` are PaF CLI flags
|
|
198
|
+
only available in binary mode. Do not append them to direct-mode
|
|
199
|
+
invocations of `codex` or `gemini`.
|
|
110
200
|
|
|
111
201
|
5. Return backend feedback in concise review format:
|
|
112
202
|
- Critical issues
|
|
@@ -123,13 +213,14 @@ When building binary-mode relay commands, add `--fast` if ALL of these are true:
|
|
|
123
213
|
CLAUDE.md rules that the backend needs to read
|
|
124
214
|
- The task does NOT need MCP tools (GitHub API, Slack, database queries)
|
|
125
215
|
|
|
126
|
-
`--fast`
|
|
127
|
-
|
|
128
|
-
|
|
216
|
+
`--fast` maps to `--pure` for OpenCode, skipping external plugins. It is a
|
|
217
|
+
no-op for Claude, Codex, Gemini, and Ollama. Claude intentionally does not
|
|
218
|
+
use `--bare` because bare mode skips OAuth/keychain reads and can break
|
|
219
|
+
subscription auth.
|
|
129
220
|
|
|
130
221
|
Most `/phone-a-friend` relay calls are self-contained reviews where the
|
|
131
|
-
context is already in the prompt. Default to including `--fast
|
|
132
|
-
|
|
222
|
+
context is already in the prompt. Default to including `--fast`; it is
|
|
223
|
+
harmless for Claude/Codex/Gemini/Ollama and meaningful for OpenCode.
|
|
133
224
|
|
|
134
225
|
## Session continuity
|
|
135
226
|
|
|
@@ -183,10 +274,10 @@ Combine with `--session <label>` to also start tracking under a label.
|
|
|
183
274
|
|
|
184
275
|
```bash
|
|
185
276
|
# Resume a raw backend thread once (no PaF persistence):
|
|
186
|
-
phone-a-friend --to codex --repo "$PWD" --backend-session <thread-id> --prompt "<...>"
|
|
277
|
+
phone-a-friend --to codex --repo "$PWD" --backend-session <thread-id> --prompt "<...>" $PAF_NO_DIFF
|
|
187
278
|
|
|
188
279
|
# Adopt: resume AND start tracking under a PaF label going forward:
|
|
189
|
-
phone-a-friend --to codex --repo "$PWD" --session <label> --backend-session <thread-id> --prompt "<...>"
|
|
280
|
+
phone-a-friend --to codex --repo "$PWD" --session <label> --backend-session <thread-id> --prompt "<...>" $PAF_NO_DIFF
|
|
190
281
|
```
|
|
191
282
|
|
|
192
283
|
This is rarely the right move from inside a Claude Code conversation — the
|
|
@@ -241,6 +332,10 @@ This does NOT apply to `--to codex`.
|
|
|
241
332
|
|
|
242
333
|
## Notes
|
|
243
334
|
|
|
244
|
-
- Prefer `--context-text` for small payloads.
|
|
335
|
+
- Prefer `--context-text` for small narrative payloads.
|
|
245
336
|
- `--context-file` and `--context-text` are mutually exclusive.
|
|
246
|
-
- If context is too large for inline args,
|
|
337
|
+
- If your narrative context is too large for inline args, write it to a
|
|
338
|
+
temp file outside the repo (e.g. under `/tmp`). Do NOT use a repo-local
|
|
339
|
+
temp file — it muddies git status and risks accidental commit. Repo
|
|
340
|
+
content itself does not need a temp file at all; see "Context hygiene"
|
|
341
|
+
above.
|