@deeeed/metamask-harness 0.28.0 → 0.29.0

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 (52) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +41 -0
  3. package/adapters/extension/build-lavamoat.sh +2 -1
  4. package/adapters/extension/ensure-browser.sh +82 -9
  5. package/adapters/extension/inject.mjs +1 -0
  6. package/adapters/extension/launch-browser.cjs +83 -1
  7. package/adapters/extension/lib/chrome-args.cjs +325 -1
  8. package/adapters/extension/lib/playwright-cdp.cjs +34 -0
  9. package/adapters/extension/lib/slot-title.cjs +2 -4
  10. package/adapters/extension/lib/validation-launch-supervisor.cjs +292 -0
  11. package/adapters/extension/lib/validation-process-ownership.cjs +69 -0
  12. package/adapters/extension/reattach.sh +2 -1
  13. package/adapters/extension/sidepanel-toggle.sh +14 -96
  14. package/adapters/extension/wallet-fixture-state.cjs +8 -31
  15. package/adapters/manifest.json +16 -0
  16. package/adapters/shared/private-atomic-write.cjs +47 -0
  17. package/adapters/shared/setup-base.sh +864 -0
  18. package/dist/adapters/extension/runtime.js +367 -24
  19. package/dist/adapters/extension/validation-process-ownership.js +10 -0
  20. package/dist/cli-commands.js +1 -0
  21. package/dist/command-contract.js +12 -0
  22. package/dist/commands/launch/extension.js +130 -19
  23. package/dist/commands/setup-base.js +24 -0
  24. package/dist/mm-harness-cli.js +28 -2
  25. package/library/actions/extension/analytics/consent.mjs +203 -0
  26. package/library/actions/extension/analytics/set_consent.mjs +19 -143
  27. package/library/actions/extension/perps/perps.mjs +2 -16
  28. package/library/actions/extension/perps/state.mjs +20 -0
  29. package/library/actions/extension/wallet/list_accounts.mjs +3 -25
  30. package/library/actions/extension/wallet/read_state.mjs +3 -23
  31. package/library/actions/extension/wallet/select_account.mjs +6 -33
  32. package/library/actions/extension/wallet/setup.mjs +2 -20
  33. package/library/actions/extension/wallet/state.mjs +111 -0
  34. package/library/recipes/runner/action-validation.extension.recipe.json +1 -1
  35. package/library/recipes/runner/action-validation.mobile.recipe.json +1 -1
  36. package/package.json +7 -4
  37. package/scripts/site-contrast.mjs +538 -0
  38. package/site/architecture.html +415 -0
  39. package/site/assets/progress.mjs +272 -0
  40. package/site/assets/style.css +808 -0
  41. package/site/cheatsheet.html +305 -0
  42. package/site/index.html +643 -0
  43. package/site/recipes.html +396 -0
  44. package/site/reviewers.html +374 -0
  45. package/site/tutorials/index.html +180 -0
  46. package/site/tutorials/v1.html +211 -0
  47. package/site/tutorials/v2.html +207 -0
  48. package/site/tutorials/v3.html +214 -0
  49. package/site/tutorials/v4.html +195 -0
  50. package/site/tutorials/v5.html +163 -0
  51. package/site/tutorials/v6.html +165 -0
  52. package/site/tutorials/v7.html +184 -0
