Skip to content

docs(flutterbits): charter + structure/routing + registry/CLI specs & Button plan#44

Merged
SiphoChris merged 6 commits into
mainfrom
docs/flutterbits-design-specs
Jun 10, 2026
Merged

docs(flutterbits): charter + structure/routing + registry/CLI specs & Button plan#44
SiphoChris merged 6 commits into
mainfrom
docs/flutterbits-design-specs

Conversation

@SiphoChris

Copy link
Copy Markdown
Owner

Moves the project into the flutterbits component layer. This branch is design + plan only (the first code lands on a follow-up branch).

What's here

Three design specs (docs/superpowers/specs/2026-06-10-*):

  • flutterbits-charter — identity (shadcn parity + an opinionated, intention-revealing structure layer), the four tiers, the full catalog with shadcn re-homing (sheet/dialog/sidebar/tabs → structure), mobile-first platform stance, unprefixed-component naming, dependency policy.
  • structure-and-routing-designLayout/Screen as composed widgets (not base classes; dissolves "ScreenSpec"), header/body/footer slots, typed hand-written routing over go_router (no codegen), presentation-as-a-knob (deep-linkable sheets/dialogs), guards, transitions, imperative overlays.
  • registry-cli-design — install-types, manifest schema, flutterbits.json, init/add/diff, barrel regen, the anchor overlay substrate (flutterbits' cn.ts), preview strategy (golden images + DartPad).

First implementation plan (docs/superpowers/plans/2026-06-10-flutterbits-button-and-gallery.md) — TDD, grounded in the real engine API: scaffold apps/gallery + the canonical Button.

Key decisions (locked with the user)

  • Routing wraps go_router, typed hand-written routes, no codegen.
  • Components unprefixed (Button/Screen); engine + routing value types stay Fw.
  • Mobile-first, portable, matures to desktop/web by-demand.
  • apps/gallery is the flutterbits component target; apps/example stays the engine showcase.
  • Previews: golden images (always-on) + DartPad live embeds.

Reconciliations (no-drift)

AGENTS.md (§1/§2/§4/§6/§8/§9/§10/§12), README, apps/docs flutterbits overview, and the core-engine spec were updated so nothing contradicts the new plan (e.g. the Fw-prefix rule scoped to the engine; go_router sanctioned; component target → apps/gallery).

Review note

The three specs were adversarially reviewed by an independent Opus 4.8 agent against the Flutter SDK; it caught real over-claims (a false "zero name-clashes" claim — widgets.dart exports Form/Icon/Image/…; "sheets are free" when a custom Material-free PopupRoute is needed; "tablets — no new work"). All fixed before this PR.

🤖 Generated with Claude Code

Sipho Nkebe and others added 6 commits June 10, 2026 20:53
…specs

Brainstormed and documented the move into the flutterbits component layer.
Adds three design specs under docs/superpowers/specs and reconciles every
doc that the plan extended or contradicted.

New specs (2026-06-10):
- flutterbits-charter — identity (shadcn parity + an opinionated, intention-
  revealing structure layer), the four tiers (primitives/structure/blocks/
  templates; "tools" dropped), the full catalog with shadcn re-homing
  (sheet/dialog/sidebar/tabs become structure), mobile-first platform stance,
  unprefixed-component naming, and the per-component dependency policy.
- flutterbits-structure-and-routing-design — Layout/Screen as composed widgets
  (not base classes; dissolves "ScreenSpec"), header/body/footer slots, typed
  hand-written routing over go_router (no codegen), FwRoute/FwRoutePattern,
  presentation-as-a-knob (FwPresentation page/sheet/dialog/fullScreen,
  deep-linkable), guards, transitions, imperative overlay helpers.
- flutterbits-registry-cli-design — install-types (component/util/barrel),
  manifest schema, flutterbits.json, init/add/diff, barrel regen rules, the
  anchor/overlay substrate as flutterbits cn.ts, hosting via apps/docs.

Reconciliations (no-drift, AGENTS.md s12):
- AGENTS.md s1 identity expanded (structure layer + mobile-first); s4 scoped
  the Fw-prefix rule to the engine and made flutterbits components unprefixed
  (the old FwButton example contradicted this); s8 added init/barrel/install-
  types/flutterbits.json; s12 sanctioned go_router (+ by-demand flutter_svg).
- README + apps/docs flutterbits overview updated to the same plan.
- core-engine-design spec: FwButton -> Button example fixed.

Decisions deferred by explicit sign-off: state-management conventions; the
desktop-centric component set and SidebarLayout (by-demand); routing codegen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
An independent Opus 4.8 agent reviewed the three specs against the Flutter
SDK + AGENTS.md and found real defects (several verified against the SDK on
disk). Applied the blocking + should-fixes; verified each rather than blindly
accepting (one fix diverges from the reviewer's suggestion, noted below).

Blocking fixes:
- B1 (charter §5.1): the "zero clashes in a Material-free app" claim was
  FALSE — package:flutter/widgets.dart itself exports Form/Icon/Image/Table/
  Title/Navigator/Page/etc. Rewrote to acknowledge both clash surfaces and
  made "check every component name against widgets.dart and rename collisions"
  a hard authoring rule (DataTable not Table; no Form/Icon/Image component).
- B2 (charter §5, structure §3.3): FwStatusBar was mislabeled an *engine*
  type — it wraps services.dart, which the engine never touches. Reframed as
  a flutterbits structure value type (kept the Fw name for consistency with
  FwPresentation/FwTransition — this is where I diverged from the reviewer's
  "unprefix it", since unprefixing would split the routing value-type family).
- B3 (structure §2.1/§3.1): Layout was conflated across root-app-host vs
  nested-shell vs plain-widget. Added the invariant: exactly one root Layout
  hosts the app+router; runApp(AppLayout()) works; a shell Layout compiles to
  a ShellRoute builder and must not re-host a router.
- B4 (structure §4.3): demoted "a sheet is free / zero extra code" — go_router
  ships no Material-free sheet Page, so flutterbits authors custom
  FwSheetPage/FwDialogPage PopupRoutes that own scrim/safe-area/grabber/
  drag-dismiss (feasible, scoped — §11b — not free). Added §4.3.1: deep-linked
  sheets require NESTED routes (children:), not flat siblings.
- B5 (charter §4): "tablets — no new work" was a silent scope reduction;
  narrowed to "styling reuses responsive variants; adaptive navigation is
  by-demand structure work".

Should-fixes: S2 push wiring (route.go ≡ context.go(location)); S3 web
push<T>-result caveat; S4 guards are FutureOr<String?> (async); S5 barrel
collision handling (authoring rule guarantees no widgets.dart clash); S6
registry versioning recorded as an accepted v1 limitation; S7 init theme.dart
must match the generator's emit shape (drop-in); S8 layout pubDeps reconciled.
Nits: N1 apps/example transition noted; N2 FwTone -> Tone; N4 anchor edge-flip
positioning flagged as real work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Decided: faithful golden-image previews as the always-on default + DartPad
live/editable embeds where deps allow; React reimplementation rejected (would
show a different artifact than the copied one); a Flutter-Web gallery deferred
by-demand. Added to registry/CLI spec 7.1. Codegen routing stays rejected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…/example)

User correction: flutterbits gets its OWN showcase/golden/compile app
(apps/gallery); apps/example stays the flutterwindcss ENGINE showcase only.
Reconciled AGENTS.md (S2 layout tree + prose, S6 checklist, S9 goldens, S10
commands), README repo layout, and all three flutterbits specs to point the
component golden/compile target at apps/gallery while leaving engine-showcase
references on apps/example intact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…its slice)

TDD, bite-sized plan grounded in the real engine API (fw_style_ops.dart) and the
existing golden harness. Scaffolds apps/gallery (new component target), authors
the canonical Material-free Button (6 variants x 4 sizes, FocusableActionDetector
+ keyboard + focus ring + Semantics, semantic-token styling via .tw), full golden
coverage, and a smoke test. Registry/manifest/build_registry explicitly deferred
to the next plan (recorded, not silent). Notes the default->primary/md Dart
reserved-word deviation + its charter/AGENTS reconciliation (Task 7).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ps in Layout

The gallery exists to showcase flutterbits, and Layout is its flagship/intended
root; Button is built first only to de-risk the component pattern and give Layout
something real to host. Labeled the WidgetsApp host as throwaway bootstrap that
the structure plan replaces with Layout (and demos).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flutterbits Ready Ready Preview, Comment Jun 10, 2026 8:07pm

@SiphoChris SiphoChris merged commit a47cee4 into main Jun 10, 2026
7 checks passed
@SiphoChris SiphoChris deleted the docs/flutterbits-design-specs branch June 10, 2026 20:07
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