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,310 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Extract implementation decisions for a phase before planning. Identify gray areas — places where the implementation could go multiple ways — and let the user choose. Produces CONTEXT.md that downstream research, planning, and execution agents will honor.
|
|
3
|
+
|
|
4
|
+
You are a thinking partner, not an interviewer. The user is the visionary — you are the builder. Your job is to capture decisions that guide planning and execution, not to figure out implementation yourself.
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<required_reading>
|
|
8
|
+
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
9
|
+
</required_reading>
|
|
10
|
+
|
|
11
|
+
<available_agent_types>
|
|
12
|
+
Valid FOS subagent types (use exact names):
|
|
13
|
+
- fos-researcher — Researches existing Frontier OS apps for patterns
|
|
14
|
+
- fos-planner — Creates detailed execution plans from research + context
|
|
15
|
+
- fos-plan-checker — Reviews plan quality before execution
|
|
16
|
+
- fos-executor — Executes plan tasks, commits, creates SUMMARY.md
|
|
17
|
+
- fos-verifier — Verifies phase completion, checks quality gates
|
|
18
|
+
</available_agent_types>
|
|
19
|
+
|
|
20
|
+
<downstream_awareness>
|
|
21
|
+
**CONTEXT.md feeds into:**
|
|
22
|
+
|
|
23
|
+
1. **fos-researcher** — Reads CONTEXT.md to know WHAT to research
|
|
24
|
+
- "User wants card-based layout" -> researcher investigates card patterns in existing apps
|
|
25
|
+
- "Optimistic UI for RSVP" -> researcher looks into optimistic update patterns
|
|
26
|
+
|
|
27
|
+
2. **fos-planner** — Reads CONTEXT.md to know WHAT decisions are locked
|
|
28
|
+
- "P2P transfers only" -> planner scopes to transferFrontierDollar(), not payWithFrontierDollar()
|
|
29
|
+
- "Claude's Discretion: loading skeleton" -> planner can decide approach
|
|
30
|
+
|
|
31
|
+
**Your job:** Capture decisions clearly enough that downstream agents can act on them without asking the user again.
|
|
32
|
+
|
|
33
|
+
**Not your job:** Figure out HOW to implement. That's what research and planning do with the decisions you capture.
|
|
34
|
+
</downstream_awareness>
|
|
35
|
+
|
|
36
|
+
<scope_guardrail>
|
|
37
|
+
**CRITICAL: No scope creep.**
|
|
38
|
+
|
|
39
|
+
The phase boundary comes from ROADMAP.md and is FIXED. Discussion clarifies HOW to implement what's scoped, never WHETHER to add new capabilities.
|
|
40
|
+
|
|
41
|
+
**Allowed (clarifying ambiguity):**
|
|
42
|
+
- "How should events be displayed?" (layout, density, info shown)
|
|
43
|
+
- "What happens when the wallet is empty?" (within the feature)
|
|
44
|
+
- "Should RSVP require confirmation or be one-tap?" (behavior choice)
|
|
45
|
+
|
|
46
|
+
**Not allowed (scope creep):**
|
|
47
|
+
- "Should we also add event creation?" (new capability)
|
|
48
|
+
- "What about search/filtering?" (new capability)
|
|
49
|
+
- "Maybe include social sharing?" (new capability)
|
|
50
|
+
|
|
51
|
+
**When user suggests scope creep:**
|
|
52
|
+
```
|
|
53
|
+
"[Feature X] would be a new capability — that's its own phase.
|
|
54
|
+
Want me to note it for the roadmap backlog?
|
|
55
|
+
|
|
56
|
+
For now, let's focus on [phase domain]."
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Capture the idea in a "Deferred Ideas" section. Don't lose it, don't act on it.
|
|
60
|
+
</scope_guardrail>
|
|
61
|
+
|
|
62
|
+
<process>
|
|
63
|
+
|
|
64
|
+
<step name="initialize" priority="first">
|
|
65
|
+
**Phase number from argument (required).**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
INIT=$(node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" init discuss "$PHASE")
|
|
69
|
+
if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Parse JSON for: `phase`, `phase_dir`, `has_context`, `manifest`, `state`, `roadmap_path`, `project_path`, `version`.
|
|
73
|
+
|
|
74
|
+
**If .frontier-app/ not found:**
|
|
75
|
+
```
|
|
76
|
+
Error: No .frontier-app/ directory found.
|
|
77
|
+
|
|
78
|
+
Run `/fos:new-app` first to initialize your Frontier OS app.
|
|
79
|
+
```
|
|
80
|
+
Exit workflow.
|
|
81
|
+
|
|
82
|
+
**If phase_dir is null:** The phase directory doesn't exist yet. Create it:
|
|
83
|
+
```bash
|
|
84
|
+
PADDED=$(printf "%02d" $PHASE)
|
|
85
|
+
# Read ROADMAP.md to find the phase name
|
|
86
|
+
PHASE_NAME=$(... extract from roadmap ...)
|
|
87
|
+
mkdir -p ".frontier-app/phases/${PADDED}-${PHASE_SLUG}"
|
|
88
|
+
```
|
|
89
|
+
</step>
|
|
90
|
+
|
|
91
|
+
<step name="load_context">
|
|
92
|
+
**Read project context files.**
|
|
93
|
+
|
|
94
|
+
Read these files to understand the app and phase:
|
|
95
|
+
1. `.frontier-app/PROJECT.md` — App vision, SDK modules, constraints
|
|
96
|
+
2. `.frontier-app/ROADMAP.md` — Find this phase's goal, requirements, success criteria
|
|
97
|
+
3. `.frontier-app/manifest.json` — SDK modules and permissions declared
|
|
98
|
+
|
|
99
|
+
Extract from ROADMAP.md for this phase:
|
|
100
|
+
- **Phase goal** — One sentence describing what this phase delivers
|
|
101
|
+
- **Phase requirements** — Which REQ-XX this phase covers
|
|
102
|
+
- **Success criteria** — What must be TRUE when this phase is done
|
|
103
|
+
- **SDK modules** — Which modules this phase uses (from manifest + phase goal)
|
|
104
|
+
</step>
|
|
105
|
+
|
|
106
|
+
<step name="check_existing">
|
|
107
|
+
**Check if CONTEXT.md already exists.**
|
|
108
|
+
|
|
109
|
+
**If `has_context` is true:**
|
|
110
|
+
|
|
111
|
+
Use AskUserQuestion:
|
|
112
|
+
- header: "Context Exists"
|
|
113
|
+
- question: "Phase [X] already has context decisions. What do you want to do?"
|
|
114
|
+
- options:
|
|
115
|
+
- "Update it" — Review and revise existing context
|
|
116
|
+
- "View it" — Show me what's there
|
|
117
|
+
- "Skip" — Use existing context as-is, proceed to planning
|
|
118
|
+
|
|
119
|
+
**If "Update":** Load existing CONTEXT.md, continue to analyze_phase.
|
|
120
|
+
**If "View":** Display CONTEXT.md, then offer Update/Skip.
|
|
121
|
+
**If "Skip":** Exit workflow with next-up pointing to `/fos:plan N`.
|
|
122
|
+
|
|
123
|
+
**If `has_context` is false:** Continue to analyze_phase.
|
|
124
|
+
</step>
|
|
125
|
+
|
|
126
|
+
<step name="analyze_phase">
|
|
127
|
+
**Identify gray areas based on phase goal + SDK modules.**
|
|
128
|
+
|
|
129
|
+
Gray areas are implementation decisions the user cares about — things that could go multiple ways and would change the result.
|
|
130
|
+
|
|
131
|
+
**For Phase 1 (Scaffold + SDK Core):**
|
|
132
|
+
Minimal gray areas — scaffold is well-defined. Only ask:
|
|
133
|
+
- "Router or single-component app?" (if more than 2 feature phases exist)
|
|
134
|
+
- That's usually it. Phase 1 is standardized.
|
|
135
|
+
|
|
136
|
+
**For feature phases:**
|
|
137
|
+
Generate phase-specific gray areas based on:
|
|
138
|
+
1. The phase goal from ROADMAP.md
|
|
139
|
+
2. The SDK modules involved
|
|
140
|
+
3. The domain being built
|
|
141
|
+
|
|
142
|
+
**Gray area identification by domain:**
|
|
143
|
+
|
|
144
|
+
Something users SEE (UI feature):
|
|
145
|
+
- Layout and density (cards vs list vs table)
|
|
146
|
+
- Information hierarchy (what's prominent, what's secondary)
|
|
147
|
+
- Empty states and loading states
|
|
148
|
+
- Interaction model (tap, swipe, drag)
|
|
149
|
+
|
|
150
|
+
Something users DO (action feature):
|
|
151
|
+
- Confirmation vs one-tap behavior
|
|
152
|
+
- Optimistic vs pessimistic UI updates
|
|
153
|
+
- Error recovery (retry, fallback, message)
|
|
154
|
+
- Success feedback (toast, animation, redirect)
|
|
155
|
+
|
|
156
|
+
Something involving SDK modules:
|
|
157
|
+
- Which SDK methods to use for the feature
|
|
158
|
+
- Data refresh strategy (poll, manual, real-time)
|
|
159
|
+
- Caching and offline behavior
|
|
160
|
+
- Error handling when SDK calls fail
|
|
161
|
+
|
|
162
|
+
**Don't use generic labels** (UI, UX, Behavior). Generate concrete, phase-specific areas:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
Phase: "Event Listing"
|
|
166
|
+
-> Card layout, RSVP flow, empty state, refresh strategy
|
|
167
|
+
|
|
168
|
+
Phase: "Wallet Integration"
|
|
169
|
+
-> Balance display, transfer confirmation, error handling, transaction history
|
|
170
|
+
|
|
171
|
+
Phase: "Room Booking"
|
|
172
|
+
-> Calendar view, time slot selection, booking confirmation, conflict handling
|
|
173
|
+
```
|
|
174
|
+
</step>
|
|
175
|
+
|
|
176
|
+
<step name="present_areas">
|
|
177
|
+
**Present gray areas and let user choose what to discuss.**
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
## Phase [N]: [Name] — Gray Areas
|
|
181
|
+
|
|
182
|
+
I've identified [count] areas where your input will shape the implementation:
|
|
183
|
+
|
|
184
|
+
1. **[Area 1]** — [One sentence explaining why this matters]
|
|
185
|
+
2. **[Area 2]** — [One sentence]
|
|
186
|
+
3. **[Area 3]** — [One sentence]
|
|
187
|
+
4. **[Area 4]** — [One sentence]
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Use AskUserQuestion:
|
|
191
|
+
- header: "Topics"
|
|
192
|
+
- question: "Which areas do you want to discuss? I'll handle the rest with sensible defaults."
|
|
193
|
+
- multiSelect: true
|
|
194
|
+
- options: [each gray area as an option, plus "All of them" and "None — use your judgment"]
|
|
195
|
+
|
|
196
|
+
**If "None":** Set all areas as "Claude's Discretion" and skip to write_context.
|
|
197
|
+
**If specific areas selected:** Discuss those, mark unselected as "Claude's Discretion".
|
|
198
|
+
</step>
|
|
199
|
+
|
|
200
|
+
<step name="discuss_areas">
|
|
201
|
+
**Deep-dive each selected area.**
|
|
202
|
+
|
|
203
|
+
For each selected gray area, ask ONE focused question at a time. Use AskUserQuestion with concrete options — never open-ended "what do you think?"
|
|
204
|
+
|
|
205
|
+
**Example for "Card Layout" area:**
|
|
206
|
+
```
|
|
207
|
+
AskUserQuestion:
|
|
208
|
+
header: "Card Layout"
|
|
209
|
+
question: "How should [items] be displayed?"
|
|
210
|
+
options:
|
|
211
|
+
- "Card grid (1/2/3 columns responsive)" — Visual, browsable, like a gallery
|
|
212
|
+
- "Compact list" — Dense, scannable, fits more items
|
|
213
|
+
- "Single column feed" — One item at a time, focused reading
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Example for "RSVP Flow" area:**
|
|
217
|
+
```
|
|
218
|
+
AskUserQuestion:
|
|
219
|
+
header: "RSVP Flow"
|
|
220
|
+
question: "How should RSVP work?"
|
|
221
|
+
options:
|
|
222
|
+
- "One-tap (instant)" — Tap and done, like a Like button
|
|
223
|
+
- "Confirm first" — Show confirmation modal before committing
|
|
224
|
+
- "With options" — Let user choose attendance type (going, maybe, not going)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**SDK-related areas** — ask about behavior, not implementation:
|
|
228
|
+
```
|
|
229
|
+
AskUserQuestion:
|
|
230
|
+
header: "Balance Display"
|
|
231
|
+
question: "How should the wallet balance be shown?"
|
|
232
|
+
options:
|
|
233
|
+
- "Always visible" — Balance in header, updates in real-time
|
|
234
|
+
- "On demand" — User taps to reveal balance
|
|
235
|
+
- "Contextual" — Show balance only when relevant (e.g., before payment)
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Follow-up rule:** If the user's answer raises a natural follow-up (e.g., they chose "card grid" — ask about what info shows on each card), ask ONE follow-up. Then move to the next area.
|
|
239
|
+
|
|
240
|
+
**Maximum questions per area:** 3. If you need more, the area is too broad — split it.
|
|
241
|
+
</step>
|
|
242
|
+
|
|
243
|
+
<step name="write_context">
|
|
244
|
+
**Write CONTEXT.md with all decisions.**
|
|
245
|
+
|
|
246
|
+
Use the context template format. Write to:
|
|
247
|
+
`.frontier-app/phases/XX-name/XX-CONTEXT.md`
|
|
248
|
+
|
|
249
|
+
**Content structure:**
|
|
250
|
+
- **Phase Boundary:** From ROADMAP.md (copied verbatim)
|
|
251
|
+
- **Implementation Decisions:** Each discussed area with numbered decisions (D-01, D-02, etc.)
|
|
252
|
+
- **SDK Usage decisions:** Which methods, data flow pattern
|
|
253
|
+
- **Claude's Discretion:** Areas the user deferred or didn't select
|
|
254
|
+
- **Specific Ideas:** Any references or "I want it like X" from discussion
|
|
255
|
+
- **SDK Module Context:** Table of modules/methods used, integration pattern, constraints
|
|
256
|
+
- **References to Read:** SDK docs, existing app patterns relevant to this phase
|
|
257
|
+
- **Deferred Ideas:** Any scope creep captured during discussion
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Write the file
|
|
261
|
+
# [Write CONTEXT.md content to phase directory]
|
|
262
|
+
|
|
263
|
+
# Commit if git exists
|
|
264
|
+
git add ".frontier-app/phases/"
|
|
265
|
+
git commit -m "docs: Phase $PHASE context — [count] decisions captured
|
|
266
|
+
|
|
267
|
+
Decisions: [brief list of key decisions]
|
|
268
|
+
Claude's discretion: [count] areas
|
|
269
|
+
Deferred: [count] ideas for backlog"
|
|
270
|
+
```
|
|
271
|
+
</step>
|
|
272
|
+
|
|
273
|
+
<step name="update_state">
|
|
274
|
+
**Update STATE.md.**
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update status "ready-to-plan"
|
|
278
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update next_action "/fos:plan $PHASE"
|
|
279
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update phase "$PHASE"
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Also update the body of STATE.md:
|
|
283
|
+
- Recent Decisions: Add key decisions from this discuss session
|
|
284
|
+
- Last activity: [today] — Discussed Phase [N]: [Name]
|
|
285
|
+
- Session Continuity: Update stopped-at and next-command
|
|
286
|
+
</step>
|
|
287
|
+
|
|
288
|
+
<step name="next_up">
|
|
289
|
+
**Display completion and next step.**
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
## Phase [N]: [Name] — Context Captured
|
|
293
|
+
|
|
294
|
+
[Count] decisions locked, [count] areas at Claude's discretion.
|
|
295
|
+
|
|
296
|
+
Key decisions:
|
|
297
|
+
- [D-01]: [Summary]
|
|
298
|
+
- [D-02]: [Summary]
|
|
299
|
+
- [D-03]: [Summary]
|
|
300
|
+
|
|
301
|
+
────────────────────────────────────────
|
|
302
|
+
Next up: `/fos:plan [N]`
|
|
303
|
+
Research existing Frontier OS apps and create execution plans for this phase.
|
|
304
|
+
|
|
305
|
+
Run `/clear` first to free your context window.
|
|
306
|
+
────────────────────────────────────────
|
|
307
|
+
```
|
|
308
|
+
</step>
|
|
309
|
+
|
|
310
|
+
</process>
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Execute a single plan file: read the plan, parse tasks, implement each task, verify each task, commit atomically, then produce SUMMARY.md. This workflow is loaded by fos-executor subagents spawned by the execute workflow — each executor gets a fresh context window and runs this end-to-end for one plan.
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<core_principle>
|
|
6
|
+
One plan, one agent, one SUMMARY.md. Execute tasks sequentially within the plan. Commit each task atomically. Never skip verification. If a task fails verification, fix it before moving on — do not accumulate broken state.
|
|
7
|
+
</core_principle>
|
|
8
|
+
|
|
9
|
+
<required_reading>
|
|
10
|
+
Read all files listed in the spawning prompt's <files_to_read> block BEFORE doing anything else. This is your primary context — the plan file, PROJECT.md, manifest.json, STATE.md, and any CONTEXT.md or RESEARCH.md for the phase.
|
|
11
|
+
</required_reading>
|
|
12
|
+
|
|
13
|
+
<available_agent_types>
|
|
14
|
+
This workflow runs inside a subagent — it does not spawn further subagents.
|
|
15
|
+
</available_agent_types>
|
|
16
|
+
|
|
17
|
+
<frontier_os_rules>
|
|
18
|
+
**CRITICAL — These rules apply to ALL code written for Frontier OS apps:**
|
|
19
|
+
|
|
20
|
+
1. **SDK access:** Always via `useSdk()` hook from `src/lib/sdk-context.tsx`. Never instantiate SDK directly in components.
|
|
21
|
+
2. **Dark theme:** Tailwind dark theme. Base: `bg-neutral-950`, text: `text-white`. No white backgrounds anywhere.
|
|
22
|
+
3. **Iframe detection:** `isInFrontierApp()` check in Layout.tsx. Standalone mode shows a banner explaining the app runs inside Frontier OS.
|
|
23
|
+
4. **SdkProvider wrapping:** The entire app is wrapped in SdkProvider. SDK is initialized once via useRef, destroyed on unmount.
|
|
24
|
+
5. **Error handling:** All SDK calls wrapped in try/catch. Loading states for async operations. Error states with user-friendly messages.
|
|
25
|
+
6. **Permissions:** Every SDK method used must have its permission declared in manifest.json.
|
|
26
|
+
7. **CORS:** vercel.json must include all 5 Frontier OS origins in CORS headers.
|
|
27
|
+
8. **TypeScript strict:** All code in TypeScript strict mode. No `any` types unless explicitly justified.
|
|
28
|
+
9. **Imports:** Use `@frontiertower/frontier-sdk` for SDK. Exact import paths, not barrel imports.
|
|
29
|
+
10. **Testing:** Vitest for unit tests. Test files co-located or in `src/test/`.
|
|
30
|
+
</frontier_os_rules>
|
|
31
|
+
|
|
32
|
+
<process>
|
|
33
|
+
|
|
34
|
+
<step name="load_plan">
|
|
35
|
+
**Read the plan file from <files_to_read>.**
|
|
36
|
+
|
|
37
|
+
Parse the plan:
|
|
38
|
+
- **Frontmatter:** phase, plan, wave, depends_on, requirements, files_modified, autonomous, must_haves
|
|
39
|
+
- **Objective:** What this plan accomplishes
|
|
40
|
+
- **Tasks:** Each `<task>` block with name, files, read_first, action, verify, acceptance_criteria, done
|
|
41
|
+
- **Verification:** End-of-plan verification checklist
|
|
42
|
+
- **Success criteria:** What "done" looks like
|
|
43
|
+
|
|
44
|
+
Also read all files from `<context>` block in the plan — these are source files, SDK docs, and project state the plan needs.
|
|
45
|
+
</step>
|
|
46
|
+
|
|
47
|
+
<step name="pre_execution_check">
|
|
48
|
+
**Verify prerequisites before executing.**
|
|
49
|
+
|
|
50
|
+
1. Check that dependencies are met (if `depends_on` is not empty):
|
|
51
|
+
```bash
|
|
52
|
+
# For each dependency, check SUMMARY.md exists
|
|
53
|
+
for DEP in $DEPENDS_ON; do
|
|
54
|
+
test -f "$PHASE_DIR/${DEP}-SUMMARY.md" && echo "$DEP: OK" || echo "$DEP: MISSING"
|
|
55
|
+
done
|
|
56
|
+
```
|
|
57
|
+
If any dependency SUMMARY.md is missing: STOP and report the gap.
|
|
58
|
+
|
|
59
|
+
2. Check that `read_first` files exist for the first task.
|
|
60
|
+
|
|
61
|
+
3. If this is Phase 1 (scaffold): verify the template directory exists:
|
|
62
|
+
```bash
|
|
63
|
+
ls "$HOME/.claude/frontier-os-app-builder/templates/app/" 2>/dev/null
|
|
64
|
+
```
|
|
65
|
+
</step>
|
|
66
|
+
|
|
67
|
+
<step name="execute_tasks">
|
|
68
|
+
**For each task in the plan, execute sequentially.**
|
|
69
|
+
|
|
70
|
+
**For each `<task>`:**
|
|
71
|
+
|
|
72
|
+
1. **Read referenced files:**
|
|
73
|
+
Read all files listed in `<read_first>` using the Read tool. These are source-of-truth files the task needs to reference.
|
|
74
|
+
|
|
75
|
+
2. **Execute the action:**
|
|
76
|
+
Follow the `<action>` specification exactly. This may involve:
|
|
77
|
+
|
|
78
|
+
**For scaffold tasks (Phase 1):**
|
|
79
|
+
- Use `fos-tools.cjs scaffold` to render templates:
|
|
80
|
+
```bash
|
|
81
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" scaffold "app/vite.config.ts" --raw --vars '{"DEV_PORT":"5180"}'
|
|
82
|
+
```
|
|
83
|
+
- Write rendered content to the correct file paths
|
|
84
|
+
- Install dependencies via npm
|
|
85
|
+
|
|
86
|
+
**For feature tasks (Phase 2+):**
|
|
87
|
+
- Create or modify source files as specified
|
|
88
|
+
- Follow SDK usage patterns from RESEARCH.md and references
|
|
89
|
+
- Apply Tailwind dark theme classes
|
|
90
|
+
- Handle loading/error/empty states
|
|
91
|
+
- Use TypeScript strict types
|
|
92
|
+
|
|
93
|
+
**For all tasks:**
|
|
94
|
+
- Follow the plan's action description precisely
|
|
95
|
+
- Use concrete values (exact identifiers, method signatures) from the plan
|
|
96
|
+
- Do NOT add features not specified in the task
|
|
97
|
+
- Do NOT change files not listed in the task's `<files>` block
|
|
98
|
+
|
|
99
|
+
3. **Verify the task:**
|
|
100
|
+
Run the `<verify>` command specified in the task:
|
|
101
|
+
```bash
|
|
102
|
+
# Example verifications:
|
|
103
|
+
npx tsc --noEmit # TypeScript compiles
|
|
104
|
+
npm run build # Vite build succeeds
|
|
105
|
+
grep -q "SdkProvider" src/App.tsx # Pattern exists in file
|
|
106
|
+
npm run dev -- --host & # Dev server starts
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Check each item in `<acceptance_criteria>`:
|
|
110
|
+
- Grep-verifiable: Run the grep command
|
|
111
|
+
- Build-verifiable: Run the build command
|
|
112
|
+
- File-verifiable: Check file exists and contains expected content
|
|
113
|
+
|
|
114
|
+
**If verification fails:**
|
|
115
|
+
- Read the error output
|
|
116
|
+
- Fix the issue (TypeScript error, missing import, wrong path, etc.)
|
|
117
|
+
- Re-run verification
|
|
118
|
+
- Maximum 3 fix attempts per task. If still failing after 3: document the issue and continue.
|
|
119
|
+
|
|
120
|
+
4. **Commit the task atomically:**
|
|
121
|
+
```bash
|
|
122
|
+
git add [files from task's <files> list]
|
|
123
|
+
git commit -m "[type]: [task name]
|
|
124
|
+
|
|
125
|
+
Phase [N], Plan [M], Task [K]
|
|
126
|
+
[Brief description of what was done]"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Commit types:
|
|
130
|
+
- `feat:` — New feature or capability
|
|
131
|
+
- `fix:` — Bug fix during execution
|
|
132
|
+
- `scaffold:` — Project scaffolding (Phase 1)
|
|
133
|
+
- `style:` — Styling changes (dark theme, layout)
|
|
134
|
+
- `test:` — Test files
|
|
135
|
+
- `refactor:` — Code restructuring
|
|
136
|
+
</step>
|
|
137
|
+
|
|
138
|
+
<step name="final_verification">
|
|
139
|
+
**After all tasks: run the plan's verification checklist.**
|
|
140
|
+
|
|
141
|
+
From the plan's `<verification>` block, run each check:
|
|
142
|
+
```bash
|
|
143
|
+
npm run build # Build succeeds
|
|
144
|
+
npx tsc --noEmit # No TypeScript errors
|
|
145
|
+
# npm run dev starts on correct port (quick check)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Also run FOS-specific validation:
|
|
149
|
+
```bash
|
|
150
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" validate structure
|
|
151
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" validate permissions
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Document results for SUMMARY.md.
|
|
155
|
+
</step>
|
|
156
|
+
|
|
157
|
+
<step name="write_summary">
|
|
158
|
+
**Create SUMMARY.md for this plan.**
|
|
159
|
+
|
|
160
|
+
Follow the summary template format. Write to:
|
|
161
|
+
`$PHASE_DIR/[phase]-[plan]-SUMMARY.md`
|
|
162
|
+
|
|
163
|
+
**Content:**
|
|
164
|
+
- Frontmatter: phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, sdk-modules-used, requirements-completed, duration, completed
|
|
165
|
+
- One-liner: Substantive description (NOT "plan complete")
|
|
166
|
+
- Performance: Duration, timestamps, task count, file count
|
|
167
|
+
- Accomplishments: Key outcomes
|
|
168
|
+
- Task Commits: Each task with git hash and type
|
|
169
|
+
- Files Created/Modified: Full list with descriptions
|
|
170
|
+
- SDK Integration Notes: How SDK modules were wired (or "N/A" for scaffold)
|
|
171
|
+
- Decisions Made: Choices with rationale
|
|
172
|
+
- Deviations from Plan: What changed and why (or "None")
|
|
173
|
+
- Issues Encountered: Problems and resolutions (or "None")
|
|
174
|
+
- Verification Results: Each check with pass/fail
|
|
175
|
+
- Next Phase Readiness: What's ready, any blockers
|
|
176
|
+
</step>
|
|
177
|
+
|
|
178
|
+
<step name="update_state">
|
|
179
|
+
**Update STATE.md with plan completion.**
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Update plan counter
|
|
183
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update plan "[next_plan_or_done]"
|
|
184
|
+
node "$HOME/.claude/frontier-os-app-builder/bin/fos-tools.cjs" state update status "executing"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Also update STATE.md body:
|
|
188
|
+
- Current Position: Plan [M] of [total] in Phase [N]
|
|
189
|
+
- Last activity: [today] — Completed Plan [M]: [plan name]
|
|
190
|
+
- Recent Decisions: Add any decisions from this plan
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
git add .frontier-app/
|
|
194
|
+
git commit -m "docs: Plan $PHASE-$PLAN summary — [one-liner from summary]"
|
|
195
|
+
```
|
|
196
|
+
</step>
|
|
197
|
+
|
|
198
|
+
<step name="next_up">
|
|
199
|
+
**Signal completion to the orchestrator.**
|
|
200
|
+
|
|
201
|
+
This workflow runs inside a subagent spawned by `/fos:execute`. The orchestrator reads SUMMARY.md to detect completion. No user-facing routing needed — the orchestrator handles "Next Up".
|
|
202
|
+
|
|
203
|
+
If running inline (not as a subagent), display:
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
## Plan [Phase]-[Plan] Complete
|
|
207
|
+
|
|
208
|
+
[One-liner from SUMMARY.md]
|
|
209
|
+
|
|
210
|
+
Tasks: [count] executed, [count] committed
|
|
211
|
+
Verification: [PASS/FAIL]
|
|
212
|
+
|
|
213
|
+
────────────────────────────────────────
|
|
214
|
+
Next up: `/fos:execute [N]`
|
|
215
|
+
Continue executing remaining plans in this phase.
|
|
216
|
+
|
|
217
|
+
Run `/clear` first to free your context window.
|
|
218
|
+
────────────────────────────────────────
|
|
219
|
+
```
|
|
220
|
+
</step>
|
|
221
|
+
|
|
222
|
+
</process>
|