Skip to content

feat: improve feature-video skill with GitHub native video upload#344

Merged
tmchow merged 9 commits intomainfrom
feat/video-skill-native-upload
Mar 23, 2026
Merged

feat: improve feature-video skill with GitHub native video upload#344
tmchow merged 9 commits intomainfrom
feat/video-skill-native-upload

Conversation

@tmchow
Copy link
Copy Markdown
Collaborator

@tmchow tmchow commented Mar 23, 2026

Summary

The feature-video skill previously required external storage (Cloudflare R2 via rclone) to host video files, or fell back to GitHub Release assets. Both approaches had significant problems:

  • R2/rclone: Heavy dependency chain requiring cloud storage configuration, bucket setup, and public URL validation. Most users don't have this infrastructure.
  • Release assets: URLs from gh release upload render as plain download links in PR descriptions, not inline video players. Clickable GIF previews trigger downloads on mobile -- unacceptable UX.

Only user-attachments/assets/ URLs (produced by GitHub's native paste/drag-drop upload) render as inline <video> players with controls. There is no public API for this -- GitHub keeps the upload endpoint private (cli/cli#1895, #4228, #4465 all closed "not planned").

Solution

Use agent-browser with Playwright to programmatically upload videos through GitHub's comment form file input, producing native inline video URLs without any external storage dependency.

Changes

  • Native GitHub upload: Use agent-browser upload to set video files on #fc-new_comment_field, extract the user-attachments/assets/ URL from the textarea, clear without submitting
  • Chrome session auth: --engine chrome --session-name github with one-time headed login handles 2FA/SSO/OAuth; cookies persist for weeks
  • Auth flow reordered: Session validity check now precedes auth setup (was reversed)
  • No-PR handling: Step 1 now detects missing PRs and offers to create a draft PR automatically or proceed in record-only mode (save video locally, upload later). The skill is "feature-video" not "PR-video" -- it should work regardless of PR state.
  • Scratch space: Moved from tmp/ to .context/compound-engineering/feature-video/ per repo convention
  • Pushier description: Added trigger phrases for better auto-triggering ("demo a feature", "create a PR video", "add a video to a pull request")
  • Cross-platform: Added platform question tool references (AskUserQuestion, request_user_input, ask_user)
  • Troubleshooting table: 7 common failure scenarios with causes and fixes
  • Solution docs: Two new learnings in docs/solutions/integrations/ documenting the upload mechanism and browser auth patterns
  • Removed: All R2, rclone, GIF preview generation, and release asset logic (~189 lines removed)

Test plan

  • Verified native upload produces user-attachments/assets/ URL against tmchow/test-video-embed
  • Confirmed inline video player renders in PR description (not a download link)
  • Validated session persistence across agent-browser restarts
  • Confirmed no R2/rclone/release asset references remain in SKILL.md
  • Verify skill triggers on natural prompts like "add a video to the PR"
  • Test session expiry detection and re-auth flow
  • Test no-PR flow (draft creation and record-only mode)

…eo upload

Drop the rclone/R2 external storage dependency and GitHub Release asset
fallback in favor of uploading videos directly through GitHub's native
attachment system via agent-browser. This produces user-attachments/assets/
URLs that render as inline video players in PR descriptions -- the same
result as pasting a video interactively in the GitHub editor.

Key changes:
- Use agent-browser upload command with Chrome engine to set video files
  on GitHub's hidden comment form file input
- Add session-based auth flow (--engine chrome --session-name github)
  with one-time headed login for 2FA/SSO/OAuth compatibility
- Reorder auth check before auth setup for correct execution flow
- Move scratch files to .context/compound-engineering/feature-video/
- Expand description for better auto-triggering
- Add cross-platform question tool references
- Add troubleshooting table for common failure modes
- Add solution docs for native upload pattern and browser auth patterns
- Remove all R2, rclone, GIF preview, and release asset logic
@tmchow tmchow changed the title feat(feature-video): replace R2/release assets with GitHub native video upload feat: improve feature-video skill with GitHub native video upload Mar 23, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18161e744b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
…r record-only mode

The skill name is "feature-video" not "PR-video" -- it should be able to
record a video of a feature regardless of whether a PR exists yet. Step 1
now detects the missing PR and offers to create a draft PR automatically
or proceed in record-only mode (save locally, upload later).
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8df8631673

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
- P1: Add URL validation guard -- verify extracted URL contains
  user-attachments/assets/ before editing PR body, with retry logic
- P1: Record-only mode now works end-to-end -- Step 2 falls back to
  git diff/log when no PR exists instead of failing on gh pr view
- P2: Respect explicit PR numbers -- only check current branch when
  no PR number argument was provided
- P2: Preserve existing textarea content -- save/restore any draft
  text in the comment box around the upload operation
- P2: Per-run screenshot directories ($RUN_ID) prevent stale frames
  from prior runs being spliced into new videos
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 721be6339e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
- P1: Use double quotes for ffmpeg -i glob so $RUN_ID expands correctly
- P2: Move textarea save before upload to capture the user's actual
  draft, not the post-upload mutated content
- P2: Detect default branch via gh repo view instead of hardcoding
  main, so record-only mode works in repos using master/develop/etc
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4ac227cc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
tmchow added 2 commits March 22, 2026 19:09
- P2: Replace shell $RUN_ID variable with [RUN_ID] placeholder that
  the agent substitutes with the concrete timestamp value, since shell
  variables don't persist across separate code blocks
- P2: JSON-encode saved textarea content before restoring to handle
  apostrophes, newlines, and special characters in draft text
- P2: Cleanup only removes the current run's directory, not the whole
  feature-video tree, preserving other in-progress or record-only runs
Verify ffmpeg, agent-browser, and gh are installed in Step 1b before
proceeding to recording. Prevents wasting time capturing screenshots
only to fail at the encoding step.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 607886e813

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
- Add upload-only resume mode: pass an .mp4 path as first argument to
  skip recording and go directly to upload (fixes "no resume path" gap)
- Inline DEFAULT_BRANCH into a single shell block so it persists for
  both git diff and git log in record-only mode
- Add plain-chat fallback for the GitHub login prompt per cross-platform
  compliance checklist
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 199e64905d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md
tmchow added 2 commits March 22, 2026 20:34
- Use caller-provided .mp4 path during upload in resume mode instead of
  hardcoding the RUN_ID path
- Fix textarea restore: assign JS string literal directly instead of
  JSON.parse(), which breaks on multiline content
Only delete screenshots (not the video) when in record-only mode or
after upload failure, so the user can still upload the MP4 later.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a347555e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md
Comment thread plugins/compound-engineering/skills/feature-video/SKILL.md
@tmchow tmchow merged commit 4aa50e1 into main Mar 23, 2026
2 checks passed
@github-actions github-actions bot mentioned this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant