@seanyao/roll 3.620.1 → 3.624.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.
- package/CHANGELOG.md +46 -0
- package/dist/roll.mjs +4563 -3369
- package/package.json +1 -1
- package/lib/__pycache__/changelog_audit.cpython-314.pyc +0 -0
- package/lib/__pycache__/github_sync.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop-fmt.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop_result_eval.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop_unstick.cpython-314.pyc +0 -0
- package/lib/__pycache__/model_prices.cpython-314.pyc +0 -0
- package/lib/__pycache__/prices_fetcher.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll-home.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll-loop-status.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll_git.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll_render.cpython-314.pyc +0 -0
- package/lib/__pycache__/slides-render.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/__init__.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/gemini.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/kimi.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/openai.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/pi.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/pi_emit.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/qwen.cpython-314.pyc +0 -0
- package/skills/README.md +0 -64
- package/skills/docs/skill-authoring.md +0 -74
- package/skills/reports/skill-audit-summary.md +0 -53
- package/skills/roll-.changelog/SKILL.md +0 -47
- package/skills/roll-.changelog/references/full-contract.md +0 -462
- package/skills/roll-.clarify/SKILL.md +0 -64
- package/skills/roll-.dream/SKILL.md +0 -47
- package/skills/roll-.dream/references/full-contract.md +0 -365
- package/skills/roll-.echo/SKILL.md +0 -118
- package/skills/roll-.qa/SKILL.md +0 -47
- package/skills/roll-.qa/references/full-contract.md +0 -256
- package/skills/roll-.review/SKILL.md +0 -148
- package/skills/roll-build/SKILL.md +0 -49
- package/skills/roll-build/references/full-contract.md +0 -968
- package/skills/roll-debug/SKILL.md +0 -48
- package/skills/roll-debug/assets/injectable-bb.js +0 -263
- package/skills/roll-debug/references/full-contract.md +0 -607
- package/skills/roll-design/SKILL.md +0 -52
- package/skills/roll-design/references/engineering-checklist.md +0 -298
- package/skills/roll-design/references/full-contract.md +0 -940
- package/skills/roll-doc-audit/SKILL.md +0 -51
- package/skills/roll-doc-audit/references/full-contract.md +0 -796
- package/skills/roll-doctor/SKILL.md +0 -211
- package/skills/roll-fix/SKILL.md +0 -49
- package/skills/roll-fix/references/full-contract.md +0 -672
- package/skills/roll-idea/SKILL.md +0 -62
- package/skills/roll-loop/SKILL.md +0 -50
- package/skills/roll-loop/references/full-contract.md +0 -534
- package/skills/roll-notes/SKILL.md +0 -107
- package/skills/roll-onboard/SKILL.md +0 -238
- package/skills/roll-peer/SKILL.md +0 -47
- package/skills/roll-peer/references/full-contract.md +0 -323
- package/skills/roll-propose/SKILL.md +0 -155
- package/skills/roll-review-pr/SKILL.md +0 -62
- package/skills/roll-spar/SKILL.md +0 -47
- package/skills/roll-spar/references/full-contract.md +0 -288
- package/skills/route-cases/skills.json +0 -216
- package/skills/scripts/audit-skills.mjs +0 -272
- package/skills/scripts/test-audit-skills.mjs +0 -39
- package/skills/tests/fixtures/skill-audit/block-skill/SKILL.md +0 -12
- package/skills/tests/fixtures/skill-audit/minimal-skill/SKILL.md +0 -8
- package/skills/tests/fixtures/skill-audit/quoted-skill/SKILL.md +0 -10
- package/skills/tests/fixtures/skill-audit/route-cases.json +0 -21
- package/skills/tests/fixtures/skill-audit/spoke-skill/SKILL.md +0 -12
- package/skills/tests/fixtures/skill-audit/spoke-skill/references/runbook.md +0 -3
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: roll-debug
|
|
3
|
-
license: MIT
|
|
4
|
-
allowed-tools: "Read, Edit, Write, Bash, Agent"
|
|
5
|
-
description: "Load when a web page needs black-box browser diagnostics, console/network/state capture, root-cause analysis, and source fixes for project-owned issues."
|
|
6
|
-
---
|
|
7
|
-
# Roll Debug
|
|
8
|
-
|
|
9
|
-
This hub keeps the routing boundary, hard gates, and execution skeleton in the initial context. Load the heavier runbook only when the task actually needs the detailed contract.
|
|
10
|
-
|
|
11
|
-
## Load
|
|
12
|
-
|
|
13
|
-
Load when a web page needs black-box browser diagnostics, console/network/state capture, root-cause analysis, and source fixes for project-owned issues.
|
|
14
|
-
|
|
15
|
-
## When Not to Use
|
|
16
|
-
|
|
17
|
-
- Static architecture scans; load roll-.dream.
|
|
18
|
-
- General code review; load roll-.review or roll-review-pr.
|
|
19
|
-
|
|
20
|
-
## Read On Demand
|
|
21
|
-
|
|
22
|
-
- Read [the full contract](references/full-contract.md) before executing the workflow end to end, recovering from failures, or checking exact output templates.
|
|
23
|
-
- Read [Black Box probe asset](assets/injectable-bb.js) when mounting the built-in diagnostic stub.
|
|
24
|
-
- Keep this hub in context for trigger boundaries and hard gates.
|
|
25
|
-
|
|
26
|
-
## Workflow Skeleton
|
|
27
|
-
|
|
28
|
-
1. Open or attach to the target page.
|
|
29
|
-
2. Mount the Black Box probe and collect diagnostics.
|
|
30
|
-
3. Analyze console, network, DOM, storage, and source clues.
|
|
31
|
-
4. Fix only project-owned root causes.
|
|
32
|
-
5. Unmount the probe and report evidence.
|
|
33
|
-
|
|
34
|
-
## Hard Gates
|
|
35
|
-
|
|
36
|
-
- Cleanup is mandatory.
|
|
37
|
-
- Do not hide external-service or environment faults as source fixes.
|
|
38
|
-
|
|
39
|
-
## Gotchas
|
|
40
|
-
|
|
41
|
-
- Mount the black-box probe only long enough to diagnose; clean it up before final delivery.
|
|
42
|
-
- Only auto-fix root causes in project source; external services and browser environment issues need clear attribution.
|
|
43
|
-
|
|
44
|
-
## Maintenance
|
|
45
|
-
|
|
46
|
-
- Description changes require updates in `route-cases/skills.json`.
|
|
47
|
-
- New observed failures should add a gotcha and the matching positive or negative route case.
|
|
48
|
-
- Heavy examples, templates, recovery paths, and deterministic snippets belong in `references/`, `assets/`, or `scripts/`, not in this hub.
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
// Roll Debug — Injectable BB Diagnostic Stub
|
|
2
|
-
// Injected into page context by Playwright when native BB is absent.
|
|
3
|
-
// Exposes window.__BB_DATA__ and [data-testid="bb-toggle"] for unified collection.
|
|
4
|
-
// Fully unmountable via window.__BB_UNMOUNT__().
|
|
5
|
-
|
|
6
|
-
(function () {
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
if (window.__BB_DATA__) return; // Already mounted
|
|
10
|
-
|
|
11
|
-
// ─── Backup originals ───
|
|
12
|
-
const _orig = {
|
|
13
|
-
console: {},
|
|
14
|
-
fetch: window.fetch,
|
|
15
|
-
XHR_open: XMLHttpRequest.prototype.open,
|
|
16
|
-
XHR_send: XMLHttpRequest.prototype.send,
|
|
17
|
-
};
|
|
18
|
-
['error', 'warn', 'log', 'info'].forEach((m) => {
|
|
19
|
-
_orig.console[m] = console[m];
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// ─── BB State ───
|
|
23
|
-
const BB = {
|
|
24
|
-
version: 'stub-1.0',
|
|
25
|
-
mountedAt: Date.now(),
|
|
26
|
-
console: { errors: [], warnings: [], logs: [] },
|
|
27
|
-
network: { failed: [], slow: [], all: [] },
|
|
28
|
-
errors: [],
|
|
29
|
-
dom: {},
|
|
30
|
-
performance: {},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// ─── Console hooks (with internal error firewall) ───
|
|
34
|
-
['error', 'warn', 'log', 'info'].forEach((m) => {
|
|
35
|
-
const key = m === 'error' ? 'errors' : m === 'warn' ? 'warnings' : 'logs';
|
|
36
|
-
const orig = _orig.console[m];
|
|
37
|
-
console[m] = function bbHookedConsole(...args) {
|
|
38
|
-
try {
|
|
39
|
-
BB.console[key].push({
|
|
40
|
-
message: args
|
|
41
|
-
.map((a) => {
|
|
42
|
-
try {
|
|
43
|
-
return typeof a === 'object' ? JSON.stringify(a) : String(a);
|
|
44
|
-
} catch (e) {
|
|
45
|
-
return '[unstringifiable]';
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
.join(' '),
|
|
49
|
-
timestamp: Date.now(),
|
|
50
|
-
});
|
|
51
|
-
} catch (e) {
|
|
52
|
-
/* swallow stub internal error */
|
|
53
|
-
}
|
|
54
|
-
return orig.apply(this, args);
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// ─── Fetch hook (transparent wrapper) ───
|
|
59
|
-
const origFetch = _orig.fetch;
|
|
60
|
-
window.fetch = function bbHookedFetch(...args) {
|
|
61
|
-
const start = Date.now();
|
|
62
|
-
const url =
|
|
63
|
-
typeof args[0] === 'string'
|
|
64
|
-
? args[0]
|
|
65
|
-
: args[0]?.url || '[unknown]';
|
|
66
|
-
const method = args[1]?.method || 'GET';
|
|
67
|
-
|
|
68
|
-
return origFetch.apply(this, args).then(
|
|
69
|
-
(res) => {
|
|
70
|
-
try {
|
|
71
|
-
const duration = Date.now() - start;
|
|
72
|
-
const entry = { url, status: res.status, duration, method };
|
|
73
|
-
BB.network.all.push(entry);
|
|
74
|
-
if (!res.ok) BB.network.failed.push(entry);
|
|
75
|
-
if (duration > 3000) BB.network.slow.push(entry);
|
|
76
|
-
} catch (e) {
|
|
77
|
-
/* swallow */
|
|
78
|
-
}
|
|
79
|
-
return res;
|
|
80
|
-
},
|
|
81
|
-
(err) => {
|
|
82
|
-
try {
|
|
83
|
-
BB.network.failed.push({
|
|
84
|
-
url,
|
|
85
|
-
error: err.message,
|
|
86
|
-
duration: Date.now() - start,
|
|
87
|
-
method,
|
|
88
|
-
});
|
|
89
|
-
} catch (e) {
|
|
90
|
-
/* swallow */
|
|
91
|
-
}
|
|
92
|
-
throw err;
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
try {
|
|
97
|
-
window.fetch.toString = () => 'function fetch() { [native code] }';
|
|
98
|
-
} catch (e) {
|
|
99
|
-
/* ignore */
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// ─── XHR hook ───
|
|
103
|
-
XMLHttpRequest.prototype.open = function bbHookedOpen(method, url, ...rest) {
|
|
104
|
-
this._bb = { method, url: String(url), start: null };
|
|
105
|
-
return _orig.XHR_open.call(this, method, url, ...rest);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
XMLHttpRequest.prototype.send = function bbHookedSend(...args) {
|
|
109
|
-
if (this._bb) this._bb.start = Date.now();
|
|
110
|
-
const handler = () => {
|
|
111
|
-
if (!this._bb) return;
|
|
112
|
-
try {
|
|
113
|
-
const duration = Date.now() - this._bb.start;
|
|
114
|
-
const entry = {
|
|
115
|
-
url: this._bb.url,
|
|
116
|
-
status: this.status,
|
|
117
|
-
duration,
|
|
118
|
-
method: this._bb.method,
|
|
119
|
-
};
|
|
120
|
-
BB.network.all.push(entry);
|
|
121
|
-
if (this.status >= 400 || this.status === 0)
|
|
122
|
-
BB.network.failed.push(entry);
|
|
123
|
-
if (duration > 3000) BB.network.slow.push(entry);
|
|
124
|
-
} catch (e) {
|
|
125
|
-
/* swallow */
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
this.addEventListener('loadend', handler, { once: true });
|
|
129
|
-
return _orig.XHR_send.apply(this, args);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// ─── JS Error listeners ───
|
|
133
|
-
const onError = (e) => {
|
|
134
|
-
try {
|
|
135
|
-
BB.errors.push({
|
|
136
|
-
message: e.message,
|
|
137
|
-
stack: e.error?.stack,
|
|
138
|
-
timestamp: Date.now(),
|
|
139
|
-
});
|
|
140
|
-
} catch (e) {
|
|
141
|
-
/* swallow */
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
const onRejection = (e) => {
|
|
145
|
-
try {
|
|
146
|
-
BB.errors.push({
|
|
147
|
-
message: e.reason?.message || String(e.reason),
|
|
148
|
-
stack: e.reason?.stack,
|
|
149
|
-
timestamp: Date.now(),
|
|
150
|
-
});
|
|
151
|
-
} catch (e) {
|
|
152
|
-
/* swallow */
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
window.addEventListener('error', onError);
|
|
156
|
-
window.addEventListener('unhandledrejection', onRejection);
|
|
157
|
-
|
|
158
|
-
// ─── Performance ───
|
|
159
|
-
const capturePerf = () => {
|
|
160
|
-
try {
|
|
161
|
-
const nav = performance.getEntriesByType('navigation')[0];
|
|
162
|
-
BB.performance = {
|
|
163
|
-
domContentLoaded: nav?.domContentLoadedEventEnd,
|
|
164
|
-
loadComplete: nav?.loadEventEnd,
|
|
165
|
-
firstContentfulPaint:
|
|
166
|
-
performance.getEntriesByName('first-contentful-paint')[0]?.startTime,
|
|
167
|
-
largestContentfulPaint: performance
|
|
168
|
-
.getEntriesByType('largest-contentful-paint')
|
|
169
|
-
.pop()?.startTime,
|
|
170
|
-
};
|
|
171
|
-
} catch (e) {
|
|
172
|
-
/* swallow */
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
if (document.readyState === 'complete') {
|
|
176
|
-
capturePerf();
|
|
177
|
-
} else {
|
|
178
|
-
window.addEventListener('load', capturePerf, { once: true });
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// ─── DOM Capture ───
|
|
182
|
-
function captureDOM() {
|
|
183
|
-
try {
|
|
184
|
-
const info = (sel) => {
|
|
185
|
-
const el = document.querySelector(sel);
|
|
186
|
-
return el
|
|
187
|
-
? {
|
|
188
|
-
exists: true,
|
|
189
|
-
visible: el.offsetParent !== null,
|
|
190
|
-
text: el.textContent?.slice(0, 200),
|
|
191
|
-
}
|
|
192
|
-
: { exists: false };
|
|
193
|
-
};
|
|
194
|
-
return {
|
|
195
|
-
title: document.title,
|
|
196
|
-
url: location.href,
|
|
197
|
-
htmlLength: document.documentElement.innerHTML.length,
|
|
198
|
-
keyElements: {
|
|
199
|
-
'#root': info('#root'),
|
|
200
|
-
'#app': info('#app'),
|
|
201
|
-
'[data-testid="error"]': info('[data-testid="error"]'),
|
|
202
|
-
'.error': info('.error'),
|
|
203
|
-
'.loading': info('.loading'),
|
|
204
|
-
},
|
|
205
|
-
};
|
|
206
|
-
} catch (e) {
|
|
207
|
-
return { error: 'DOM capture failed', url: location.href };
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// ─── Public API ───
|
|
212
|
-
BB.getData = () => ({ ...BB, dom: captureDOM(), collectedAt: Date.now() });
|
|
213
|
-
window.__BB_DATA__ = BB;
|
|
214
|
-
|
|
215
|
-
// ─── Visible BB toggle button ───
|
|
216
|
-
let btn;
|
|
217
|
-
if (document.body) {
|
|
218
|
-
btn = document.createElement('button');
|
|
219
|
-
btn.dataset.testid = 'bb-toggle';
|
|
220
|
-
btn.textContent = 'BB';
|
|
221
|
-
btn.title = 'Black Box Diagnostic Probe — click to download report';
|
|
222
|
-
btn.style.cssText =
|
|
223
|
-
'position:fixed;bottom:12px;right:12px;z-index:99999;' +
|
|
224
|
-
'width:36px;height:36px;border-radius:50%;border:none;' +
|
|
225
|
-
'background:#ff4444;color:#fff;font-size:11px;font-weight:bold;' +
|
|
226
|
-
'font-family:sans-serif;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,0.3);' +
|
|
227
|
-
'display:flex;align-items:center;justify-content:center;' +
|
|
228
|
-
'opacity:0.85;transition:opacity 0.2s;';
|
|
229
|
-
btn.onmouseenter = () => (btn.style.opacity = '1');
|
|
230
|
-
btn.onmouseleave = () => (btn.style.opacity = '0.85');
|
|
231
|
-
btn.onclick = () => {
|
|
232
|
-
const data = BB.getData();
|
|
233
|
-
const blob = new Blob([JSON.stringify(data, null, 2)], {
|
|
234
|
-
type: 'application/json',
|
|
235
|
-
});
|
|
236
|
-
const a = document.createElement('a');
|
|
237
|
-
a.href = URL.createObjectURL(blob);
|
|
238
|
-
a.download = `bb-diagnostic-${Date.now()}.json`;
|
|
239
|
-
a.click();
|
|
240
|
-
};
|
|
241
|
-
document.body.appendChild(btn);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// ─── Unmount (restore page to original state) ───
|
|
245
|
-
window.__BB_UNMOUNT__ = function () {
|
|
246
|
-
try {
|
|
247
|
-
['error', 'warn', 'log', 'info'].forEach(
|
|
248
|
-
(m) => (console[m] = _orig.console[m])
|
|
249
|
-
);
|
|
250
|
-
window.fetch = _orig.fetch;
|
|
251
|
-
XMLHttpRequest.prototype.open = _orig.XHR_open;
|
|
252
|
-
XMLHttpRequest.prototype.send = _orig.XHR_send;
|
|
253
|
-
window.removeEventListener('error', onError);
|
|
254
|
-
window.removeEventListener('unhandledrejection', onRejection);
|
|
255
|
-
if (btn) btn.remove();
|
|
256
|
-
delete window.__BB_DATA__;
|
|
257
|
-
delete window.__BB_UNMOUNT__;
|
|
258
|
-
return true;
|
|
259
|
-
} catch (e) {
|
|
260
|
-
return false;
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
})();
|