@@ -0,0 +1,211 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>V1 — Getting started with recipes</title>
7
+ <meta name="description" content="Video one of the series: one CLI drives the wallet and proves what happened. With the same checklist as Start Here.">
8
+ <link rel="stylesheet" href="../assets/style.css">
9
+ </head>
10
+ <body data-progress-page="start">
11
+ <a class="skip" href="#steps">Skip to the checklist</a>
12
+
13
+ <header class="topbar">
14
+ <div class="wrap topbar-inner">
15
+ <a class="brand" href="../index.html">
16
+ <span class="brand-mark" aria-hidden="true"></span>
17
+ <span class="brand-name">mm-harness</span>
18
+ </a>
19
+ <nav class="nav" aria-label="Main">
20
+ <a href="../index.html">Start Here</a>
21
+ <a href="../recipes.html">Recipes</a>
22
+ <a href="../cheatsheet.html">Cheatsheet</a>
23
+ <a href="../architecture.html">Architecture</a>
24
+ <a href="index.html" aria-current="page">Tutorials</a>
25
+ <a href="../reviewers.html">For Reviewers</a>
26
+ </nav>
27
+ </div>
28
+ </header>
29
+
30
+ <div class="progress-rail">
31
+ <div class="wrap progress-inner">
32
+ <div class="progress-track" role="progressbar" aria-label="Walkthrough progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
33
+ <div class="progress-fill"></div>
34
+ </div>
35
+ <span class="progress-label">0/8 steps</span>
36
+ <button type="button" class="progress-reset">Reset</button>
37
+ </div>
38
+ </div>
39
+
40
+ <main>
41
+ <section class="wrap hero" style="padding-bottom:1rem">
42
+ <span class="eyebrow">Tutorial V1 · 5 minutes</span>
43
+ <h1>Getting started with recipes</h1>
44
+ <p class="lede">
45
+ The promise in one sentence: one command-line tool drives a real MetaMask build, and then proves
46
+ what it did. This is the first video in the series and the shortest path into everything else.
47
+ </p>
48
+ <div class="hero-meta">
49
+ <span>no prerequisites</span>
50
+ <span>checklist shared with Start Here</span>
51
+ </div>
52
+ </section>
53
+
54
+ <section class="wrap">
55
+ <div class="vid-thumb" style="border-radius:var(--radius);border:1px solid var(--line);margin-bottom:1.5rem">
56
+ <div style="text-align:center;padding:1rem">
57
+ <div class="vid-id" style="font-size:2.6rem">V1</div>
58
+ <p style="color:var(--text-dim);margin:.5rem 0 0;font-size:.92rem">Video recording in progress</p>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="note plain">
63
+ <span class="note-title">The checklist below is the video</span>
64
+ <p>
65
+ Same eight steps, same commands, same expected output — it is genuinely useful before the
66
+ recording exists, which is why it is here rather than a "coming soon" page. Your progress is
67
+ shared with <a href="../index.html">Start Here</a>: tick a step in either place and it is ticked
68
+ in both. Start Here carries the longer explanations and the full "if it fails" notes for each
69
+ step.
70
+ </p>
71
+ </div>
72
+
73
+ <h2>What the video covers</h2>
74
+ <div class="table-scroll">
75
+ <table>
76
+ <thead><tr><th>Beat</th><th>What is on screen</th></tr></thead>
77
+ <tbody>
78
+ <tr><td><code>0:00</code></td><td>The promise — one CLI drives the wallet and proves what happened.</td></tr>
79
+ <tr><td><code>0:30</code></td><td>Install into a clean checkout, then <code>doctor</code>. One failure gets fixed by following the error's own instruction — twenty seconds, no dwelling.</td></tr>
80
+ <tr><td><code>1:15</code></td><td><code>launch</code> — the real app comes up under harness control.</td></tr>
81
+ <tr><td><code>1:45</code></td><td><code>actions</code>, and the line that matters: you never guess capabilities, you discover them. Then two live <code>call</code>s — read the wallet state, then one UI action visibly moving the app.</td></tr>
82
+ <tr><td><code>3:00</code></td><td>The same steps as a <em>recipe</em>: <code>run</code> executes the graph and adds assertions. This is the jump from driving to proving.</td></tr>
83
+ <tr><td><code>4:00</code></td><td>Open the artifacts directory. <code>summary.json</code>, the trace, the screenshot.</td></tr>
84
+ <tr><td><code>4:30</code></td><td>Close on the cheatsheet — everything just done, on one page.</td></tr>
85
+ </tbody>
86
+ </table>
87
+ </div>
88
+ <p style="font-size:.94rem;color:var(--text-dim)">
89
+ Artifact you finish with: a green <code>summary.json</code> you produced yourself.
90
+ </p>
91
+ </section>
92
+
93
+ <section class="wrap">
94
+ <h2 id="steps">Follow along</h2>
95
+
96
+ <ol class="steps">
97
+
98
+ <li class="step" data-step="install">
99
+ <div class="step-head">
100
+ <input type="checkbox" class="step-check" id="v-install" aria-labelledby="tv-install">
101
+ <h3 class="step-title" id="tv-install">Get the CLI</h3>
102
+ </div>
103
+ <p class="step-why">Install globally, confirm it resolved, then work from inside a product checkout.</p>
104
+ <div class="cmd"><pre><code><span class="p">$ </span>npm i -g @deeeed/metamask-harness@latest
105
+ <span class="p">$ </span>mm-harness --version</code></pre></div>
106
+ <div class="out">0.26.x <span class="dim">— any 0.26 or newer</span></div>
107
+ </li>
108
+
109
+ <li class="step" data-step="doctor">
110
+ <div class="step-head">
111
+ <input type="checkbox" class="step-check" id="v-doctor" aria-labelledby="tv-doctor">
112
+ <h3 class="step-title" id="tv-doctor">Run doctor, follow what it tells you</h3>
113
+ </div>
114
+ <p class="step-why">
115
+ Read-only readiness check. Each finding names the exact command that fixes it — including,
116
+ often, <code>doctor --fix</code> itself.
117
+ </p>
118
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness doctor
119
+ <span class="p">$ </span>mm-harness doctor --fix</code></pre></div>
120
+ <div class="out"><span class="ok">pass</span> extension bridge present ready=true <span class="ok">fixed=[runtime-context]</span> failed=[]</div>
121
+ </li>
122
+
123
+ <li class="step" data-step="launch">
124
+ <div class="step-head">
125
+ <input type="checkbox" class="step-check" id="v-launch" aria-labelledby="tv-launch">
126
+ <h3 class="step-title" id="tv-launch">Launch the app</h3>
127
+ </div>
128
+ <p class="step-why">Platform auto-detects. Mobile needs an explicit target; core is headless and says so.</p>
129
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness launch <span class="dim"># extension</span>
130
+ <span class="p">$ </span>mm-harness launch ios <span class="dim"># mobile</span></code></pre></div>
131
+ </li>
132
+
133
+ <li class="step" data-step="actions">
134
+ <div class="step-head">
135
+ <input type="checkbox" class="step-check" id="v-actions" aria-labelledby="tv-actions">
136
+ <h3 class="step-title" id="tv-actions">Discover the vocabulary</h3>
137
+ </div>
138
+ <p class="step-why">
139
+ The line to remember: you never guess capabilities, you discover them. This list is the
140
+ capability boundary, not a sample of one.
141
+ </p>
142
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness actions --categories
143
+ <span class="p">$ </span>mm-harness actions --category ui</code></pre></div>
144
+ </li>
145
+
146
+ <li class="step" data-step="call-read">
147
+ <div class="step-head">
148
+ <input type="checkbox" class="step-check" id="v-call-read" aria-labelledby="tv-call-read">
149
+ <h3 class="step-title" id="tv-call-read">Drive it: read wallet state</h3>
150
+ </div>
151
+ <p class="step-why">One action through the real engine path. Reads first — they cannot break anything.</p>
152
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness call read_state</code></pre></div>
153
+ </li>
154
+
155
+ <li class="step" data-step="call-ui">
156
+ <div class="step-head">
157
+ <input type="checkbox" class="step-check" id="v-call-ui" aria-labelledby="tv-call-ui">
158
+ <h3 class="step-title" id="tv-call-ui">Drive it: move the UI</h3>
159
+ </div>
160
+ <p class="step-why">Keep the app on screen. This is the beat where a terminal command visibly moves a real build.</p>
161
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness call navigate page=perps</code></pre></div>
162
+ </li>
163
+
164
+ <li class="step" data-step="run">
165
+ <div class="step-head">
166
+ <input type="checkbox" class="step-check" id="v-run" aria-labelledby="tv-run">
167
+ <h3 class="step-title" id="tv-run">Prove it: run a recipe</h3>
168
+ </div>
169
+ <p class="step-why">
170
+ The same operations composed into a graph with assertions. <code>--plan</code> validates first
171
+ without touching anything.
172
+ </p>
173
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness run --list
174
+ <span class="p">$ </span>mm-harness run wallet.smoke --plan
175
+ <span class="p">$ </span>mm-harness run wallet.smoke --artifacts-dir ./first-recipe-artifacts</code></pre></div>
176
+ </li>
177
+
178
+ <li class="step" data-step="evidence">
179
+ <div class="step-head">
180
+ <input type="checkbox" class="step-check" id="v-evidence" aria-labelledby="tv-evidence">
181
+ <h3 class="step-title" id="tv-evidence">Open the evidence</h3>
182
+ </div>
183
+ <p class="step-why">
184
+ The closing shot of the video, and the reason for all of it. Start with <code>report.md</code>,
185
+ then the summary, then the trace when you want to know why.
186
+ </p>
187
+ <div class="cmd"><pre><code><span class="p">$ </span>cat first-recipe-artifacts/report.md
188
+ <span class="p">$ </span>cat first-recipe-artifacts/summary.json</code></pre></div>
189
+ </li>
190
+
191
+ </ol>
192
+
193
+ <hr class="sep">
194
+ <div class="btn-row">
195
+ <a class="btn btn-primary" href="../index.html#steps">Full walkthrough, with failure notes →</a>
196
+ <a class="btn btn-ghost" href="../cheatsheet.html">The cheatsheet</a>
197
+ <a class="btn btn-ghost" href="index.html">Back to the series</a>
198
+ </div>
199
+ </section>
200
+ </main>
201
+
202
+ <footer class="footer">
203
+ <div class="wrap">
204
+ <p>Internal getting-started guide for the MetaMask agentic coding workflow. Not official MetaMask product documentation.</p>
205
+ <p>Verified against mm-harness 0.26+.</p>
206
+ </div>
207
+ </footer>
208
+
209
+ <script type="module" src="../assets/progress.mjs"></script>
210
+ </body>
211
+ </html>
@@ -0,0 +1,207 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>V2 — Reading the evidence</title>
7
+ <meta name="description" content="Walk one finished run file by file, and learn the two rules that make a green verdict worth believing.">
8
+ <link rel="stylesheet" href="../assets/style.css">
9
+ </head>
10
+ <body data-progress-page="v2">
11
+ <a class="skip" href="#steps">Skip to the checklist</a>
12
+
13
+ <header class="topbar">
14
+ <div class="wrap topbar-inner">
15
+ <a class="brand" href="../index.html">
16
+ <span class="brand-mark" aria-hidden="true"></span>
17
+ <span class="brand-name">mm-harness</span>
18
+ </a>
19
+ <nav class="nav" aria-label="Main">
20
+ <a href="../index.html">Start Here</a>
21
+ <a href="../recipes.html">Recipes</a>
22
+ <a href="../cheatsheet.html">Cheatsheet</a>
23
+ <a href="../architecture.html">Architecture</a>
24
+ <a href="index.html" aria-current="page">Tutorials</a>
25
+ <a href="../reviewers.html">For Reviewers</a>
26
+ </nav>
27
+ </div>
28
+ </header>
29
+
30
+ <div class="progress-rail">
31
+ <div class="wrap progress-inner">
32
+ <div class="progress-track" role="progressbar" aria-label="Tutorial progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
33
+ <div class="progress-fill"></div>
34
+ </div>
35
+ <span class="progress-label">0/5 steps</span>
36
+ <button type="button" class="progress-reset">Reset</button>
37
+ </div>
38
+ </div>
39
+
40
+ <main>
41
+ <section class="wrap hero" style="padding-bottom:1rem">
42
+ <span class="eyebrow">Tutorial V2 · 6 minutes</span>
43
+ <h1>Reading the evidence</h1>
44
+ <p class="lede">
45
+ For reviewers and sceptics. A green run is a claim; this is how you check it.
46
+ </p>
47
+ <div class="hero-meta">
48
+ <span>no prerequisites</span>
49
+ <span>reference: <a href="../reviewers.html">For Reviewers</a></span>
50
+ </div>
51
+ </section>
52
+
53
+ <section class="wrap">
54
+ <div class="vid-thumb" style="border-radius:var(--radius);border:1px solid var(--line);margin-bottom:1.5rem">
55
+ <div style="text-align:center;padding:1rem">
56
+ <div class="vid-id" style="font-size:2.6rem">V2</div>
57
+ <p style="color:var(--text-dim);margin:.5rem 0 0;font-size:.92rem">Video recording in progress</p>
58
+ </div>
59
+ </div>
60
+
61
+ <div class="note plain">
62
+ <span class="note-title">This page and the reviewer's guide</span>
63
+ <p>
64
+ This is the tour: what each file is for, in the order you open them.
65
+ <a href="../reviewers.html">For Reviewers</a> is the reference — a real bundle annotated line by line,
66
+ including a screenshot that passed while recording that its capture had degraded. Read this first,
67
+ keep that one open during a review.
68
+ </p>
69
+ </div>
70
+
71
+ <h2>What the video covers</h2>
72
+ <div class="table-scroll">
73
+ <table>
74
+ <thead><tr><th>Beat</th><th>On screen</th></tr></thead>
75
+ <tbody>
76
+ <tr><td><code>0:00</code></td><td>One finished run directory, opened cold.</td></tr>
77
+ <tr><td><code>0:40</code></td><td><code>recipe.json</code> — the graph that executed. Each node's <code>intent</code> is the argument being made.</td></tr>
78
+ <tr><td><code>1:40</code></td><td><code>trace.json</code> — per-node verdicts, timings, outputs. Counts come from here.</td></tr>
79
+ <tr><td><code>2:50</code></td><td><code>summary.json</code> — the verdict, the totals, which libraries were in scope.</td></tr>
80
+ <tr><td><code>3:30</code></td><td>Screenshots, and on Mobile the run video. Extension captures stills only.</td></tr>
81
+ <tr><td><code>4:20</code></td><td><code>diagnostics.json</code> — application warnings, quarantined from the verdict.</td></tr>
82
+ <tr><td><code>5:10</code></td><td>The two rules that make the whole thing worth reading.</td></tr>
83
+ </tbody>
84
+ </table>
85
+ </div>
86
+ </section>
87
+
88
+ <section class="wrap">
89
+ <h2 id="rules">The two rules</h2>
90
+ <p>Both are enforced in code, not by convention.</p>
91
+
92
+ <div class="doctrine">
93
+ <p>
94
+ <span class="k">Placeholders are refused, and a missing adapter throws.</span> The harness will not
95
+ accept a static stand-in where a real observation belongs, and when the adapter that would perform
96
+ an action is absent it raises instead of returning a plausible-looking object. A system that
97
+ guessed would produce evidence indistinguishable from the real thing.
98
+ </p>
99
+ </div>
100
+
101
+ <p>
102
+ The practical consequence: a node that passed had a real adapter execute it. That is what makes
103
+ <code>"ok": true</code> worth anything.
104
+ </p>
105
+
106
+ <div class="note blue">
107
+ <span class="note-title">Capture is not symmetric</span>
108
+ <p>
109
+ Mobile records video of a full run; Extension captures screenshots only. Do not promise a reviewer
110
+ a video of an Extension run. <code>mm-harness doctor</code> reports what the current checkout can
111
+ capture on its <code>capture:</code> line.
112
+ </p>
113
+ </div>
114
+ </section>
115
+
116
+ <section class="wrap">
117
+ <h2 id="steps">Follow along</h2>
118
+ <p>Use a bundle you produced in <a href="../index.html#steps">Start Here</a>, or any run directory.</p>
119
+
120
+ <ol class="steps">
121
+ <li class="step" data-step="open">
122
+ <div class="step-head">
123
+ <input type="checkbox" class="step-check" id="v2-open" aria-labelledby="t2-open">
124
+ <h3 class="step-title" id="t2-open">Open a bundle</h3>
125
+ </div>
126
+ <p class="step-why"><code>last</code> prints the path of the most recent run for this checkout.</p>
127
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness last
128
+ <span class="p">$ </span>ls first-recipe-artifacts</code></pre></div>
129
+ </li>
130
+
131
+ <li class="step" data-step="report">
132
+ <div class="step-head">
133
+ <input type="checkbox" class="step-check" id="v2-report" aria-labelledby="t2-report">
134
+ <h3 class="step-title" id="t2-report">Skim report.md</h3>
135
+ </div>
136
+ <p class="step-why">The whole run on one page. If it disagrees with the pull request description, stop and ask.</p>
137
+ <div class="cmd"><pre><code><span class="p">$ </span>cat first-recipe-artifacts/report.md</code></pre></div>
138
+ </li>
139
+
140
+ <li class="step" data-step="verdict">
141
+ <div class="step-head">
142
+ <input type="checkbox" class="step-check" id="v2-verdict" aria-labelledby="t2-verdict">
143
+ <h3 class="step-title" id="t2-verdict">Check the verdict and the counts</h3>
144
+ </div>
145
+ <p class="step-why">Compare <code>total</code> against what the author claims was proven.</p>
146
+ <div class="cmd"><pre><code><span class="p">$ </span>cat first-recipe-artifacts/summary.json</code></pre></div>
147
+ <div class="out">{
148
+ "status": <span class="ok">"pass"</span>,
149
+ "total": 6,
150
+ "passed": 6,
151
+ "failed": 0
152
+ }</div>
153
+ </li>
154
+
155
+ <li class="step" data-step="trace">
156
+ <div class="step-head">
157
+ <input type="checkbox" class="step-check" id="v2-trace" aria-labelledby="t2-trace">
158
+ <h3 class="step-title" id="t2-trace">Read the intents in order</h3>
159
+ </div>
160
+ <p class="step-why">
161
+ The per-node intents are the argument. If they do not add up to the claim, the bundle does not
162
+ support it — however green it is.
163
+ </p>
164
+ <div class="cmd"><pre><code><span class="p">$ </span>cat first-recipe-artifacts/trace.json</code></pre></div>
165
+ <p class="step-why">
166
+ Triaging a failure: find the first node with <code>"ok": false</code>. Everything after it is
167
+ consequence.
168
+ </p>
169
+ </li>
170
+
171
+ <li class="step" data-step="artifacts">
172
+ <div class="step-head">
173
+ <input type="checkbox" class="step-check" id="v2-artifacts" aria-labelledby="t2-artifacts">
174
+ <h3 class="step-title" id="t2-artifacts">Open the images, then the diagnostics</h3>
175
+ </div>
176
+ <p class="step-why">
177
+ The trace says a PNG was registered and how it was captured. Only your eyes confirm it shows what
178
+ the author says.
179
+ </p>
180
+ <div class="cmd"><pre><code><span class="p">$ </span>open first-recipe-artifacts/screenshots
181
+ <span class="p">$ </span>cat first-recipe-artifacts/diagnostics.json</code></pre></div>
182
+ <p class="step-why">
183
+ <code>diagnostics.json</code> is bracketed to the run window, so <code>"status": "clean"</code>
184
+ is a claim about this run rather than about the log file.
185
+ </p>
186
+ </li>
187
+ </ol>
188
+
189
+ <hr class="sep">
190
+ <div class="btn-row">
191
+ <a class="btn btn-primary" href="../reviewers.html">The annotated reference →</a>
192
+ <a class="btn btn-ghost" href="v3.html">Next: skills setup</a>
193
+ <a class="btn btn-ghost" href="index.html">Back to the series</a>
194
+ </div>
195
+ </section>
196
+ </main>
197
+
198
+ <footer class="footer">
199
+ <div class="wrap">
200
+ <p>Internal getting-started guide for the MetaMask agentic coding workflow. Not official MetaMask product documentation.</p>
201
+ <p>Verified against mm-harness 0.26+.</p>
202
+ </div>
203
+ </footer>
204
+
205
+ <script type="module" src="../assets/progress.mjs"></script>
206
+ </body>
207
+ </html>
@@ -0,0 +1,214 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>V3 — Skills and your team's library</title>
7
+ <meta name="description" content="Install the agentic skills into a checkout and declare your team's recipe library, with the perps library as the worked example.">
8
+ <link rel="stylesheet" href="../assets/style.css">
9
+ </head>
10
+ <body data-progress-page="v3">
11
+ <a class="skip" href="#steps">Skip to the checklist</a>
12
+
13
+ <header class="topbar">
14
+ <div class="wrap topbar-inner">
15
+ <a class="brand" href="../index.html">
16
+ <span class="brand-mark" aria-hidden="true"></span>
17
+ <span class="brand-name">mm-harness</span>
18
+ </a>
19
+ <nav class="nav" aria-label="Main">
20
+ <a href="../index.html">Start Here</a>
21
+ <a href="../recipes.html">Recipes</a>
22
+ <a href="../cheatsheet.html">Cheatsheet</a>
23
+ <a href="../architecture.html">Architecture</a>
24
+ <a href="index.html" aria-current="page">Tutorials</a>
25
+ <a href="../reviewers.html">For Reviewers</a>
26
+ </nav>
27
+ </div>
28
+ </header>
29
+
30
+ <div class="progress-rail">
31
+ <div class="wrap progress-inner">
32
+ <div class="progress-track" role="progressbar" aria-label="Tutorial progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
33
+ <div class="progress-fill"></div>
34
+ </div>
35
+ <span class="progress-label">0/5 steps</span>
36
+ <button type="button" class="progress-reset">Reset</button>
37
+ </div>
38
+ </div>
39
+
40
+ <main>
41
+ <section class="wrap hero" style="padding-bottom:1rem">
42
+ <span class="eyebrow">Tutorial V3 · 5 minutes</span>
43
+ <h1>Skills and your team's library</h1>
44
+ <p class="lede">
45
+ Two things turn a bare harness into your team's setup: skills that carry the workflow, and a library
46
+ that carries the recipes. Both install into a checkout.
47
+ </p>
48
+ <div class="hero-meta">
49
+ <span>prerequisite: <a href="../index.html#steps">Start Here</a></span>
50
+ <span>worked example: the perps library</span>
51
+ </div>
52
+ </section>
53
+
54
+ <section class="wrap">
55
+ <div class="vid-thumb" style="border-radius:var(--radius);border:1px solid var(--line);margin-bottom:1.5rem">
56
+ <div style="text-align:center;padding:1rem">
57
+ <div class="vid-id" style="font-size:2.6rem">V3</div>
58
+ <p style="color:var(--text-dim);margin:.5rem 0 0;font-size:.92rem">Video recording in progress</p>
59
+ </div>
60
+ </div>
61
+
62
+ <h2>Skills versus libraries</h2>
63
+ <div class="table-scroll">
64
+ <table>
65
+ <thead><tr><th></th><th>Skills</th><th>Recipe library</th></tr></thead>
66
+ <tbody>
67
+ <tr><td>Carry</td><td>The workflow an agent follows.</td><td>Recipes and domain actions.</td></tr>
68
+ <tr><td>Live in</td><td><code>Consensys/skills</code>, installed per checkout.</td><td>A team repo, declared by path.</td></tr>
69
+ <tr><td>Needed to run a recipe</td><td>No.</td><td>Yes, for your team's recipes.</td></tr>
70
+ </tbody>
71
+ </table>
72
+ </div>
73
+
74
+ <div class="note blue">
75
+ <span class="note-title">Layering</span>
76
+ <p>
77
+ Personal beats domain beats default, for skills and libraries alike. Your own overrides your team's,
78
+ which overrides what ships. A library that shadows another is reported in the run summary's
79
+ <code>shadowed</code> list rather than silently winning.
80
+ </p>
81
+ </div>
82
+ </section>
83
+
84
+ <section class="wrap">
85
+ <h2 id="steps">Set it up</h2>
86
+
87
+ <ol class="steps">
88
+ <li class="step" data-step="skills">
89
+ <div class="step-head">
90
+ <input type="checkbox" class="step-check" id="v3-skills" aria-labelledby="t3-skills">
91
+ <h3 class="step-title" id="t3-skills">Install the skills into your checkout</h3>
92
+ </div>
93
+ <p class="step-why">Run this from the product checkout you work in.</p>
94
+ <div class="cmd"><pre><code><span class="p">$ </span>yarn skills --include agentic/recipe-cook,agentic/recipe-quality --save</code></pre></div>
95
+ <p class="step-why">
96
+ The agentic skills carry <code>experimental</code> maturity, so they are visible only when
97
+ experimental skills are enabled. <code>recipe-cook</code> is the one you want first — it owns
98
+ the authoring and review flows covered in <a href="v4.html">V4</a>.
99
+ </p>
100
+ <details class="fail">
101
+ <summary>If it fails</summary>
102
+ <div class="fail-body">
103
+ <p><strong>No <code>skills</code> script</strong> — not every repo has the tooling wired yet. Check the skills repo for the current install path for your checkout.</p>
104
+ <p><strong>The skill does not appear</strong> — confirm experimental maturity is enabled; that is the usual cause.</p>
105
+ </div>
106
+ </details>
107
+ </li>
108
+
109
+ <li class="step" data-step="clone">
110
+ <div class="step-head">
111
+ <input type="checkbox" class="step-check" id="v3-clone" aria-labelledby="t3-clone">
112
+ <h3 class="step-title" id="t3-clone">Clone your team's library</h3>
113
+ </div>
114
+ <p class="step-why">The perps library, as the worked example:</p>
115
+ <div class="cmd"><pre><code><span class="p">$ </span>git clone git@github.com:MetaMask/experimental-metamask-recipe-perps.git \
116
+ "$HOME/shared-library/metamask-recipe-perps"</code></pre></div>
117
+ <div class="note">
118
+ <span class="note-title">A 404 means access, not a typo</span>
119
+ <p>
120
+ The repository is private. If the clone fails with a 404, your account cannot see it yet — ask
121
+ for access rather than hunting for the right URL.
122
+ </p>
123
+ </div>
124
+ <p class="step-why">
125
+ Already have it somewhere? Symlink that checkout instead of making a second copy.
126
+ </p>
127
+ </li>
128
+
129
+ <li class="step" data-step="declare">
130
+ <div class="step-head">
131
+ <input type="checkbox" class="step-check" id="v3-declare" aria-labelledby="t3-declare">
132
+ <h3 class="step-title" id="t3-declare">Declare it</h3>
133
+ </div>
134
+ <p class="step-why">One <code>name=path</code> entry, absolute path:</p>
135
+ <div class="cmd"><pre><code><span class="p">$ </span>export RECIPE_LIBRARY_PATH="perps=$HOME/shared-library/metamask-recipe-perps"</code></pre></div>
136
+ <p class="step-why">Several libraries are colon-separated, and the name is how they are labelled in output:</p>
137
+ <div class="cmd"><pre><code><span class="p">$ </span>export RECIPE_LIBRARY_PATH="perps=$HOME/shared-library/metamask-recipe-perps:mine=$HOME/dev/my-recipes"</code></pre></div>
138
+ <p class="step-why">
139
+ Put it in your shell profile so every session has it. Per-command, <code>--library
140
+ perps=&lt;path&gt;</code> does the same thing and is repeatable.
141
+ </p>
142
+ </li>
143
+
144
+ <li class="step" data-step="verify">
145
+ <div class="step-head">
146
+ <input type="checkbox" class="step-check" id="v3-verify" aria-labelledby="t3-verify">
147
+ <h3 class="step-title" id="t3-verify">Prove discovery sees it</h3>
148
+ </div>
149
+ <p class="step-why">This is the step people skip, then spend an afternoon on.</p>
150
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness run --list</code></pre></div>
151
+ <div class="out-label">Expected — library recipes tagged with your library's name</div>
152
+ <div class="out">runnable recipes (core)
153
+ Inspect: mm-harness run &lt;recipe&gt; --describe
154
+ perps.ensure-market-state <span class="hint">[perps]</span> variant=core params=network,market,side,…
155
+ perps.prove-order <span class="hint">[perps]</span> variant=core params=network,market,side,order_type,…
156
+ perps.snapshot-market <span class="hint">[perps]</span> variant=core params=network,market
157
+ perps.smoke <span class="dim">[metamask]</span> variant=core — Non-mutating Perps domain smoke…
158
+ runner.smoke <span class="dim">[metamask]</span> variant=core — Proves the headless Core runner…</div>
159
+ <p class="step-why">
160
+ The tag is the proof: <code>[perps]</code> came from your library, <code>[metamask]</code> ships
161
+ with the harness. No tags from your library means it was not loaded.
162
+ </p>
163
+ <details class="fail">
164
+ <summary>If it fails</summary>
165
+ <div class="fail-body">
166
+ <p><strong>Only <code>[metamask]</code> recipes</strong> — the variable is unset in this shell, or the path is wrong or relative. Echo it and check the path exists.</p>
167
+ <p><strong>Fewer recipes than expected</strong> — recipes declare which adapters they support. A mobile-only recipe will not appear in a core checkout. <code>--describe</code> shows the variant.</p>
168
+ </div>
169
+ </details>
170
+ </li>
171
+
172
+ <li class="step" data-step="run">
173
+ <div class="step-head">
174
+ <input type="checkbox" class="step-check" id="v3-run" aria-labelledby="t3-run">
175
+ <h3 class="step-title" id="t3-run">Read one before running it</h3>
176
+ </div>
177
+ <p class="step-why">Team recipes take parameters and many mutate testnet state.</p>
178
+ <div class="cmd"><pre><code><span class="p">$ </span>mm-harness run perps.prove-order --describe
179
+ <span class="p">$ </span>mm-harness run perps.prove-order market=ETH side=short order_type=limit --plan</code></pre></div>
180
+ <p class="step-why">
181
+ Drop <code>--plan</code> when the mutation and its cleanup are what you want. The perps library's
182
+ <code>README.md</code> is its onboarding doc, and <code>docs/AUTHORING.md</code> covers writing
183
+ recipes into it.
184
+ </p>
185
+ </li>
186
+ </ol>
187
+
188
+ <div class="doctrine">
189
+ <p>
190
+ <span class="k">Your team's library follows the same pattern:</span> a repo of recipes plus domain
191
+ actions, cloned and declared by path. Nothing about the perps setup above is perps-specific except
192
+ the URL.
193
+ </p>
194
+ </div>
195
+
196
+ <hr class="sep">
197
+ <div class="btn-row">
198
+ <a class="btn btn-primary" href="v4.html">Next: cook a recipe →</a>
199
+ <a class="btn btn-ghost" href="../architecture.html#libraries">Where libraries fit</a>
200
+ <a class="btn btn-ghost" href="index.html">Back to the series</a>
201
+ </div>
202
+ </section>
203
+ </main>
204
+
205
+ <footer class="footer">
206
+ <div class="wrap">
207
+ <p>Internal getting-started guide for the MetaMask agentic coding workflow. Not official MetaMask product documentation.</p>
208
+ <p>Verified against mm-harness 0.26+.</p>
209
+ </div>
210
+ </footer>
211
+
212
+ <script type="module" src="../assets/progress.mjs"></script>
213
+ </body>
214
+ </html>