Skip to content

Commit 28dc098

Browse files
committed
docs(superpowers): add implementation plans and specs
1 parent 17ef9de commit 28dc098

12 files changed

Lines changed: 5768 additions & 0 deletions

docs/superpowers/plans/2026-05-11-supervisor-execution-policy.md

Lines changed: 1217 additions & 0 deletions
Large diffs are not rendered by default.

docs/superpowers/plans/2026-05-12-supervisor-target-scoped-memory-implementation.md

Lines changed: 1352 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Mobile Terminal Paste/Upload Implementation Plan
2+
3+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4+
5+
**Goal:** Add two mobile terminal actions: paste from clipboard and upload files/images from the device picker.
6+
7+
**Architecture:** Keep the existing terminal upload pipeline in `use-paste-drop-upload`, but extend it with explicit entry points for clipboard reads and file picker uploads. `MobileTerminalInputBar` owns the visible buttons and emits user intent; `XtermHost` wires those intents to workspace-scoped upload helpers and disables the controls while uploads are in flight. Desktop terminal behavior stays unchanged.
8+
9+
**Tech Stack:** React, TypeScript, Jotai, browser Clipboard API, browser file input, Vitest, Testing Library.
10+
11+
---
12+
13+
### Task 1: Add mobile toolbar actions and wiring hooks
14+
15+
**Files:**
16+
- Modify: `packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.tsx`
17+
- Modify: `packages/web/src/features/terminal-panel/views/shared/xterm-host.tsx`
18+
- Test: `packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.test.tsx`
19+
20+
- [ ] **Step 1: Write the failing test**
21+
22+
Add assertions that the mobile input bar renders two new buttons labeled `Paste` and `Upload`, and that clicking them invokes dedicated callbacks instead of terminal key handlers.
23+
24+
```tsx
25+
it("renders paste and upload actions and dispatches their callbacks", () => {
26+
const onPaste = vi.fn();
27+
const onUpload = vi.fn();
28+
29+
render(
30+
<MobileTerminalInputBar
31+
ctrlMode="off"
32+
shiftArmed={false}
33+
labels={labels}
34+
onKeyPress={vi.fn()}
35+
onCtrlTap={vi.fn()}
36+
onCtrlLongPress={vi.fn()}
37+
onShiftTap={vi.fn()}
38+
onPaste={onPaste}
39+
onUpload={onUpload}
40+
/>
41+
);
42+
43+
fireEvent.click(screen.getByRole("button", { name: "Paste" }));
44+
fireEvent.click(screen.getByRole("button", { name: "Upload" }));
45+
46+
expect(onPaste).toHaveBeenCalledTimes(1);
47+
expect(onUpload).toHaveBeenCalledTimes(1);
48+
});
49+
```
50+
51+
- [ ] **Step 2: Run the test to verify it fails**
52+
53+
Run: `pnpm vitest packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.test.tsx -t "renders paste and upload actions and dispatches their callbacks" -v`
54+
55+
Expected: fail because the props and buttons do not exist yet.
56+
57+
- [ ] **Step 3: Write the minimal implementation**
58+
59+
Add `onPaste` and `onUpload` props to `MobileTerminalInputBar`, render two leading action buttons in the mobile bar, and forward clicks to the callbacks. In `xterm-host.tsx`, pass handlers that will be implemented in the next task.
60+
61+
```tsx
62+
interface MobileTerminalInputBarProps {
63+
// existing props...
64+
onPaste: () => void;
65+
onUpload: () => void;
66+
}
67+
```
68+
69+
- [ ] **Step 4: Run the test to verify it passes**
70+
71+
Run: `pnpm vitest packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.test.tsx -v`
72+
73+
Expected: pass, with the new buttons appearing before the terminal key group.
74+
75+
- [ ] **Step 5: Commit**
76+
77+
```bash
78+
git add packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.tsx packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.test.tsx packages/web/src/features/terminal-panel/views/shared/xterm-host.tsx
79+
git commit -m "feat: add mobile terminal paste and upload actions"
80+
```
81+
82+
### Task 2: Implement clipboard paste and file-picker upload flows
83+
84+
**Files:**
85+
- Modify: `packages/web/src/features/terminal-panel/uploads/use-paste-drop-upload.ts`
86+
- Modify: `packages/web/src/features/terminal-panel/views/shared/xterm-host.tsx`
87+
- Test: `packages/web/src/features/terminal-panel/uploads/use-paste-drop-upload.test.tsx`
88+
- Test: `packages/web/src/features/terminal-panel/__tests__/xterm-host.test.tsx`
89+
90+
- [ ] **Step 1: Write the failing test**
91+
92+
Add coverage for two new helpers:
93+
- a clipboard path that reads `ClipboardItem`s or text and uploads image files when present
94+
- a file-picker path that uploads selected files and then writes the quoted terminal command back into the PTY
95+
96+
```ts
97+
it("uploads clipboard image files when paste is requested", async () => {
98+
// mock navigator.clipboard.read() to return an image ClipboardItem
99+
// assert uploadFiles receives a File and sendTextToTerminal gets the quoted path
100+
});
101+
102+
it("uploads files selected from the picker when upload is requested", async () => {
103+
// mock an <input type=\"file\"> selection and assert the same upload path is used
104+
});
105+
```
106+
107+
- [ ] **Step 2: Run the tests to verify they fail**
108+
109+
Run:
110+
`pnpm vitest packages/web/src/features/terminal-panel/uploads/use-paste-drop-upload.test.tsx packages/web/src/features/terminal-panel/__tests__/xterm-host.test.tsx -v`
111+
112+
Expected: fail because the new public helpers and host wiring do not exist yet.
113+
114+
- [ ] **Step 3: Write the minimal implementation**
115+
116+
Extend `use-paste-drop-upload` with explicit methods for:
117+
- reading clipboard files/text from a user gesture
118+
- uploading an arbitrary `File[]`
119+
120+
Keep the existing paste/drop DOM listeners intact for desktop and non-mobile surfaces. In `xterm-host.tsx`, wire the new mobile buttons to the new helpers and add a hidden file input or equivalent picker flow scoped to mobile only.
121+
122+
```ts
123+
// shape only; keep existing uploadFiles/quoteShellSingle flow
124+
type UploadSource = "clipboard" | "picker";
125+
```
126+
127+
- [ ] **Step 4: Run the tests to verify they pass**
128+
129+
Run:
130+
`pnpm vitest packages/web/src/features/terminal-panel/uploads/use-paste-drop-upload.test.tsx packages/web/src/features/terminal-panel/__tests__/xterm-host.test.tsx -v`
131+
132+
Expected: pass, with clipboard and picker uploads both producing quoted terminal insertions and error toasts on failure.
133+
134+
- [ ] **Step 5: Commit**
135+
136+
```bash
137+
git add packages/web/src/features/terminal-panel/uploads/use-paste-drop-upload.ts packages/web/src/features/terminal-panel/views/shared/xterm-host.tsx packages/web/src/features/terminal-panel/uploads/use-paste-drop-upload.test.tsx packages/web/src/features/terminal-panel/__tests__/xterm-host.test.tsx
138+
git commit -m "feat: wire mobile terminal clipboard and file upload"
139+
```
140+
141+
### Task 3: Add labels, polish layout, and verify mobile behavior
142+
143+
**Files:**
144+
- Modify: `packages/web/src/locales/en.json`
145+
- Modify: `packages/web/src/locales/zh.json`
146+
- Modify: `packages/web/src/styles/components.css`
147+
- Test: `packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.test.tsx`
148+
149+
- [ ] **Step 1: Write the failing test**
150+
151+
Extend the mobile input bar test to assert the new action buttons are present, readable, and do not collapse the existing terminal key order on narrow layouts.
152+
153+
```ts
154+
expect(screen.getByRole("button", { name: "Paste" })).toBeInTheDocument();
155+
expect(screen.getByRole("button", { name: "Upload" })).toBeInTheDocument();
156+
```
157+
158+
- [ ] **Step 2: Run the test to verify it fails**
159+
160+
Run: `pnpm vitest packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.test.tsx -v`
161+
162+
Expected: fail until the labels and layout styles are added.
163+
164+
- [ ] **Step 3: Write the minimal implementation**
165+
166+
Add localized labels for the two actions in `en.json` and `zh.json`, then update `components.css` so the two action buttons read as a separate group from the terminal keys without shrinking the existing soft-key row.
167+
168+
- [ ] **Step 4: Run the tests to verify they pass**
169+
170+
Run: `pnpm vitest packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.test.tsx packages/web/src/features/terminal-panel/uploads/use-paste-drop-upload.test.tsx packages/web/src/features/terminal-panel/__tests__/xterm-host.test.tsx -v`
171+
172+
Expected: pass, and the mobile bar should still fit on small screens with horizontal scrolling for the terminal keys.
173+
174+
- [ ] **Step 5: Commit**
175+
176+
```bash
177+
git add packages/web/src/locales/en.json packages/web/src/locales/zh.json packages/web/src/styles/components.css packages/web/src/features/terminal-panel/mobile/mobile-terminal-input-bar.test.tsx
178+
git commit -m "feat: polish mobile terminal paste and upload actions"
179+
```
180+
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# README Top Structure Implementation Plan
2+
3+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4+
5+
**Goal:** Restructure the top of both README files for faster product comprehension on GitHub and add a README-friendly animated demo preview.
6+
7+
**Architecture:** Keep the existing repository sections after quick start, but replace the top section with a tighter landing-style structure. Use a lightweight animated GIF as the inline preview in README and keep the existing `mp4` as the full demo target.
8+
9+
**Tech Stack:** Markdown, ffmpeg, existing demo assets in `docs/assets`
10+
11+
---
12+
13+
### Task 1: Create README-Friendly Demo Preview Asset
14+
15+
**Files:**
16+
- Create: `docs/assets/demo-preview.gif`
17+
- Modify: `docs/assets/demo.mp4` (no changes expected)
18+
- Modify: `docs/assets/demo-poster.png` (no changes expected)
19+
20+
- [ ] **Step 1: Generate a compact animated GIF from the recorded MP4**
21+
22+
Run:
23+
24+
```bash
25+
ffmpeg -y -i docs/assets/demo.mp4 -vf "fps=8,scale=960:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=bayer:bayer_scale=3" -loop 0 docs/assets/demo-preview.gif
26+
```
27+
28+
Expected: `docs/assets/demo-preview.gif` is created successfully.
29+
30+
- [ ] **Step 2: Verify the GIF asset exists and is a reasonable size**
31+
32+
Run:
33+
34+
```bash
35+
ls -lh docs/assets/demo-preview.gif docs/assets/demo.mp4 docs/assets/demo-poster.png
36+
```
37+
38+
Expected: the GIF exists and remains small enough for repository use.
39+
40+
- [ ] **Step 3: Keep the MP4 as the full demo target**
41+
42+
No file edit required. The README will use the GIF as inline preview and link through to `docs/assets/demo.mp4`.
43+
44+
### Task 2: Refactor README.md Top Section
45+
46+
**Files:**
47+
- Modify: `README.md`
48+
49+
- [ ] **Step 1: Replace the current top block with the approved landing-style structure**
50+
51+
Edit the top portion of `README.md` so it contains:
52+
53+
- logo and title
54+
- sharper one-line positioning statement
55+
- supporting paragraph
56+
- reduced badge set
57+
- CTA row with `Watch Demo`, `Quick Start`, `Star on GitHub`
58+
- language/docs links
59+
- inline GIF preview linked to `docs/assets/demo.mp4`
60+
- one-line demo framing copy
61+
- `Why It Feels Different`
62+
- quick start moved up
63+
64+
- [ ] **Step 2: Remove or move down top-of-page content that competes with the demo**
65+
66+
Specifically remove from the top block:
67+
68+
- blockquote slogan
69+
- top six-item feature list
70+
- top static workspace overview screenshot
71+
- discussions / issues / contributors badges from the first visual block
72+
73+
- [ ] **Step 3: Keep lower repository sections unchanged unless needed for heading continuity**
74+
75+
Preserve existing sections below quick start, including use cases, screenshots, feature overview, docs, roadmap, contributing, and license.
76+
77+
### Task 3: Refactor README.zh-CN.md Top Section
78+
79+
**Files:**
80+
- Modify: `README.zh-CN.md`
81+
82+
- [ ] **Step 1: Mirror the English information architecture in Chinese**
83+
84+
Edit the top portion of `README.zh-CN.md` so it matches the same structure and CTA order as `README.md`.
85+
86+
- [ ] **Step 2: Use Chinese copy that preserves the same product claims**
87+
88+
The Chinese version should clearly communicate:
89+
90+
- browser-based AI coding workspace
91+
- cross-device continuity
92+
- Claude Code and Codex in one workspace
93+
- demo first, star second
94+
95+
- [ ] **Step 3: Keep lower sections intact**
96+
97+
Do not redesign the rest of the Chinese README in this pass.
98+
99+
### Task 4: Verify README Rendering Inputs
100+
101+
**Files:**
102+
- Modify: `README.md`
103+
- Modify: `README.zh-CN.md`
104+
- Create: `docs/assets/demo-preview.gif`
105+
106+
- [ ] **Step 1: Verify README media references**
107+
108+
Run:
109+
110+
```bash
111+
rg -n "demo-preview\\.gif|demo\\.mp4|demo-poster\\.png|Quick Start|快速开始" README.md README.zh-CN.md
112+
```
113+
114+
Expected: both README files reference the new GIF preview and the MP4 target consistently.
115+
116+
- [ ] **Step 2: Inspect the diff for only intended files**
117+
118+
Run:
119+
120+
```bash
121+
git diff -- README.md README.zh-CN.md docs/assets/demo-preview.gif
122+
```
123+
124+
Expected: only the approved top-structure and preview changes appear.
125+
126+
- [ ] **Step 3: Verify repository status remains scoped**
127+
128+
Run:
129+
130+
```bash
131+
git status --short
132+
```
133+
134+
Expected: only intended README/media/spec/plan changes are new in this task; unrelated untracked files remain untouched.

0 commit comments

Comments
 (0)