Skip to content

Day 4 fix: iOS + Android product-slug rename (symmetric with Rails)#10

Merged
dadachi merged 2 commits intomainfrom
feat/day4-mobile-product-rename
Apr 21, 2026
Merged

Day 4 fix: iOS + Android product-slug rename (symmetric with Rails)#10
dadachi merged 2 commits intomainfrom
feat/day4-mobile-product-rename

Conversation

@dadachi
Copy link
Copy Markdown
Contributor

@dadachi dadachi commented Apr 21, 2026

Summary

Extends PR #9's Rails product rename to the two mobile workers. After this PR, all three generated projects are fully slug-scoped — no substrate product tokens leak into iOS bundle IDs, Xcode target names, Android applicationId, namespaces, or Kotlin package directories.

  • src/slug.ts — extract slugToPascal(). Pure function, reused by all three workers.
  • src/agents/workers/rails.ts — now imports slugToPascal instead of defining it inline. No behavior change.
  • src/agents/workers/ios.ts and src/agents/workers/android.ts — each synthesizes two product-rename pairs:
    • NativeAppTemplateFree → <Slug>Free (runs first — longer token in com.nativeapptemplate.nativeapptemplatefree)
    • NativeAppTemplate → <Slug> (general brand/target)

Why the order matters

com.nativeapptemplate.nativeapptemplatefree has the flat token nativeapptemplatefree at the end. Our flat-lowercase pattern requires a non-letter (or uppercase) boundary, so nativeapptemplate alone won't match inside nativeapptemplatefree (followed by f). Running NativeAppTemplateFree → <Slug>Free first replaces that full suffix token; the remaining com.nativeapptemplate then matches the shorter pair on its own.

Verified on clinic-queue spec

iOS

  • Xcode project: ClinicQueue.xcodeproj (was NativeAppTemplate.xcodeproj)
  • Bundle IDs: com.clinicqueue.ClinicQueueFree.ios...
  • PRODUCT_NAME = ClinicQueue
  • Zero NativeAppTemplate / nativeapptemplate leftovers in .swift, .pbxproj, .plist, .strings

Android

  • namespace = "com.clinicqueue.clinicqueuefree" (app + model modules)
  • applicationId = "com.clinicqueue.clinicqueuefree"
  • Kotlin package dirs: app/src/main/kotlin/com/clinicqueue/clinicqueuefree/… (both com/ subdirs renamed, deepest-first)
  • Zero leftovers in .kt, .kts, .xml, .gradle

Regression

What remains (not in this PR)

  • Actual mobile buildsxcodebuild / ./gradlew assembleDebug on generated projects. Day-5 Layer-2 work.
  • Ruby version pin for Rails — substrate pins 4.0.2, user machine had 4.0.1. Day-4 Add demo-tmux.sh for beat-3 split-pane visual #2 finding, separate PR.

Test plan

  • npm run ci — 5/5 green
  • clinic-queue end-to-end — iOS + Android product tokens all replaced, zero leftovers
  • Rails regression (no behavior change)
  • Task-tracker spec verification — will run before merging
  • Real mobile builds — Day 5 Layer 2

dadachi and others added 2 commits April 21, 2026 18:08
Extends PR #9's Rails fix to the mobile workers. iOS generated
project now ships with slug-scoped bundle ID + Xcode target +
product name; Android generated project ships with slug-scoped
applicationId, namespace, and Kotlin package path.

- src/slug.ts: extract slugToPascal() — pure function, used by
  all three workers' buildProductRenamePairs.
- src/agents/workers/rails.ts: import slugToPascal from ../../slug.
- src/agents/workers/ios.ts: synthesize product pairs
  {NativeAppTemplateFree -> <Slug>Free, NativeAppTemplate -> <Slug>}
  and prepend to the domain plan. `NativeAppTemplateFree` runs first
  so `com.nativeapptemplate.nativeapptemplatefree`'s longer token
  gets replaced before the shorter prefix.
- src/agents/workers/android.ts: same pair set (iOS and Android both
  have the `NativeAppTemplateFree` package suffix).

Verified on clinic-queue spec:
  iOS:
    xcodeproj: ClinicQueue.xcodeproj
    bundle: com.clinicqueue.ClinicQueueFree.ios...
    product name: ClinicQueue
    zero NativeAppTemplate / nativeapptemplate leftovers
  Android:
    namespace + applicationId: com.clinicqueue.clinicqueuefree
    package dirs: app/src/main/kotlin/com/clinicqueue/clinicqueuefree/
    zero leftovers

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
"Free" was a vestige of the substrate being the MIT free edition;
the generated project has no paid counterpart so the suffix added
no information. `App` matches the standard `com.org.app` Android
package convention and reads naturally in iOS bundle IDs.

Verified on clinic-queue:
  iOS bundle: com.clinicqueue.ClinicQueueApp.ios...
  Android:    applicationId/namespace com.clinicqueue.clinicqueueapp
              package dir .../com/clinicqueue/clinicqueueapp/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dadachi dadachi merged commit b81a5ce into main Apr 21, 2026
1 check passed
@dadachi dadachi deleted the feat/day4-mobile-product-rename branch April 21, 2026 11:06
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