Skip to content

Commit 515b59a

Browse files
open-design-release-bot[bot]open-design-crew[bot]bone3deep1962-collab
authored
feat(prompts): introduce on-demand discovery in SP v2.0 (#6223) (#6292)
* feat(prompts): introduce on-demand discovery in SP v2.0 * fix(prompts): prevent nested deck label overlap * fix(plugins): stabilize od-default task routing * fix: address prompt and deck audit regressions * fix(prompts): restore plan mode precedence * fix(daemon): accept all form answer headers --------- (cherry picked from commit ebcba70) Co-authored-by: open-design-crew[bot] <299007234+open-design-crew[bot]@users.noreply.github.com> Co-authored-by: bone3deep1962-collab <bone3deep1962@gmail.com>
1 parent 66d492a commit 515b59a

68 files changed

Lines changed: 2546 additions & 1231 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/daemon/src/plugins/atoms.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export interface AtomCatalogEntry {
1414
}
1515

1616
export const FIRST_PARTY_ATOMS: ReadonlyArray<AtomCatalogEntry> = [
17-
{ id: 'discovery-question-form', label: 'Discovery question form', description: 'Turn-1 question form for ambiguous briefs.', status: 'implemented', taskKinds: ['new-generation', 'tune-collab'] },
18-
{ id: 'direction-picker', label: 'Direction picker', description: '3-5 direction picker before final.', status: 'implemented', taskKinds: ['new-generation', 'tune-collab'] },
17+
{ id: 'discovery-question-form', label: 'Discovery question form', description: 'Structured clarification for unresolved material requirements.', status: 'implemented', taskKinds: ['new-generation', 'tune-collab'] },
18+
{ id: 'direction-picker', label: 'Direction picker', description: 'Optional 3-5 directions when explicitly requested.', status: 'implemented', taskKinds: ['new-generation', 'tune-collab'] },
1919
{ id: 'todo-write', label: 'Todo write', description: 'TodoWrite-driven plan.', status: 'implemented', taskKinds: ['new-generation', 'code-migration', 'figma-migration', 'tune-collab'] },
2020
{ id: 'file-read', label: 'File read', description: 'Read project files.', status: 'implemented', taskKinds: ['new-generation', 'code-migration', 'figma-migration', 'tune-collab'] },
2121
{ id: 'file-write', label: 'File write', description: 'Write project files.', status: 'implemented', taskKinds: ['new-generation', 'code-migration', 'figma-migration', 'tune-collab'] },

apps/daemon/src/prompts/core-slim.ts

Lines changed: 320 additions & 112 deletions
Large diffs are not rendered by default.

apps/daemon/src/prompts/deck-framework.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,25 @@ Rules — same weight as the density rules above:
453453
- ❌ Don't nest value labels inside a clipping fixed-height bar.
454454
- ❌ Don't omit any data point's label, however short its bar.
455455
456+
## Nested / concentric diagram discipline
457+
458+
Nested shapes may share a center; their text blocks may not. Treat geometry and labels as separate layout responsibilities.
459+
460+
- Put at most one short KPI in the shared center. Never center a label/value/description stack inside two or more concentric layers.
461+
- Put every other label in a separate legend, external callout, or visibly reserved non-overlapping region. If those regions do not fit, use a stacked comparison, flow, or table instead.
462+
- When rendering cannot confirm the layout and static review leaves any collision risk, choose the separate-legend structure below.
463+
464+
\`\`\`html
465+
<div class="nested-market">
466+
<div class="nested-market__rings" aria-hidden="true"><!-- shapes only; no text --></div>
467+
<dl class="nested-market__legend">
468+
<div><dt>Outer layer</dt><dd>Value — explanation</dd></div>
469+
<div><dt>Middle layer</dt><dd>Value — explanation</dd></div>
470+
<div><dt>Inner layer</dt><dd>Value — explanation</dd></div>
471+
</dl>
472+
</div>
473+
\`\`\`
474+
456475
## Mermaid diagram theme discipline (dark decks)
457476
458477
Mermaid's default theme is built for white pages: near-black labels (\`#333\`), pale node fills, black strokes, and a TRANSPARENT svg background. Embedded in a dark-themed deck it produces the failure users report as "the diagram text is unreadable in dark mode": dark labels sitting directly on the dark slide background. Prefer a hand-written HTML/CSS/SVG diagram styled with the deck's own tokens (\`--bg\`, \`--fg\`, \`--accent\`) — it never drifts from the theme and needs no external JS. When you do embed Mermaid, pick the theme from the slide background at initialize time — never leave the default (light) theme on a dark deck:

apps/daemon/src/prompts/directions.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* Built-in design direction library.
33
*
4-
* Distilled from huashu-design's "5 schools × 20 philosophies" idea: when
5-
* the user hasn't specified a brand and selected "Pick a direction for me"
6-
* in the discovery form, the agent emits a *second* `<question-form>` whose
7-
* radio options are these 5 schools. Each school carries a concrete spec —
8-
* fonts, palette in OKLch, mood keywords, real-world references — that the
9-
* agent then encodes into the active CSS `:root` tokens before generating.
4+
* Distilled from huashu-design's "5 schools × 20 philosophies" idea. The
5+
* library gives the agent concrete visual references to infer from by default.
6+
* When the user explicitly asks to compare visual directions, it can also
7+
* render these schools as `<question-form>` choices. Each school carries a
8+
* concrete spec — fonts, palette in OKLch, mood keywords, real-world
9+
* references — that the agent encodes into active CSS `:root` tokens.
1010
*
1111
* The library has TWO purposes:
1212
*
@@ -273,9 +273,9 @@ export function renderDirectionSpec(d: DesignDirection): string {
273273

274274
export function renderDirectionSpecBlock(): string {
275275
const lines: string[] = [
276-
'## Direction library — bind into `:root` when the user picks one',
276+
'## Direction library — infer and bind by default',
277277
'',
278-
'Each direction below carries a CSS-ready palette (OKLch values) and font stacks. When the user selects one in the direction-form, replace the seed template\'s `:root` block with that direction\'s palette and font stacks **verbatim** — do not improvise. Posture cues describe how that direction *behaves* (border weight, radius, accent budget); honour them in the layout choices.',
278+
'Each direction below carries a CSS-ready palette (OKLch values) and font stacks. Infer the best match from the brief and known context, then bind it without asking. If the user explicitly requested direction comparison and selected one in a direction-form, use that selection instead. Replace the seed template\'s `:root` block with the chosen direction\'s palette and font stacks **verbatim** — do not improvise. Posture cues describe how that direction *behaves* (border weight, radius, accent budget); honour them in the layout choices.',
279279
'',
280280
];
281281
for (const d of DESIGN_DIRECTIONS) {
@@ -304,7 +304,7 @@ export function renderDirectionIndexBlock(): string {
304304
return lines.join('\n');
305305
}
306306

307-
/** Resolve a direction by id (preferred) or label; used by `od tools directions`. */
307+
/** Resolve an inferred or user-selected direction; used by `od tools directions`. */
308308
export function formatDirectionSpecText(idOrLabel: string): string | null {
309309
const needle = idOrLabel.trim().toLowerCase();
310310
if (!needle) return null;

0 commit comments

Comments
 (0)