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.
- package/README.md +92 -0
- package/agents/fos-executor.md +460 -0
- package/agents/fos-plan-checker.md +386 -0
- package/agents/fos-planner.md +416 -0
- package/agents/fos-researcher.md +358 -0
- package/agents/fos-verifier.md +491 -0
- package/bin/fos-tools.cjs +794 -0
- package/bin/install.js +234 -0
- package/commands/fos/add-feature.md +29 -0
- package/commands/fos/discuss.md +31 -0
- package/commands/fos/execute.md +35 -0
- package/commands/fos/new-app.md +39 -0
- package/commands/fos/new-milestone.md +28 -0
- package/commands/fos/next.md +29 -0
- package/commands/fos/plan.md +37 -0
- package/commands/fos/ship.md +29 -0
- package/commands/fos/status.md +22 -0
- package/package.json +30 -0
- package/references/app-patterns.md +501 -0
- package/references/deployment.md +395 -0
- package/references/module-inference.md +349 -0
- package/references/sdk-surface.md +1622 -0
- package/references/verification-rules.md +404 -0
- package/templates/app/gitignore +25 -0
- package/templates/app/index.css +111 -0
- package/templates/app/index.html +19 -0
- package/templates/app/layout.tsx +45 -0
- package/templates/app/main-router.tsx +17 -0
- package/templates/app/main-simple.tsx +19 -0
- package/templates/app/package.json +36 -0
- package/templates/app/postcss.config.js +5 -0
- package/templates/app/router.tsx +22 -0
- package/templates/app/sdk-context.tsx +33 -0
- package/templates/app/test-setup.ts +19 -0
- package/templates/app/tsconfig.json +22 -0
- package/templates/app/vercel.json +127 -0
- package/templates/app/vite.config.ts +15 -0
- package/templates/state/context.md +248 -0
- package/templates/state/manifest.json +11 -0
- package/templates/state/plan.md +187 -0
- package/templates/state/project.md +118 -0
- package/templates/state/requirements.md +133 -0
- package/templates/state/roadmap.md +129 -0
- package/templates/state/state.md +131 -0
- package/templates/state/summary.md +273 -0
- package/workflows/add-feature.md +234 -0
- package/workflows/discuss.md +310 -0
- package/workflows/execute-plan.md +222 -0
- package/workflows/execute.md +338 -0
- package/workflows/new-app.md +331 -0
- package/workflows/new-milestone.md +258 -0
- package/workflows/next.md +157 -0
- package/workflows/plan.md +310 -0
- package/workflows/ship.md +296 -0
- package/workflows/status.md +145 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Execute all plans in a phase using wave-based execution. Orchestrator stays lean — delegates plan execution to subagents, each getting a fresh context window with the full execute-plan workflow. After all plans complete, spawns a verifier to confirm the phase delivers what it promised.
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<core_principle>
|
|
6
|
+
Orchestrator coordinates, not executes. Each subagent loads the full execute-plan context. Orchestrator: discover plans -> analyze deps -> group waves -> spawn agents -> collect results -> verify.
|
|
7
|
+
</core_principle>
|
|
8
|
+
|
|
9
|
+
<required_reading>
|
|
10
|
+
Read STATE.md before any operation to load project context.
|
|
11
|
+
</required_reading>
|
|
12
|
+
|
|
13
|
+
<available_agent_types>
|
|
14
|
+
Valid FOS subagent types (use exact names):
|
|
15
|
+
- fos-researcher — Researches existing Frontier OS apps for patterns
|
|
16
|
+
- fos-planner — Creates detailed execution plans from research + context
|
|
17
|
+
- fos-plan-checker — Reviews plan quality before execution
|
|
18
|
+
- fos-executor — Executes plan tasks, commits, creates SUMMARY.md
|
|
19
|
+
- fos-verifier — Verifies phase completion, checks quality gates
|
|
20
|
+
</available_agent_types>
|
|
21
|
+
|
|
22
|
+
<process>
|
|
23
|
+
|
|
24
|
+
<step name="initialize" priority="first">
|
|
25
|
+
**Phase number from argument (required).**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
INIT=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" init execute "$PHASE")
|
|
29
|
+
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Parse JSON for: `phase`, `phase_dir`, `plans`, `summaries`, `incomplete_plans`, `all_complete`, `manifest`, `state`, `project_path`, `roadmap_path`, `template_home`, `version`.
|
|
33
|
+
|
|
34
|
+
**If .frontier-app/ not found:**
|
|
35
|
+
```
|
|
36
|
+
Error: No .frontier-app/ directory found.
|
|
37
|
+
|
|
38
|
+
Run `/fos:new-app` first to initialize your Frontier OS app.
|
|
39
|
+
```
|
|
40
|
+
Exit workflow.
|
|
41
|
+
|
|
42
|
+
**If `phase_dir` is null:**
|
|
43
|
+
```
|
|
44
|
+
Error: Phase [N] directory not found.
|
|
45
|
+
|
|
46
|
+
Run `/fos:plan [N]` first to create execution plans.
|
|
47
|
+
```
|
|
48
|
+
Exit workflow.
|
|
49
|
+
|
|
50
|
+
**If `plans` is empty:**
|
|
51
|
+
```
|
|
52
|
+
Error: No plans found in Phase [N].
|
|
53
|
+
|
|
54
|
+
Run `/fos:plan [N]` first to create execution plans.
|
|
55
|
+
```
|
|
56
|
+
Exit workflow.
|
|
57
|
+
|
|
58
|
+
**If `all_complete` is true:**
|
|
59
|
+
```
|
|
60
|
+
Phase [N] is already fully executed — all plans have SUMMARY.md files.
|
|
61
|
+
|
|
62
|
+
Run `/fos:status` to see project state, or `/fos:next` for the next step.
|
|
63
|
+
```
|
|
64
|
+
Exit workflow.
|
|
65
|
+
|
|
66
|
+
Report status:
|
|
67
|
+
```
|
|
68
|
+
## Phase [N]: [Name]
|
|
69
|
+
|
|
70
|
+
Found [total] plan(s), [incomplete] remaining to execute.
|
|
71
|
+
[If some complete: "[complete] plan(s) already done — resuming from where we left off."]
|
|
72
|
+
```
|
|
73
|
+
</step>
|
|
74
|
+
|
|
75
|
+
<step name="discover_and_group_plans">
|
|
76
|
+
**Read all plan files and group into execution waves.**
|
|
77
|
+
|
|
78
|
+
For each plan file in `incomplete_plans`:
|
|
79
|
+
1. Read the plan file
|
|
80
|
+
2. Parse frontmatter for: `wave`, `depends_on`, `autonomous`, `files_modified`
|
|
81
|
+
3. Parse `<objective>` for the plan description
|
|
82
|
+
|
|
83
|
+
**Group plans by wave number:**
|
|
84
|
+
- Wave 1: Plans with `depends_on: []` or `wave: 1`
|
|
85
|
+
- Wave 2: Plans with `wave: 2` (depends on Wave 1 plans)
|
|
86
|
+
- Wave 3+: Subsequent waves
|
|
87
|
+
|
|
88
|
+
**If no wave field in frontmatter:** Default to Wave 1 (no dependencies).
|
|
89
|
+
|
|
90
|
+
**Report execution plan:**
|
|
91
|
+
```
|
|
92
|
+
## Execution Plan
|
|
93
|
+
|
|
94
|
+
**Phase [N]: [Name]** — [count] plans across [wave_count] wave(s)
|
|
95
|
+
|
|
96
|
+
| Wave | Plans | What It Builds |
|
|
97
|
+
|------|-------|----------------|
|
|
98
|
+
| 1 | 01-01, 01-02 | [from plan objectives, 3-8 words] |
|
|
99
|
+
| 2 | 01-03 | [from plan objectives, 3-8 words] |
|
|
100
|
+
```
|
|
101
|
+
</step>
|
|
102
|
+
|
|
103
|
+
<step name="execute_waves">
|
|
104
|
+
**Execute each wave in sequence. Plans within a wave run in parallel.**
|
|
105
|
+
|
|
106
|
+
**For each wave:**
|
|
107
|
+
|
|
108
|
+
1. **Describe what's being built (BEFORE spawning):**
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
---
|
|
112
|
+
## Wave [N]
|
|
113
|
+
|
|
114
|
+
**[Plan ID]: [Plan Name]**
|
|
115
|
+
[2-3 sentences: what this builds, which SDK modules, why it matters]
|
|
116
|
+
|
|
117
|
+
Spawning [count] agent(s)...
|
|
118
|
+
---
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
2. **Spawn fos-executor per plan:**
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
Task(
|
|
125
|
+
subagent_type="fos-executor",
|
|
126
|
+
prompt="
|
|
127
|
+
<objective>
|
|
128
|
+
Execute plan [plan_number] of Phase [phase_number]-[phase_name].
|
|
129
|
+
Commit each task atomically. Create SUMMARY.md when done. Update STATE.md.
|
|
130
|
+
</objective>
|
|
131
|
+
|
|
132
|
+
<execution_context>
|
|
133
|
+
@$HOME/.claude/frontier-os-app-builder/workflows/execute-plan.md
|
|
134
|
+
@$HOME/.claude/frontier-os-app-builder/templates/state/summary.md
|
|
135
|
+
@$HOME/.claude/frontier-os-app-builder/references/sdk-surface.md
|
|
136
|
+
@$HOME/.claude/frontier-os-app-builder/references/app-patterns.md
|
|
137
|
+
@$HOME/.claude/frontier-os-app-builder/references/verification-rules.md
|
|
138
|
+
</execution_context>
|
|
139
|
+
|
|
140
|
+
<files_to_read>
|
|
141
|
+
Read these files at execution start using the Read tool:
|
|
142
|
+
- $PHASE_DIR/[plan_file] (The plan to execute)
|
|
143
|
+
- .frontier-app/PROJECT.md (App vision, SDK modules)
|
|
144
|
+
- .frontier-app/manifest.json (Permissions)
|
|
145
|
+
- .frontier-app/STATE.md (Current state)
|
|
146
|
+
- $PHASE_DIR/$PADDED-CONTEXT.md (User decisions, if exists)
|
|
147
|
+
- $PHASE_DIR/$PADDED-RESEARCH.md (Research findings, if exists)
|
|
148
|
+
</files_to_read>
|
|
149
|
+
|
|
150
|
+
<success_criteria>
|
|
151
|
+
- [ ] All tasks executed
|
|
152
|
+
- [ ] Each task committed individually
|
|
153
|
+
- [ ] SUMMARY.md created in phase directory
|
|
154
|
+
- [ ] Build succeeds (npm run build)
|
|
155
|
+
- [ ] No TypeScript errors (npx tsc --noEmit)
|
|
156
|
+
- [ ] Dark theme verified
|
|
157
|
+
</success_criteria>
|
|
158
|
+
"
|
|
159
|
+
)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
3. **Wait for all agents in wave to complete before starting next wave.**
|
|
163
|
+
|
|
164
|
+
**Completion verification (per plan):**
|
|
165
|
+
```bash
|
|
166
|
+
SUMMARY_FILE="$PHASE_DIR/[plan_prefix]-SUMMARY.md"
|
|
167
|
+
test -f "$SUMMARY_FILE" && echo "complete" || echo "incomplete"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
If SUMMARY.md exists and git log shows recent commits for this plan: treat as complete.
|
|
171
|
+
If SUMMARY.md missing after agent returns: report as failed.
|
|
172
|
+
|
|
173
|
+
4. **Report wave completion:**
|
|
174
|
+
|
|
175
|
+
For each completed plan, read its SUMMARY.md and extract:
|
|
176
|
+
- One-liner description
|
|
177
|
+
- Files created/modified
|
|
178
|
+
- Any deviations from plan
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
---
|
|
182
|
+
## Wave [N] Complete
|
|
183
|
+
|
|
184
|
+
**[Plan ID]: [Plan Name]**
|
|
185
|
+
[What was built — from SUMMARY.md]
|
|
186
|
+
[Notable deviations, if any]
|
|
187
|
+
|
|
188
|
+
[If more waves: what this enables for next wave]
|
|
189
|
+
---
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
5. **Handle failures:**
|
|
193
|
+
|
|
194
|
+
If a plan fails:
|
|
195
|
+
- Report which plan failed and why (from agent output or error)
|
|
196
|
+
- Ask: "Retry this plan?" / "Skip and continue?" / "Stop execution?"
|
|
197
|
+
- If retry: re-spawn the executor for that plan
|
|
198
|
+
- If skip: note the gap for the verifier
|
|
199
|
+
- If stop: save state and exit
|
|
200
|
+
</step>
|
|
201
|
+
|
|
202
|
+
<step name="spawn_verifier">
|
|
203
|
+
**After all waves complete: verify the phase.**
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
Task(
|
|
207
|
+
subagent_type="fos-verifier",
|
|
208
|
+
prompt="
|
|
209
|
+
<objective>
|
|
210
|
+
Verify Phase [N]: [Name] delivers what the roadmap promised.
|
|
211
|
+
Check all success criteria from ROADMAP.md are met.
|
|
212
|
+
Check all SUMMARY.md files for issues.
|
|
213
|
+
Run structural and permission validation.
|
|
214
|
+
</objective>
|
|
215
|
+
|
|
216
|
+
<files_to_read>
|
|
217
|
+
Read these files at execution start using the Read tool:
|
|
218
|
+
- .frontier-app/ROADMAP.md (Phase success criteria)
|
|
219
|
+
- .frontier-app/PROJECT.md (App constraints)
|
|
220
|
+
- .frontier-app/manifest.json (Permissions)
|
|
221
|
+
- All SUMMARY.md files in $PHASE_DIR/
|
|
222
|
+
</files_to_read>
|
|
223
|
+
|
|
224
|
+
<verification_commands>
|
|
225
|
+
Run these checks:
|
|
226
|
+
- node '$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs' validate structure
|
|
227
|
+
- node '$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs' validate permissions
|
|
228
|
+
- npx tsc --noEmit (if app source exists)
|
|
229
|
+
- npm run build (if package.json exists)
|
|
230
|
+
</verification_commands>
|
|
231
|
+
|
|
232
|
+
<output>
|
|
233
|
+
Return structured result:
|
|
234
|
+
- verdict: PASS or FAIL
|
|
235
|
+
- criteria_results: each success criterion with pass/fail
|
|
236
|
+
- gaps: list of gaps found (if any)
|
|
237
|
+
- suggestions: optional improvements
|
|
238
|
+
</output>
|
|
239
|
+
"
|
|
240
|
+
)
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**If verifier returns FAIL:**
|
|
244
|
+
```
|
|
245
|
+
## Verification Issues
|
|
246
|
+
|
|
247
|
+
The verifier found [count] issue(s):
|
|
248
|
+
|
|
249
|
+
1. [Issue description]
|
|
250
|
+
2. [Issue description]
|
|
251
|
+
|
|
252
|
+
Options:
|
|
253
|
+
- Generate fix plans for these gaps
|
|
254
|
+
- Address manually and re-verify
|
|
255
|
+
- Accept and move on (gaps noted)
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Use AskUserQuestion to let user decide.
|
|
259
|
+
|
|
260
|
+
**If "Generate fix plans":** Create gap-closure plans in the phase directory and re-execute.
|
|
261
|
+
</step>
|
|
262
|
+
|
|
263
|
+
<step name="update_state_and_roadmap">
|
|
264
|
+
**Update STATE.md and ROADMAP.md.**
|
|
265
|
+
|
|
266
|
+
**Determine next phase:**
|
|
267
|
+
- Read ROADMAP.md for total phase count
|
|
268
|
+
- If current phase < total phases: next is discuss for phase N+1
|
|
269
|
+
- If current phase = total phases: next is ship
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
# Update state
|
|
273
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update status "phase-complete"
|
|
274
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update phase "$PHASE"
|
|
275
|
+
|
|
276
|
+
# Set next action based on whether more phases remain
|
|
277
|
+
if [ "$PHASE" -lt "$TOTAL_PHASES" ]; then
|
|
278
|
+
NEXT_PHASE=$((PHASE + 1))
|
|
279
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update next_action "/fos:discuss $NEXT_PHASE"
|
|
280
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update status "ready-to-discuss"
|
|
281
|
+
else
|
|
282
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update next_action "/fos:ship"
|
|
283
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update status "milestone-complete"
|
|
284
|
+
fi
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Update ROADMAP.md:**
|
|
288
|
+
- Mark phase plans as complete in the progress table
|
|
289
|
+
- Update phase status to "Complete" (or "Partial" if gaps)
|
|
290
|
+
- Add completion date
|
|
291
|
+
|
|
292
|
+
**Update STATE.md body:**
|
|
293
|
+
- Current Position: Advance to next phase or "Ready to ship"
|
|
294
|
+
- Update progress bar
|
|
295
|
+
- Update metrics (plans completed, duration)
|
|
296
|
+
- Last activity: [today] — Executed Phase [N]: [Name]
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
git add .frontier-app/
|
|
300
|
+
git commit -m "docs: Phase $PHASE complete — [plan_count] plans executed
|
|
301
|
+
|
|
302
|
+
Verification: [PASS/FAIL]
|
|
303
|
+
Next: [/fos:discuss N+1 or /fos:ship]"
|
|
304
|
+
```
|
|
305
|
+
</step>
|
|
306
|
+
|
|
307
|
+
<step name="next_up">
|
|
308
|
+
**Display completion and next step.**
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
## Phase [N]: [Name] — Complete
|
|
312
|
+
|
|
313
|
+
Executed [plan_count] plan(s) across [wave_count] wave(s).
|
|
314
|
+
Verification: [PASS / PASS with notes / FAIL with gaps]
|
|
315
|
+
|
|
316
|
+
Plans completed:
|
|
317
|
+
- [Plan 01]: [one-liner from SUMMARY.md]
|
|
318
|
+
- [Plan 02]: [one-liner from SUMMARY.md]
|
|
319
|
+
|
|
320
|
+
[If more phases remain:]
|
|
321
|
+
────────────────────────────────────────
|
|
322
|
+
Next up: `/fos:discuss [N+1]`
|
|
323
|
+
Discuss Phase [N+1]: [Name] — capture implementation decisions before planning.
|
|
324
|
+
|
|
325
|
+
Run `/clear` first to free your context window.
|
|
326
|
+
────────────────────────────────────────
|
|
327
|
+
|
|
328
|
+
[If all phases complete:]
|
|
329
|
+
────────────────────────────────────────
|
|
330
|
+
Next up: `/fos:ship`
|
|
331
|
+
Deploy to Vercel and register in the Frontier app store.
|
|
332
|
+
|
|
333
|
+
Run `/clear` first to free your context window.
|
|
334
|
+
────────────────────────────────────────
|
|
335
|
+
```
|
|
336
|
+
</step>
|
|
337
|
+
|
|
338
|
+
</process>
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Initialize a new Frontier OS app through guided flow: gather a natural language description, infer SDK modules, ask domain-specific questions, create phased roadmap and all project state files. This is the most leveraged moment in any app — deep questioning here means the right SDK modules, the right phases, the right architecture from day one.
|
|
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="setup" priority="first">
|
|
21
|
+
**MANDATORY FIRST STEP — Execute before any user interaction:**
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
INIT=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" init new-app)
|
|
25
|
+
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Parse JSON for: `project_exists`, `has_git`, `cwd`, `template_home`, `version`.
|
|
29
|
+
|
|
30
|
+
**If `project_exists` is true:**
|
|
31
|
+
```
|
|
32
|
+
Error: This directory already has a .frontier-app/ directory.
|
|
33
|
+
|
|
34
|
+
If you want to see your project status: /fos:status
|
|
35
|
+
If you want to continue building: /fos:next
|
|
36
|
+
If you want to start fresh: delete .frontier-app/ and run /fos:new-app again
|
|
37
|
+
```
|
|
38
|
+
Exit workflow.
|
|
39
|
+
|
|
40
|
+
**If `has_git` is false:** Will initialize git after scaffolding (step 9).
|
|
41
|
+
</step>
|
|
42
|
+
|
|
43
|
+
<step name="gather_description">
|
|
44
|
+
**Get the app description.**
|
|
45
|
+
|
|
46
|
+
Check if `$ARGUMENTS` contains a description (any text that isn't just flags).
|
|
47
|
+
|
|
48
|
+
**If description provided in $ARGUMENTS:** Use it directly. Display it back:
|
|
49
|
+
```
|
|
50
|
+
Building: "[description from arguments]"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**If no description:** Use AskUserQuestion:
|
|
54
|
+
- header: "App Idea"
|
|
55
|
+
- question: "What Frontier OS app do you want to build? Describe it in plain language — what it does, who uses it, and what Frontier features it needs."
|
|
56
|
+
|
|
57
|
+
**Store the description** for use in subsequent steps.
|
|
58
|
+
</step>
|
|
59
|
+
|
|
60
|
+
<step name="infer_modules">
|
|
61
|
+
**Infer SDK modules from the description.**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
MODULES=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" infer-modules "<description>")
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Parse JSON for: `modules`, `details`, `permissions`, `moduleCount`.
|
|
68
|
+
|
|
69
|
+
**Present the inferred modules to the user:**
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
## SDK Modules Detected
|
|
73
|
+
|
|
74
|
+
Based on your description, your app will use these Frontier SDK modules:
|
|
75
|
+
|
|
76
|
+
| Module | Why | Key Methods |
|
|
77
|
+
|--------|-----|-------------|
|
|
78
|
+
| [Module] | [Matched keywords from description] | [suggestedMethods from details] |
|
|
79
|
+
|
|
80
|
+
**Always included:**
|
|
81
|
+
- Storage — App state persistence (preferences, drafts, etc.)
|
|
82
|
+
- Chain — Network configuration and contract addresses
|
|
83
|
+
|
|
84
|
+
**Permissions requested:** [count] permissions across [moduleCount] modules
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This is informational — the user will confirm or adjust in step 5.
|
|
88
|
+
</step>
|
|
89
|
+
|
|
90
|
+
<step name="smart_questions">
|
|
91
|
+
**Ask domain-specific questions based on inferred modules.**
|
|
92
|
+
|
|
93
|
+
Generate 2-5 questions based on WHICH modules were inferred. These are DOMAIN questions about the user's app, NOT SDK implementation questions.
|
|
94
|
+
|
|
95
|
+
**Question bank by module:**
|
|
96
|
+
|
|
97
|
+
**Wallet module detected:**
|
|
98
|
+
- "Should transactions use FND (Frontier Dollar) only, or also support fiat on/off-ramp?"
|
|
99
|
+
- "Will users send money to each other (P2P), or only pay for services?"
|
|
100
|
+
- "Do you need transaction history displayed in the app?"
|
|
101
|
+
|
|
102
|
+
**Events module detected:**
|
|
103
|
+
- "Do you need real-time availability updates, or is periodic refresh fine?"
|
|
104
|
+
- "Should users be able to create events, or only browse and RSVP?"
|
|
105
|
+
- "Are events tied to physical locations (rooms/venues) or virtual?"
|
|
106
|
+
|
|
107
|
+
**Communities module detected:**
|
|
108
|
+
- "Is this for a specific community, or should users browse/join multiple communities?"
|
|
109
|
+
- "Do you need member lists visible, or just community-level info?"
|
|
110
|
+
|
|
111
|
+
**Partnerships module detected:**
|
|
112
|
+
- "Are sponsors displayed publicly, or is this for internal partner management?"
|
|
113
|
+
- "Do sponsors get special access passes or visibility?"
|
|
114
|
+
|
|
115
|
+
**Offices module detected:**
|
|
116
|
+
- "Is this for visitor access passes, member day passes, or both?"
|
|
117
|
+
- "Do users need to see available rooms/spaces?"
|
|
118
|
+
|
|
119
|
+
**User module detected (implied):**
|
|
120
|
+
- "Do you need to show user profiles beyond basic name/avatar?"
|
|
121
|
+
- "Are there different user roles (member vs admin vs operator)?"
|
|
122
|
+
|
|
123
|
+
**ThirdParty module detected:**
|
|
124
|
+
- "Is this a developer-facing tool, or does it use ThirdParty APIs behind the scenes?"
|
|
125
|
+
|
|
126
|
+
**Ask questions one batch at a time** using AskUserQuestion with appropriate options for each. Keep it to ONE round of questions — do not over-interrogate.
|
|
127
|
+
|
|
128
|
+
**For modules with no specific questions** (Storage, Chain): skip — these are utility modules with standard patterns.
|
|
129
|
+
</step>
|
|
130
|
+
|
|
131
|
+
<step name="confirm">
|
|
132
|
+
**Present final module list and permissions for approval.**
|
|
133
|
+
|
|
134
|
+
Incorporate answers from smart questions to refine the module list. If the user's answers suggest additional modules or removal of inferred modules, adjust.
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
## App Summary
|
|
138
|
+
|
|
139
|
+
**Name:** [Inferred from description, or ask]
|
|
140
|
+
**Description:** [From step 2, refined by step 4 answers]
|
|
141
|
+
**Dev Port:** [Pick from 5180-5199 range, avoid common ports]
|
|
142
|
+
|
|
143
|
+
### SDK Modules (Final)
|
|
144
|
+
|
|
145
|
+
| Module | Key Methods | Permissions |
|
|
146
|
+
|--------|-------------|-------------|
|
|
147
|
+
| [Module] | [methods] | [permissions count] |
|
|
148
|
+
|
|
149
|
+
### Phases Preview
|
|
150
|
+
|
|
151
|
+
1. **Phase 1: Scaffold + SDK Core** — Project setup, SdkProvider, iframe detection, dark theme
|
|
152
|
+
2. **Phase 2: [Feature]** — [From description + smart question answers]
|
|
153
|
+
3. **Phase N: [Feature]** — [From description + smart question answers]
|
|
154
|
+
|
|
155
|
+
Total permissions: [N]
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Use AskUserQuestion:
|
|
159
|
+
- header: "Confirm"
|
|
160
|
+
- question: "Does this look right?"
|
|
161
|
+
- options:
|
|
162
|
+
- "Looks good — create the app" — Proceed to scaffolding
|
|
163
|
+
- "Change something" — Let user modify modules, name, or phases
|
|
164
|
+
- "Start over" — Go back to description
|
|
165
|
+
|
|
166
|
+
**If "Change something":** Ask what to change, adjust, and re-confirm.
|
|
167
|
+
**If "Start over":** Return to step 2.
|
|
168
|
+
</step>
|
|
169
|
+
|
|
170
|
+
<step name="create_app_directory">
|
|
171
|
+
**Create the app directory structure.**
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
APP_DIR=$(pwd)
|
|
175
|
+
mkdir -p .frontier-app/phases/01-scaffold
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
This creates:
|
|
179
|
+
- `.frontier-app/` — Project state directory
|
|
180
|
+
- `.frontier-app/phases/01-scaffold/` — Phase 1 directory (always created)
|
|
181
|
+
</step>
|
|
182
|
+
|
|
183
|
+
<step name="create_roadmap">
|
|
184
|
+
**Build the phased roadmap.**
|
|
185
|
+
|
|
186
|
+
Phase 1 is ALWAYS "Scaffold + SDK Core" — this is non-negotiable for every Frontier OS app.
|
|
187
|
+
|
|
188
|
+
Additional phases come from the features identified in steps 3-5:
|
|
189
|
+
- Group related features into coherent phases
|
|
190
|
+
- Each phase should deliver something testable
|
|
191
|
+
- Keep to 3-6 total phases for v1 — ship fast
|
|
192
|
+
- Order phases by dependency (features that build on each other)
|
|
193
|
+
|
|
194
|
+
**Phase sizing heuristics:**
|
|
195
|
+
- Simple feature (one SDK module, one view): 1 phase, 1-2 plans
|
|
196
|
+
- Medium feature (SDK module + UI + state): 1 phase, 2-3 plans
|
|
197
|
+
- Complex feature (multiple modules, multiple views): 1-2 phases, 2-3 plans each
|
|
198
|
+
</step>
|
|
199
|
+
|
|
200
|
+
<step name="write_state_files">
|
|
201
|
+
**Write all project state files using templates.**
|
|
202
|
+
|
|
203
|
+
**1. PROJECT.md:**
|
|
204
|
+
```bash
|
|
205
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" scaffold "state/project.md" --raw --vars '{"APP_NAME":"[name]","APP_DESCRIPTION":"[description]","DATE":"[today]","TRIGGER":"initial creation"}'
|
|
206
|
+
```
|
|
207
|
+
Then fill in the template sections:
|
|
208
|
+
- SDK Modules table with actual module data from step 3
|
|
209
|
+
- Target Users from description and smart question answers
|
|
210
|
+
- Core Value from the description
|
|
211
|
+
- Constraints (standard 6 + any app-specific from answers)
|
|
212
|
+
|
|
213
|
+
Write to `.frontier-app/PROJECT.md`.
|
|
214
|
+
|
|
215
|
+
**2. REQUIREMENTS.md:**
|
|
216
|
+
```bash
|
|
217
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" scaffold "state/requirements.md" --raw --vars '{"APP_NAME":"[name]","MILESTONE_VERSION":"v1","DATE":"[today]","TRIGGER":"initial creation"}'
|
|
218
|
+
```
|
|
219
|
+
Then fill in:
|
|
220
|
+
- Standard PLAT-01 through PLAT-05 (always)
|
|
221
|
+
- Feature requirements REQ-01+ (from phases)
|
|
222
|
+
- Traceability table mapping requirements to phases
|
|
223
|
+
- Out of scope (standard 2 + app-specific)
|
|
224
|
+
|
|
225
|
+
Write to `.frontier-app/REQUIREMENTS.md`.
|
|
226
|
+
|
|
227
|
+
**3. ROADMAP.md:**
|
|
228
|
+
```bash
|
|
229
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" scaffold "state/roadmap.md" --raw --vars '{"APP_NAME":"[name]","MILESTONE_VERSION":"v1","DATE":"[today]","TRIGGER":"initial creation"}'
|
|
230
|
+
```
|
|
231
|
+
Then fill in:
|
|
232
|
+
- Phase list with all phases from step 7
|
|
233
|
+
- Phase details with goals, dependencies, requirements, success criteria
|
|
234
|
+
- Progress table initialized to "Not started"
|
|
235
|
+
|
|
236
|
+
Write to `.frontier-app/ROADMAP.md`.
|
|
237
|
+
|
|
238
|
+
**4. STATE.md:**
|
|
239
|
+
```bash
|
|
240
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" scaffold "state/state.md" --raw --vars '{"MILESTONE_VERSION":"v1","CURRENT_PHASE":"1","CURRENT_PLAN":"01","STATUS":"ready-to-discuss","NEXT_ACTION":"/fos:discuss 1"}'
|
|
241
|
+
```
|
|
242
|
+
Then fill in:
|
|
243
|
+
- Current Position: Phase 1 of [N], ready to discuss
|
|
244
|
+
- App Reference: Name, core value, SDK modules, dev port
|
|
245
|
+
- Empty Recent Decisions, Blockers, Metrics
|
|
246
|
+
- Next command: /fos:discuss 1
|
|
247
|
+
|
|
248
|
+
Write to `.frontier-app/STATE.md`.
|
|
249
|
+
|
|
250
|
+
**5. manifest.json:**
|
|
251
|
+
Construct the manifest object:
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"name": "[App Name]",
|
|
255
|
+
"packageName": "[package-name]",
|
|
256
|
+
"description": "[Description]",
|
|
257
|
+
"sdkVersion": "latest",
|
|
258
|
+
"devPort": [port],
|
|
259
|
+
"modules": ["Storage", "Chain", ...other modules...],
|
|
260
|
+
"permissions": ["storage:get", "storage:set", ...all permissions...],
|
|
261
|
+
"milestone": "v1",
|
|
262
|
+
"phases": [
|
|
263
|
+
{"number": 1, "name": "Scaffold + SDK Core", "status": "not-started"},
|
|
264
|
+
{"number": 2, "name": "[Feature]", "status": "not-started"},
|
|
265
|
+
...
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Write to `.frontier-app/manifest.json`.
|
|
271
|
+
</step>
|
|
272
|
+
|
|
273
|
+
<step name="git_init_and_commit">
|
|
274
|
+
**Initialize git and create initial commit.**
|
|
275
|
+
|
|
276
|
+
**If `has_git` is false:**
|
|
277
|
+
```bash
|
|
278
|
+
git init
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Create .gitignore if it doesn't exist:**
|
|
282
|
+
```bash
|
|
283
|
+
cat > .gitignore << 'GITIGNORE'
|
|
284
|
+
node_modules/
|
|
285
|
+
dist/
|
|
286
|
+
.env
|
|
287
|
+
.env.local
|
|
288
|
+
*.log
|
|
289
|
+
.DS_Store
|
|
290
|
+
GITIGNORE
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Commit all state files:**
|
|
294
|
+
```bash
|
|
295
|
+
git add .frontier-app/ .gitignore
|
|
296
|
+
git commit -m "feat: initialize [App Name] — Frontier OS app
|
|
297
|
+
|
|
298
|
+
SDK Modules: [comma-separated modules]
|
|
299
|
+
Phases: [count] phases planned for v1
|
|
300
|
+
Created by: /fos:new-app"
|
|
301
|
+
```
|
|
302
|
+
</step>
|
|
303
|
+
|
|
304
|
+
<step name="next_up">
|
|
305
|
+
**Display completion and next step.**
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
## App Initialized
|
|
309
|
+
|
|
310
|
+
**[App Name]** is ready to build.
|
|
311
|
+
|
|
312
|
+
Created:
|
|
313
|
+
.frontier-app/PROJECT.md — App vision and SDK modules
|
|
314
|
+
.frontier-app/REQUIREMENTS.md — Scoped requirements
|
|
315
|
+
.frontier-app/ROADMAP.md — [N]-phase build plan
|
|
316
|
+
.frontier-app/STATE.md — Project memory
|
|
317
|
+
.frontier-app/manifest.json — Machine-readable metadata
|
|
318
|
+
|
|
319
|
+
SDK Modules: [list]
|
|
320
|
+
Phases: [list of phase names]
|
|
321
|
+
|
|
322
|
+
────────────────────────────────────────
|
|
323
|
+
Next up: `/fos:discuss 1`
|
|
324
|
+
Discuss Phase 1 approach — minimal decisions for scaffold, but establishes patterns.
|
|
325
|
+
|
|
326
|
+
Run `/clear` first to free your context window.
|
|
327
|
+
────────────────────────────────────────
|
|
328
|
+
```
|
|
329
|
+
</step>
|
|
330
|
+
|
|
331
|
+
</process>
|