@atlassian/chippy 0.0.0-stage → 0.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +188 -2
  3. package/bin/chippy.mjs +134 -0
  4. package/bin/pack.mjs +184 -0
  5. package/lib/avalanche.js +2570 -0
  6. package/lib/avalanche.js.map +7 -0
  7. package/lib/bootstrap.d.ts +1 -0
  8. package/lib/bootstrap.js +51 -0
  9. package/lib/bootstrap.js.map +7 -0
  10. package/lib/browser.js +15 -0
  11. package/lib/browser.js.map +7 -0
  12. package/lib/extension/avalanche.es.js +5396 -0
  13. package/lib/extension/avalanche.es.js.map +1 -0
  14. package/lib/extension/chippy-page-bridge.js +1833 -0
  15. package/lib/extension/inspect-react.js +216 -0
  16. package/lib/extension/layout-lab.js +1453 -0
  17. package/lib/extension/panel-dom.js +90 -0
  18. package/lib/extension/resolve-probes.js +342 -0
  19. package/lib/mcp-skill/LICENSE +201 -0
  20. package/lib/mcp-skill/README.md +150 -0
  21. package/lib/mcp-skill/SKILL.md +330 -0
  22. package/lib/mcp-skill/browser-scripts/playwright-probes.js +368 -0
  23. package/lib/mcp-skill/browser-scripts/playwright-session.js +114 -0
  24. package/lib/mcp-skill/extension/avalanche.es.js +5396 -0
  25. package/lib/mcp-skill/extension/avalanche.es.js.map +1 -0
  26. package/lib/mcp-skill/extension/avalanche.iife.js +5397 -0
  27. package/lib/mcp-skill/extension/avalanche.iife.js.map +1 -0
  28. package/lib/mcp-skill/extension/background.js +323 -0
  29. package/lib/mcp-skill/extension/chippy-page-bridge.js +1833 -0
  30. package/lib/mcp-skill/extension/content-script.js +167 -0
  31. package/lib/mcp-skill/extension/devtools-hook-shim.js +68 -0
  32. package/lib/mcp-skill/extension/early-bootstrap.js +47 -0
  33. package/lib/mcp-skill/extension/icon-128.png +0 -0
  34. package/lib/mcp-skill/extension/icon-16.png +0 -0
  35. package/lib/mcp-skill/extension/icon-32.png +0 -0
  36. package/lib/mcp-skill/extension/icon-48.png +0 -0
  37. package/lib/mcp-skill/extension/inspect-react.js +216 -0
  38. package/lib/mcp-skill/extension/layout-lab.js +1453 -0
  39. package/lib/mcp-skill/extension/logo.svg +14 -0
  40. package/lib/mcp-skill/extension/manifest.json +69 -0
  41. package/lib/mcp-skill/extension/panel-dom.js +90 -0
  42. package/lib/mcp-skill/extension/panel-settings.js +191 -0
  43. package/lib/mcp-skill/extension/popup.html +41 -0
  44. package/lib/mcp-skill/extension/popup.js +80 -0
  45. package/lib/mcp-skill/extension/probe-descriptor.js +241 -0
  46. package/lib/mcp-skill/extension/resolve-probes.js +342 -0
  47. package/lib/mcp-skill/package.json +1 -0
  48. package/lib/mcp-skill/references/README.md +56 -0
  49. package/lib/mcp-skill/references/active-stimulus.md +85 -0
  50. package/lib/mcp-skill/references/avalanche-detector.md +731 -0
  51. package/lib/mcp-skill/references/bdd-router.md +310 -0
  52. package/lib/mcp-skill/references/browser-runtime-api.md +193 -0
  53. package/lib/mcp-skill/references/command-output-formats.md +1075 -0
  54. package/lib/mcp-skill/references/command-surface.md +183 -0
  55. package/lib/mcp-skill/references/cynefin.md +99 -0
  56. package/lib/mcp-skill/references/debug-hook.md +161 -0
  57. package/lib/mcp-skill/references/fixing-performance.md +490 -0
  58. package/lib/mcp-skill/references/hook-metrics.md +199 -0
  59. package/lib/mcp-skill/references/hooks-inspection.md +61 -0
  60. package/lib/mcp-skill/references/jira-taxonomy.md +81 -0
  61. package/lib/mcp-skill/references/mcp.md +122 -0
  62. package/lib/mcp-skill/references/mode-a-injection.md +68 -0
  63. package/lib/mcp-skill/references/operating-model.md +128 -0
  64. package/lib/mcp-skill/references/playwright-cli-setup.md +105 -0
  65. package/lib/mcp-skill/references/playwright-probes.md +205 -0
  66. package/lib/mcp-skill/references/procedures.md +545 -0
  67. package/lib/mcp-skill/references/recipes.txt +114 -0
  68. package/lib/mcp-skill/references/stability-render.md +428 -0
  69. package/lib/mcp-skill/references/test-mode-playbook.md +193 -0
  70. package/lib/mcp-skill/references/troubleshooting.md +54 -0
  71. package/lib/mcp-skill/scripts/avalanche-analyze.cjs +495 -0
  72. package/lib/mcp-skill/scripts/build-avalanche-command.js +34 -0
  73. package/lib/mcp-skill/scripts/build-fiber-state-command.js +19 -0
  74. package/lib/mcp-skill/scripts/chippy-helper-server.js +1710 -0
  75. package/lib/mcp-skill/scripts/chippy-mcp.cjs +273 -0
  76. package/lib/mcp-skill/scripts/chippy.sh +1218 -0
  77. package/lib/mcp-skill/scripts/format-probe-result.js +34 -0
  78. package/lib/mcp-skill/scripts/helper-access.js +144 -0
  79. package/lib/mcp-skill/scripts/probe-annotation-channel.js +116 -0
  80. package/lib/mcp-skill/scripts/search-recipes.js +248 -0
  81. package/lib/mcp-skill/snippets/README.md +89 -0
  82. package/lib/mcp-skill/snippets/count-context-consumers.js +40 -0
  83. package/lib/mcp-skill/snippets/find-context-providers.js +38 -0
  84. package/lib/mcp-skill/snippets/find-legacy-context.js +47 -0
  85. package/lib/mcp-skill/snippets/find-prop.js +83 -0
  86. package/lib/mcp-skill/snippets/hook-metrics-sample.js +69 -0
  87. package/lib/mcp-skill/snippets/hook-metrics.js +60 -0
  88. package/lib/mcp-skill/snippets/hook-tracker.js +198 -0
  89. package/lib/mcp-skill/snippets/stability-nudge.js +101 -0
  90. package/lib/package.json +1 -0
  91. package/lib/plugin.js +119 -0
  92. package/lib/plugin.js.map +7 -0
  93. package/lib/storybook/avalanche-panel-model.js +79 -0
  94. package/lib/storybook/brand.jsx +6 -0
  95. package/lib/storybook/connection-fallback.jsx +47 -0
  96. package/lib/storybook/constants.js +15 -0
  97. package/lib/storybook/context-card.jsx +171 -0
  98. package/lib/storybook/manager.jsx +403 -0
  99. package/lib/storybook/preset.js +7 -0
  100. package/lib/storybook/preview.js +263 -0
  101. package/lib/storybook/probe-annotation-editor.jsx +52 -0
  102. package/lib/storybook/probe-intent.js +23 -0
  103. package/lib/storybook/setup.js +93 -0
  104. package/lib/types/avalanche/commit-metrics-adapter.d.ts +76 -0
  105. package/lib/types/avalanche/commit-stats-indices.d.ts +41 -0
  106. package/lib/types/avalanche/commit-surface-ownership.d.ts +9 -0
  107. package/lib/types/avalanche/detector.d.ts +183 -0
  108. package/lib/types/avalanche/interaction-capture.d.ts +25 -0
  109. package/lib/types/avalanche/internals.d.ts +189 -0
  110. package/lib/types/avalanche/report-serializer.d.ts +283 -0
  111. package/lib/types/avalanche/reporter.d.ts +610 -0
  112. package/lib/types/chippy-bridge/fiber-source.d.ts +37 -0
  113. package/lib/types/chippy-bridge/react-renderer.d.ts +49 -0
  114. package/lib/types/chippy-bridge/source-map.d.ts +30 -0
  115. package/lib/types/debug-render/core.d.ts +72 -0
  116. package/lib/types/layout-lab/fiber-boundaries.d.ts +51 -0
  117. package/lib/types/layout-lab/fiber-walk.d.ts +131 -0
  118. package/lib/types/layout-lab/marker-context.d.ts +94 -0
  119. package/lib/types/package/avalanche.d.ts +6 -0
  120. package/lib/types/package/browser.d.ts +10 -0
  121. package/lib/types/package/plugin.d.ts +15 -0
  122. package/lib/types/plugins/atl/commit-metrics-adapter.d.ts +65 -0
  123. package/lib/types/plugins/atl/metrics-slot.d.ts +37 -0
  124. package/lib/types/plugins/index.d.ts +49 -0
  125. package/lib/types/plugins/jira/context-provider.d.ts +36 -0
  126. package/package.json +104 -4
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright (c) 2026 Atlassian US., Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,189 @@
1
- # Temporary Holding Version
1
+ ![Chippy logo](.agents/skills/chippy/extension/icon-48.png)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # Chippy
4
+
5
+ [![Atlassian license](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)
6
+
7
+ **A friend who helps you understand what’s happening, find the cause, and fix it.**
8
+
9
+ <p align="center">
10
+ <a href="assets/chippy-intro.mp4"><img src="assets/chippy-intro.svg" width="900" alt="Animated intro: Chippy connects your coding agent to the running React page through React's DevTools hook, traces a button to its component, owners, and source line, runs experiments on live state, separates a slow click's trigger from the busiest component, and shows the browser scripts, local helper, and agent skill working as one system."></a>
11
+ <br><a href="assets/chippy-intro.mp4">Watch with sound</a>
12
+ </p>
13
+
14
+ Chippy lets your coding agent see the React app running in your browser: which
15
+ component drew an element, its props and state, where it lives in source, and
16
+ what re-rendered during a slow interaction. Ask the agent, or point at an element
17
+ on the page and leave it a note.
18
+
19
+ Chippy works with standard React and needs no patched packages. Development
20
+ builds give the most detail; production builds show less, and every answer says
21
+ what was available. See [React compatibility](docs/react-compatibility.md).
22
+
23
+ ## What you can ask
24
+
25
+ - **Explore:** "Which components render this list, and what state do they hold?"
26
+ - **Debug:** "Where does this label's text come from?" or "Which boundary shows this spinner?"
27
+ - **Compare:** "What changed in the tree between these two states, or these two pages?"
28
+ - **Investigate:** "Why is this click slow?" or "What re-renders on initial load?"
29
+
30
+ ## Install
31
+
32
+ You need Node.js 22.12 or later and Chrome or another Chromium browser.
33
+
34
+ 1. Install the agent skill:
35
+
36
+ ```sh
37
+ npx @atlassian/chippy install
38
+ ```
39
+
40
+ This copies the skill to `~/.agents/skills/chippy` (run it again to update)
41
+ and prints the next steps with the exact paths for your machine. To install
42
+ it in a project instead, pass `--dir`, for example
43
+ `npx @atlassian/chippy install --dir .agents/skills/chippy`; the paths below
44
+ then start from that folder.
45
+
46
+ 2. Load the browser extension: open `chrome://extensions`, turn on
47
+ **Developer mode**, choose **Load unpacked**, and select the `extension`
48
+ folder the installer printed (`~/.agents/skills/chippy/extension` by
49
+ default). The folder picker hides dot-folders, so paste the path instead of
50
+ browsing: press **Cmd+Shift+G** on macOS or **Ctrl+L** on Linux, or use the
51
+ address bar on Windows.
52
+
53
+ 3. Open your app, click the Chippy extension icon, and enable Chippy for the
54
+ page's origin.
55
+
56
+ 4. Ask your agent to use Chippy on the page.
57
+
58
+ The agent runs Chippy through the skill's `chippy.sh` script, which needs bash
59
+ (macOS, Linux, or WSL on Windows). You don't start anything yourself: the agent
60
+ starts a local helper on `127.0.0.1:7823` when it needs one. A sandboxed agent
61
+ asks for permission to reach it; approve the prompt or allow `chippy.sh`. If
62
+ your agent runs in a container or a remote machine, see
63
+ [MCP setup](.agents/skills/chippy/references/mcp.md) for reaching the helper.
64
+
65
+ **Optional: connect over MCP.** If your agent supports MCP, it can call Chippy
66
+ as tools instead of running a script. Ask it:
67
+
68
+ > Connect Chippy over MCP using the MCP setup steps in the Chippy skill.
69
+
70
+ The agent adds the Chippy server to its own MCP configuration and checks the
71
+ connection. Some agents need a restart before the new tools appear. To set it
72
+ up yourself, see [MCP setup](.agents/skills/chippy/references/mcp.md).
73
+
74
+ ## Two ways to start
75
+
76
+ - **From the agent:** ask it about the page. It finds components by name, text,
77
+ test ID, source file, or prop, reads their state, clicks through the page, and
78
+ records renders.
79
+ - **From the page:** click the Chippy button in the page corner and drag a probe
80
+ marker (P1, or P2 to compare two elements) onto an element. Choose whether you
81
+ want it explained, investigated, or changed, and add a note. Then ask the agent
82
+ to read it, or to keep watching for new notes while you click around.
83
+
84
+ No extension? Once the agent has started the helper, paste this into the page's
85
+ console:
86
+
87
+ ```js
88
+ import('http://127.0.0.1:7823/__chippy/inject.mjs')
89
+ ```
90
+
91
+ Repeat it after every reload. Sites with a strict Content Security Policy block
92
+ it, and it can't record the initial page load; use the extension for that.
93
+
94
+ ## Evidence, then edits
95
+
96
+ The agent works from what actually rendered instead of guessing from a code
97
+ search. Some deep inspections re-run a component's code; if your components have
98
+ side effects during render, say so and the agent uses read-only inspection
99
+ instead. Chippy changes your source only when you ask it to, and checks the fix
100
+ against the same page.
101
+
102
+ ## Use Chippy from your own code
103
+
104
+ Install `@atlassian/chippy` in your project when the extension is not the right fit:
105
+
106
+ - **Catch re-render regressions in tests.** Record which components rendered
107
+ during an interaction, and why, in a test or a script, with no agent, helper, or
108
+ extension.
109
+ - **Connect pages the extension cannot reach**, such as an embedded browser or a
110
+ test runner, or connect from your app's startup code so Chippy sees the first
111
+ render.
112
+ - **Add Chippy to Storybook** as an addon.
113
+ - **Ship your own build** with extra plugins for your stack.
114
+
115
+ See the [package documentation](docs/npm-package.md) for setup.
116
+
117
+ ## How Chippy compares
118
+
119
+ Other tools read what React already exposes, such as a component name or a
120
+ source line, and hand it to a person or an agent. Chippy is a system of three
121
+ parts that work together:
122
+
123
+ - **In the browser,** Chippy walks React's fiber tree, owners, props, and hooks,
124
+ records commits during an interaction or page load, and can replay a
125
+ component's render to see how its hooks produced a value.
126
+ - **The local helper** stores that evidence and gives the agent only what it
127
+ needs: compact summaries instead of raw trees, renders ranked by where a
128
+ cascade started, and diffs between snapshots of two states or two pages.
129
+ - **The agent acts back on the page** at the React level, not only through
130
+ clicks: it finds fibers by name, text, test ID, file, or prop, forces a single
131
+ component to re-render, calls a component's callbacks directly, and records
132
+ what happens.
133
+
134
+ | Tool | Built for | What it gives you | Where it stops |
135
+ | --- | --- | --- | --- |
136
+ | [React Developer Tools](https://react.dev/learn/react-developer-tools) | A person in DevTools | Component tree, props, state, hooks, and the Profiler | You read the panels and decide what to change |
137
+ | [react-grab](https://www.react-grab.com/) | A person handing off to an agent | Hover an element and copy its component name, file and line, and HTML for your agent | Your agent takes it from the pasted context |
138
+ | [react-scan](https://react-scan.com/) | A person watching the page | Render outlines, a toolbar showing what changed, and alerts on slow frames | Shows what is slow; finding the cause and fixing it is up to you |
139
+ | [agent-browser](https://github.com/vercel-labs/agent-browser) | An agent driving a browser | Navigation, clicks, form input, snapshots, and screenshots | Works at the DOM and accessibility level, not inside React |
140
+ | **Chippy** | An agent working from runtime evidence | Live React state, render recordings, and snapshot diffs, reduced for the agent, plus React-level actions on the page | Changes the source when you ask, then re-checks the same page |
141
+
142
+ **Compared with react-grab.** Both start when you point at something on the
143
+ page and the tool works out which React component it is. react-grab copies that
144
+ context to your agent and its work is done. For Chippy, that is the first step.
145
+ A probe resolves the owner chain, hooks, and props, so the agent can follow a
146
+ value up the chain to the component that created it, past components that only
147
+ pass it along. Two probes resolve to their nearest common parent. The agent then
148
+ opens the source line, makes the change, and probes again to confirm it.
149
+
150
+ **Compared with react-scan.** Both answer "what rendered, and why?" react-scan
151
+ shows the answer on the page for a person to read. Chippy returns it as data for
152
+ an agent to build on. Render recordings cover both a single interaction and the
153
+ initial page load. The helper ranks them by where a render cascade started, not
154
+ only by how long each component took, so the agent can tell the component that
155
+ caused a slowdown from the ones that rendered along with it. The agent can then
156
+ re-render a single component on purpose to test a fix, and record again to
157
+ confirm the cascade is gone.
158
+
159
+ **Compared with React Developer Tools.** Chippy reads the same information
160
+ through React's DevTools hook and adds the steps a person would otherwise do by
161
+ hand: tracing a value to where it comes from, replaying a render to explain a
162
+ hook, comparing two states or pages, and separating the trigger of a slow
163
+ interaction from collateral renders.
164
+
165
+ **Compared with browser automation.** Tools such as agent-browser or Playwright
166
+ operate the page as a user would: they click, type, and take screenshots. Chippy
167
+ operates it from inside React and explains what React did in response. They work
168
+ well together. The agent uses an automation tool to repeat a user flow and
169
+ Chippy to inspect, nudge, and record the result, and keeps going until the
170
+ change is verified.
171
+
172
+ ## Learn more
173
+
174
+ - [Agent skill](.agents/skills/chippy/SKILL.md) and its [references](.agents/skills/chippy/references/README.md)
175
+ - [React compatibility](docs/react-compatibility.md)
176
+ - [Plugins](docs/plugins.md) for app-specific knowledge
177
+ - [Trust boundary](docs/trust-boundary.md): what page data Chippy sees and who can reach the helper
178
+ - [Security policy](SECURITY.md)
179
+ - [Changelog](CHANGELOG.md)
180
+
181
+ To build, test, or change Chippy, see [Contributing](CONTRIBUTING.md) and the
182
+ [code of conduct](CODE_OF_CONDUCT.md).
183
+
184
+ ## License
185
+
186
+ Copyright (c) 2026 Atlassian US., Inc.
187
+ Apache 2.0 licensed, see [LICENSE](LICENSE) file.
188
+
189
+ [![With ❤️ from Atlassian](https://raw.githubusercontent.com/atlassian-internal/oss-assets/master/banner-cheers.png)](https://www.atlassian.com)
package/bin/chippy.mjs ADDED
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env node
2
+ // Installs the Chippy agent skill from this package and prints the next steps,
3
+ // or packs a custom build with extra plugins (see pack.mjs).
4
+ // npx @atlassian/chippy install [--dir <path>] [--force]
5
+ // npx @atlassian/chippy pack [--config <file>]
6
+ import { cpSync, existsSync, mkdirSync, readFileSync, realpathSync, rmSync } from 'node:fs';
7
+ import { homedir } from 'node:os';
8
+ import { dirname, join, resolve } from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+
11
+ const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
12
+ const HEALTH_URL = 'http://127.0.0.1:7823/__chippy/health';
13
+
14
+ export function defaultSkillDir() {
15
+ return join(homedir(), '.agents', 'skills', 'chippy');
16
+ }
17
+
18
+ function isChippySkill(directory) {
19
+ const skill = join(directory, 'SKILL.md');
20
+ return existsSync(skill) && /^name:\s*chippy\s*$/m.test(readFileSync(skill, 'utf8'));
21
+ }
22
+
23
+ // Copies the bundled skill to `target`. An existing Chippy skill is replaced;
24
+ // any other existing directory is left alone unless `force` is set.
25
+ export function installSkill({ source = join(PACKAGE_ROOT, 'lib', 'mcp-skill'), target = defaultSkillDir(), force = false } = {}) {
26
+ const destination = resolve(target);
27
+ if (!isChippySkill(source)) throw new Error(`Bundled skill not found at ${source}; build the package first`);
28
+ if ([homedir(), dirname(homedir()), '/', resolve('.')].includes(destination)) {
29
+ throw new Error(`Choose a dedicated skill directory, not ${destination}`);
30
+ }
31
+ if (existsSync(destination) && !isChippySkill(destination) && !force) {
32
+ throw new Error(`${destination} exists and is not a Chippy skill; pass --force to replace it`);
33
+ }
34
+ mkdirSync(dirname(destination), { recursive: true });
35
+ rmSync(destination, { recursive: true, force: true });
36
+ cpSync(source, destination, { recursive: true });
37
+ return destination;
38
+ }
39
+
40
+ export function mcpConfig(skillDir) {
41
+ return { mcpServers: { chippy: { command: 'node', args: [join(skillDir, 'scripts', 'chippy-mcp.cjs')] } } };
42
+ }
43
+
44
+ async function helperStatus() {
45
+ try {
46
+ const response = await fetch(HEALTH_URL, { signal: AbortSignal.timeout(1000) });
47
+ return response.ok ? 'running' : `responded ${response.status}`;
48
+ } catch {
49
+ return 'not running (the MCP server or `chippy.sh start` starts it on demand)';
50
+ }
51
+ }
52
+
53
+ function parseArgs(argv) {
54
+ const args = { command: argv[0], dir: undefined, force: false, config: 'chippy.config.mjs' };
55
+ for (let i = 1; i < argv.length; i++) {
56
+ if (argv[i] === '--force') args.force = true;
57
+ else if (argv[i] === '--dir') args.dir = argv[++i];
58
+ else if (argv[i] === '--config') args.config = argv[++i];
59
+ else throw new Error(`Unknown option: ${argv[i]}`);
60
+ }
61
+ return args;
62
+ }
63
+
64
+ async function main(argv) {
65
+ const { name } = JSON.parse(readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8'));
66
+ const args = parseArgs(argv);
67
+ if (args.command === 'pack') {
68
+ await pack(args.config);
69
+ return;
70
+ }
71
+ if (args.command !== 'install') {
72
+ process.stdout.write(`Usage: npx ${name} install [--dir <path>] [--force]
73
+ npx ${name} pack [--config <file>]
74
+
75
+ install Installs the Chippy agent skill (default ${defaultSkillDir()}).
76
+ pack Builds a custom skill and extension with extra plugins from a config
77
+ file (default chippy.config.mjs). See the package README.
78
+ `);
79
+ process.exitCode = args.command === undefined || args.command === '--help' ? 0 : 2;
80
+ return;
81
+ }
82
+ const skillDir = installSkill({ target: args.dir ?? defaultSkillDir(), force: args.force });
83
+ process.stdout.write(`Installed the Chippy skill to ${skillDir}
84
+
85
+ 1. Install the browser extension: open chrome://extensions, turn on Developer
86
+ mode, choose Load unpacked, and select this folder:
87
+ ${join(skillDir, 'extension')}${folderPickerHint(skillDir)}
88
+ Without the extension, once your agent has started the helper, run this in
89
+ the page's console:
90
+ import('http://127.0.0.1:7823/__chippy/inject.mjs')
91
+
92
+ 2. Enable Chippy for your page's origin in the extension popup, then ask your
93
+ agent to use Chippy on the page. The agent runs
94
+ ${join(skillDir, 'scripts', 'chippy.sh')}
95
+
96
+ Optional: connect over MCP if your agent supports it. Ask your agent:
97
+ Connect Chippy over MCP by following ${join(skillDir, 'references', 'mcp.md')}
98
+ Or add this server to your agent's MCP configuration yourself:
99
+ ${JSON.stringify(mcpConfig(skillDir), null, 2).replace(/^/gm, ' ')}
100
+
101
+ Helper: ${await helperStatus()}
102
+ `);
103
+ }
104
+
105
+ // The skill lives in a dot-folder, which folder pickers hide by default.
106
+ const FOLDER_PICKER_HINT = {
107
+ darwin: 'The folder is hidden in Finder: press Cmd+Shift+G in the picker and paste the path.',
108
+ win32: 'Paste the path into the picker\'s address bar.',
109
+ linux: 'The folder is hidden: press Ctrl+L in the picker and paste the path.',
110
+ };
111
+
112
+ function folderPickerHint(skillDir) {
113
+ if (!skillDir.split(/[\\/]/).some((part) => part.startsWith('.'))) return '';
114
+ return `\n ${FOLDER_PICKER_HINT[process.platform] ?? FOLDER_PICKER_HINT.linux}`;
115
+ }
116
+
117
+ async function pack(configPath) {
118
+ // Loaded on demand: install must not depend on the packer.
119
+ const { loadPackConfig, packChippy } = await import('./pack.mjs');
120
+ const result = await packChippy(await loadPackConfig(resolve(configPath)));
121
+ process.stdout.write(`Packed Chippy:
122
+ skill ${result.skillDir}
123
+ skill zip ${result.skillZip}
124
+ extension ${result.extensionZip}
125
+ `);
126
+ }
127
+
128
+ // npx and global installs start the bin through a symlink, so compare real paths.
129
+ if (process.argv[1] && realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url))) {
130
+ main(process.argv.slice(2)).catch((error) => {
131
+ process.stderr.write(`${error.message}\n`);
132
+ process.exitCode = 1;
133
+ });
134
+ }