mirror of
https://github.com/nexu-io/open-design.git
synced 2026-05-31 19:04:39 +07:00
fix: restore Atelier Zero deck plugin prompt (#2822)
Co-authored-by: icc <iccccccccccccc@users.noreply.github.com>
This commit is contained in:
parent
b4f700540f
commit
587f6de46d
3 changed files with 29 additions and 4 deletions
|
|
@ -45,8 +45,8 @@
|
|||
},
|
||||
"useCase": {
|
||||
"query": {
|
||||
"en": "Produce a single-file slide deck in the Atelier Zero visual language (warm-paper background, italic-serif emphasis spans, coral terminating dots, surreal collage plates) — Open Design's brand deck recipe. The deck uses **horizontal magazine-style swipe pagination** (←/→, wheel, swipe), a per-slide chrome strip with bra",
|
||||
"zh-CN": "使用这个插件完成以下任务:Produce a single-file slide deck in the Atelier Zero visual language (warm-paper background, italic-serif emphasis spans, coral terminating dots, surreal collage plates) — Open Design's brand deck recipe. The deck uses **horizontal magazine-style swipe pagination** (←/→, wheel, swipe), a per-slide chrome strip with bra"
|
||||
"en": "Build me an 11-slide pitch deck for \"Lumen Field\", a focus-soundscape studio. Cover with hero plate, two section dividers, two product content slides with bullets, a stats slide showing 12 soundscapes / 4 presets / 1 daily ritual, a customer quote, a closing CTA, and an end card. Reuse the open-design-landing image library.",
|
||||
"zh-CN": "使用这个插件完成以下任务:Build me an 11-slide pitch deck for \"Lumen Field\", a focus-soundscape studio. Cover with hero plate, two section dividers, two product content slides with bullets, a stats slide showing 12 soundscapes / 4 presets / 1 daily ritual, a customer quote, a closing CTA, and an end card. Reuse the open-design-landing image library."
|
||||
},
|
||||
"exampleOutputs": [
|
||||
{
|
||||
|
|
|
|||
24
scripts/migrate-to-plugins/example.test.ts
Normal file
24
scripts/migrate-to-plugins/example.test.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { derivePrompt } from './example.ts';
|
||||
|
||||
test('example plugin manifests prefer top-level skill example_prompt', () => {
|
||||
const prompt = derivePrompt({
|
||||
description: 'A long description that should not become the plugin use-case query.',
|
||||
example_prompt: 'Build a polished deck from the authored example prompt.',
|
||||
});
|
||||
|
||||
assert.equal(prompt, 'Build a polished deck from the authored example prompt.');
|
||||
});
|
||||
|
||||
test('example plugin manifests fall back to od.example_prompt before description snippets', () => {
|
||||
const prompt = derivePrompt({
|
||||
description: 'A long description that should not become the plugin use-case query.',
|
||||
od: {
|
||||
example_prompt: 'Create a focused artifact from od metadata.',
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(prompt, 'Create a focused artifact from od metadata.');
|
||||
});
|
||||
|
|
@ -32,6 +32,7 @@ interface SkillFrontmatter {
|
|||
zh_name?: string;
|
||||
en_name?: string;
|
||||
description?: string;
|
||||
example_prompt?: string;
|
||||
triggers?: unknown[];
|
||||
tags?: unknown[];
|
||||
od?: {
|
||||
|
|
@ -169,8 +170,8 @@ function inferSurface(mode: string): string {
|
|||
return 'web';
|
||||
}
|
||||
|
||||
function derivePrompt(fm: SkillFrontmatter): string {
|
||||
const explicit = fm.od?.example_prompt;
|
||||
export function derivePrompt(fm: SkillFrontmatter): string {
|
||||
const explicit = fm.example_prompt ?? fm.od?.example_prompt;
|
||||
if (typeof explicit === 'string' && explicit.trim()) return explicit.trim();
|
||||
const desc = typeof fm.description === 'string' ? fm.description.trim() : '';
|
||||
if (!desc) return 'Produce the artifact described in this skill, following its workflow exactly.';
|
||||
|
|
|
|||
Loading…
Reference in a new issue