oh-my-opencode 4.14.2 → 4.15.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.
- package/dist/cli/index.js +14 -14
- package/dist/cli-node/index.js +14 -14
- package/dist/index.js +13 -13
- package/dist/skills/frontend/ATTRIBUTION.md +7 -0
- package/dist/skills/frontend/SKILL.md +7 -3
- package/dist/skills/frontend/references/design/README.md +11 -34
- package/dist/skills/frontend/references/design/clone-from-url.md +65 -0
- package/dist/skills/programming/SKILL.md +5 -3
- package/dist/skills/remove-ai-slops/SKILL.md +34 -15
- package/dist/skills/visual-qa/SKILL.md +11 -0
- package/dist/skills/visual-qa/scripts/skill-prompt-contract.test.ts +42 -0
- package/package.json +13 -13
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +13 -13
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +7 -0
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +7 -3
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +11 -34
- package/packages/omo-codex/plugin/skills/frontend/references/design/clone-from-url.md +65 -0
- package/packages/omo-codex/plugin/skills/programming/SKILL.md +5 -3
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +34 -15
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +11 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +1 -1
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +7 -0
- package/packages/shared-skills/skills/frontend/SKILL.md +7 -3
- package/packages/shared-skills/skills/frontend/references/design/README.md +11 -34
- package/packages/shared-skills/skills/frontend/references/design/clone-from-url.md +65 -0
- package/packages/shared-skills/skills/programming/SKILL.md +5 -3
- package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +34 -15
- package/packages/shared-skills/skills/visual-qa/SKILL.md +11 -0
- package/packages/shared-skills/skills/visual-qa/scripts/skill-prompt-contract.test.ts +42 -0
|
@@ -131,12 +131,14 @@ Do NOT use this for greenfield work — the audit phase is wasted effort there.
|
|
|
131
131
|
|
|
132
132
|
### Step 4 — Is this an image-first workflow?
|
|
133
133
|
|
|
134
|
-
Triggers: "generate the design first then code it", "make a mockup before we build", "show me what it could look like".
|
|
134
|
+
Triggers: "generate the design first then code it", "make a mockup before we build", "show me what it could look like" — AND, by default, any expressive greenfield brief (glossy / premium / wow / brand-grade) with no user-supplied reference.
|
|
135
135
|
|
|
136
136
|
**Action:** Load both:
|
|
137
137
|
- `image-to-code-skill.md` (the workflow: generate → analyze → implement)
|
|
138
138
|
- `imagegen-frontend-web.md` for web, or `imagegen-frontend-mobile.md` for mobile screens
|
|
139
139
|
|
|
140
|
+
For an expressive greenfield brief, default to generating **2-3 imagen concept drafts**, each prompt **seeded with the loaded Layer A + Layer B tokens** (palette, type, signature material) so the drafts inherit the reference's taste instead of generic priors. Pick the strongest, then treat the chosen draft as the reference-fidelity contract for `/visual-qa`.
|
|
141
|
+
|
|
140
142
|
If the user wants only the imagery (no code), load only the imagegen file.
|
|
141
143
|
|
|
142
144
|
### Step 5 — Image-only requests (no code)
|
|
@@ -215,39 +217,14 @@ Once references are loaded, before writing any UI code:
|
|
|
215
217
|
|
|
216
218
|
## Phase Final — Design QA (MANDATORY, runs after implementation)
|
|
217
219
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
1. **Launch the app** in a real browser (use `agent-browser` skill or the project's dev server + screenshot tool).
|
|
227
|
-
2. **Take screenshots** at key breakpoints: mobile (375px), tablet (768px), desktop (1280px).
|
|
228
|
-
3. **Walk the design system checklist** visually:
|
|
229
|
-
- [ ] Colors match `DESIGN.md` palette — no off-brand colors visible
|
|
230
|
-
- [ ] Typography hierarchy is clear — headings, body, captions are visually distinct
|
|
231
|
-
- [ ] Spacing rhythm feels consistent — no cramped or floating elements
|
|
232
|
-
- [ ] Interactive states work — hover every button, focus every input, toggle every switch
|
|
233
|
-
- [ ] Empty, loading, and error states exist and look intentional
|
|
234
|
-
- [ ] Dark mode (if declared in `DESIGN.md`) works completely
|
|
235
|
-
- [ ] No layout overflow, no horizontal scroll on mobile
|
|
236
|
-
- [ ] Motion/animation feels smooth — no jank, no missing transitions
|
|
237
|
-
- [ ] (Expressive brief) Surfaces AND the hero focal object read as real, dimensional material — not flat fills or flat geometric primitives. Use the brand's material: glass = tint+backdrop saturate+rim+sheen+glow; bright/playful = gradient fills+soft depth shadows+a lit focal object. The hero focal object is a generated bitmap, or carries real light/shadow/gradient/depth.
|
|
238
|
-
- [ ] (Expressive brief) Brand color is a perceptual ramp (multiple stops / OKLCH), not one tint reused at different opacities
|
|
239
|
-
- [ ] (Expressive brief) Every interactive element has a visible hover AND active/pressed micro-interaction, and the hero carries one signature moment
|
|
240
|
-
4. **Two kinds of failure count equally — fix both, then re-check.** Defects: clipping, wrong font, missing state, jank. Flatness: a surface that reads generic next to the loaded reference. When the render is bug-free but flat, you are NOT done — RAISE the design: deepen the material layering, give the color real depth and a ramp, add the signature interaction. Patching only bugs while the surface stays at the floor is the single most common way this skill ships clean-but-generic work. Do not report "done" with visual bugs OR a floor-level surface.
|
|
241
|
-
5. **If you cannot launch a browser** (e.g. no dev server, CI-only environment), state this explicitly and list what you would check. Never silently skip QA.
|
|
242
|
-
|
|
243
|
-
### QA Report
|
|
244
|
-
|
|
245
|
-
After passing QA, write a short summary:
|
|
246
|
-
- Breakpoints tested
|
|
247
|
-
- States verified (hover, focus, disabled, loading, error, empty)
|
|
248
|
-
- Design system compliance: all tokens traced back to `DESIGN.md`
|
|
249
|
-
- Issues found and fixed during QA
|
|
250
|
-
- Screenshot evidence (attach or describe)
|
|
220
|
+
Before declaring the task done, verify the rendered UI. **The verification authority is `/visual-qa`, not a hand-rolled checklist here.** Run `/visual-qa`: it captures every page and breakpoint (375 / 768 / 1280px) on fresh evidence, drives and inspects interaction states (hover/focus/active) and motion (transitions, scroll-triggered, load), runs the dual-oracle pass, and loops until an independent reviewer passes. For a concrete reference or clone, run it in reference-fidelity mode.
|
|
221
|
+
|
|
222
|
+
This skill adds only the design-taste judgments `/visual-qa` cannot make for you:
|
|
223
|
+
|
|
224
|
+
1. **Two kinds of failure count equally — fix both, then re-check.** Defects: clipping, wrong font, missing state, jank. Flatness: a surface that reads generic next to the loaded reference. When the render is bug-free but flat, you are NOT done — RAISE the design: deepen the material layering, give the color a real perceptual ramp (multiple stops / OKLCH, not one tint at varied opacity), render the hero focal object as real dimensional material (a generated bitmap, or real light/shadow/gradient/depth — never flat geometric primitives), and add the one signature moment. Patching only bugs while the surface stays at the floor is the single most common way this skill ships clean-but-generic work.
|
|
225
|
+
2. **Motion serves meaning; slop animation is forbidden.** Every interactive element must communicate its affordance and state changes — but a hover that changes nothing, motion on a non-interactive element, or a decorative micro-animation with no informational purpose is slop. Do not add it, and treat any you find as a defect. The hero may carry one signature moment; the rest of the surface earns motion only where it signals interaction or state.
|
|
226
|
+
|
|
227
|
+
Report "done" only when `/visual-qa` has passed on fresh evidence AND neither a visual bug nor a floor-level or slop-laden surface remains.
|
|
251
228
|
|
|
252
229
|
|
|
253
230
|
## Final notes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Clone From URL — Runtime Design-System Extraction
|
|
2
|
+
|
|
3
|
+
Use this when the user gives a **live site or a URL** to clone: "clone aside.com", "rebuild this page", "make it look exactly like `<url>`". A live URL affords what a screenshot cannot — the browser's **runtime truth**. Extract that truth with the real browser, make it the `DESIGN.md` contract, then build reusable primitives against it. Never eyeball a screenshot into a one-off.
|
|
4
|
+
|
|
5
|
+
## Outcome and stop rule
|
|
6
|
+
|
|
7
|
+
A `DESIGN.md` whose every token, interaction state, and motion value was read from the running page with `getComputedStyle`, plus a component-level clone that an independent reviewer confirms is an extensible design system (live DOM, reused primitives) — not a screenshot-matched or pasted-image fake. Done is defined by `/visual-qa` reference-fidelity mode passing on fresh evidence, not by your own glance.
|
|
8
|
+
|
|
9
|
+
## Phase 1 — Extract the runtime truth (never guess a value)
|
|
10
|
+
|
|
11
|
+
Drive a real browser: Codex `browser:control-in-app-browser` first, otherwise the project's `agent-browser` / playwright / dev-browser tooling. Do NOT parse CSS files — minification, CORS, CSS-in-JS, and Tailwind utilities make source unreliable. `getComputedStyle` returns what the browser ACTUALLY rendered, so it is the only source of truth.
|
|
12
|
+
|
|
13
|
+
Sweep the page and read, for every meaningful element and every repeated pattern:
|
|
14
|
+
|
|
15
|
+
- **Tokens** — color, background, border, font family/size/weight, line-height, letter-spacing, radius, shadow, and spacing (padding/margin/gap). Cluster the repeated values into the token scale.
|
|
16
|
+
- **Interaction states** — capture `default/hover/focus/active` (plus disabled/loading/empty/error where they exist) by DRIVING the state, then re-reading the computed style. A system with only the resting state is incomplete.
|
|
17
|
+
- **Motion** — `transition` (property, duration, timing function, delay), `@keyframes` (walk `document.styleSheets` for `CSSKeyframesRule`), and `transform`. Motion is part of the contract, not decoration.
|
|
18
|
+
- **Assets** — `<img>` and background-image URLs, inline SVG, `@font-face` files, video sources. Download the REAL assets; never substitute stock or placeholders.
|
|
19
|
+
- **Responsive** — re-run the sweep at 375 / 768 / 1280 and record what actually changes per breakpoint.
|
|
20
|
+
|
|
21
|
+
A compact sweep payload to inject through the browser's evaluate action (extend the recorded fields as needed):
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
() => {
|
|
25
|
+
const out = [];
|
|
26
|
+
for (const el of document.querySelectorAll("*")) {
|
|
27
|
+
const s = getComputedStyle(el);
|
|
28
|
+
out.push({
|
|
29
|
+
tag: el.tagName,
|
|
30
|
+
color: s.color, background: s.backgroundColor, border: s.borderColor,
|
|
31
|
+
font: s.fontFamily, size: s.fontSize, weight: s.fontWeight,
|
|
32
|
+
lineHeight: s.lineHeight, letterSpacing: s.letterSpacing,
|
|
33
|
+
radius: s.borderRadius, shadow: s.boxShadow,
|
|
34
|
+
padding: s.padding, margin: s.margin, gap: s.gap,
|
|
35
|
+
transition: s.transition, animation: s.animation, transform: s.transform,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Phase 2 — Write the DESIGN.md contract
|
|
43
|
+
|
|
44
|
+
Turn the extraction into `DESIGN.md` per `design-system-architecture.md`: token scales, typography, spacing, the component anatomy with every captured state, the motion rules, and the responsive deltas. Name which source each value came from. If a value is not in `DESIGN.md`, it may not appear in code.
|
|
45
|
+
|
|
46
|
+
## Phase 3 — Clone-code reusable primitives (one at a time)
|
|
47
|
+
|
|
48
|
+
Build primitives against the contract, not the screenshot. One component per cycle: implement, render, compare to the source region, fix, then move on. Use the downloaded assets. Never paste a raster or `background-image` where a live element belongs. Never approximate a token you already extracted.
|
|
49
|
+
|
|
50
|
+
## Phase 4 — Reference-fidelity QA (mandatory, motion included)
|
|
51
|
+
|
|
52
|
+
Verify through `/visual-qa` in reference-fidelity mode against the source captures, for every page and every breakpoint. Interaction states and animations are IN SCOPE: drive hover/focus/click/scroll, then compare the settled states AND the motion itself against the source. You are not done until the dual-oracle gate passes on fresh evidence.
|
|
53
|
+
|
|
54
|
+
## Anti-patterns
|
|
55
|
+
|
|
56
|
+
- Parsing CSS files instead of `getComputedStyle` — the rendered truth is the only source.
|
|
57
|
+
- "CORS blocked" as an excuse — computed styles bypass it.
|
|
58
|
+
- Resting state only — capture hover/focus/active and the rest.
|
|
59
|
+
- Screenshot-matched one-off — build reusable, token-driven primitives.
|
|
60
|
+
- Placeholder or stock assets — download and use the originals.
|
|
61
|
+
- Desktop only — re-extract at each breakpoint.
|
|
62
|
+
|
|
63
|
+
## Provenance
|
|
64
|
+
|
|
65
|
+
This runtime-extraction workflow follows the MIT-licensed **[JCodesMore/ai-website-cloner-template](https://github.com/JCodesMore/ai-website-cloner-template)** clone-website approach: browser automation plus a `getComputedStyle` sweep, state/motion/asset capture, spec files, and visual QA. It is a project-original synthesis, not a copy of that template. Do not treat this file as a license to copy any target site's trademarks, brand assets, logos, or proprietary copy — extract the design *system* (tokens, layout grammar, component anatomy, interaction states, motion) and apply it to the user's own product and content.
|
|
@@ -5,7 +5,7 @@ description: "MUST USE for ANY work on .py .pyi .rs .ts .tsx .mts .cts .go files
|
|
|
5
5
|
|
|
6
6
|
# Programming
|
|
7
7
|
|
|
8
|
-
You are a senior engineer
|
|
8
|
+
You are a lazy senior engineer — lazy meaning efficient, never careless. **The best code is the code never written; the code you do write is type-strict, stack-first, async-correct, and architecturally honest about size.**
|
|
9
9
|
|
|
10
10
|
This skill is an index. The hard per-language rules live under `references/`. Load the language-specific reference **before** writing a single line of code.
|
|
11
11
|
|
|
@@ -33,7 +33,9 @@ This skill is an index. The hard per-language rules live under `references/`. Lo
|
|
|
33
33
|
|
|
34
34
|
## Shared philosophy (all three languages)
|
|
35
35
|
|
|
36
|
-
These are not style preferences. They are the
|
|
36
|
+
These are not style preferences. They are the seven axioms every recipe in `references/` derives from.
|
|
37
|
+
|
|
38
|
+
0. **The best code is the code never written.** Before writing, stop at the first rung that holds: (1) does this need to exist at all? (YAGNI) (2) does this codebase already have it? — reuse the helper or pattern, do not re-implement. (3) does the standard library do it? (4) does a native platform feature cover it? (5) does an installed dependency solve it? (6) can it be one line? (7) only then, write the minimum that works. Climb the ladder *after* you understand the problem and trace the real flow end to end — the smallest diff in the wrong place is a second bug, not laziness. The ladder is a fast decision, not a written essay: pick the rung and move. **Bug fix = root cause, not symptom.** A ticket names a symptom; grep every caller of the function you touch and fix the shared seam once — one guard at the source is a smaller, more correct diff than one guard per caller, and patching only the path the ticket names leaves a sibling caller broken.
|
|
37
39
|
|
|
38
40
|
1. **The type system is your proof system.** Make illegal states unrepresentable. The compiler / type checker is the cheapest test you will ever run. If a bug can be expressed as a type error, it is *required* to be expressed as a type error.
|
|
39
41
|
|
|
@@ -254,7 +256,7 @@ After every code-writing session, answer these out loud (in your reply) before d
|
|
|
254
256
|
3. **Variant discrimination?** Did I use `if`/`elif`/`else` (or `switch` without `assertNever`, or `match` without `assert_never`) anywhere to discriminate on a tagged type or enum? If yes, rewrite as exhaustive match.
|
|
255
257
|
4. **Escape hatches?** Any `Any`, `# type: ignore`, `unwrap`, `expect` outside `main`/tests, `as` numeric cast, `!`, `@ts-ignore`, `@ts-expect-error`, `#[allow]` on a real warning? If yes, fix the type or document why with a comment.
|
|
256
258
|
5. **Defensive layer?** Any null check, try/except, or `isinstance` guarding a value the type system already proves? If yes, delete.
|
|
257
|
-
6. **Helpers for one-off?** Any function, class, or trait introduced for a single caller that will never get a second caller? If yes, inline.
|
|
259
|
+
6. **Helpers for one-off?** Any function, class, or trait introduced for a single caller that will never get a second caller? If yes, inline — axiom 0 should have caught it pre-write; this is the backstop.
|
|
258
260
|
7. **Tests?** Is the behavior I just introduced locked by a test that would fail if I revert this commit?
|
|
259
261
|
8. **Parameter bloat?** Any function I wrote or modified that takes more than 3 parameters — or smuggles them through a dict/kwargs/`...args`/throwaway options object? If yes, group related params into a typed value object. See [Smell 2](references/code-smells.md#smell-2--function-with-more-than-3-parameters).
|
|
260
262
|
9. **Redundant verification?** Did I perform a destructive action (delete, remove, clear) and then immediately re-query to "confirm" it worked? Did I call a setter then a getter to "verify"? If yes, delete the verification — the operation's contract IS the proof. See [Smell 3](references/code-smells.md#smell-3--redundant-verification-after-a-destructive-action).
|
|
@@ -30,6 +30,7 @@ The agent looks for these nine categories. The first three are stylistic, the ne
|
|
|
30
30
|
2. **Over-defensive code** — null checks for guaranteed values, try/except around code that cannot raise, isinstance checks for statically typed params, default values for required params, backward-compat shims, redundant validation duplicated at multiple layers, **broad exception catching** (`except Exception`/`except BaseException` in Python, empty `catch {}` or `catch (e) { console.error(e) }` without narrowing in TypeScript/JavaScript).
|
|
31
31
|
- KEEP: validation at system boundaries (user input, external APIs), I/O error handling, nullable DB fields. Top-level boundary catch-all (CLI `main()`, HTTP handler) with explicit logging + re-raise is acceptable.
|
|
32
32
|
- REFACTOR: `except Exception` → catch the specific exception you expect. Empty `catch {}` → add `instanceof` narrowing or re-throw. `catch (e) { log(e) }` → narrow with `instanceof`, handle known cases, re-throw unknown.
|
|
33
|
+
- PROOF REQUIRED: before deleting any validation or error handling at a trust boundary, Phase 2 must include an **adversarial** regression (malformed or hostile input) that fails if the guard is removed. No adversarial test → the guard stays. Redundant defense to remove is a duplicate of a check that already runs *inside* the boundary; a guard with no proof of redundancy is load-bearing.
|
|
33
34
|
|
|
34
35
|
3. **Excessive complexity** — deep nesting (>3 levels), nested ternaries, complex boolean expressions (combine 4+ predicates), long parameter lists (>5 args without a struct/dataclass/object), god functions (>50 lines doing many things), overly clever one-liners that sacrifice readability, `if/elif/else` chains for type/enum/literal discrimination (must be `match/case` + `assert_never`), `object` used as a type annotation (must be `Protocol`, `TypeVar`, or explicit union).
|
|
35
36
|
- KEEP: established complexity patterns in this codebase, performance-critical hot paths that intentionally use a complex idiom. `if/else` for boolean conditions and range checks (not variant discrimination).
|
|
@@ -126,22 +127,37 @@ For each in-scope source file:
|
|
|
126
127
|
|
|
127
128
|
If you cannot establish a green baseline (e.g., test runner is broken), STOP and report. Do not proceed with cleanup on unverified ground.
|
|
128
129
|
|
|
129
|
-
### Phase 3: Cleanup plan
|
|
130
|
+
### Phase 3: Cleanup plan — existence first, then smells
|
|
130
131
|
|
|
131
|
-
|
|
132
|
+
The largest, safest deletion is code that should not have existed. **Before categorizing smells, run the deletion ladder on each changed unit:**
|
|
133
|
+
|
|
134
|
+
- **Delete entirely** — the behavior is not needed (YAGNI, speculative, dead on arrival).
|
|
135
|
+
- **Reuse** — an existing helper or pattern in this repo already does it; replace the reimplementation with a call to it.
|
|
136
|
+
- **Platform / stdlib / native / dependency** — the language stdlib, the runtime, or an already-installed dependency already does it (a hand-rolled date picker → `<input type="date">`, a custom query parser → `URLSearchParams`, a bespoke debounce → the util already imported).
|
|
137
|
+
- **Simplify in place** — it must exist; make it smaller.
|
|
138
|
+
|
|
139
|
+
Only code that lands on **Simplify in place** proceeds to the smell categories. This turns the pass from "find smells to trim" into "first decide whether the code should exist, then trim what survives." One function replaced by a platform call is a bigger, safer win than any in-place cleanup — and it needs no per-line smell analysis.
|
|
140
|
+
|
|
141
|
+
For a diff that **fixes a bug**, grep the callers of every shared function it touches. Prefer one root-cause fix at the shared seam over repeated guards at each caller — a per-caller patch that leaves a sibling caller broken is a partial fix, not a cleanup.
|
|
142
|
+
|
|
143
|
+
Then produce an explicit plan **before** spawning the removal agents:
|
|
132
144
|
|
|
133
145
|
```
|
|
134
146
|
File: src/foo.py
|
|
147
|
+
Ladder: 2 units simplify-in-place; 1 unit delete (native <input> replaces custom picker)
|
|
135
148
|
Categories: dead code, excessive complexity, performance
|
|
136
149
|
Order: dead code → complexity → performance
|
|
137
150
|
Risk: medium (touches caching layer)
|
|
138
151
|
|
|
139
152
|
File: src/bar.py
|
|
153
|
+
Ladder: all simplify-in-place
|
|
140
154
|
Categories: obvious comments, over-defensive
|
|
141
155
|
Order: comments → defensive
|
|
142
156
|
Risk: low
|
|
143
157
|
```
|
|
144
158
|
|
|
159
|
+
**Intentional shortcuts:** if the plan deliberately keeps a bounded simplification (a naive scan fine under N rows, a global lock, an O(n²) path), mark it in-code with a `debt:` comment naming the ceiling and the upgrade trigger (in omo, prefix with `// @allow` so the comment-checker treats it as intentional), and list it under "Remaining Risks / Deferred" in the report. That section is the debt ledger — a simplification with a known ceiling and no marker is indistinguishable from a bug.
|
|
160
|
+
|
|
145
161
|
Order rule (safest → riskiest): comments → dead code → defensive → duplication → complexity → abstraction/boundary → performance → tests → oversized-modules. This minimizes blast radius of any one change.
|
|
146
162
|
|
|
147
163
|
### Phase 4: Parallel slop removal via `deep` agents in batches of 5
|
|
@@ -170,13 +186,9 @@ task(
|
|
|
170
186
|
prompt="""
|
|
171
187
|
Remove AI slops from: {file_path}
|
|
172
188
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- Boundary violations: wrong-layer imports, leaky responsibilities, hidden coupling
|
|
177
|
-
- Dead code: unused imports, unreachable branches, stale flags, debug leftovers
|
|
178
|
-
- Duplication: copy-paste branches, redundant helpers
|
|
179
|
-
- Performance equivalences: O(n²)→O(n) via set lookup, hoist computation out of loops, eager→lazy collections, batch redundant calls, cache repeated len()/length
|
|
189
|
+
First run the deletion ladder from Phase 3 on this file (delete entirely / reuse existing repo code / platform-stdlib-native / simplify in place); only code that must exist proceeds to smell removal.
|
|
190
|
+
|
|
191
|
+
Then evaluate EVERY category defined in this skill's "Categories (what counts as slop)" section, applying that section's KEEP and REFACTOR rules verbatim — the Categories section you have loaded is canonical, do not work from a restated subset.
|
|
180
192
|
|
|
181
193
|
Apply changes in this order (safest → riskiest): comments → dead code → defensive → duplication → complexity → abstraction/boundary → performance → oversized-modules.
|
|
182
194
|
|
|
@@ -251,18 +263,19 @@ Behavior Lock:
|
|
|
251
263
|
- Baseline status: GREEN
|
|
252
264
|
|
|
253
265
|
Cleanup Plan:
|
|
254
|
-
- path/to/file1.ts: [dead code → complexity → performance]
|
|
255
|
-
- path/to/file2.py: [comments → defensive]
|
|
266
|
+
- path/to/file1.ts: [ladder: 1 delete (native) + simplify-in-place] → [dead code → complexity → performance]
|
|
267
|
+
- path/to/file2.py: [ladder: all simplify-in-place] → [comments → defensive]
|
|
256
268
|
|
|
257
|
-
Per-File Results:
|
|
269
|
+
Per-File Results (each cut shows what replaces it):
|
|
258
270
|
path/to/file1.ts
|
|
259
|
-
-
|
|
271
|
+
- Ladder/delete: custom DatePicker (48 lines) → <input type="date"> (native), flatpickr import removed
|
|
272
|
+
- Dead code: 3 removed (lines X-Y, A-B, C) → nothing (unreachable)
|
|
260
273
|
- Excessive complexity: 1 simplified (nested ternary at L42 → if/else)
|
|
261
274
|
- Performance: 1 (line N: list scan → set lookup, O(n²)→O(n), behavior identical)
|
|
262
275
|
- Skipped (preserved): 2 (defensive null check at boundary; commented WHY at L88)
|
|
263
276
|
|
|
264
277
|
path/to/file2.py
|
|
265
|
-
- Obvious comments: 5 removed
|
|
278
|
+
- Obvious comments: 5 removed → nothing
|
|
266
279
|
- Over-defensive: 1 simplified (redundant isinstance on typed param)
|
|
267
280
|
|
|
268
281
|
Quality Gates:
|
|
@@ -280,8 +293,14 @@ Critical Review:
|
|
|
280
293
|
Issues Found & Fixed:
|
|
281
294
|
- [None] OR [Issue description → Fix applied]
|
|
282
295
|
|
|
283
|
-
|
|
296
|
+
Net Impact:
|
|
297
|
+
- LOC: -74 (removed 91, added 17)
|
|
298
|
+
- Dependencies: -1 (flatpickr removed; native <input type="date"> used)
|
|
299
|
+
- Files deleted: 1 (src/date-picker-wrapper.ts — platform-native replacement)
|
|
300
|
+
|
|
301
|
+
Remaining Risks / Deferred (this section is the debt ledger):
|
|
284
302
|
- [None] OR [e.g., "boundary violation in module X flagged but not refactored — needs human judgment"]
|
|
303
|
+
- `debt:` markers kept this pass: [None] OR [file:line — ceiling → upgrade trigger]
|
|
285
304
|
|
|
286
305
|
Final Status: CLEAN | ISSUES FIXED | REQUIRES ATTENTION
|
|
287
306
|
```
|
|
@@ -89,6 +89,16 @@ Key fields: `maxWidth`, `overflowLines[]`, `borderMisaligned`, `wideCharColumns[
|
|
|
89
89
|
|
|
90
90
|
This JSON (diff ratio, similarity score, hotspots or overflow lines, border alignment, wide-char columns, alpha) is REFERENCE evidence to aim the reviewers. It is not the verdict by itself.
|
|
91
91
|
|
|
92
|
+
### Motion and interaction capture
|
|
93
|
+
|
|
94
|
+
Static screenshots miss what moves. For every interactive element and every animated region, do NOT settle for a single resting frame — capture the motion as evidence:
|
|
95
|
+
|
|
96
|
+
- **Interaction states:** drive the real browser to each state before capturing. Hover the element, focus it, click/press it, and for scroll-driven surfaces scroll to trigger the effect. Capture three frames per transition: **rest** (before), **mid-transition** (~100ms in, to prove the animation exists and is smooth), and **settled** (after it completes).
|
|
97
|
+
- **Entrance and scroll motion:** capture scroll-triggered reveals and any load animation as a short frame sequence (start, mid, end), not one frame. A reveal that never fires, janks, or lands in the wrong place is a defect only the sequence exposes.
|
|
98
|
+
- **Reference clones:** when the reference site has its own motion, capture the reference's motion the same way and compare it to the actual — timing, easing feel, and end state.
|
|
99
|
+
|
|
100
|
+
**Animation is never an excuse to skip or pass a region.** A high `diffRatio` caused by an in-flight animation is **never a valid excuse** to dismiss a defect or wave a region through. Compare **settled state to settled state** for pixel fidelity, and separately verify the motion against the **reference's own motion** (or, with no reference, against the stated intent). "The pixels differ because it animates" is a reason to capture the settled frame and the motion properly — not a reason to pass.
|
|
101
|
+
|
|
92
102
|
## Step 3 - Dispatch two read-only QA subagents in parallel
|
|
93
103
|
|
|
94
104
|
This independent review is REQUIRED before any "done" claim. Do not self-review inside the main agent and call the UI verified - a self-graded pass is the failure mode this step exists to stop. Dispatch it yourself, every time, without waiting to be told. Give each reviewer the captures for every enumerated page from Step 2, not a sample, and tell it the page count so it can confirm none were skipped.
|
|
@@ -135,6 +145,7 @@ CHECK EACH:
|
|
|
135
145
|
5. Responsive and resize behavior across viewport sizes (web) or terminal resize (TUI).
|
|
136
146
|
6. Do the user-intended FEATURES actually work: interactions, states, navigation (web); input handling, resize, scroll (TUI)? Trace the code paths.
|
|
137
147
|
7. Reference packet coverage: every reference page, state, viewport, and annotated requirement is implemented or explicitly marked out of scope by the user. Missing copy, missing overview content, swapped hierarchy, or unimplemented reference states are BLOCKING.
|
|
148
|
+
8. Slop animation: flag motion that signals nothing. A hover-without-action (a hover that produces no state change or affordance), motion on a non-interactive element, or a decorative micro-animation with no informational purpose is slop and a REVISE finding. Motion must map to a real interaction, state, or affordance; the hero may carry one signature moment, nothing else earns decoration.
|
|
138
149
|
|
|
139
150
|
OUTPUT:
|
|
140
151
|
VERDICT: PASS | REVISE | FAIL
|
|
@@ -252,3 +252,45 @@ describe("visual-qa skill exhaustive-coverage and review-gate contract", () => {
|
|
|
252
252
|
}
|
|
253
253
|
})
|
|
254
254
|
})
|
|
255
|
+
|
|
256
|
+
describe("visual-qa motion capture and slop-animation contract", () => {
|
|
257
|
+
test("#given an animated or interactive surface #when capturing #then rest, mid-transition and settled frames are driven and captured", () => {
|
|
258
|
+
for (const fixture of fixtures()) {
|
|
259
|
+
const motion = sectionBetween(fixture.text, "### Motion and interaction capture", "## Step 3")
|
|
260
|
+
const lower = motion.toLowerCase()
|
|
261
|
+
|
|
262
|
+
expect(lower, fixture.label).toContain("rest")
|
|
263
|
+
expect(lower, fixture.label).toContain("mid-transition")
|
|
264
|
+
expect(lower, fixture.label).toContain("settled")
|
|
265
|
+
expect(lower, fixture.label).toContain("hover")
|
|
266
|
+
expect(lower, fixture.label).toContain("focus")
|
|
267
|
+
expect(lower, fixture.label).toContain("click")
|
|
268
|
+
expect(lower, fixture.label).toContain("scroll-triggered")
|
|
269
|
+
expect(lower, fixture.label).toContain("load animation")
|
|
270
|
+
}
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
test("#given animation-induced pixel diff #when judging fidelity #then it is never an excuse to dismiss a defect", () => {
|
|
274
|
+
for (const fixture of fixtures()) {
|
|
275
|
+
const motion = sectionBetween(fixture.text, "### Motion and interaction capture", "## Step 3")
|
|
276
|
+
const lower = motion.toLowerCase()
|
|
277
|
+
|
|
278
|
+
expect(lower, fixture.label).toContain("never a valid excuse")
|
|
279
|
+
expect(lower, fixture.label).toContain("settled state to settled state")
|
|
280
|
+
expect(lower, fixture.label).toContain("reference's own motion")
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
test("#given meaningless motion #when reviewing #then Pass A flags slop animation, especially hover-without-action", () => {
|
|
285
|
+
for (const fixture of fixtures()) {
|
|
286
|
+
const passA = sectionBetween(fixture.text, "### Pass A", "### Pass B")
|
|
287
|
+
const checkBlock = sectionBetween(passA, "CHECK EACH:", "OUTPUT:")
|
|
288
|
+
const lower = checkBlock.toLowerCase()
|
|
289
|
+
|
|
290
|
+
expect(lower, fixture.label).toContain("slop animation")
|
|
291
|
+
expect(lower, fixture.label).toContain("non-interactive")
|
|
292
|
+
expect(lower, fixture.label).toContain("no state change")
|
|
293
|
+
expect(lower, fixture.label).toContain("hover-without-action")
|
|
294
|
+
}
|
|
295
|
+
})
|
|
296
|
+
})
|