nativeapptemplate-agent 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/AGENTS.md +151 -0
  2. package/CLAUDE.md +1 -139
  3. package/README.md +93 -10
  4. package/dist/agents/repair.js +1 -1
  5. package/dist/agents/repair.js.map +1 -1
  6. package/dist/agents/reviewer.d.ts +1 -0
  7. package/dist/agents/reviewer.d.ts.map +1 -1
  8. package/dist/agents/reviewer.js +17 -3
  9. package/dist/agents/reviewer.js.map +1 -1
  10. package/dist/agents/workers/android.d.ts.map +1 -1
  11. package/dist/agents/workers/android.js +16 -34
  12. package/dist/agents/workers/android.js.map +1 -1
  13. package/dist/agents/workers/copy.d.ts +6 -0
  14. package/dist/agents/workers/copy.d.ts.map +1 -0
  15. package/dist/agents/workers/copy.js +32 -0
  16. package/dist/agents/workers/copy.js.map +1 -0
  17. package/dist/agents/workers/ios.d.ts.map +1 -1
  18. package/dist/agents/workers/ios.js +8 -28
  19. package/dist/agents/workers/ios.js.map +1 -1
  20. package/dist/agents/workers/rails.d.ts.map +1 -1
  21. package/dist/agents/workers/rails.js +7 -24
  22. package/dist/agents/workers/rails.js.map +1 -1
  23. package/dist/env-bridge.d.ts.map +1 -1
  24. package/dist/env-bridge.js +3 -2
  25. package/dist/env-bridge.js.map +1 -1
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +32 -3
  29. package/dist/index.js.map +1 -1
  30. package/dist/mcp.d.ts.map +1 -1
  31. package/dist/mcp.js +3 -1
  32. package/dist/mcp.js.map +1 -1
  33. package/dist/rails-lifecycle.d.ts.map +1 -1
  34. package/dist/rails-lifecycle.js +16 -0
  35. package/dist/rails-lifecycle.js.map +1 -1
  36. package/dist/repair-loop.js +1 -1
  37. package/dist/report/collect.js +16 -2
  38. package/dist/report/collect.js.map +1 -1
  39. package/dist/ruby.d.ts.map +1 -1
  40. package/dist/ruby.js +8 -1
  41. package/dist/ruby.js.map +1 -1
  42. package/dist/validation/discover.d.ts.map +1 -1
  43. package/dist/validation/discover.js +2 -4
  44. package/dist/validation/discover.js.map +1 -1
  45. package/dist/validation/ios-destination.d.ts +2 -0
  46. package/dist/validation/ios-destination.d.ts.map +1 -0
  47. package/dist/validation/ios-destination.js +7 -0
  48. package/dist/validation/ios-destination.js.map +1 -0
  49. package/dist/validation/layer2.d.ts.map +1 -1
  50. package/dist/validation/layer2.js +7 -7
  51. package/dist/validation/layer2.js.map +1 -1
  52. package/dist/validation/stage2-judge.d.ts.map +1 -1
  53. package/dist/validation/stage2-judge.js +21 -4
  54. package/dist/validation/stage2-judge.js.map +1 -1
  55. package/dist/validation/visual-judge.d.ts.map +1 -1
  56. package/dist/validation/visual-judge.js +22 -3
  57. package/dist/validation/visual-judge.js.map +1 -1
  58. package/package.json +2 -1
  59. package/scripts/ruby/rename.rb +25 -8
