CodeDesign
Copyright 2026 wz927

This product includes material derived from nexu-io/open-design
(https://github.com/nexu-io/open-design), licensed under the Apache
License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0).

Specifically, the following files in this package contain derivative
work from open-design, adapted for the codedesign terminal agent:

  - src/directions.ts
      Derived from apps/daemon/src/prompts/directions.ts.
      The five design directions (editorial-monocle, modern-minimal,
      warm-soft, tech-utility, brutalist-experimental), their OKLch
      palettes, font stacks, posture rules, and real-world references
      are ported verbatim. sRGB hex approximations of each OKLch value
      are added so the DS token consumer (Figma) can bind them.

  - src/prompts.ts
      Derived from apps/daemon/src/prompts/discovery.ts.
      The three-rule discovery arc (Turn 1 discovery brief → Turn 2
      brand-answer branching → Turn 3 plan-aloud), the anti-AI-slop
      P0 checklist, and the 5-dimensional critique rubric are adapted
      from open-design's HTML-artifact context to codedesign's
      terminal/Figma context.

  - craft/*.md (11 files)
      Derived from open-design's craft/ directory, which is itself
      adapted from the MIT-licensed refero_skill project
      (https://github.com/referodesign/refero_skill, © Refero Design).
      Files vendored verbatim with minor edits to:
        - replace open-design-specific references (apps/daemon paths,
          data-od-id, .ph-img class) with codedesign equivalents;
        - retarget the `od.craft.requires` key to `cd.craft.requires`;
        - add a Figma-vocabulary mapping in the craft/README.md so the
          CSS/DOM idioms in the rules translate unambiguously to Figma
          nodes, text styles, and color variables.
      See craft/README.md for the full attribution chain (refero → open-
      design → codedesign) and Figma mapping table.

  - src/craft.ts
      New file. Loads the vendored craft/*.md files at runtime and
      concatenates the requested set into the system prompt. The default
      set (typography, color, anti-ai-slop) is always-on.

  - src/craftLint.ts, src/tools/craftLint.ts
      Derived from apps/daemon/src/lint-artifact.ts. Ports the
      deterministic P0/P1 rule data (AI_DEFAULT_INDIGO hex list,
      EMOJI_AS_ICON glyph list, invented-metric + filler-copy + external
      placeholder regex patterns) and the scanning approach into a
      standalone function that runs against either a text blob or a
      Figma-style node tree. Exposed to the agent as the `craft_lint`
      tool so the model can self-check without an LLM round trip.

  - src/skills.ts, skills/README.md
      SKILL.md schema ported from open-design's skill frontmatter
      (name, description, triggers, od.{mode, platform, scenario,
      preview, design_system, craft, inputs, parameters, outputs,
      default_for, upstream, featured, fidelity, speaker_notes,
      animations, example_prompt}). The `od.` namespace is retargeted
      to `cd.`; output kinds that only applied to HTML artifacts
      (html, jsx) are replaced with Figma-shaped kinds
      (figma_frames, figma_component). The loader implements a
      minimal YAML parser sufficient for the schema (scalars, inline
      arrays, block sequences, nested 2-space mappings); all extensions
      beyond that subset require a real YAML library.

  - src/designSpec.ts
      Inspired by open-design's design-systems/*.md layout (the
      nine-section structure: visual-theme, palette, typography,
      components, spacing, shadows, motion, tokens, guidelines). The
      section ordering and headings match open-design's convention so
      hand-authored DS files can round-trip between the two projects.
      Rendering from a CodeDesign Direction is original to this project
      (deterministic, no LLM), as is the parser and round-trip contract.

No other material from open-design is vendored in this package.
