Adopting Starboard in an existing app
Adopting Starboard means writing down the app you already have: every
screen registered from its source, files that are not screens set aside
with a reason, layouts drawn from the code, and then the flows. Done one
area at a time, every commit along the way passes starboard lint, so the
work can be reviewed and merged in pieces.
Coding agents can do most of this; the starboard-adopt skill follows the
steps below. See Working with coding agents.
1. Start the project
Section titled “1. Start the project”At the repository root, run init with each platform the app ships on:
starboard init --platform ios --platform androidstarboard lintCommit what it writes, .gitattributes lines included. A new project
passes lint.
2. Find the screen files
Section titled “2. Find the screen files”Tell Starboard where each platform’s screens are. In starboard.yaml, give
each platform its source roots and the screenFiles patterns that match
its screen files:
platforms: ios: formFactors: [phone] roots: [src/ios/Screens] screenFiles: ["**/*View.swift"] android: formFactors: [phone] roots: [src/android] screenFiles: ["*Screen.kt"]Now every matching file that no screen claims is a finding. Here, one Android screen the travel app has not registered:
// The trip's shared expenses: a screen not in the reference yet.starboard lintsrc/android/ExpensesScreen.kt: error unregistered-screen-file: matches platforms.android.screenFiles "*Screen.kt" but no screen claims it; add it to a screen's files, or to unmapped in docs/flows/screens.yaml with a reason1 error, 0 warningsOn an app with no screens registered, this list is every screen file: your
to-do list. Run starboard lint --json for it in a form you can sort, group
the files into the app’s areas, and list the areas in starboard.yaml in
the order people meet them. Then remove the screenFiles patterns again,
keeping roots, so lint passes while you work, and keep the list.
3. One area at a time
Section titled “3. One area at a time”For each area:
-
Widen coverage to the area. Add patterns that match only its files. Patterns are matched inside each root, so a directory scopes them (
Trip/**/*View.swift), and a path with no wildcard matches one file (Settings/SettingsView.swift).starboard lintnow lists exactly this area’s unregistered files. -
Register each screen. Give it an ID such as
trip.timeline, atitle, itsarea, a one-sentencepurpose, apresentation, and its source underfilesfor each platform. Everything adoption writes is shipped, because it describes the app as it is. -
Set aside what is not a screen. A row, a control or a wrapper that happens to match goes under
unmapped, with areasonthat says where it is used:unmapped:- path: src/macos/Notes/QuickLookWindow.swiftreason: a floating preview of the note selected in library.main#notes, not a screen -
Draw each layout from the code. List the regions in order, each with the closest kind, a
labelfor what it shows, and atofor every place it navigates. Check a layout withstarboard render <screen-id>. Atoto a screen in a later area needs that screen registered now: register it, and widen the patterns to its file. -
Check and commit. Run
starboard fmt,starboard generateandstarboard lint, fix every error, and commit the area on its own.
Remove the example screen and flow that init wrote once the first real
screens exist.
When every area is done, put back the full patterns from step 2.
starboard lint still passes, which shows no screen file is left out.
4. Write the flows
Section titled “4. Write the flows”With the screens registered, write a flow for each thing people do with the
app, as docs/flows/flows/<id>.md with status: shipped. Start with the
flows that matter most; orphan-screen warnings
show which screens no flow covers yet. The Flows
page has the format.
Add starboard lint to CI (Check it in CI), so
the reference stays true. From here on, a change to the app starts as a
proposal in the reference: see Status and
Per-platform status.