-
Notifications
You must be signed in to change notification settings - Fork 0
feat(live): add live-poll tool and pending signals guidance #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chiplay
wants to merge
2
commits into
main
Choose a base branch
from
feature/live-poll-skill
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+132
−16
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| --- | ||
| name: subtext:live-review | ||
| description: Open a Subtext live viewer session for real-time human-agent collaboration when making UI or frontend changes. Connects a hosted browser via the Subtext MCP server, shares a viewer URL so the human can watch the agent work, and polls for comments and signals throughout. Use when the user asks to build, fix, update, or modify any user-facing surface — components, pages, layouts, styles, copy, or routing. Also use when the user says "let me watch", "open a viewer", "start a live session", or requests live feedback on changes. Do NOT use for pure backend, API, or infrastructure changes with no visual impact. | ||
| metadata: | ||
| requires: | ||
| skills: ["subtext:shared", "subtext:live", "subtext:tunnel", "subtext:agent-playback-link", "subtext:comments"] | ||
| --- | ||
|
|
||
| # Live Review | ||
|
|
||
| Real-time human-agent collaboration for UI development. The agent works in a hosted browser while the human watches via a Subtext viewer, leaving comments and annotations as feedback. The agent polls for signals between actions and adjusts its plan based on human input. | ||
|
|
||
| ## When to Use | ||
|
|
||
| - User asks to build, fix, update, or modify a UI component, page, layout, style, or copy | ||
| - User says "let me watch", "open a viewer", "start a live session" | ||
| - User wants to give real-time feedback on visual changes | ||
| - Any task that will change what users see | ||
|
|
||
| ## When NOT to Use | ||
|
|
||
| - Pure backend, API, or infrastructure changes | ||
| - Database migrations, feature flag config, gRPC endpoints | ||
| - Changes with no visual impact | ||
|
|
||
| ## Setup Phase | ||
|
|
||
| Before starting implementation: | ||
|
|
||
| ### 1. Determine the target URL | ||
|
|
||
| - If the user mentioned a specific page, infer the local dev URL | ||
| - If unclear, ask: "Which page should I open in the viewer?" | ||
| - Default to the app root (e.g. `http://localhost:3000`) if working on a global component | ||
|
|
||
| ### 2. Connect the hosted browser | ||
|
|
||
| - Follow the `subtext:tunnel` flow to connect to the local dev server | ||
| - Follow the `subtext:live` connection pattern to open the page | ||
| - Authenticate if redirected to a login page | ||
|
|
||
| ### 3. Share the viewer | ||
|
|
||
| - Follow the `subtext:agent-playback-link` pattern to construct and share the viewer URL | ||
| - Tell the user: "You can watch, leave comments, and annotate while I work. I'll check for your feedback between each action." | ||
|
|
||
| ### 4. Start the signal heartbeat | ||
|
|
||
| - Follow the polling guidance in `subtext:live` (Pending Signals section) | ||
| - Check for signals between every subsequent action during implementation | ||
|
|
||
| ### 5. Capture baseline state | ||
|
|
||
| - Screenshot the current page before making changes (upload with `upload=true`) | ||
| - Save the artifact URL — include it in the PR as "before" state alongside the viewer URL for downstream reviewers | ||
|
|
||
| ## During Implementation | ||
|
|
||
| The agent proceeds with its normal implementation workflow (brainstorming, TDD, code edits, builds, etc.). This skill does NOT own the implementation — it provides the feedback loop around it. | ||
|
|
||
| **Between every action:** | ||
| - Call `live-poll` to check for pending signals | ||
| - If a `new_comment` signal arrives: read it, reply via `comment-reply`, adjust plan if the feedback redirects the work | ||
| - If a `control_change: human_driving` signal arrives: stop input actions, keep polling with read-only tools, wait for `control_change: agent_driving` before resuming | ||
|
|
||
| **After code changes that affect the UI:** | ||
| - Rebuild the frontend | ||
| - Refresh or re-navigate the live browser to pick up changes | ||
| - Screenshot the result for visual verification | ||
|
|
||
| ## Teardown Phase | ||
|
|
||
| After implementation is complete: | ||
|
|
||
| ### 1. Capture the final state | ||
|
|
||
| - Screenshot the result (upload with `upload=true`) | ||
| - Save as "after" artifact for the PR | ||
|
|
||
| ### 2. Check for unresolved comments | ||
|
|
||
| - Call `comment-list` to review any comments from the human | ||
| - If unresolved comments remain, ask the user if they should be addressed before finishing | ||
|
|
||
| ### 3. Disconnect | ||
|
|
||
| - Call `live-disconnect` to free the hosted browser | ||
| - Use the `subtext:agent-playback-link` pattern to construct a shareable playback link for the PR | ||
|
|
||
| ### 4. Summarize for the PR | ||
|
|
||
| Include in the PR description: | ||
| - Before/after screenshots | ||
| - Agent playback link (so reviewers can replay the session) | ||
| - Any comment threads that informed the changes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder if we should have a tool that just does this and stores them somewhere the agent can see? getting the agent to poll for these on it's own might be unpredictable. not really sure what's best here tbh since even a sideband poll requires something back to claude or requires claude to do something to look.