Skip to content

feat(plan,build): enforce design-system rules on every UI task - #107

Merged
rshankras merged 1 commit into
mainfrom
feat/99-enforce-design-rules
Nov 4, 2026
Merged

rshankras merged 1 commit into
mainfrom
feat/99-enforce-design-rules

Conversation

@rshankras

Copy link
Copy Markdown
Owner

Closes #99

Why

#92 taught swiftui-builder the design-system rules, but nothing checked them per task. A task could produce raw styling and still pass, and the problem only surfaced at review (#93) or phase-end verify (#98), by which point it had spread across the phase.

What

A project has a design system when .planning/DESIGN-SYSTEM.md exists (from #95) or .swiftlint.yml contains the ds_* rules. Without one, nothing changes.

/apple:plan reads DESIGN-SYSTEM.md. Every view-touching task then:

  • carries type="lint" (the design rules plus the baseline)
  • carries a new type="design" check, covering the per-task subset of the verify: per-screen design-system definition of done for UI phases #98 definition of done:
    • state previews, with Dynamic Type on iOS, window sizes on macOS, watch sizes on watchOS
    • identifiers on interactive elements
    • the view file under ~300 lines
    • new files never added to the baseline
  • gets design/design-system in <apple-patterns> and names the components to use in <action>

/apple:build:

  • Routing row: tokens, text styles, shared components, restyles and design-system migration go to swiftui-builder with design/design-system + design/typography.
  • UI spawns get a <design-system> block (token map, text styles, components) and requirement 6: tokens and .appText only, listed components, ContentStateView, identifiers, under ~300 lines, missing tokens added to the token file rather than inlined.
  • New check type design, run by the orchestrator, not taken from the agent's report.
  • Design lint gate after every view-touching task, even when <verify> omits it, as with the always-on build check. New code must have zero violations, and the baseline may only shrink: rewriting it to absorb new violations is a FAIL.

Bug caught while testing the gate

swiftlint lint --baseline X <file paths> does not match the passed files against the baseline. The stored paths differ, so baselined legacy violations showed up as new: a touched legacy file would always fail. The gate now lints the whole tree with the baseline and filters the output to the touched files. I checked it on a fixture:

File Result
Touched legacy file, baselined violation 0 reported ✅
New file with raw padding violation reported ✅

Checks

./scripts/validate.sh: all pass.

🤖 Generated with Claude Code

- 'has a design system' = DESIGN-SYSTEM.md or ds_* rules in .swiftlint.yml
- plan: view tasks get type=lint + new type=design check (state previews
  per platform, identifiers, <300 lines, new files never baselined),
  design/design-system in apple-patterns, components named in action
- build: routing row -> swiftui-builder + design/design-system;
  <design-system> block + requirement 6 for UI spawns; design check type
- design lint gate after every view-touching task: whole-tree lint with
  baseline filtered to touched files (path args break baseline matching);
  baseline may only shrink
- no design system: unchanged

Closes #99

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rshankras
rshankras merged commit 168e24b into main Nov 4, 2026
2 checks passed
@rshankras
rshankras deleted the feat/99-enforce-design-rules branch November 4, 2026 11:09
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.

build + plan: enforce design-system rules on UI tasks (routing, auto lint checks, per-task gate)

1 participant