The design language that makes your AI harness better at design.
JavaScript
Fix: critique skips the detector on native targets (#1017) (#1033)
Abdul Wahabce9145b6defc
diff --git a/skill/reference/critique.md b/skill/reference/critique.mdindex ad0831694..74816ee7a 100644--- a/skill/reference/critique.md+++ b/skill/reference/critique.md@@ -4,11 +4,11 @@ Resolve one stable target, run two independent assessments, synthesize a design### Hard Invariants-- Assessment A (design review) and Assessment B (detector/browser evidence) are both required.-- Assessment A and B MUST run as two isolated sub-agents whenever a sub-agent/Task tool is exposed. Running them inline in this context is "possible" but is NOT permitted; it is a degraded run. Inline is allowed ONLY when no sub-agent tool exists (or the user declined, on harnesses that ask).+- Assessment A (design review) and Assessment B (detector/browser evidence) are both required, except on a native platform (see Assessment Orchestration).+- Assessment A and B MUST run as two isolated sub-agents whenever a sub-agent/Task tool is exposed. Running them inline in this context is "possible" but is NOT permitted; it is a degraded run. Inline is allowed ONLY when no sub-agent tool exists (or the user declined, on harnesses that ask). Native platforms run A alone (see Assessment Orchestration).- If you degrade for any reason, the report's first line MUST be a banner: `⚠️ DEGRADED: single-context (<reason>)`. A silent degraded critique is a failed critique.- Assessment A must finish before detector findings enter the parent synthesis context. Detector output is deterministic, but it still anchors judgment.-- A skipped detector is a failed critique run unless `impeccable detect` is missing or crashes after a real attempt.+- A skipped detector is a failed critique run unless `impeccable detect` is missing or crashes after a real attempt, or the platform is native (see Assessment Orchestration).- Viewable targets require browser inspection when available.- Any local server started only for critique visualization must run in the background, have a recorded stop method, and be stopped before final reporting unless the user asks to keep it.- Do not claim a user-visible overlay exists unless script injection succeeded and the detector ran in the page.@@ -30,6 +30,8 @@ Resolve one stable target, run two independent assessments, synthesize a design### Assessment Orchestration+**Native platforms** (`ios` / `android` / `adaptive`): Assessment B does not apply, because `impeccable detect` and the browser overlay read only web markup. Run Assessment A alone in this context and skip both sub-agent gates below, the Codex permission question included: with no B there is nothing to isolate A from, so this is the complete native method and carries no degraded banner. Do not run `impeccable detect` on native source; its empty result reads as clean.+Delegate Assessment A and Assessment B to separate sub-agents. They must not see each other's output. Do not show findings to the user until synthesis.Sub-agent gate (all harnesses):@@ -66,7 +68,7 @@ Return: design-specificity verdict, heuristic scores, cognitive load, emotional### Assessment B: Detector + Browser Evidence-Run the bundled detector and browser visualization evidence. Assessment B is mandatory and must remain isolated from Assessment A until both are complete.+Run the bundled detector and browser visualization evidence. On web, Assessment B is mandatory and must remain isolated from Assessment A until both are complete.CLI scan:```bash@@ -116,6 +118,7 @@ Structure your feedback as a design director would:The report's first line MUST declare how the assessments were run, so a degraded run is never silent:- Dual-agent: `Method: dual-agent (A: <agent-id> · B: <agent-id>)`- Degraded: `⚠️ DEGRADED: single-context (<reason, e.g. no sub-agent tool exposed>)`+- Native: `Method: design review only (detector not applicable, native platform)`#### Design Health Score> *Consult the [Heuristics Scoring Guide](#heuristics-scoring-guide) section below.*@@ -148,7 +151,7 @@ Be honest with scores. A 4 means genuinely excellent. Most real interfaces score**LLM assessment**: Your unanchored evaluation of design specificity. Cover overall coherence, structural sameness, category-interchangeable choices, and missed opportunities for product character.-**Deterministic scan**: Summarize what the automated detector found, with counts and file locations. Note any additional issues the detector caught that you missed, and flag any false positives.+**Deterministic scan**: Summarize what the automated detector found, with counts and file locations. Note any additional issues the detector caught that you missed, and flag any false positives. On a native platform, write `not applicable (native platform)` instead.**Visual overlays** (if injection succeeded): Tell the user that overlays are now visible in the **[Human]** tab in their browser, highlighting the detected issues. Summarize what the console output reported. If browser visualization was attempted but injection failed, say that no reliable user-visible overlay is available and report the fallback signal instead.diff --git a/tests/skill-reference.test.mjs b/tests/skill-reference.test.mjsindex 402c0a550..6948e8165 100644--- a/tests/skill-reference.test.mjs+++ b/tests/skill-reference.test.mjs@@ -43,6 +43,17 @@ describe('skill reference authoring contracts', () => {assert.doesNotMatch(newWork, /first child of the document's body/);});+ it('skips the detector and its degraded banner on native critique targets', () => {+ const critique = readFileSync(join(ROOT, 'skill/reference/critique.md'), 'utf-8').replace(/\r\n?/g, '\n');+ const orchestration = critique.match(/### Assessment Orchestration\n([\s\S]*?)\n<codex>/)?.[1] ?? '';++ assert.match(orchestration, /\*\*Native platforms\*\* \(`ios` \/ `android` \/ `adaptive`\): Assessment B does not apply/);+ assert.match(orchestration, /skip both sub-agent gates below, the Codex permission question included/);+ assert.match(critique, /Native platforms run A alone \(see Assessment Orchestration\)/);+ assert.match(critique, /- Native: `Method: design review only \(detector not applicable, native platform\)`/);+ assert.match(critique, /write `not applicable \(native platform\)` instead/);+ });+it('keeps reduced-motion guidance on the animation build path', () => {const animate = readFileSync(join(ROOT, 'skill/reference/animate.md'), 'utf-8').replace(/\r\n?/g, '\n');const accessibility = animate.match(/## Accessibility and control\n([\s\S]*?)\n## Verify/)?.[1] ?? '';