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,258 @@
1
+ <purpose>
2
+ Archive the current milestone and start a new one. Gathers new feature descriptions, infers SDK modules, creates new phases in the roadmap, and updates all state files. Transitions from v1 to v2 (or vN to vN+1).
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="load_current_state" priority="first">
21
+ **Read current project state.**
22
+
23
+ ```bash
24
+ # Load all relevant state
25
+ STATE_JSON=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state json)
26
+ MANIFEST=$(cat .frontier-app/manifest.json)
27
+ ```
28
+
29
+ Read these files:
30
+ 1. `.frontier-app/ROADMAP.md` — Current phases, progress, completion status
31
+ 2. `.frontier-app/STATE.md` — Current milestone, position
32
+ 3. `.frontier-app/manifest.json` — Current modules and permissions
33
+ 4. `.frontier-app/PROJECT.md` — App vision, SDK modules, decisions
34
+
35
+ **If .frontier-app/ not found:**
36
+ ```
37
+ Error: No .frontier-app/ directory found.
38
+
39
+ Run `/fos:new-app` first to initialize your Frontier OS app.
40
+ ```
41
+ Exit workflow.
42
+
43
+ Extract:
44
+ - Current milestone version (e.g., "v1")
45
+ - Total phases and their completion status
46
+ - Current SDK modules and permissions
47
+ - App name and description
48
+ </step>
49
+
50
+ <step name="archive_milestone">
51
+ **Archive the completed milestone.**
52
+
53
+ Create or append to `.frontier-app/MILESTONES.md`:
54
+
55
+ ```markdown
56
+ # Milestone History
57
+
58
+ ## [Current Version] — Completed [date]
59
+
60
+ **Phases:** [count] phases, [count] plans
61
+ **Duration:** [first commit to last commit]
62
+ **SDK Modules:** [list]
63
+
64
+ ### Phase Summary
65
+
66
+ | Phase | Name | Plans | Status |
67
+ |-------|------|-------|--------|
68
+ | 1 | Scaffold + SDK Core | 1/1 | Complete |
69
+ | 2 | [Name] | N/N | Complete |
70
+ | ... | ... | ... | ... |
71
+
72
+ ### Key Decisions
73
+ [Aggregated from SUMMARY.md files and PROJECT.md Key Decisions table]
74
+
75
+ ### What Shipped
76
+ [One paragraph summary of what was built in this milestone]
77
+
78
+ ---
79
+ ```
80
+
81
+ ```bash
82
+ git add .frontier-app/MILESTONES.md
83
+ git commit -m "docs: archive milestone [version] — [phase_count] phases complete"
84
+ ```
85
+ </step>
86
+
87
+ <step name="gather_new_features">
88
+ **Get feature descriptions for the new milestone.**
89
+
90
+ Check if `$ARGUMENTS` contains feature descriptions.
91
+
92
+ **If description provided in $ARGUMENTS:** Use it directly.
93
+
94
+ **If no description:** Use AskUserQuestion:
95
+ - header: "New Milestone"
96
+ - question: "What features should [App Name] [next version] include? Describe the new capabilities you want to add."
97
+
98
+ Parse the response into individual features. Each feature becomes a candidate for a phase.
99
+ </step>
100
+
101
+ <step name="infer_new_modules">
102
+ **Infer SDK modules for the new features.**
103
+
104
+ ```bash
105
+ MODULES=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" infer-modules "<new feature descriptions>")
106
+ ```
107
+
108
+ Compare with existing modules from manifest:
109
+ - **Already have:** Modules in current manifest that are still needed
110
+ - **New modules:** Modules inferred from new features not in current manifest
111
+ - **Removed modules:** Modules in current manifest not needed by any feature (old or new) — rare
112
+
113
+ ```
114
+ ## New Milestone: SDK Module Changes
115
+
116
+ **Keeping:** [existing modules still in use]
117
+ **Adding:** [new modules required by new features]
118
+ [If any removed:] **No longer needed:** [removed modules]
119
+
120
+ New permissions required: [list new permissions]
121
+ ```
122
+ </step>
123
+
124
+ <step name="create_new_phases">
125
+ **Create new phases in the roadmap.**
126
+
127
+ Calculate the next phase number from the highest existing phase:
128
+ ```bash
129
+ # Find highest phase number in phases directory
130
+ HIGHEST=$(ls .frontier-app/phases/ 2>/dev/null | sort -r | head -1 | cut -d- -f1)
131
+ NEXT_PHASE=$((10#$HIGHEST + 1))
132
+ ```
133
+
134
+ Generate new phases from the features:
135
+ - Group related features into coherent phases
136
+ - Each phase delivers something testable
137
+ - Keep to 2-5 new phases per milestone
138
+ - Order by dependency
139
+
140
+ **New version number:**
141
+ ```
142
+ CURRENT_VERSION="v1" # from manifest
143
+ NEW_VERSION="v2" # increment
144
+ ```
145
+
146
+ Present the plan:
147
+ ```
148
+ ## [New Version] Roadmap
149
+
150
+ Starting from Phase [N]:
151
+
152
+ - [ ] **Phase [N]: [Feature Name]** — [Description]
153
+ - [ ] **Phase [N+1]: [Feature Name]** — [Description]
154
+ - [ ] **Phase [N+2]: [Feature Name]** — [Description]
155
+ ```
156
+
157
+ Use AskUserQuestion:
158
+ - header: "Confirm"
159
+ - question: "Does this milestone plan look right?"
160
+ - options:
161
+ - "Looks good" — Create the phases
162
+ - "Change something" — Adjust phases
163
+ - "Cancel" — Don't start new milestone yet
164
+ </step>
165
+
166
+ <step name="update_all_state_files">
167
+ **Update ROADMAP.md, manifest.json, STATE.md, PROJECT.md.**
168
+
169
+ **1. ROADMAP.md:**
170
+ Add new phase section under `## [New Version] Phases`:
171
+ - Keep completed phases from previous milestones (marked as done)
172
+ - Add new phase details with goals, dependencies, requirements, success criteria
173
+ - Update progress table with new phases
174
+
175
+ **2. manifest.json:**
176
+ ```json
177
+ {
178
+ "milestone": "[new version]",
179
+ "modules": [/* updated module list */],
180
+ "permissions": [/* updated permissions list */],
181
+ "phases": [
182
+ /* existing completed phases */,
183
+ {"number": N, "name": "[Feature]", "status": "not-started"},
184
+ /* ... new phases ... */
185
+ ]
186
+ }
187
+ ```
188
+
189
+ **3. REQUIREMENTS.md:**
190
+ Add new requirements for the new milestone:
191
+ - Keep completed requirements from previous milestone (marked as done)
192
+ - Add new REQ-XX entries for new features
193
+ - Update traceability table
194
+
195
+ **4. STATE.md:**
196
+ ```bash
197
+ node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update milestone "[new version]"
198
+ node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update phase "$NEXT_PHASE"
199
+ node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update status "ready-to-discuss"
200
+ node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update next_action "/fos:discuss $NEXT_PHASE"
201
+ ```
202
+
203
+ Update body:
204
+ - Current Position: Phase [N] of [total], [new version]
205
+ - App Reference: Update SDK modules list
206
+ - Clear Blockers (fresh milestone)
207
+ - Last activity: [today] — Started [new version] milestone
208
+
209
+ **5. PROJECT.md:**
210
+ - Update SDK Modules table with new modules
211
+ - Update "What This Is" if the app's scope has grown
212
+ - Log milestone transition in Key Decisions table
213
+
214
+ **Create phase directories:**
215
+ ```bash
216
+ for PHASE in $NEW_PHASES; do
217
+ PADDED=$(printf "%02d" $PHASE_NUM)
218
+ mkdir -p ".frontier-app/phases/${PADDED}-${PHASE_SLUG}"
219
+ done
220
+ ```
221
+
222
+ **Commit everything:**
223
+ ```bash
224
+ git add .frontier-app/
225
+ git commit -m "feat: start [new version] milestone — [phase_count] new phases
226
+
227
+ New features: [brief list]
228
+ New modules: [if any]
229
+ Phases: [N] through [M]"
230
+ ```
231
+ </step>
232
+
233
+ <step name="next_up">
234
+ **Display completion and next step.**
235
+
236
+ ```
237
+ ## Milestone [New Version] Started
238
+
239
+ **[App Name]** is entering [new version] with [count] new phases.
240
+
241
+ New phases:
242
+ - Phase [N]: [Name]
243
+ - Phase [N+1]: [Name]
244
+ - Phase [N+2]: [Name]
245
+
246
+ [If new modules:] New SDK modules: [list]
247
+ [If new permissions:] New permissions: [count] added
248
+
249
+ ────────────────────────────────────────
250
+ Next up: `/fos:discuss [first-new-phase]`
251
+ Discuss Phase [N]: [Name] — capture implementation decisions.
252
+
253
+ Run `/clear` first to free your context window.
254
+ ────────────────────────────────────────
255
+ ```
256
+ </step>
257
+
258
+ </process>
@@ -0,0 +1,157 @@
1
+ <purpose>
2
+ Auto-route to the next logical step in the FOS workflow. Reads project state and existing artifacts to determine what's needed: discuss, plan, execute, or ship. Tells the user exactly which command to run next and why.
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
+ This workflow does not spawn subagents — it reads state and routes.
11
+ </available_agent_types>
12
+
13
+ <process>
14
+
15
+ <step name="check_project_exists" priority="first">
16
+ **Verify .frontier-app/ exists.**
17
+
18
+ ```bash
19
+ test -d .frontier-app && echo "exists" || echo "missing"
20
+ ```
21
+
22
+ **If missing:**
23
+ ```
24
+ No Frontier OS app found in this directory.
25
+
26
+ To get started, run:
27
+
28
+ ────────────────────────────────────────
29
+ Next up: `/fos:new-app`
30
+ Initialize a new Frontier OS app from a natural language description.
31
+
32
+ Run `/clear` first to free your context window.
33
+ ────────────────────────────────────────
34
+ ```
35
+ Exit workflow.
36
+ </step>
37
+
38
+ <step name="read_state">
39
+ **Load project state.**
40
+
41
+ ```bash
42
+ STATE_JSON=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state json)
43
+ ```
44
+
45
+ Parse for: `milestone`, `phase`, `plan`, `status`, `next_action`.
46
+
47
+ Also read:
48
+ - `.frontier-app/STATE.md` — Full state body for additional context
49
+ - `.frontier-app/ROADMAP.md` — Phase list and completion status
50
+ - `.frontier-app/manifest.json` — Phase definitions
51
+
52
+ **If STATE.md has a `next_action` field:** This is the fastest path — it was set by the previous workflow.
53
+ </step>
54
+
55
+ <step name="determine_position">
56
+ **Analyze artifacts to determine exactly where the project stands.**
57
+
58
+ For the current phase (from STATE.md `phase` field):
59
+
60
+ ```bash
61
+ PADDED=$(printf "%02d" $CURRENT_PHASE)
62
+ PHASE_DIR=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" find-phase "$CURRENT_PHASE" --raw 2>/dev/null)
63
+
64
+ # Check what artifacts exist
65
+ HAS_CONTEXT="false"
66
+ HAS_RESEARCH="false"
67
+ HAS_PLANS="false"
68
+ PLAN_COUNT=0
69
+ SUMMARY_COUNT=0
70
+ ALL_PLANS_DONE="false"
71
+
72
+ if [ -n "$PHASE_DIR" ]; then
73
+ # Context file
74
+ test -f "$PHASE_DIR/${PADDED}-CONTEXT.md" && HAS_CONTEXT="true"
75
+
76
+ # Research file
77
+ test -f "$PHASE_DIR/${PADDED}-RESEARCH.md" && HAS_RESEARCH="true"
78
+
79
+ # Plan files
80
+ PLAN_COUNT=$(ls "$PHASE_DIR/"*-PLAN.md 2>/dev/null | wc -l | tr -d ' ')
81
+ test "$PLAN_COUNT" -gt 0 && HAS_PLANS="true"
82
+
83
+ # Summary files (completed plans)
84
+ SUMMARY_COUNT=$(ls "$PHASE_DIR/"*-SUMMARY.md 2>/dev/null | wc -l | tr -d ' ')
85
+
86
+ # Check if all plans are done
87
+ if [ "$PLAN_COUNT" -gt 0 ] && [ "$SUMMARY_COUNT" -ge "$PLAN_COUNT" ]; then
88
+ ALL_PLANS_DONE="true"
89
+ fi
90
+ fi
91
+ ```
92
+
93
+ **Decision tree:**
94
+
95
+ 1. **Status is "shipped" or "milestone-complete":**
96
+ -> Suggest `/fos:new-milestone` or `/fos:add-feature`
97
+
98
+ 2. **Phase directory doesn't exist:**
99
+ -> Suggest `/fos:discuss $CURRENT_PHASE` (need to start from scratch)
100
+
101
+ 3. **No CONTEXT.md (and phase > 1):**
102
+ -> Suggest `/fos:discuss $CURRENT_PHASE`
103
+
104
+ 4. **No PLAN.md files:**
105
+ -> Suggest `/fos:plan $CURRENT_PHASE`
106
+
107
+ 5. **Plans exist but not all have SUMMARY.md (incomplete execution):**
108
+ -> Suggest `/fos:execute $CURRENT_PHASE`
109
+
110
+ 6. **All plans have SUMMARY.md (phase complete):**
111
+ -> Check if more phases exist in ROADMAP.md
112
+ -> If yes: Advance to next phase, suggest `/fos:discuss $NEXT_PHASE`
113
+ -> If no: Suggest `/fos:ship`
114
+
115
+ 7. **Fallback — use STATE.md next_action field:**
116
+ -> Trust the last workflow's suggestion
117
+ </step>
118
+
119
+ <step name="display_suggestion">
120
+ **Show the suggestion with explanation.**
121
+
122
+ ```
123
+ ## Current Position
124
+
125
+ **App:** [App Name]
126
+ **Milestone:** [version]
127
+ **Phase [N]:** [Phase Name]
128
+ **Status:** [human-readable status]
129
+
130
+ [Explanation of why this is the next step:]
131
+
132
+ [Example for no context:]
133
+ Phase [N] has no context decisions yet. The discuss step captures your
134
+ implementation preferences before planning begins — what layout you want,
135
+ how interactions should work, which SDK methods to use.
136
+
137
+ [Example for no plans:]
138
+ Phase [N] has context but no execution plans. The plan step researches
139
+ existing Frontier OS apps for patterns and creates detailed task plans.
140
+
141
+ [Example for incomplete execution:]
142
+ Phase [N] has [plan_count] plans, but [remaining] haven't been executed yet.
143
+ Continuing execution will build the remaining features.
144
+
145
+ [Example for all phases done:]
146
+ All [count] phases are complete! Your app is ready to deploy.
147
+
148
+ ────────────────────────────────────────
149
+ Next up: `/fos:[command] [args]`
150
+ [One-line description of what it does]
151
+
152
+ Run `/clear` first to free your context window.
153
+ ────────────────────────────────────────
154
+ ```
155
+ </step>
156
+
157
+ </process>