package/AGENTS.md ADDED
@@ -0,0 +1,151 @@
1
+ # AGENTS.md
2
+
3
+ Project-wide instructions for AI coding agents (Claude Code, Codex, etc.). Keep this file short — it's loaded into context every session. For deep context, read the linked docs on demand.
4
+
5
+ ## What this project is
6
+
7
+ `nativeapptemplate-agent` — a Claude Code agent that turns a natural-language SaaS spec (e.g. "a walk-in queue for a barbershop") into a working three-platform implementation: Rails 8.1 API + native SwiftUI iOS + native Jetpack Compose Android. Built during the Built with Opus 4.7 Claude Code Hackathon, April 21–27, 2026.
8
+
9
+ **Read `docs/SPEC.md` before making non-trivial changes.** It's the source of truth for architecture, three-layer validation, operation paths (adapt vs. replace), and hackathon success criteria.
10
+
11
+ ## Model
12
+
13
+ - Use `claude-opus-4-7` for all agent invocations.
14
+ - Requires Claude Agent SDK `>= 0.2.111`.
15
+ - Do not set `thinking.type.enabled` — use `thinking: {type: "adaptive"}` instead (Opus 4.7 uses adaptive thinking).
16
+
17
+ ## Stack
18
+
19
+ - **Host language:** TypeScript (Claude Agent SDK `@anthropic-ai/claude-agent-sdk`)
20
+ - **Ruby subprocesses** for Rails AST / ERB / migration work (called from TypeScript)
21
+ - **External MCP:** [`mobile-next/mobile-mcp`](https://github.com/mobile-next/mobile-mcp) for iOS Simulator + Android Emulator UI automation. **Pin `npx -y @mobilenext/mobile-mcp@0.0.54`** — 0.0.55+ closes the stdio connection on startup (the pin lives in `src/mobile.ts` and the plugin's `.mcp.json`).
22
+ - **Node 22+ required.**
23
+
24
+ ## Coding conventions
25
+
26
+ - TypeScript `strict: true`; no implicit `any`.
27
+ - Prefer functions over classes — introduce a class only when state + lifecycle justify it (e.g. a long-lived MCP client wrapper). Stateless transforms are functions.
28
+ - Ruby subprocesses: shell out via `spawn("ruby", ["scripts/ruby/<script>.rb"])` from the thin wrapper in `src/ruby.ts` (`runRuby`). Pass structured data as JSON on stdin/stdout, not positional CLI args. Each script must be self-contained and re-entrant.
29
+ - No comments explaining *what* the code does — name things well instead. Reserve comments for non-obvious *why*.
30
+
31
+ ## Testing policy
32
+
33
+ Applies to this repo's own code. For generated projects, see Guardrails ("Do not invent tests for the generated code").
34
+
35
+ - **Bug fixes start with a failing test that reproduces the bug. No exceptions.** The fix commit always includes that reproduction test.
36
+ - **Record where each expected value comes from, in the code.** One of: the relevant spec section, a hand calculation, or a known oracle. Never paste in whatever the implementation happened to output as the expected value.
37
+
38
+ # floor(10000 * 31 / 71) = 4366 ← document the basis like this
39
+
40
+ - **See it red at least once before calling it done.** For every new test — especially guards and config checks — deliberately break the target and confirm the test fails. A test that can't fail verifies nothing.
41
+ - **Passing tests alone don't mean done.** Actually run the thing and exercise it.
42
+ - Implementation and tests go in the same commit. "I'll write the tests later" never happens.
43
+
44
+ ## Substrate (what the agent operates on)
45
+
46
+ The agent targets BOTH the paid and free (MIT-licensed) editions — the same code path handles both, validated end-to-end. **Test the paid edition first**: the free edition is a strict subset of paid (paid = free + multi-tenancy + invitations + role permissions + org switching), so anything that works on paid works on free, but not vice-versa. Catching paid-only regressions first avoids "free passes, paid breaks" surprises.
47
+
48
+ The three env vars are required (the workers throw if one is unset; there is no built-in default). Point them at the paid repos first, then at the free repos:
49
+
50
+ - `$NATIVEAPPTEMPLATE_API` — Rails 8.1 API repo (`nativeapptemplateapi`, single repo serves both editions; multi-tenancy + invitations are conditional features)
51
+ - `$NATIVEAPPTEMPLATE_IOS` — SwiftUI iOS repo. Paid: `NativeAppTemplate` (Swift 23,003 LOC, adds org switching, invitations, role permissions). Free: `NativeAppTemplate-Free-iOS` (Swift 15,311 LOC).
52
+ - `$NATIVEAPPTEMPLATE_ANDROID` — Jetpack Compose Android repo. Paid: `NativeAppTemplate` (Kotlin 28,401 LOC). Free: `NativeAppTemplate-Free-Android` (Kotlin 19,521 LOC).
53
+
54
+ The renamer's substitution rules (Shop / Shopkeeper / ItemTag / NativeAppTemplate) apply identically to both editions. Paid-only concepts (Account, Member, Invitation) aren't in the rename plan, so paid features survive the generation intact. Both editions hit the same Rails OpenAPI server, so the reviewer's three-way diff works against either.
55
+
56
+ **Substrate repos are read-only from the agent's perspective.** The agent never commits, pushes, edits, or runs destructive commands inside the substrate directories. To customize, the agent copies the substrate into `./out/<spec-slug>/{rails,ios,android}/` as fresh git-initialized project directories, and works exclusively inside `./out/` thereafter. Treat the substrate paths the same way you'd treat a read-only mount.
57
+
58
+ ## Domain model (do not misread)
59
+
60
+ - `Shop` → per-tenant primary resource (not "store", not "shop" in e-commerce sense — a physical location with a walk-in queue)
61
+ - `Shopkeeper` → the authenticated user/owner of a Shop
62
+ - `ItemTag` (aka Number Tag) → a queue entry, attached to a Shop
63
+ - **ItemTag has TWO states: `Idled` ↔ `Completed`.** It's a toggle, not a three-state machine. If a user's spec wants three states (e.g. "in-service"), extend the machine rather than assume it.
64
+ - Free edition is single-organization (personal account is transparent). Paid edition adds multi-tenancy, invitations, roles, org switching — all out of scope for the rename pipeline (paid-only concepts aren't in the rename plan), but test against the paid substrates first since paid is a superset of free.
65
+
66
+ ## Commands
67
+
68
+ ```bash
69
+ # Build & test the agent (run from this repo root)
70
+ npm run build
71
+ npm run test
72
+ npm run dev -- "your spec here"
73
+
74
+ # Substrate commands — run from the matching generated project dir in ./out/<slug>/
75
+ bin/dev # Rails API
76
+ xcodebuild -scheme NativeAppTemplate -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.2' build # iOS
77
+ ./gradlew assembleDebug && ./gradlew installDebug # Android
78
+
79
+ # Validation (run from this repo root)
80
+ rg -n "Shop|Shopkeeper|ItemTag" ./out/<slug>/ # Layer 1 rename completeness check
81
+ cloc --vcs=git "$NATIVEAPPTEMPLATE_API" # LOC measurement for a specific substrate repo
82
+
83
+ # mobile-mcp — invoked via natural language through Claude Code
84
+ # "Take a screenshot", "Tap on Sign Up", "List elements on screen", etc.
85
+ ```
86
+
87
+ ## Operations the agent performs
88
+
89
+ Three clean operations on the substrate (details in `docs/SPEC.md` section 4):
90
+
91
+ 1. **Rename the skeleton** — Shop → Clinic, Shopkeeper → Staff, propagated coherently across Rails + Swift + Kotlin.
92
+ 2. **Adapt or replace the domain module** — keep ItemTag for queue variants; strip and insert a new resource for non-queue SaaS.
93
+ 3. **Drive the build green** — Rails tests + xcodebuild + gradlew must all pass.
94
+
95
+ ## Validation (three layers, gated)
96
+
97
+ 1. **Structural** — ripgrep for leftover domain tokens + OpenAPI contract parity (Rails ↔ iOS ↔ Android).
98
+ 2. **Runtime** — Rails boots, iOS builds & launches, Android builds & launches (Stage 1); UI-driven CRUD scenario via mobile-mcp (Stage 2).
99
+ 3. **Semantic** — Opus 4.7 as judge (text + vision) scoring against a structured rubric. Three runs per screenshot, take the median.
100
+
101
+ ## Guardrails
102
+
103
+ - **Self-repair loop hard-capped at 5 iterations** per generated project, opt-in via `NATIVEAPPTEMPLATE_REPAIR` (targets Layer 1/2 only; Layer 3 + reviewer are surfaced, not auto-repaired). On exceed, surface residuals and exit. Code: `src/repair-loop.ts` + `src/agents/repair.ts`.
104
+ - Known-cryptic failure modes: Jetpack Compose compilation, Hilt DI. Slow down and verify rather than pattern-match on those.
105
+ - **Do not invent tests for the generated code.** The substrate already has tests; use them.
106
+ - **Never modify the substrate repos** — clone them fresh into `./out/<slug>/{rails,ios,android}` before editing.
107
+ - Token budget: keep per-sub-agent context under 500k tokens to leave headroom for self-repair loops.
108
+
109
+ ## Output layout
110
+
111
+ ```
112
+ ./out/<spec-slug>/
113
+ ├── rails/ # customized Rails API (git-initialized)
114
+ ├── ios/ # customized iOS project (git-initialized)
115
+ └── android/ # customized Android project (git-initialized)
116
+ ```
117
+
118
+ Each is an independent, buildable git repo.
119
+
120
+ ## Packaging
121
+
122
+ Ships as three surfaces today:
123
+ - `npx nativeapptemplate-agent "your spec"` — standalone CLI (primary)
124
+ - `npx -y -p nativeapptemplate-agent nativeapptemplate-agent-mcp` — stdio MCP server wrapping `dispatch()` as a `generate_app` tool, for any MCP-capable assistant (Claude Code, Cursor, Cline, Goose). The distribution multiplier. (The `-mcp` entry point is a *bin* of the `nativeapptemplate-agent` package, not its own package — hence `-p`; `npx -y nativeapptemplate-agent-mcp` 404s.)
125
+ - **Claude Code plugin** in `plugin/` — `claude --plugin-dir ./plugin` loads two skills: `/nativeapptemplate-agent:generate-app` (generate → validate → explain) and `/nativeapptemplate-agent:walk-app` (drive the running app via `mobile-mcp`). Bundles the generator MCP server + mobile-mcp. See `plugin/README.md`.
126
+
127
+ Plugin `.mcp.json` pins are load-bearing: `nativeapptemplate-agent@latest` (MCP servers spawn with cwd = repo root; without `@latest`, `npx -p` resolves the *local* package and fails) and `@mobilenext/mobile-mcp@0.0.54` (0.0.55+ closes stdio).
128
+
129
+ ## Hackathon success criteria (quick reminder — details in docs/SPEC.md section 11)
130
+
131
+ **Must-have for the demo video:**
132
+ - Clinic queue spec produces 3 projects passing Layer 1 + Layer 2 Stage 1
133
+ - Layer 3 rubric scores above threshold for captured home-screen shots
134
+ - 90s demo video of end-to-end run with validation report
135
+
136
+ **Stretch:** restaurant waitlist + task tracker also pass; self-repair loop fixes at least one real failure in the video.
137
+
138
+ ## Sibling docs
139
+
140
+ - `docs/SPEC.md` — full technical specification (read first for any non-trivial change)
141
+ - `ROADMAP.md` — post-hackathon direction, OSS vs hosted tracks, durable scope boundaries
142
+ - `docs-private/GTM.md` — business strategy (relevant when discussing product surface, pricing, or Phase A/B transitions). Gitignored, not for publication.
143
+ - `docs-private/PREP-CHECKLIST.md` — pre-hackathon setup (should already be all-green by the time development starts). Gitignored.
144
+
145
+ ## Anti-patterns to avoid
146
+
147
+ - **Don't reimplement mobile UI automation.** Use mobile-mcp. The hackathon is not about inventing device automation.
148
+ - **Don't extend scope beyond the queue / simple-CRUD-SaaS family** during the hackathon week. See `docs/SPEC.md` section 9 for the full non-goals list.
149
+ - **Test the paid edition first.** Free is a strict subset of paid, so running paid first catches regressions that wouldn't surface against free alone. The OSS reproducibility story (judges/contributors with no paid license) lives in the free edition — once paid is green, point env vars at the free repos and re-run for the public demo.
150
+ - **Don't skip the validation layers to save time.** They are the demo story. A run that green-builds without passing Layer 3 is a failed run.
151
+ - **Don't edit, commit, push, or run `git clean` / `rm` inside `$NATIVEAPPTEMPLATE_API`, `$NATIVEAPPTEMPLATE_IOS`, or `$NATIVEAPPTEMPLATE_ANDROID`.** Those are the developer's working copies of the substrate (paid or free), shared with other projects on the same machine. Copy them into `./out/<slug>/` first; change nothing in place. If unsure whether a command is safe, ask.
package/CLAUDE.md CHANGED
@@ -1,139 +1 @@
1
- # CLAUDE.md
2
-
3
- Project-wide Claude Code instructions. Keep this file short — it's loaded into context every session. For deep context, read the linked docs on demand.
4
-
5
- ## What this project is
6
-
7
- `nativeapptemplate-agent` — a Claude Code agent that turns a natural-language SaaS spec (e.g. "a walk-in queue for a barbershop") into a working three-platform implementation: Rails 8.1 API + native SwiftUI iOS + native Jetpack Compose Android. Built during the Built with Opus 4.7 Claude Code Hackathon, April 21–27, 2026.
8
-
9
- **Read `docs/SPEC.md` before making non-trivial changes.** It's the source of truth for architecture, three-layer validation, operation paths (adapt vs. replace), and hackathon success criteria.
10
-
11
- ## Model
12
-
13
- - Use `claude-opus-4-7` for all agent invocations.
14
- - Requires Claude Agent SDK `>= 0.2.111`.
15
- - Do not set `thinking.type.enabled` — use `thinking: {type: "adaptive"}` instead (Opus 4.7 uses adaptive thinking).
16
-
17
- ## Stack
18
-
19
- - **Host language:** TypeScript (Claude Agent SDK `@anthropic-ai/claude-agent-sdk`)
20
- - **Ruby subprocesses** for Rails AST / ERB / migration work (called from TypeScript)
21
- - **External MCP:** [`mobile-next/mobile-mcp`](https://github.com/mobile-next/mobile-mcp) for iOS Simulator + Android Emulator UI automation (`npx -y @mobilenext/mobile-mcp@latest`)
22
- - **Node 22+ required.**
23
-
24
- ## Coding conventions
25
-
26
- - TypeScript `strict: true`; no implicit `any`.
27
- - Prefer functions over classes — introduce a class only when state + lifecycle justify it (e.g. a long-lived MCP client wrapper). Stateless transforms are functions.
28
- - Ruby subprocesses: shell out via `execFile("ruby", ["scripts/ruby/<script>.rb", ...])` from a thin wrapper in `src/ruby.ts`. Pass structured data as JSON on stdin/stdout, not positional CLI args. Each script must be self-contained and re-entrant.
29
- - No comments explaining *what* the code does — name things well instead. Reserve comments for non-obvious *why*.
30
-
31
- ## Substrate (what the agent operates on)
32
-
33
- The agent targets BOTH the paid and free (MIT-licensed) editions — the same code path handles both, validated end-to-end. **Test the paid edition first**: the free edition is a strict subset of paid (paid = free + multi-tenancy + invitations + role permissions + org switching), so anything that works on paid works on free, but not vice-versa. Catching paid-only regressions first avoids "free passes, paid breaks" surprises.
34
-
35
- Env vars point at the paid edition by default. Pick which substrate to use by pointing them at the corresponding repos:
36
-
37
- - `$NATIVEAPPTEMPLATE_API` — Rails 8.1 API repo (`nativeapptemplateapi`, single repo serves both editions; multi-tenancy + invitations are conditional features)
38
- - `$NATIVEAPPTEMPLATE_IOS` — SwiftUI iOS repo. Paid: `NativeAppTemplate` (Swift 23,003 LOC, adds org switching, invitations, role permissions). Free: `NativeAppTemplate-Free-iOS` (Swift 15,311 LOC).
39
- - `$NATIVEAPPTEMPLATE_ANDROID` — Jetpack Compose Android repo. Paid: `NativeAppTemplate` (Kotlin 28,401 LOC). Free: `NativeAppTemplate-Free-Android` (Kotlin 19,521 LOC).
40
-
41
- The renamer's substitution rules (Shop / Shopkeeper / ItemTag / NativeAppTemplate) apply identically to both editions. Paid-only concepts (Account, Member, Invitation) aren't in the rename plan, so paid features survive the generation intact. Both editions hit the same Rails OpenAPI server, so the reviewer's three-way diff works against either.
42
-
43
- **Substrate repos are read-only from the agent's perspective.** The agent never commits, pushes, edits, or runs destructive commands inside the substrate directories. To customize, the agent copies the substrate into `./out/<spec-slug>/{rails,ios,android}/` as fresh git-initialized project directories, and works exclusively inside `./out/` thereafter. Treat the substrate paths the same way you'd treat a read-only mount.
44
-
45
- ## Domain model (do not misread)
46
-
47
- - `Shop` → per-tenant primary resource (not "store", not "shop" in e-commerce sense — a physical location with a walk-in queue)
48
- - `Shopkeeper` → the authenticated user/owner of a Shop
49
- - `ItemTag` (aka Number Tag) → a queue entry, attached to a Shop
50
- - **ItemTag has TWO states: `Idled` ↔ `Completed`.** It's a toggle, not a three-state machine. If a user's spec wants three states (e.g. "in-service"), extend the machine rather than assume it.
51
- - Free edition is single-organization (personal account is transparent). Paid edition adds multi-tenancy, invitations, roles, org switching — all out of scope for the rename pipeline (paid-only concepts aren't in the rename plan), but the agent still operates against paid substrates by default since paid is a superset of free.
52
-
53
- ## Repository state
54
-
55
- Pre-implementation as of this writing: `src/` and `scripts/ruby/` are empty, and there is no `package.json`. The npm commands below are the target interface — don't try to run them until the scaffolding lands. Check `src/` before assuming.
56
-
57
- ## Commands
58
-
59
- ```bash
60
- # Build & test the agent (run from this repo root — once package.json exists)
61
- npm run build
62
- npm run test
63
- npm run dev -- "your spec here"
64
-
65
- # Substrate commands — run from the matching generated project dir in ./out/<slug>/
66
- bin/dev # Rails API
67
- xcodebuild -scheme NativeAppTemplate -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.2' build # iOS
68
- ./gradlew assembleDebug && ./gradlew installDebug # Android
69
-
70
- # Validation (run from this repo root)
71
- rg -n "Shop|Shopkeeper|ItemTag" ./out/<slug>/ # Layer 1 rename completeness check
72
- cloc --vcs=git "$NATIVEAPPTEMPLATE_API" # LOC measurement for a specific substrate repo
73
-
74
- # mobile-mcp — invoked via natural language through Claude Code
75
- # "Take a screenshot", "Tap on Sign Up", "List elements on screen", etc.
76
- ```
77
-
78
- ## Operations the agent performs
79
-
80
- Three clean operations on the substrate (details in `docs/SPEC.md` section 4):
81
-
82
- 1. **Rename the skeleton** — Shop → Clinic, Shopkeeper → Staff, propagated coherently across Rails + Swift + Kotlin.
83
- 2. **Adapt or replace the domain module** — keep ItemTag for queue variants; strip and insert a new resource for non-queue SaaS.
84
- 3. **Drive the build green** — Rails tests + xcodebuild + gradlew must all pass.
85
-
86
- ## Validation (three layers, gated)
87
-
88
- 1. **Structural** — ripgrep for leftover domain tokens + OpenAPI contract parity (Rails ↔ iOS ↔ Android).
89
- 2. **Runtime** — Rails boots, iOS builds & launches, Android builds & launches (Stage 1); UI-driven CRUD scenario via mobile-mcp (Stage 2).
90
- 3. **Semantic** — Opus 4.7 as judge (text + vision) scoring against a structured rubric. Three runs per screenshot, take the median.
91
-
92
- ## Guardrails
93
-
94
- - **Self-repair loop hard-capped at 5 iterations** per generated project, opt-in via `NATIVEAPPTEMPLATE_REPAIR` (targets Layer 1/2 only; Layer 3 + reviewer are surfaced, not auto-repaired). On exceed, surface residuals and exit. Code: `src/repair-loop.ts` + `src/agents/repair.ts`.
95
- - Known-cryptic failure modes: Jetpack Compose compilation, Hilt DI. Slow down and verify rather than pattern-match on those.
96
- - **Do not invent tests for the generated code.** The substrate already has tests; use them.
97
- - **Never modify the substrate repos** — clone them fresh into `./out/<slug>/{rails,ios,android}` before editing.
98
- - Token budget: keep per-sub-agent context under 500k tokens to leave headroom for self-repair loops.
99
-
100
- ## Output layout
101
-
102
- ```
103
- ./out/<spec-slug>/
104
- ├── rails/ # customized Rails API (git-initialized)
105
- ├── ios/ # customized iOS project (git-initialized)
106
- └── android/ # customized Android project (git-initialized)
107
- ```
108
-
109
- Each is an independent, buildable git repo.
110
-
111
- ## Packaging
112
-
113
- Ships as:
114
- - `npx nativeapptemplate-agent "your spec"` — standalone CLI
115
- - A Claude Code plugin (slash commands + skills)
116
-
117
- ## Hackathon success criteria (quick reminder — details in docs/SPEC.md section 11)
118
-
119
- **Must-have for the demo video:**
120
- - Clinic queue spec produces 3 projects passing Layer 1 + Layer 2 Stage 1
121
- - Layer 3 rubric scores above threshold for captured home-screen shots
122
- - 90s demo video of end-to-end run with validation report
123
-
124
- **Stretch:** restaurant waitlist + task tracker also pass; self-repair loop fixes at least one real failure in the video.
125
-
126
- ## Sibling docs
127
-
128
- - `docs/SPEC.md` — full technical specification (read first for any non-trivial change)
129
- - `ROADMAP.md` — post-hackathon direction, OSS vs hosted tracks, durable scope boundaries
130
- - `docs-private/GTM.md` — business strategy (relevant when discussing product surface, pricing, or Phase A/B transitions). Gitignored, not for publication.
131
- - `docs-private/PREP-CHECKLIST.md` — pre-hackathon setup (should already be all-green by the time development starts). Gitignored.
132
-
133
- ## Anti-patterns to avoid
134
-
135
- - **Don't reimplement mobile UI automation.** Use mobile-mcp. The hackathon is not about inventing device automation.
136
- - **Don't extend scope beyond the queue / simple-CRUD-SaaS family** during the hackathon week. See `docs/SPEC.md` section 9 for the full non-goals list.
137
- - **Test the paid edition first.** Free is a strict subset of paid, so running paid first catches regressions that wouldn't surface against free alone. The OSS reproducibility story (judges/contributors with no paid license) lives in the free edition — once paid is green, point env vars at the free repos and re-run for the public demo.
138
- - **Don't skip the validation layers to save time.** They are the demo story. A run that green-builds without passing Layer 3 is a failed run.
139
- - **Don't edit, commit, push, or run `git clean` / `rm` inside `$NATIVEAPPTEMPLATE_API`, `$NATIVEAPPTEMPLATE_IOS`, or `$NATIVEAPPTEMPLATE_ANDROID`.** Those are the developer's working copies of the substrate (paid by default; possibly free), shared with other projects on the same machine. Copy them into `./out/<slug>/` first; change nothing in place. If unsure whether a command is safe, ask.
1
+ @AGENTS.md
package/README.md CHANGED
@@ -14,10 +14,45 @@ Coherent across all three, in under an hour.
14
14
  [![node: >=22](https://img.shields.io/node/v/nativeapptemplate-agent.svg)](https://nodejs.org/)
15
15
 
16
16
  ```bash
17
- npx nativeapptemplate-agent "a walk-in clinic queue for small veterinary practices"
17
+ npx nativeapptemplate-agent "a walk-in clinic queue for small veterinary practices" --project-name="VetClinic"
18
18
  ```
19
19
 
20
- > **Status: v0.1.2 stable.** First built during [Built with Opus 4.7: a Claude Code Hackathon](https://cerebralvalley.ai/e/built-with-4-7-hackathon) (April 21–27, 2026); shipped to npm post-hackathon. Verified end-to-end on the three demo specs below from a fresh `/tmp/` cwd. Stage 2 (scripted-CRUD walk-through via `mobile-mcp` against a live Rails server) and paid-edition parity validation landed post-launch. Active development continues — see the [roadmap](./ROADMAP.md) for what's next.
20
+ > **Status: 0.2.3 stable.** First built during [Built with Opus 4.7: a Claude Code Hackathon](https://cerebralvalley.ai/e/built-with-4-7-hackathon) (April 21–27, 2026); shipped to npm post-hackathon. Verified end-to-end on the three demo specs below from a fresh `/tmp/` cwd — the full 3-spec × 2-edition × 2-platform matrix is green at `NATIVEAPPTEMPLATE_VISUAL=2` (see the [matrix](#demo)). Stage 2 (scripted-CRUD walk-through via `mobile-mcp` against a live Rails server) and paid-edition parity validation landed post-launch. Active development continues — see the [roadmap](./ROADMAP.md) for what's next.
21
+
22
+ ---
23
+
24
+ ## Quick Start
25
+
26
+ ### Option 1: Claude Code plugin (recommended)
27
+
28
+ Install the plugin once, then drive the agent with two slash commands — `/nativeapptemplate-agent:generate-app` (generate → validate → explain) and `/nativeapptemplate-agent:walk-app` (launch the app on a simulator/emulator and walk its UI via `mobile-mcp`, screenshots inline).
29
+
30
+ ```bash
31
+ /plugin marketplace add nativeapptemplate/nativeapptemplate-agent
32
+ /plugin install nativeapptemplate-agent@nativeapptemplate
33
+ ```
34
+
35
+ Then in Claude Code:
36
+
37
+ ```
38
+ /nativeapptemplate-agent:generate-app a walk-in clinic queue for small veterinary practices. project name is VetClinic.
39
+ ```
40
+
41
+ Or load it locally without the marketplace: `claude --plugin-dir ./plugin`. See [`plugin/README.md`](./plugin/README.md) for the reference card, and the [A-to-Z plugin guide](./docs/PLUGIN-GUIDE.md) for a full walkthrough.
42
+
43
+ ### Option 2: Standalone CLI
44
+
45
+ No editor required — runs anywhere Node 22+ is installed.
46
+
47
+ ```bash
48
+ npx nativeapptemplate-agent "a walk-in clinic queue for small veterinary practices" --project-name="VetClinic"
49
+ ```
50
+
51
+ Generated output appears under `./out/<slug>/`. See [Usage](#usage) for rename overrides and report flags.
52
+
53
+ > **Pass a project name.** `--project-name` (or "project name is …" in the plugin) pins the Pascal project name, output slug (`out/vet-clinic/`), Xcode scheme, and display name across all three platforms. Omit it and the planner picks one — fine for one-off exploration, but it'll differ across re-runs.
54
+
55
+ > Using Cursor, Cline, Goose, or another MCP-capable editor? The generator also ships as an MCP server: `npx -y -p nativeapptemplate-agent nativeapptemplate-agent-mcp` exposes a `generate_app` tool you can wire into your editor's MCP config.
21
56
 
22
57
  ---
23
58
 
@@ -29,6 +64,8 @@ Classic mobile boilerplates sell "save 12–16 weeks of setup." AI coding tools
29
64
 
30
65
  This agent is an answer to that: turn a boilerplate into a generator that produces coherent three-platform implementations on demand, with structural and semantic validation built in.
31
66
 
67
+ > 📝 **Background:** [*One sentence becomes a native iOS app, a native Android app, and a Rails API*](https://medium.com/@dadachix/one-sentence-becomes-a-native-ios-app-a-native-android-app-and-a-rails-api-0000aaf9010c) — the long-form version of this argument: why cross-platform coherence, not code volume, is the problem AI didn't make easier.
68
+
32
69
  ## What it does
33
70
 
34
71
  Point the agent at a natural-language spec:
@@ -43,14 +80,18 @@ It will:
43
80
  2. **Copy the free-edition substrate** (three MIT-licensed repos covering Rails + iOS + Android) into `./out/<spec-slug>/{rails,ios,android}/`.
44
81
  3. **Rename the skeleton** — `Shop → Clinic`, `Shopkeeper → Vet`, etc. — consistently across Ruby migrations, Swift models, Kotlin data classes, policies, tests, and localized copy.
45
82
  4. **Adapt or replace the domain module** — keep `ItemTag` for walk-in queue variants; strip and insert a new resource for non-queue SaaS.
46
- 5. **Drive the build green** — `bin/rails test`, `xcodebuild test`, `./gradlew test` must all pass before the agent exits.
83
+ 5. **Drive the build green** — every platform must pass before the agent exits. By default this is a fast gate: Rails routes load (`bin/rails routes`) and the iOS/Android projects resolve (`xcodebuild -list`, `./gradlew --version`). With `NATIVEAPPTEMPLATE_VISUAL=1`+ it escalates to full builds — Rails boots (`bin/rails db:prepare` + `bin/rails runner`), iOS builds (`xcodebuild build`), Android builds (`./gradlew assembleDebug`).
47
84
  6. **Validate the output** across three layers (structural, runtime, semantic) and write a self-contained HTML + JSON [validation report](#validation-report). Details in [`docs/SPEC.md`](./docs/SPEC.md) section 6.
48
85
 
49
86
  ## Demo
50
87
 
88
+ **Quick look (40s)** — what the agent does, the three distribution surfaces, and a live walk of the generated app: **▸ [Watch on YouTube](https://youtu.be/fsjfskPWecQ)**
89
+
90
+ **Full end-to-end run (90s)** — spec → renamed Rails API + iOS app + Android app, all three platforms validated:
91
+
51
92
  https://github.com/user-attachments/assets/bd1ed091-93d8-45d7-b502-c21720218484
52
93
 
53
- 90-second end-to-end run: spec → renamed Rails API + iOS app + Android app, all three platforms validated. Also on [YouTube](https://youtu.be/z08ueZX-02I) for full-screen viewing.
94
+ Also on [YouTube](https://youtu.be/z08ueZX-02I) for full-screen viewing.
54
95
 
55
96
  Three demo specs, both adapt and replace paths, all four validation layers green end-to-end:
56
97
 
@@ -64,8 +105,34 @@ Layer 2 ran in build mode — real `xcodebuild build` and `./gradlew assembleDeb
64
105
 
65
106
  The agent works on either the **free (MIT) edition** or the **paid edition** without code changes — the same pipeline handles both substrates; multi-tenant features (org switching, invitations, role permissions) survive the rename pipeline when targeting paid. The agent tests paid first because free is a strict subset of paid; running paid first catches regressions that wouldn't surface against free alone.
66
107
 
108
+ ### Validation matrix — 12/12 green at `VISUAL=2`
109
+
110
+ All three specs pass a full end-to-end `NATIVEAPPTEMPLATE_VISUAL=2` run (build → rename → boot → scripted-CRUD walk → vision judge) on **both editions and both platforms** — 12 cells (3 specs × 2 editions × 2 platforms), each **Layer 1 3/3 · Layer 2 3/3 · Layer 3 2/2 · reviewer PASS** on a real iPhone 17 Pro simulator + Android emulator:
111
+
112
+ | Spec | Free (iOS · Android) | Paid (iOS · Android) |
113
+ |---|---|---|
114
+ | Walk-in queue | ✅ · ✅ | ✅ · ✅ |
115
+ | Restaurant / sushi waitlist | ✅ · ✅ | ✅ · ✅ |
116
+ | Personal task tracker | ✅ · ✅ | ✅ · ✅ |
117
+
118
+ After the queue cell's Stage-2 hardening landed, sushi and the task tracker passed first-try on both editions with no further changes — the scripted scenario is genuinely spec- and edition-agnostic (the task tracker is a non-queue spec running the same walk).
119
+
67
120
  Both screenshots are real captures from the booted iOS Simulator and Android emulator post-`./gradlew assembleDebug` / `xcodebuild build`, after the agent installed and launched the generated app.
68
121
 
122
+ ## Runtime
123
+
124
+ End-to-end wall-clock per run, measured from `report.json`'s `meta.durationMs` on a 2021 M1 Max with both simulators pre-booted:
125
+
126
+ | `NATIVEAPPTEMPLATE_VISUAL` | What runs | Observed time | Approx cost |
127
+ |---|---|---|---|
128
+ | `0` (default) | Layer 1 (ripgrep) + Layer 2 *fast* (Rails boot probe, iOS/Android type-check) + reviewer | ~2–3 min | ~$0.05 |
129
+ | `1` | + full `xcodebuild build` + `./gradlew assembleDebug` + home-screen capture + Stage 1 vision judge | ~2.5 min (barbershop-queue · 2026-05-24) | — |
130
+ | `2` | + Rails server boot + scripted-CRUD walk via `mobile-mcp` + Stage 2 vision judge | ~7–8 min (sentova / sushi / task-tracker · 2026-05-23) | — |
131
+
132
+ Cold builds, first-run cocoapods/gradle dependency resolution, or unbooted simulators add a one-time minute or two. The self-repair loop (opt-in, hard-capped at 5 iterations) can extend a failing run substantially — budget for it if you set `NATIVEAPPTEMPLATE_REPAIR=on`.
133
+
134
+ **Cost** scales with model usage, not wall-clock. The agent makes real `claude-opus-4-7` API calls (planner, workers, reviewer, judge) and a single VISUAL=2 run consumes tens of thousands of tokens across multiple sub-agents. Set a workspace spend cap (see [Security](#security)) as a backstop — the agent exits non-zero on validation failure, but doesn't gate on spend itself.
135
+
69
136
  ## Architecture
70
137
 
71
138
  ```mermaid
@@ -105,6 +172,12 @@ npx nativeapptemplate-agent "a walk-in clinic queue for small veterinary practic
105
172
  npx nativeapptemplate-agent "a restaurant waitlist for casual dining"
106
173
  npx nativeapptemplate-agent "a personal task tracker with due dates"
107
174
 
175
+ # Name the project explicitly (sets display name + output slug, independent of the
176
+ # domain rename). The plugin/MCP path accepts the same intent in plain language —
177
+ # "…detection. project name is Sentova." — mapped to the projectName argument.
178
+ npx nativeapptemplate-agent "a two-device home monitor for household pest detection" --project-name="Sentova"
179
+ # → out/sentova/ · Sentova.xcodeproj · "Sentova API"; adapts ItemTag (e.g. Shop→Household, ItemTag→Sighting)
180
+
108
181
  # Generated output appears under ./out/<slug>/
109
182
  tree ./out/clinic-queue/
110
183
  # ├── rails/ ← Rails 8.1 API, git-initialized, buildable
@@ -114,7 +187,14 @@ tree ./out/clinic-queue/
114
187
  # └── validation-report.html ← self-contained visual report (open in a browser)
115
188
  ```
116
189
 
117
- The agent will also be available as a Claude Code plugin.
190
+ The same generator also ships as an MCP server — `npx -y -p nativeapptemplate-agent nativeapptemplate-agent-mcp` exposes a `generate_app` tool, so any MCP-capable assistant (Claude Code, Cursor, Cline, Goose) can invoke it without leaving the editor. And a **Claude Code plugin** ships in [`plugin/`](./plugin/) with two skills: `/nativeapptemplate-agent:generate-app` (generate → validate → explain) and `/nativeapptemplate-agent:walk-app` (launch the app on a simulator/emulator and walk its UI via `mobile-mcp`, screenshots inline). Install it via the bundled marketplace:
191
+
192
+ ```bash
193
+ /plugin marketplace add nativeapptemplate/nativeapptemplate-agent
194
+ /plugin install nativeapptemplate-agent@nativeapptemplate
195
+ ```
196
+
197
+ …or load it locally with `claude --plugin-dir ./plugin`. See [`plugin/README.md`](./plugin/README.md) for the reference card, or the **[A-to-Z plugin guide](./docs/PLUGIN-GUIDE.md)** for a full follow-along walkthrough.
118
198
 
119
199
  ## Requirements
120
200
 
@@ -143,7 +223,10 @@ The agent will also be available as a Claude Code plugin.
143
223
  - `NATIVEAPPTEMPLATE_BRIDGE=off` — skip writing to `~/.gradle/gradle.properties`. The agent normally mirrors `NATIVEAPPTEMPLATE_API_*` (HOST/PORT/SCHEME) into renamed-product variants (`<PRODUCT>_API_*`) at run time so the generated Android app picks them up via `gradle.properties` and the iOS sim launch picks them up via `SIMCTL_CHILD_*`. Set this to disable the file write (process.env injection still runs for child-spawn paths).
144
224
  - `NATIVEAPPTEMPLATE_BRIDGE_DRY_RUN=1` — log what would be written to `~/.gradle/gradle.properties` instead of writing. Useful before granting the bridge write access to your user-global gradle.
145
225
  - `NATIVEAPPTEMPLATE_AGENT_ANTHROPIC_KEY` — dedicated workspace key, see [Security](#security).
146
- - `ANDROID_SERIAL` — when more than one Android device/emulator is attached (e.g. a physical device plus a running emulator), `adb` standard practice is to set `ANDROID_SERIAL=<serial>` to disambiguate. The agent honors this transparently because it runs `adb` directly. Run `adb devices` to list serials. Visual-judge runs with multiple Android targets attached will error with `more than one device/emulator` if this isn't set.
226
+ - `NATIVEAPPTEMPLATE_ADB_SERIAL` — the `adb -s` target when more than one Android device/emulator is attached. Without it the agent prefers an `emulator-*` serial, then the first device. Run `adb devices` to list serials.
227
+ - `NATIVEAPPTEMPLATE_MOBILE_IOS_DEVICE` / `NATIVEAPPTEMPLATE_MOBILE_ANDROID_DEVICE` — pin the device `mobile-mcp` drives in Stage 2 (device id or exact name) when several are booted.
228
+ - `NATIVEAPPTEMPLATE_IOS_DESTINATION` — the `xcodebuild -destination` for build mode (default `platform=iOS Simulator,name=iPhone 17 Pro,OS=26.2`). Set it if you don't have that simulator, e.g. `platform=iOS Simulator,name=iPhone 16`.
229
+ - `NATIVEAPPTEMPLATE_API_SCHEME` — `http` or `https` for the generated apps' API URL (read by the env bridge alongside the substrate Rails `.env` HOST/PORT).
147
230
 
148
231
  The agent resolves `adb` to a known-good binary in this priority order: `$ANDROID_HOME/platform-tools/adb`, `$ANDROID_SDK_ROOT/platform-tools/adb`, `~/Library/Android/sdk/platform-tools/adb` (Android Studio default), `/Applications/android-sdk-macosx/platform-tools/adb`, `/opt/homebrew/bin/adb`, `/usr/local/bin/adb`, then PATH. This avoids surprises like a stale `~/.apportable/SDK/bin/adb` (i386, won't exec on Apple Silicon) shadowing a working `adb` on PATH.
149
232
 
@@ -152,7 +235,7 @@ The agent resolves `adb` to a known-good binary in this priority order: `$ANDROI
152
235
  The agent doesn't just generate code and exit — it validates the output.
153
236
 
154
237
  1. **Structural.** `ripgrep` for leftover domain tokens; OpenAPI contract parity check between Rails, iOS networking, and Android repository layers. A silent rename inconsistency fails the run before any tests execute.
155
- 2. **Runtime.** Verify the generated Rails app boots (`bin/rails runner 'puts OK'`); type-check or build the iOS and Android apps. With `NATIVEAPPTEMPLATE_VISUAL=1`, escalate to a full build (`xcodebuild build` + `./gradlew assembleDebug`) and install on the booted sim/emulator. With `=2`, additionally boot the live Rails server and drive a scripted CRUD walk-through via [`mobile-next/mobile-mcp`](https://github.com/mobile-next/mobile-mcp). Any 4xx/5xx or unhandled client error fails the run.
238
+ 2. **Runtime.** Verify the generated Rails app boots (`bin/rails runner 'puts OK'`); type-check or build the iOS and Android apps. With `NATIVEAPPTEMPLATE_VISUAL=1`, escalate to a full build (`xcodebuild build` + `./gradlew assembleDebug`) and install on the booted sim/emulator. With `=2`, additionally boot the live Rails server and drive a scripted CRUD walk-through via [`mobile-next/mobile-mcp`](https://github.com/mobile-next/mobile-mcp). A walk step that doesn't reach its expected screen fails the run.
156
239
  3. **Semantic.** Opus 4.7 as judge — scores whether the generated code and rendered UI actually express the intended domain. Vision judges read simulator/emulator screenshots directly.
157
240
 
158
241
  See [`docs/SPEC.md`](./docs/SPEC.md) for the full design.
@@ -206,17 +289,17 @@ Report flags:
206
289
 
207
290
  **Don't** paste a real key into shell history (`HISTFILE` captures it), commit a `.env`, or echo the key into a non-private channel.
208
291
 
209
- The agent strips `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and `NATIVEAPPTEMPLATE_AGENT_ANTHROPIC_KEY` from the environment of every subprocess it spawns — Ruby scripts, `git`, `psql`, `xcodebuild`, `gradlew`, the future mobile-mcp client. Keys are only seen by the Anthropic SDK in the Node process. Set spend limits on your API workspace as a backstop, and rotate the key if you suspect leak.
292
+ The agent strips `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and `NATIVEAPPTEMPLATE_AGENT_ANTHROPIC_KEY` from the environment of every subprocess it spawns — Ruby scripts, `git`, `psql`, `xcodebuild`, `gradlew`, the mobile-mcp client. Keys are only seen by the Anthropic SDK in the Node process. Set spend limits on your API workspace as a backstop, and rotate the key if you suspect leak.
210
293
 
211
294
  ## Project docs
212
295
 
213
296
  - [`docs/SPEC.md`](./docs/SPEC.md) — full technical specification
214
297
  - [`ROADMAP.md`](./ROADMAP.md) — where this project is headed, OSS vs hosted, what stays out of scope
215
- - [`CLAUDE.md`](./CLAUDE.md) — Claude Code project instructions (read if you're running Claude Code against this repo)
298
+ - [`AGENTS.md`](./AGENTS.md) — AI coding agent instructions (read if you're running Claude Code, Codex, etc. against this repo; `CLAUDE.md` imports it)
216
299
 
217
300
  ## Contributing
218
301
 
219
- Issues and PRs welcome. The repository is stable now (v0.1.x) — no more hackathon-pace rewrites. A `CONTRIBUTING.md` with detailed guidelines will land alongside v0.2.
302
+ Issues and PRs welcome. The repository is stable now (v0.2.x) — no more hackathon-pace rewrites. A `CONTRIBUTING.md` with detailed guidelines is still to come.
220
303
 
221
304
  For now, the simplest path is: open an issue describing what you're trying to do, and we'll figure out the right shape together before code lands. Bug reports with reproducible commands (and the `/tmp/<dir>/tmp/trace/` log) are especially welcome.
222
305
 
@@ -29,7 +29,7 @@ export async function runRepair(target, domain) {
29
29
  allowDangerouslySkipPermissions: true,
30
30
  maxTurns: target.layer === "layer2" ? 40 : 20,
31
31
  // Hermetic: don't inherit the developer's ~/.claude settings, project
32
- // CLAUDE.md, or custom agents — the repair agent runs only with the
32
+ // CLAUDE.md / AGENTS.md, or custom agents — the repair agent runs only with the
33
33
  // system prompt below.
34
34
  settingSources: [],
35
35
  env: { ...stringEnv(process.env), ANTHROPIC_API_KEY: apiKey },
@@ -1 +1 @@
1
- {"version":3,"file":"repair.js","sourceRoot":"","sources":["../../src/agents/repair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,MAAM,KAAK,GAAG,iBAAiB,CAAC;AA4BhC,0EAA0E;AAC1E,4EAA4E;AAC5E,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAoB,EAAE,MAAkB;IACtE,IAAI,MAAM,CAAC,QAAQ,CAAC;QAAE,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;IAEnD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxG,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,MAAM,EAAE,uCAAuC,EAAE,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,8BAA8B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAEjG,wEAAwE;IACxE,oCAAoC;IACpC,MAAM,YAAY,GAChB,MAAM,CAAC,KAAK,KAAK,QAAQ;QACvB,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QAC1C,CAAC,CAAC,CA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EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC;AAED,MAAM,KAAK,GAAG,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAExF,KAAK,UAAU,aAAa,CAAC,MAAoB;IAC/C,KAAK,CAAC,QAAQ,EAAE,eAAe,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAClE,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,0BAA0B,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;AACjF,CAAC"}
@@ -6,4 +6,5 @@ export type ReviewerInput = {
6
6
  android: WorkerResult;
7
7
  };
8
8
  export declare function runReviewer(input: ReviewerInput): Promise<ReviewerResult>;
9
+ export declare function deriveRole(domain: DomainSpec): string;
9
10
  //# sourceMappingURL=reviewer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reviewer.d.ts","sourceRoot":"","sources":["../../src/agents/reviewer.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAeF,wBAAsB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAgE/E"}
1
+ {"version":3,"file":"reviewer.d.ts","sourceRoot":"","sources":["../../src/agents/reviewer.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAeF,wBAAsB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAuE/E;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAGrD"}
@@ -41,7 +41,13 @@ export async function runReviewer(input) {
41
41
  const summary = formatDiffSummary(diff);
42
42
  for (const line of summary)
43
43
  trace("reviewer", line);
44
- const fatalCount = diff.iosOrphan.length + diff.androidOrphan.length + diff.iosOnly.length + diff.androidOnly.length;
44
+ // An extractor that finds nothing (e.g. a renamed networking dir it no
45
+ // longer recognizes) would otherwise yield an empty diff and a vacuous PASS.
46
+ const emptyClients = [
47
+ ...(iosEndpoints.length === 0 ? ["ios:no-endpoints-extracted"] : []),
48
+ ...(androidEndpoints.length === 0 ? ["android:no-endpoints-extracted"] : []),
49
+ ];
50
+ const fatalCount = diff.iosOrphan.length + diff.androidOrphan.length + diff.iosOnly.length + diff.androidOnly.length + emptyClients.length;
45
51
  const baseDiffs = [
46
52
  `rails:openapi=${railsContract.openapiVersion}`,
47
53
  `rails:title=${railsContract.title}`,
@@ -57,6 +63,7 @@ export async function runReviewer(input) {
57
63
  `android-only=${diff.androidOnly.length}`,
58
64
  ];
59
65
  const findings = [
66
+ ...emptyClients,
60
67
  ...formatFindings("ios-orphan", diff.iosOrphan),
61
68
  ...formatFindings("android-orphan", diff.androidOrphan),
62
69
  ...formatFindings("ios-only", diff.iosOnly),
@@ -69,9 +76,16 @@ export async function runReviewer(input) {
69
76
  trace("reviewer", `${domain.displayName}: contract parity PASS`);
70
77
  return { contractParity: "pass", diffs: [...baseDiffs, ...findings] };
71
78
  }
72
- function deriveRole(domain) {
79
+ export function deriveRole(domain) {
73
80
  const pair = domain.renamePlan.find((p) => p.from === "Shopkeeper");
74
- return (pair?.to ?? "Shopkeeper").toLowerCase();
81
+ return pascalToSnake(pair?.to ?? "Shopkeeper");
82
+ }
83
+ // Mirrors rename.rb's snake_case: the route segment for FrontDesk is front_desk.
84
+ function pascalToSnake(pascal) {
85
+ return pascal
86
+ .replace(/([a-z\d])([A-Z])/g, "$1_$2")
87
+ .replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2")
88
+ .toLowerCase();
75
89
  }
76
90
  function formatDiffSummary(diff) {
77
91
  const lines = [];
@@ -1 +1 @@
1
- {"version":3,"file":"reviewer.js","sourceRoot":"","sources":["../../src/agents/reviewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,GAGd,MAAM,uBAAuB,CAAC;AAU/B,wEAAwE;AACxE,2EAA2E;AAC3E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EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAC/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../src/agents/workers/android.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAc,YAAY,EAAE,MAAM,aAAa,CAAC;AAoBxE,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAwChF"}
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../src/agents/workers/android.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAc,YAAY,EAAE,MAAM,aAAa,CAAC;AAsBxE,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAwChF"}