Skip to content

Commit 964a3fe

Browse files
authored
feat(sse): add i-have-adhd output style to compression catalog (#10271)
Adds `i-have-adhd` as the 5th entry in OUTPUT_STYLE_CATALOG — a port of the github.com/ayghri/i-have-adhd skill (MIT), following the same integration shape as ponytail. Action-first output shaping: the next action leads, multi-step work is numbered, no preamble/recap/closers — which also trims output tokens. lite/full/ultra levels in en + pt-BR, each ending in SHARED_BOUNDARIES so code, paths, commands, errors and URLs stay verbatim. The agent-harness-specific upstream rules (restate plan state, time estimates) are reworded as conditionals so they hold for plain chat clients too. Per the D-A1 registry contract, one catalog entry is the whole change: the injector, the settings panel, the Zod schema and the telemetry all enumerate the catalog, so no other production file moves. Dedicated test mirrors ponytail-catalog.test.ts (7 tests).
1 parent 0bd2be0 commit 964a3fe

2 files changed

Lines changed: 100 additions & 0 deletions

File tree

open-sse/services/compression/outputStyles/catalog.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,30 @@ export const OUTPUT_STYLE_CATALOG: Record<string, OutputStyle> = {
9595
},
9696
},
9797
},
98+
// i-have-adhd (action-first output) — integrated into the output-style registry
99+
// so it rides the existing production injector, like ponytail.
100+
// Source: https://github.com/ayghri/i-have-adhd (MIT). The upstream skill's 10
101+
// ADHD-friendly rules, adapted for proxy injection: agent-harness-specific rules
102+
// (restate plan state, time estimates) reworded as conditionals so they hold for
103+
// plain chat clients too.
104+
"i-have-adhd": {
105+
id: "i-have-adhd",
106+
label: "I have ADHD (action-first)",
107+
description:
108+
"Action-first output: next action leads, steps numbered, one concrete next step, no preamble.",
109+
levels: {
110+
lite: `# I have ADHD (lite)\nLead with the action: command, path, or snippet first, prose after. Number multi-step work; each step one bounded action. End with ONE concrete next step. No preamble, no recap, no closing pleasantries. ${SHARED_BOUNDARIES}`,
111+
full: `# I have ADHD — action-first output\n\nThe reader has ADHD. Shape output so an ADHD brain can act on it:\n1. Lead with the next action — command, path, or snippet first; context after, if at all.\n2. Number multi-step work; each step is one bounded action; use the fewest steps that work.\n3. End with ONE concrete next step doable in under two minutes.\n4. Suppress tangents: finish the first issue, offer the second as a separate question.\n5. In multi-turn work, restate where things stand ("step 3 of 5 done") — the reader cannot hold state between messages.\n6. When human effort is involved, estimate it in concrete units (minutes, an afternoon), never "some work".\n7. Make wins visible: state what now works and how to try it.\n8. Errors matter-of-fact: cause and fix; never "Uh oh".\n9. Cap lists at 5 items; split into "do now" vs "later" beyond that.\n10. No preamble, no recap, no closers ("Hope this helps").\nExceptions: an explicit "explain" request gets a full body (still no preamble/closer); destructive actions get confirmation first; real ambiguity gets one short clarifying question. ${SHARED_BOUNDARIES}`,
112+
ultra: `# I have ADHD (ultra)\nAction first: command/path/snippet, then prose if needed. Numbered bounded steps, fewest that work. One <2-min next step at the end. No tangents — separate question. Multi-turn: restate state. Human effort: concrete time units. Wins visible. Errors: cause + fix. Lists ≤5. Zero preamble/recap/closers. Explain-requests get full body; destructive actions get confirmation; real ambiguity gets one question. ${SHARED_BOUNDARIES}`,
113+
},
114+
i18n: {
115+
"pt-BR": {
116+
lite: `# Eu tenho TDAH (lite)\nComece pela ação: comando, path ou snippet primeiro, prosa depois. Numere trabalho multi-passo; cada passo é uma ação delimitada. Termine com UMA próxima ação concreta. Sem preâmbulo, sem recap, sem despedidas. ${SHARED_BOUNDARIES}`,
117+
full: `# Eu tenho TDAH — saída action-first\n\nO leitor tem TDAH. Molde a saída para que um cérebro TDAH consiga agir sobre ela:\n1. Comece pela próxima ação — comando, path ou snippet primeiro; contexto depois, se necessário.\n2. Numere trabalho multi-passo; cada passo é uma ação delimitada; use o menor número de passos que funcione.\n3. Termine com UMA próxima ação concreta executável em menos de dois minutos.\n4. Suprima tangentes: termine a primeira questão, ofereça a segunda como pergunta separada.\n5. Em trabalho multi-turno, reafirme onde as coisas estão ("passo 3 de 5 feito") — o leitor não guarda estado entre mensagens.\n6. Quando houver esforço humano, estime em unidades concretas (minutos, uma tarde), nunca "um pouco de trabalho".\n7. Torne vitórias visíveis: diga o que funciona agora e como testar.\n8. Erros de forma direta: causa e fix; nunca "Opa!".\n9. Listas com no máximo 5 itens; acima disso, divida em "agora" vs "depois".\n10. Sem preâmbulo, sem recap, sem despedidas ("Espero ter ajudado").\nExceções: pedido explícito de "explique" recebe corpo completo (ainda sem preâmbulo/despedida); ações destrutivas recebem confirmação antes; ambiguidade real recebe uma pergunta curta de esclarecimento. ${SHARED_BOUNDARIES}`,
118+
ultra: `# Eu tenho TDAH (ultra)\nAção primeiro: comando/path/snippet, prosa depois se precisar. Passos numerados e delimitados, o mínimo que funcione. UMA próxima ação <2 min no fim. Sem tangentes — pergunta separada. Multi-turno: reafirme o estado. Esforço humano: unidades concretas de tempo. Vitórias visíveis. Erros: causa + fix. Listas ≤5. Zero preâmbulo/recap/despedidas. "Explique" recebe corpo completo; ação destrutiva recebe confirmação; ambiguidade real recebe uma pergunta. ${SHARED_BOUNDARIES}`,
119+
},
120+
},
121+
},
98122
"terse-cjk": {
99123
id: "terse-cjk",
100124
label: "Terse CJK (文言)",
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/**
2+
* Tests for the i-have-adhd output style — action-first prompt injection.
3+
*
4+
* Verifies:
5+
* - i-have-adhd is registered with lite/full/ultra levels
6+
* - i18n map exists for pt-BR with all three levels
7+
* - Each level (en and pt-BR) contains the SHARED_BOUNDARIES suffix
8+
* - Core concepts present: action-first, numbered steps, no preamble
9+
* - No locale gate (style valid under every language)
10+
*/
11+
12+
import { describe, it } from "node:test";
13+
import assert from "node:assert/strict";
14+
import {
15+
OUTPUT_STYLE_CATALOG,
16+
outputStyleMeta,
17+
} from "../../../open-sse/services/compression/outputStyles/catalog.ts";
18+
19+
const ADHD = OUTPUT_STYLE_CATALOG["i-have-adhd"];
20+
21+
function assertString(v: unknown, label: string): asserts v is string {
22+
assert.equal(typeof v, "string", `${label} must be a string`);
23+
}
24+
25+
describe("i-have-adhd output style", () => {
26+
it("is registered in the catalog with lite/full/ultra levels", () => {
27+
assert.ok(ADHD, "i-have-adhd must be in catalog");
28+
assert.equal(ADHD.id, "i-have-adhd");
29+
assert.ok(ADHD.label.includes("ADHD"));
30+
assertString(ADHD.levels.lite, "lite");
31+
assertString(ADHD.levels.full, "full");
32+
assertString(ADHD.levels.ultra, "ultra");
33+
});
34+
35+
it("every level ends with the shared boundaries suffix", () => {
36+
const shared = "Code blocks, file paths";
37+
assert.ok(ADHD.levels.lite.includes(shared));
38+
assert.ok(ADHD.levels.full.includes(shared));
39+
assert.ok(ADHD.levels.ultra.includes(shared));
40+
});
41+
42+
it("the full level contains the action-first core concepts", () => {
43+
assert.ok(ADHD.levels.full.includes("Lead with the next action"));
44+
assert.ok(/[Nn]umber/.test(ADHD.levels.full), "full mentions numbered steps");
45+
assert.ok(ADHD.levels.full.includes("No preamble"));
46+
});
47+
48+
it("has an i18n map for pt-BR with all three intensity levels", () => {
49+
assert.ok(ADHD.i18n, "i18n must be defined");
50+
const pt = ADHD.i18n["pt-BR"];
51+
assert.ok(pt, "pt-BR must exist");
52+
assertString(pt.lite, "pt-BR.lite");
53+
assertString(pt.full, "pt-BR.full");
54+
assertString(pt.ultra, "pt-BR.ultra");
55+
});
56+
57+
it("each pt-BR level ends with shared boundaries", () => {
58+
const shared = "Code blocks";
59+
const pt = ADHD.i18n?.["pt-BR"];
60+
assert.ok(pt, "pt-BR i18n must exist");
61+
assert.ok(pt.lite.includes(shared), "pt-BR.lite contains shared boundaries");
62+
assert.ok(pt.full.includes(shared), "pt-BR.full contains shared boundaries");
63+
assert.ok(pt.ultra.includes(shared), "pt-BR.ultra contains shared boundaries");
64+
});
65+
66+
it("pt-BR full contains Portuguese action-first terminology", () => {
67+
const pt = ADHD.i18n?.["pt-BR"];
68+
assert.ok(pt, "pt-BR i18n must exist");
69+
assert.ok(/ação/.test(pt.full), "pt-BR.full mentions ação");
70+
assert.ok(/preâmbulo/.test(pt.full), "pt-BR.full mentions preâmbulo");
71+
});
72+
73+
it("carries no locale gate", () => {
74+
assert.equal(outputStyleMeta("i-have-adhd").locale, undefined);
75+
});
76+
});

0 commit comments

Comments
 (0)