-
Notifications
You must be signed in to change notification settings - Fork 328
docs: add agent integration roadmap to README #344
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
aidenybai
wants to merge
1
commit into
main
Choose a base branch
from
devin/1778728637-agent-integration-plan
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.
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 |
|---|---|---|
|
|
@@ -190,6 +190,57 @@ actions: [ | |
|
|
||
| See [`packages/react-grab/src/types.ts`](https://github.com/aidenybai/react-grab/blob/main/packages/react-grab/src/types.ts) for the full `Plugin`, `PluginHooks`, and `PluginConfig` interfaces. | ||
|
|
||
| ## Agent Integration | ||
|
|
||
| React Grab connects to coding agents through a layered architecture. Each layer builds on the previous — use whichever fits your workflow. | ||
|
|
||
| ### Layer 0 — Paste (zero setup) | ||
|
|
||
| Grab an element, then **⌘V** / **Ctrl+V** into any agent chat. The clipboard already carries the source location, component stack, and HTML snippet. Works with every agent, no configuration needed. | ||
|
|
||
| ### Layer 1 — Context File (zero-config auto-discovery) | ||
|
|
||
| When `grab watch` is running, React Grab maintains a living context file at `.react-grab/context.md` with the latest grab formatted as markdown. Agents that auto-index project files (Cursor, Claude Code, Copilot, etc.) discover it automatically — no skill or tool call required. | ||
|
|
||
| ```bash | ||
| # Start the background watcher (polls clipboard → writes to .react-grab/) | ||
| npx grab@latest watch | ||
| ``` | ||
|
|
||
| The `.react-grab/` directory also keeps a grab journal (`.react-grab/grabs/`) so past selections survive clipboard overwrites and can be referenced later via `grab history`. | ||
|
|
||
| ### Layer 2 — CLI Primitives | ||
|
|
||
| Composable one-shot commands that skills and scripts can call: | ||
|
|
||
| ```bash | ||
| grab latest # latest grab as JSON (reads .react-grab/ or falls back to clipboard) | ||
| grab context # latest grab as formatted markdown | ||
| grab log # stream grabs as NDJSON (runs until killed) | ||
| grab history # list past grabs from .react-grab/grabs/ | ||
| ``` | ||
|
|
||
| ### Layer 3 — Hooks | ||
|
|
||
| Git-hook-style executables that fire on each grab: | ||
|
|
||
| ```bash | ||
| .react-grab/hooks/ | ||
| └── on-grab # receives JSON via stdin + env vars | ||
| ``` | ||
|
|
||
| Hooks are completely agent-agnostic — any executable that reads stdin works. | ||
|
|
||
| ### Per-Agent Setup | ||
|
|
||
| `grab add` detects your agent and installs the right integration format: | ||
|
|
||
| ```bash | ||
| grab add # interactive: pick agents | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Don't present the Cursor/Claude adapter examples as current commands yet; the CLI is still MCP-only, so these examples will fail if users copy them. Prompt for AI agents |
||
| grab add cursor # Cursor-specific integration | ||
| grab add claude # Claude Code-specific integration | ||
| ``` | ||
|
|
||
| ## Resources & Contributing Back | ||
|
|
||
| Want to try it out? Check out [our demo](https://react-grab.com). | ||
|
|
||
Oops, something went wrong.
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.
README documents CLI commands (grab watch, grab latest, grab context, grab log, grab history) that are not implemented in the codebase