frontier-os-app-builder 1.0.0

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 (55) hide show
  1. package/README.md +92 -0
  2. package/agents/fos-executor.md +460 -0
  3. package/agents/fos-plan-checker.md +386 -0
  4. package/agents/fos-planner.md +416 -0
  5. package/agents/fos-researcher.md +358 -0
  6. package/agents/fos-verifier.md +491 -0
  7. package/bin/fos-tools.cjs +794 -0
  8. package/bin/install.js +234 -0
  9. package/commands/fos/add-feature.md +29 -0
  10. package/commands/fos/discuss.md +31 -0
  11. package/commands/fos/execute.md +35 -0
  12. package/commands/fos/new-app.md +39 -0
  13. package/commands/fos/new-milestone.md +28 -0
  14. package/commands/fos/next.md +29 -0
  15. package/commands/fos/plan.md +37 -0
  16. package/commands/fos/ship.md +29 -0
  17. package/commands/fos/status.md +22 -0
  18. package/package.json +30 -0
  19. package/references/app-patterns.md +501 -0
  20. package/references/deployment.md +395 -0
  21. package/references/module-inference.md +349 -0
  22. package/references/sdk-surface.md +1622 -0
  23. package/references/verification-rules.md +404 -0
  24. package/templates/app/gitignore +25 -0
  25. package/templates/app/index.css +111 -0
  26. package/templates/app/index.html +19 -0
  27. package/templates/app/layout.tsx +45 -0
  28. package/templates/app/main-router.tsx +17 -0
  29. package/templates/app/main-simple.tsx +19 -0
  30. package/templates/app/package.json +36 -0
  31. package/templates/app/postcss.config.js +5 -0
  32. package/templates/app/router.tsx +22 -0
  33. package/templates/app/sdk-context.tsx +33 -0
  34. package/templates/app/test-setup.ts +19 -0
  35. package/templates/app/tsconfig.json +22 -0
  36. package/templates/app/vercel.json +127 -0
  37. package/templates/app/vite.config.ts +15 -0
  38. package/templates/state/context.md +248 -0
  39. package/templates/state/manifest.json +11 -0
  40. package/templates/state/plan.md +187 -0
  41. package/templates/state/project.md +118 -0
  42. package/templates/state/requirements.md +133 -0
  43. package/templates/state/roadmap.md +129 -0
  44. package/templates/state/state.md +131 -0
  45. package/templates/state/summary.md +273 -0
  46. package/workflows/add-feature.md +234 -0
  47. package/workflows/discuss.md +310 -0
  48. package/workflows/execute-plan.md +222 -0
  49. package/workflows/execute.md +338 -0
  50. package/workflows/new-app.md +331 -0
  51. package/workflows/new-milestone.md +258 -0
  52. package/workflows/next.md +157 -0
  53. package/workflows/plan.md +310 -0
  54. package/workflows/ship.md +296 -0
  55. package/workflows/status.md +145 -0
@@ -0,0 +1,273 @@
1
+ # Summary Template
2
+
3
+ Template for `.frontier-app/phases/XX-name/{phase}-{plan}-SUMMARY.md` — plan completion documentation.
4
+
5
+ ---
6
+
7
+ ## File Template
8
+
9
+ ```markdown
10
+ ---
11
+ phase: XX-name
12
+ plan: NN
13
+ subsystem: [primary category: scaffold, ui, feature, integration, sdk-module, etc.]
14
+ tags: [searchable tech: react, vite, tailwind, frontier-sdk, events, wallet]
15
+
16
+ requires:
17
+ - phase: [prior phase this depends on]
18
+ provides: [what that phase built that this uses]
19
+ provides:
20
+ - [bullet list of what this plan built/delivered]
21
+ affects: [list of phase names that will need this context]
22
+
23
+ tech-stack:
24
+ added: [libraries/tools added]
25
+ patterns: [patterns established]
26
+
27
+ key-files:
28
+ created: [important files created]
29
+ modified: [important files modified]
30
+
31
+ key-decisions:
32
+ - "Decision 1"
33
+ - "Decision 2"
34
+
35
+ patterns-established:
36
+ - "Pattern 1: description"
37
+ - "Pattern 2: description"
38
+
39
+ sdk-modules-used: []
40
+
41
+ requirements-completed: []
42
+
43
+ duration: Xmin
44
+ completed: YYYY-MM-DD
45
+ ---
46
+
47
+ # Phase [X]: [Name] — Plan [Y] Summary
48
+
49
+ **[Substantive one-liner — NOT "phase complete" or "scaffold done"]**
50
+
51
+ ## Performance
52
+
53
+ - **Duration:** [time]
54
+ - **Started:** [ISO timestamp]
55
+ - **Completed:** [ISO timestamp]
56
+ - **Tasks:** [count completed]
57
+ - **Files modified:** [count]
58
+
59
+ ## Accomplishments
60
+
61
+ - [Most important outcome]
62
+ - [Second key accomplishment]
63
+ - [Third if applicable]
64
+
65
+ ## Task Commits
66
+
67
+ Each task was committed atomically:
68
+
69
+ 1. **Task 1: [name]** — `abc123f` (feat/fix/scaffold)
70
+ 2. **Task 2: [name]** — `def456g` (feat/fix/test)
71
+
72
+ ## Files Created/Modified
73
+
74
+ - `src/App.tsx` — What it does
75
+ - `src/lib/sdk-context.tsx` — What it does
76
+
77
+ ## SDK Integration Notes
78
+
79
+ [How SDK modules were integrated, any gotchas, patterns established for SDK usage.
80
+ Or "No SDK module integration in this plan" if scaffold-only.]
81
+
82
+ ## Decisions Made
83
+
84
+ [Key decisions with brief rationale, or "None — followed plan as specified"]
85
+
86
+ ## Deviations from Plan
87
+
88
+ [If no deviations: "None — plan executed exactly as written"]
89
+
90
+ [If deviations occurred:]
91
+
92
+ ### Auto-fixed Issues
93
+
94
+ **1. [Category] Brief description**
95
+ - **Found during:** Task [N] ([task name])
96
+ - **Issue:** [What was wrong]
97
+ - **Fix:** [What was done]
98
+ - **Files modified:** [file paths]
99
+ - **Verification:** [How it was verified]
100
+
101
+ ---
102
+
103
+ **Total deviations:** [N] auto-fixed
104
+ **Impact on plan:** [Brief assessment]
105
+
106
+ ## Issues Encountered
107
+
108
+ [Problems and how they were resolved, or "None"]
109
+
110
+ ## Verification Results
111
+
112
+ - [ ] Build: [pass/fail]
113
+ - [ ] Dev server: [pass/fail on port XXXX]
114
+ - [ ] TypeScript: [pass/fail]
115
+ - [ ] Dark theme: [pass/fail]
116
+ - [ ] Iframe mode: [pass/fail or N/A]
117
+ - [ ] Standalone mode: [pass/fail or N/A]
118
+
119
+ ## Next Phase Readiness
120
+
121
+ [What's ready for next phase]
122
+ [Any blockers or concerns]
123
+
124
+ ---
125
+ *Phase: XX-name*
126
+ *Completed: [date]*
127
+ ```
128
+
129
+ <guidelines>
130
+
131
+ **Frontmatter:**
132
+ - MANDATORY — complete all fields
133
+ - `sdk-modules-used` tracks which Frontier SDK modules this plan touched
134
+ - `requirements-completed` lists requirement IDs fulfilled by this plan
135
+ - Enables automatic context assembly for future planning
136
+
137
+ **One-liner:**
138
+ Must be substantive. Examples:
139
+ - "Vite + React scaffold with SdkProvider, iframe detection, and dark Tailwind theme"
140
+ - "Event listing page with real-time updates via Events SDK module"
141
+ - "Wallet integration for USDC payments with transaction confirmation UI"
142
+
143
+ NOT: "Phase complete" / "Scaffold done" / "Feature implemented"
144
+
145
+ **SDK Integration Notes:**
146
+ - Document how SDK modules were wired up in this plan
147
+ - Document how SDK modules were wired up
148
+ - Note any SDK quirks or workarounds
149
+ - Helps future phases that use the same modules
150
+
151
+ **Verification Results:**
152
+ - Frontier-specific checks always included (dark theme, iframe, standalone)
153
+ - Mark N/A for checks not applicable to this plan
154
+ - All must pass before plan is considered complete
155
+
156
+ **After creation:** STATE.md updated with position, decisions, metrics.
157
+
158
+ </guidelines>
159
+
160
+ <example>
161
+
162
+ ```markdown
163
+ ---
164
+ phase: 01-scaffold
165
+ plan: 01
166
+ subsystem: scaffold
167
+ tags: [react, vite, tailwind, frontier-sdk, iframe-detection]
168
+
169
+ requires: []
170
+ provides:
171
+ - "Vite + React project structure"
172
+ - "SdkProvider context with useSdk hook"
173
+ - "Iframe detection with standalone fallback"
174
+ - "Dark theme via Tailwind"
175
+ affects: [02-event-listing, 03-event-creation]
176
+
177
+ tech-stack:
178
+ added: [react, vite, tailwind, @frontiertower/frontier-sdk]
179
+ patterns: [SdkProvider wrapper, useSdk hook, iframe detection utility]
180
+
181
+ key-files:
182
+ created: [src/App.tsx, src/lib/sdk-context.tsx, src/lib/iframe.ts, src/components/Layout.tsx]
183
+ modified: []
184
+
185
+ key-decisions:
186
+ - "Used Tailwind for styling — matches Frontier OS design system"
187
+ - "Iframe detection via window.self !== window.top with fallback UI"
188
+
189
+ patterns-established:
190
+ - "SdkProvider: All SDK access via useSdk() hook, never direct instantiation"
191
+ - "Dark theme: bg-neutral-950 base, text-white, no light mode support"
192
+
193
+ sdk-modules-used: []
194
+
195
+ requirements-completed: [PLAT-01, PLAT-02, PLAT-03, PLAT-04, PLAT-05]
196
+
197
+ duration: 18min
198
+ completed: 2026-03-27
199
+ ---
200
+
201
+ # Phase 1: Scaffold + SDK Core — Plan 1 Summary
202
+
203
+ **Vite + React scaffold with SdkProvider, iframe detection, dark Tailwind theme on port 5180**
204
+
205
+ ## Performance
206
+
207
+ - **Duration:** 18 min
208
+ - **Started:** 2026-03-27T10:00:00Z
209
+ - **Completed:** 2026-03-27T10:18:00Z
210
+ - **Tasks:** 3
211
+ - **Files modified:** 8
212
+
213
+ ## Accomplishments
214
+
215
+ - Full Vite + React + TypeScript project scaffolded
216
+ - SdkProvider wraps app, useSdk() available everywhere
217
+ - Iframe detection works — shows standalone banner when not in Frontier OS
218
+ - Dark theme via Tailwind — bg-neutral-950 base, all components dark
219
+
220
+ ## Task Commits
221
+
222
+ 1. **Task 1: Scaffold Vite project** — `a1b2c3d` (feat: scaffold)
223
+ 2. **Task 2: SdkProvider + iframe detection** — `e4f5g6h` (feat: sdk integration)
224
+ 3. **Task 3: Dark theme + layout** — `i7j8k9l` (feat: dark theme)
225
+
226
+ ## Files Created/Modified
227
+
228
+ - `src/App.tsx` — Root component with SdkProvider
229
+ - `src/lib/sdk-context.tsx` — SdkProvider + useSdk hook
230
+ - `src/lib/iframe.ts` — Iframe detection utility
231
+ - `src/components/Layout.tsx` — Dark theme shell
232
+ - `vite.config.ts` — Dev server on port 5180
233
+ - `tailwind.config.ts` — Dark theme configuration
234
+ - `tsconfig.json` — TypeScript strict mode
235
+ - `postcss.config.js` — Tailwind PostCSS setup
236
+
237
+ ## SDK Integration Notes
238
+
239
+ - SDK initialized once in SdkProvider via useRef to prevent re-instantiation
240
+ - SDK destroyed on unmount via cleanup in useEffect
241
+ - useSdk() throws if used outside SdkProvider — fail-fast pattern
242
+ - No SDK modules used yet — just core initialization
243
+
244
+ ## Decisions Made
245
+
246
+ - Used Tailwind instead of CSS modules — better dark theme support, matches Frontier OS
247
+ - Iframe detection uses window.self !== window.top — simple, reliable
248
+
249
+ ## Deviations from Plan
250
+
251
+ None — plan executed exactly as written
252
+
253
+ ## Verification Results
254
+
255
+ - [x] Build: pass
256
+ - [x] Dev server: pass on port 5180
257
+ - [x] TypeScript: pass (strict mode, no errors)
258
+ - [x] Dark theme: pass (no white backgrounds)
259
+ - [x] Iframe mode: pass (renders in Frontier OS)
260
+ - [x] Standalone mode: pass (shows fallback banner)
261
+
262
+ ## Next Phase Readiness
263
+
264
+ - Scaffold complete, ready for feature development
265
+ - SdkProvider available for module integration in Phase 2
266
+ - No blockers
267
+
268
+ ---
269
+ *Phase: 01-scaffold*
270
+ *Completed: 2026-03-27*
271
+ ```
272
+
273
+ </example>
@@ -0,0 +1,234 @@
1
+ <purpose>
2
+ Add a new feature as a new phase to the current milestone. Takes a feature description, infers SDK modules, calculates the next phase number, creates the phase directory, updates ROADMAP.md, manifest.json, and STATE.md. Quick and focused — gets you back into the discuss->plan->execute cycle.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+ </required_reading>
8
+
9
+ <available_agent_types>
10
+ Valid FOS subagent types (use exact names):
11
+ - fos-researcher — Researches existing Frontier OS apps for patterns
12
+ - fos-planner — Creates detailed execution plans from research + context
13
+ - fos-plan-checker — Reviews plan quality before execution
14
+ - fos-executor — Executes plan tasks, commits, creates SUMMARY.md
15
+ - fos-verifier — Verifies phase completion, checks quality gates
16
+ </available_agent_types>
17
+
18
+ <process>
19
+
20
+ <step name="gather_description" priority="first">
21
+ **Get the feature description.**
22
+
23
+ **If .frontier-app/ not found:**
24
+ ```
25
+ Error: No .frontier-app/ directory found.
26
+
27
+ Run `/fos:new-app` first to initialize your Frontier OS app.
28
+ ```
29
+ Exit workflow.
30
+
31
+ Check if `$ARGUMENTS` contains a feature description.
32
+
33
+ **If description provided in $ARGUMENTS:** Use it directly.
34
+ ```
35
+ Adding feature: "[description]"
36
+ ```
37
+
38
+ **If no description:** Use AskUserQuestion:
39
+ - header: "New Feature"
40
+ - question: "What feature do you want to add to [App Name]? Describe what it does."
41
+
42
+ **Store the description** for module inference.
43
+ </step>
44
+
45
+ <step name="infer_modules">
46
+ **Infer SDK modules for the new feature.**
47
+
48
+ ```bash
49
+ MODULES=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" infer-modules "<feature description>")
50
+ ```
51
+
52
+ Parse JSON for: `modules`, `details`, `permissions`, `moduleCount`.
53
+
54
+ **Compare with existing manifest modules:**
55
+ ```bash
56
+ MANIFEST=$(cat .frontier-app/manifest.json)
57
+ ```
58
+
59
+ Identify:
60
+ - **Already declared:** Modules in manifest that this feature also needs (no change)
61
+ - **New modules:** Modules inferred that aren't in the manifest (need to add)
62
+
63
+ ```
64
+ ## Feature Analysis
65
+
66
+ **Feature:** [description]
67
+
68
+ **SDK Modules needed:**
69
+ [If all modules already declared:]
70
+ All required modules already in manifest. No new permissions needed.
71
+
72
+ [If new modules needed:]
73
+ New modules required:
74
+ | Module | Why | New Permissions |
75
+ |--------|-----|-----------------|
76
+ | [Module] | [matched keywords] | [permissions to add] |
77
+ ```
78
+ </step>
79
+
80
+ <step name="calculate_phase_number">
81
+ **Find the next available phase number.**
82
+
83
+ Read ROADMAP.md to find the highest phase number:
84
+ ```bash
85
+ # Count existing phases from phases directory
86
+ EXISTING_PHASES=$(ls -d .frontier-app/phases/*/ 2>/dev/null | wc -l)
87
+ NEXT_PHASE=$((EXISTING_PHASES + 1))
88
+ ```
89
+
90
+ Also check ROADMAP.md for any planned-but-not-yet-created phases to avoid conflicts.
91
+
92
+ Generate the phase slug from the feature description:
93
+ ```bash
94
+ # Example: "Event Creation Form" -> "event-creation-form"
95
+ PHASE_SLUG=$(echo "$FEATURE_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-' | head -c 50)
96
+ PADDED=$(printf "%02d" $NEXT_PHASE)
97
+ PHASE_DIR=".frontier-app/phases/${PADDED}-${PHASE_SLUG}"
98
+ ```
99
+ </step>
100
+
101
+ <step name="create_phase">
102
+ **Create the phase directory.**
103
+
104
+ ```bash
105
+ mkdir -p "$PHASE_DIR"
106
+ ```
107
+
108
+ Generate 1-3 requirement IDs for this feature:
109
+ - Use existing requirement prefix pattern from REQUIREMENTS.md
110
+ - Or generate new REQ-XX IDs
111
+ </step>
112
+
113
+ <step name="update_roadmap">
114
+ **Add the new phase to ROADMAP.md.**
115
+
116
+ Read ROADMAP.md and append:
117
+
118
+ **In the phase list:**
119
+ ```markdown
120
+ - [ ] **Phase [N]: [Feature Name]** — [One-line description]
121
+ ```
122
+
123
+ **In Phase Details:**
124
+ ```markdown
125
+ ### Phase [N]: [Feature Name]
126
+ **Goal**: [What this phase delivers — one sentence]
127
+ **Depends on**: Phase [N-1] (or whichever phase it actually depends on)
128
+ **Requirements**: [REQ-XX, REQ-YY]
129
+ **Success Criteria** (what must be TRUE):
130
+ 1. [Observable behavior from user perspective]
131
+ 2. [Observable behavior from user perspective]
132
+ 3. [Observable behavior from user perspective]
133
+ **Plans**: TBD (created during /fos:plan)
134
+
135
+ Plans:
136
+ - (created during /fos:plan [N])
137
+ ```
138
+
139
+ **In Progress table:**
140
+ ```markdown
141
+ | [N]. [Feature Name] | 0/TBD | Not started | - |
142
+ ```
143
+
144
+ Update the "Last updated" footer.
145
+ </step>
146
+
147
+ <step name="update_manifest">
148
+ **Update manifest.json with new modules and permissions if needed.**
149
+
150
+ **If new modules were identified:**
151
+ ```bash
152
+ # Read current manifest, add new modules and permissions, write back
153
+ ```
154
+
155
+ Add to `modules` array: any new module names
156
+ Add to `permissions` array: any new permissions
157
+ Add to `phases` array: `{"number": N, "name": "[Feature Name]", "status": "not-started"}`
158
+
159
+ **If no new modules:** Only add the phase entry.
160
+ </step>
161
+
162
+ <step name="update_requirements">
163
+ **Add new requirements to REQUIREMENTS.md.**
164
+
165
+ Add a new section for the feature:
166
+ ```markdown
167
+ ### [Feature Name]
168
+
169
+ - [ ] **REQ-XX**: [Requirement 1 — user-centric, testable, atomic]
170
+ - [ ] **REQ-YY**: [Requirement 2]
171
+ ```
172
+
173
+ Update the traceability table:
174
+ ```markdown
175
+ | REQ-XX | Phase [N] | Pending |
176
+ | REQ-YY | Phase [N] | Pending |
177
+ ```
178
+
179
+ Update coverage counts.
180
+ </step>
181
+
182
+ <step name="update_state">
183
+ **Update STATE.md to point to the new feature phase.**
184
+
185
+ ```bash
186
+ node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update status "ready-to-discuss"
187
+ node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update phase "$NEXT_PHASE"
188
+ node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update next_action "/fos:discuss $NEXT_PHASE"
189
+ ```
190
+
191
+ Update STATE.md body:
192
+ - Last activity: [today] — Added feature: [feature name] as Phase [N]
193
+ - Session Continuity: next-command = /fos:discuss N
194
+
195
+ **Commit all changes:**
196
+ ```bash
197
+ git add .frontier-app/
198
+ git commit -m "feat: add Phase $NEXT_PHASE — [Feature Name]
199
+
200
+ Feature: [description]
201
+ [If new modules:] New SDK modules: [list]
202
+ [If new permissions:] New permissions: [count]
203
+ Phase: ${PADDED}-${PHASE_SLUG}"
204
+ ```
205
+ </step>
206
+
207
+ <step name="next_up">
208
+ **Display completion and next step.**
209
+
210
+ ```
211
+ ## Feature Added: [Feature Name]
212
+
213
+ Created Phase [N] in the current milestone.
214
+
215
+ [If new modules:]
216
+ Added SDK modules: [list]
217
+ New permissions: [list]
218
+
219
+ [If no new modules:]
220
+ No new SDK modules needed — existing modules cover this feature.
221
+
222
+ Phase directory: .frontier-app/phases/${PADDED}-${PHASE_SLUG}/
223
+ Requirements: [REQ-XX, REQ-YY]
224
+
225
+ ────────────────────────────────────────
226
+ Next up: `/fos:discuss [N]`
227
+ Discuss implementation decisions for [Feature Name] before planning.
228
+
229
+ Run `/clear` first to free your context window.
230
+ ────────────────────────────────────────
231
+ ```
232
+ </step>
233
+
234
+ </process>