# Platform Mapping Reference

Every Feynman-skill SKILL.md in this directory refers to the abstractions defined here. Both runtimes implement the same conceptual operations under different tool names.

## Subagent delegation

Feynman ships four bundled research roles: `researcher`, `reviewer`, `writer`, `verifier`. Outside of Feynman, dispatch them via the host platform's generic delegation primitive.

| Role | Claude Code | OpenCode |
|---|---|---|
| `researcher` (evidence gathering, source hunting) | `Task` tool with `subagent_type: scholar` (if installed from personas repo) or `general-purpose` | `task` tool invoking `scholar` agent (if installed) or `general` |
| `reviewer` (adversarial review of a cited draft) | `Task` tool with `subagent_type: general-purpose`, prompt: *"review this artifact for FATAL/MAJOR/MINOR issues — no rewrites, only findings"* | `task` tool invoking a `reviewer`-prompted general agent |
| `writer` (synthesize notes into a polished draft) | `Task` tool with `subagent_type: forge` (personas) or `general-purpose` | `task` tool invoking `forge` or `general` |
| `verifier` (URL / citation verification) | `Task` tool with `subagent_type: oracle` (personas) or `general-purpose` + `WebFetch` permission | `task` tool invoking `oracle` or `general` with `webfetch` allowed |

The lead agent (the skill caller) plans, dispatches, synthesizes, and delivers. Subagents write artifacts to disk and the lead reads them. Never dump large intermediate results back into parent context.

## Scheduling recurring work

| Need | Claude Code | OpenCode |
|---|---|---|
| Wake up later in same session | `ScheduleWakeup` | (no direct equivalent — use cron) |
| Cron-style recurring agent runs | `CronCreate` / `CronList` / `CronDelete` | system `cron` invoking `opencode run` |
| Interactive loop with self-pacing | `/loop` slash command | Manual re-invocation |

## Charts and diagrams

`pi-charts` is a Feynman-runtime helper. Outside Feynman:

- **Quantitative comparisons**: output Mermaid bar/line/pie charts, or write CSV and ask the user to render. Do not invent charts.
- **Architecture / pipeline diagrams**: Mermaid `graph TD` / `flowchart`.
- **Every figure** needs a provenance-bearing caption naming the source.

## Preview / render

`/preview` is Feynman-specific. Fallbacks:

```bash
# macOS
open <file.md>          # opens in default app
open <file.pdf>

# Linux
xdg-open <file.md>
xdg-open <file.pdf>

# PDF export (cross-platform)
pandoc <file.md> -o <file.pdf>
```

## Session history search

Feynman stores transcripts at `~/.feynman/sessions/*.jsonl`. Other runtimes:

| Platform | Session store |
|---|---|
| Claude Code | `~/.claude/projects/<hash-of-cwd>/*.jsonl` |
| OpenCode | `~/.local/share/opencode/session/` |

Search with `grep -ril "<query>" <store>` or the platform's session-search command.

## Paper search

`alpha` CLI (alphaXiv-backed) is platform-agnostic — install via `pip install alpha-hub` or the upstream installer. When `alpha` is unavailable, fall back to:

- `WebSearch` + arXiv abstract page fetch (Claude Code)
- `webfetch` + arXiv (OpenCode)
- Semantic Scholar API / OpenAlex API for programmatic paper search

## Cross-session persistence (plans, memory)

Feynman has a `memory_remember` tool that lets a workflow stash a plan or artifact under a stable key (e.g. `deepresearch.<slug>.plan`) so a later session can recover it. Outside Feynman:

| Platform | Equivalent |
|---|---|
| Claude Code | `auto-memory` system (`~/.claude/projects/<hash>/memory/`) — write `{{slug}}-plan.md` and add a one-liner to `MEMORY.md` |
| OpenCode | No first-party equivalent; use filesystem (`outputs/.plans/<slug>.md` is already the canonical location) |
| Any runtime | Filesystem is the lowest-common-denominator — `outputs/.plans/<slug>.md` survives session boundaries |

Rule: always write the plan to disk first (`outputs/.plans/<slug>.md`). If platform-native memory exists, also mirror a pointer there. Never rely on memory alone.

## Background process inspection

Feynman `process` tool → outside Feynman:

```bash
# running processes
ps auxf
pgrep -fa <pattern>

# cron / systemd-timers
crontab -l
systemctl --user list-timers
```

Claude Code also has `Monitor` for streaming background-command output.
