Skip to content

[NO-ISSUE] chore(specs): default optional text props to empty string, not undefined#671

Merged
HerbertJulio merged 4 commits into
devfrom
chore/spec-defaults-empty-string
Jun 25, 2026
Merged

[NO-ISSUE] chore(specs): default optional text props to empty string, not undefined#671
HerbertJulio merged 4 commits into
devfrom
chore/spec-defaults-empty-string

Conversation

@HerbertJulio

Copy link
Copy Markdown
Contributor

Summary

Prevents the default-value issue raised in review of #646: an optional string prop that holds renderable text was specced/scaffolded with 'undefined' / value: undefined instead of ''.

Makes the empty-string convention explicit across the component-creation pipeline:

  • .specs/_template.md — Props example now includes a string prop defaulting to '', and the Props rules spell out the convention (text → ''; boolean → false; undefined written unquoted only when absence ≠ empty, e.g. open / modelValue / src; never the literal 'undefined').
  • .claude/skills/spec-create/SKILL.md — the Props-collection step states the default rule.
  • .claude/skills/component-scaffold/SKILL.mdwithDefaults mirrors the spec; emits BLOCKED: if a spec's Default cell says 'undefined' for text instead of silently copying it.
  • .claude/agents/scaffolder.md — reinforces the same rule in the injected prompt (where value: undefined originally leaked).

Notes

  • Docs/tooling only — no component code, no new dependency, no release bump.
  • Not included (possible follow-ups): (1) a spec-validator check that hard-rejects the literal 'undefined' in Default cells; (2) cleaning up the pre-existing 'undefined' defaults already in checkbox.md / dropdown.md (both status: implemented).

… not undefined

Optional string props that hold renderable text now default to '' across the spec template, the spec-create / component-scaffold skills, and the scaffolder agent. Reserve undefined (unquoted) for props where absence differs from empty (open, modelValue, src); never the literal 'undefined'. Prevents the default-value issue raised in review of PR #646.
@HerbertJulio HerbertJulio requested a review from a team as a code owner June 25, 2026 18:59
robsongajunior
robsongajunior previously approved these changes Jun 25, 2026
robsongajunior and others added 2 commits June 25, 2026 16:43
…fault cells

Enforces the empty-string default convention documented earlier in this PR via
spec-validate Step 3 plus a shared defaultCellIsStringUndefined helper and a unit
test; status:implemented specs (checkbox/dropdown) are not re-validated so they stay green.
@HerbertJulio HerbertJulio merged commit 90c0b77 into dev Jun 25, 2026
7 checks passed
@HerbertJulio HerbertJulio deleted the chore/spec-defaults-empty-string branch June 25, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants