Skip to content

feat(prompts): align with Claude Design conventions (empty EDITMODE, 9-token palette, 2-font default, animation cap, Fraunces for marketing)#115

Merged
hqhq1025 merged 1 commit intomainfrom
wt/prompt-claude-design-align
Apr 19, 2026
Merged

feat(prompts): align with Claude Design conventions (empty EDITMODE, 9-token palette, 2-font default, animation cap, Fraunces for marketing)#115
hqhq1025 merged 1 commit intomainfrom
wt/prompt-claude-design-align

Conversation

@hqhq1025
Copy link
Copy Markdown
Collaborator

Five small content updates that align our system prompt with patterns extracted from real Claude Design output (research docs §1.2, §2, §6, §11.3, §11.4).

Reopened after #109 squash-merge auto-closed the original (#110). Rebased cleanly onto current main.

Changes

  1. EDITMODE protocol — empty {} block valid (research §11.4). Documents that an empty marker block is a valid signal to the host that the artifact is tweak-aware.
  2. Design methodology — token density (research §1.2). New subsection: aim for 9 ± 3 oklch tokens per artifact, declared as a flat object.
  3. Craft directives — Typography ladder (research §2). Default to two font families (display + workhorse sans). Mono is on-demand only — not part of the default ladder.
  4. Craft directives — Animation budget (research §6). New subsection capping CSS keyframes at four named animations: fadeUp, breathe, pulse-ring, spin, with staggered animation-delay.
  5. Progressive disclosure — Marketing font hint (research §11.3). New marketingFontHint Layer 2 section + routing in composeCreateProgressive. Marketing/landing/case-study prompts now surface a Fraunces preference reminder (~150 chars).

Tests

  • +1 marketing prompt includes Fraunces hint
  • +1 dashboard prompt does NOT include Fraunces hint
  • Existing drift test auto-handles the new section (PROMPT_SECTIONS / PROMPT_SECTION_FILES both updated; one new marketing-font-hint.v1.txt)
  • 161 → 163 tests, all green

Verification

  • pnpm --filter @open-codesign/core test ✅ 163/163
  • pnpm --filter @open-codesign/core typecheck
  • pnpm exec biome check packages/core/src/prompts/ packages/core/src/generate.test.ts

PRINCIPLES §5b checks

  • Compatibility ✅ — additive only, no schema/contract changes
  • Upgradeability ✅ — sections registered in PROMPT_SECTIONS map, drift test enforces .txt/TS parity
  • No bloat ✅ — marketing hint only ships when keyword matches; budget for matched dashboard prompt still <25 KB
  • Elegance ✅ — content edits + one routing line; no abstractions added

Five small content updates extracted from real Claude Design output
analysis (research docs §1.2, §2, §6, §11.3, §11.4):

- EDITMODE: document empty `{}` block as valid (tweak-aware signal)
- Design methodology: 9 ± 3 oklch token density target
- Craft directives: 2-font default (mono on-demand only)
- Craft directives: 4-animation CSS keyframe budget
- Progressive disclosure: marketing prompts surface Fraunces hint

New `marketingFontHint` section + Layer 2 routing in
`composeCreateProgressive` triggers on KEYWORDS_MARKETING. Drift test
auto-handles the new section via PROMPT_SECTIONS / PROMPT_SECTION_FILES
maps. +2 tests for Fraunces inclusion / exclusion.

Signed-off-by: hqhq1025 <1506751656@qq.com>
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • No high-confidence issues found in added/modified lines.

Summary

  • Review mode: initial
  • No blocker/major/minor/nit findings attributable to this diff.
  • Residual risk: docs/VISION.md and docs/PRINCIPLES.md are not present in this checkout (Not found in repo/docs), so hard-constraint verification was limited to repository-visible constraints and changed files.

Testing

  • Not run (automation)

open-codesign Bot

@hqhq1025 hqhq1025 merged commit 886c9a8 into main Apr 19, 2026
6 checks passed
@hqhq1025 hqhq1025 deleted the wt/prompt-claude-design-align branch April 19, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant