Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Agentic React

[English](./README.md) | [中文](./README.zh-CN.md)
<p align="center">
<a href="./README.md">English</a> ·
<a href="./README.zh-CN.md">简体中文</a>
</p>

**Give coding agents the exact React context behind the UI they are editing.**

Expand Down Expand Up @@ -37,6 +40,12 @@ Install one dev adapter, select one or many elements in the browser, and pass so
- **Dev-only bridge:** keep local source lookup and MCP transport in development tooling, outside production bundles.
- **Multi-select and tuning:** collect several UI targets, inspect styling, and turn visual adjustments into prompt-ready instructions.

### Measured Source-Location Benchmark

In a controlled three-area benchmark on the Webpack Issue Tracking Playground, pasted Agentic React UI context used **53.6% fewer total tokens** than cropped screenshot inputs for the same correct source-location tasks, with **66.1% lower API-equivalent cost** under the recorded gpt-5.4 pricing assumptions.

This is measured evidence from three UI areas, not a general guarantee. See the [benchmark write-up](./docs/blog/agentic-react-ui-context-token-benchmark.md) and [raw evidence manifest](./docs/benchmarks/ui-context-token-study/results.json) for setup, prompts, costs, hashes, limitations, and the full matrix.

The packages are published under the `@agentic-react` namespace.

## Packages
Expand Down
11 changes: 10 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Agentic React

[English](./README.md) | [中文](./README.zh-CN.md)
<p align="center">
<a href="./README.md">English</a> ·
<a href="./README.zh-CN.md">简体中文</a>
</p>

**把 UI 背后的 React 上下文和源码位置,直接交给 coding agent。**

Expand Down Expand Up @@ -37,6 +40,12 @@ source trace:
- **Dev-only bridge:** 本地源码查找和 MCP transport 只存在于开发工具链,不进入 production bundle。
- **Multi-select and tuning:** 一次收集多个 UI target,检查样式,并把视觉调整转成 prompt-ready instructions。

### 实测源码定位 Benchmark

在 Webpack Issue Tracking Playground 的三组受控测试中,针对相同且均能正确定位源码的任务,粘贴 Agentic React UI context 相比输入裁剪截图,**总 token 使用量减少了 53.6%**;按照测试所记录的 gpt-5.4 定价假设换算,**API 等价成本降低了 66.1%**。

这组数据来自三个 UI 区域,不代表对所有场景的普遍保证。完整的测试设置、prompt、成本公式、文件哈希、限制条件和对照矩阵,请参阅[中文 Benchmark 文章](./docs/blog/agentic-react-ui-context-token-benchmark.zh-CN.md)与[原始证据清单](./docs/benchmarks/ui-context-token-study/results.json)。

packages 发布在 `@agentic-react` namespace 下。

## Packages
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/benchmarks/ui-context-token-study/contexts/issue-detail.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<web_context type="react_component_location">
component: Inspector
selector: div > .inspector > h2
source: /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:303

details:
source trace:
Inspector at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:589:3
-> WorkspacePreview at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:801:96
-> <MantineThemeProvider> from @mantine/core
-> App at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:589:3
-> App at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:801:96
-> <Context.Provider> from @mantine/core
component: Inspector
selector: div > .inspector > h2
</web_context>
16 changes: 16 additions & 0 deletions docs/benchmarks/ui-context-token-study/contexts/issue-row.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<web_context type="react_component_location">
component: IssueList
selector: .issue-rows > button:nth-of-type(1) > span:nth-of-type(2)
source: /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:275

details:
source trace:
IssueList at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:388:3
-> WorkspacePreview at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:801:96
-> <MantineThemeProvider> from @mantine/core
-> App at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:388:3
-> App at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:801:96
-> <Context.Provider> from @mantine/core
component: IssueList
selector: .issue-rows > button:nth-of-type(1) > span:nth-of-type(2)
</web_context>
10 changes: 10 additions & 0 deletions docs/benchmarks/ui-context-token-study/contexts/live-analytics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<web_context type="react_component_location">
component: AnalyticsPanel
selector: .feature-grid > article:nth-of-type(3) > h3
source: /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:415

details:
in AnalyticsPanel (at /Users/jazelly/Desktop/github/my-proj/agentic-react/playground/agentic-react-webpack-playground/src/App.jsx:415)
component: AnalyticsPanel
selector: .feature-grid > article:nth-of-type(3) > h3
</web_context>
Loading
Loading