howone 0.1.30 → 0.1.32

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 (31) hide show
  1. package/package.json +1 -1
  2. package/templates/vite/.howone/skills/howone/01-architect/01-app-generation.md +138 -176
  3. package/templates/vite/.howone/skills/howone/01-architect/02-manifest-codegen.md +2 -2
  4. package/templates/vite/.howone/skills/howone/{02-database → 02-entity-schema}/01-schema-design.md +12 -30
  5. package/templates/vite/.howone/skills/howone/02-entity-schema/02-schema-operations.md +329 -0
  6. package/templates/vite/.howone/skills/howone/02-entity-schema/03-access-models.md +151 -0
  7. package/templates/vite/.howone/skills/howone/02-entity-schema/04-query-contracts.md +123 -0
  8. package/templates/vite/.howone/skills/howone/02-entity-schema/05-ai-persistence-patterns.md +255 -0
  9. package/templates/vite/.howone/skills/howone/{04-ai → 03-ai-capabilities}/01-ai-capability-architecture.md +42 -36
  10. package/templates/vite/.howone/skills/howone/{04-ai → 03-ai-capabilities}/02-workflow-contract-rules.md +5 -4
  11. package/templates/vite/.howone/skills/howone/{04-ai/04-service-capability-catalog.md → 03-ai-capabilities/03-service-capability-catalog.md} +15 -11
  12. package/templates/vite/.howone/skills/howone/03-ai-capabilities/04-workflow-operations.md +141 -0
  13. package/templates/vite/.howone/skills/howone/{04-ai/06-ai-feature-playbooks.md → 03-ai-capabilities/05-ai-feature-playbooks.md} +8 -29
  14. package/templates/vite/.howone/skills/howone/{03-sdk → 04-app-sdk}/01-client-setup.md +7 -6
  15. package/templates/vite/.howone/skills/howone/{03-sdk → 04-app-sdk}/07-ai-action-calls.md +5 -5
  16. package/templates/vite/.howone/skills/howone/{04-ai/03-ai-sdk-handoff.md → 04-app-sdk/08-ai-manifest-handoff.md} +8 -7
  17. package/templates/vite/.howone/skills/howone/{03-sdk/08-extension-boundaries.md → 04-app-sdk/09-extension-boundaries.md} +1 -1
  18. package/templates/vite/.howone/skills/howone/{02-database/03-data-access-patterns.md → 04-app-sdk/11-entity-data-access-patterns.md} +4 -4
  19. package/templates/vite/.howone/skills/howone/{02-database/04-query-dsl-and-responses.md → 04-app-sdk/12-query-dsl-and-responses.md} +1 -1
  20. package/templates/vite/.howone/skills/howone/SKILL.md +137 -133
  21. package/templates/vite/.howone/skills/howone/agents/openai.yaml +3 -3
  22. package/templates/vite/AGENTS.md +2 -2
  23. package/templates/vite/.howone/skills/howone/02-database/02-schema-operations.md +0 -398
  24. package/templates/vite/.howone/skills/howone/02-database/05-ai-persistence-patterns.md +0 -372
  25. package/templates/vite/.howone/skills/howone/04-ai/05-workflow-operations.md +0 -256
  26. /package/templates/vite/.howone/skills/howone/{03-sdk → 04-app-sdk}/02-entity-operations.md +0 -0
  27. /package/templates/vite/.howone/skills/howone/{03-sdk → 04-app-sdk}/03-auth.md +0 -0
  28. /package/templates/vite/.howone/skills/howone/{03-sdk → 04-app-sdk}/04-react-integration.md +0 -0
  29. /package/templates/vite/.howone/skills/howone/{03-sdk → 04-app-sdk}/05-file-upload.md +0 -0
  30. /package/templates/vite/.howone/skills/howone/{03-sdk → 04-app-sdk}/06-raw-http.md +0 -0
  31. /package/templates/vite/.howone/skills/howone/{03-sdk/09-workflow-execute-sse.md → 04-app-sdk/10-workflow-execute-sse.md} +0 -0
@@ -1,7 +1,7 @@
1
1
  # AI Feature Playbooks
2
2
 
3
- Use this reference when turning a user request into concrete HowOne AI capabilities, database
4
- entities, and SDK calls.
3
+ Use this reference when turning a user request into concrete HowOne AI capabilities and optional
4
+ persistence entities. App-side SDK calls belong to `04-app-sdk/`.
5
5
 
6
6
  ## Playbook: Document Summary
7
7
 
@@ -47,11 +47,8 @@ Persistence:
47
47
  - private `DocumentSummary` if user history is needed;
48
48
  - fields: `documentUrl`, `summary`, `status`, `errorMessage`, `requestedAt`, `completedAt`.
49
49
 
50
- SDK:
51
-
52
- ```ts
53
- const output = await howone.ai.summarizeDocument.run({ document_url: fileUrl })
54
- ```
50
+ App implementation handoff: after sync and external workflow submit, read the SDK track before
51
+ writing app-side AI runtime calls.
55
52
 
56
53
  ## Playbook: Image Generator
57
54
 
@@ -97,26 +94,8 @@ Persistence:
97
94
  - use `Generation` for private history;
98
95
  - public share requires separate `SharedGeneration`.
99
96
 
100
- SDK:
101
-
102
- ```ts
103
- await runAiActionAndPersist({
104
- entity: howone.entities.Generation,
105
- input: { image_description, style_preference },
106
- createPending: (input) => ({
107
- prompt: input.image_description,
108
- style: input.style_preference ?? null,
109
- status: 'pending',
110
- requestedAt: new Date().toISOString(),
111
- }),
112
- run: (input) => howone.ai.generateImage.run(input),
113
- mapCompleted: ({ output }) => ({
114
- status: 'completed',
115
- resultUrl: output.generated_image_url,
116
- completedAt: new Date().toISOString(),
117
- }),
118
- })
119
- ```
97
+ App implementation handoff: if persistence is needed, finish the entity contract first, then read
98
+ the SDK track for runtime action calls and persistence helper usage.
120
99
 
121
100
  ## Playbook: Image Editor
122
101
 
@@ -288,9 +267,9 @@ Rules:
288
267
  ## Feature Design Checklist
289
268
 
290
269
  - Choose one playbook or clearly combine compatible playbooks.
291
- - Verify capability exists in `04-service-capability-catalog.md`.
270
+ - Verify capability exists in `03-service-capability-catalog.md`.
292
271
  - Use URL inputs for files/media.
293
272
  - Keep outputs minimal and product-facing.
294
273
  - Decide persistence separately.
295
- - Generate SDK bindings only after manifest sync.
274
+ - Generate SDK bindings only after manifest sync and external workflow submit.
296
275
  - Use app-owned UI for progress/errors.
@@ -1,5 +1,7 @@
1
1
  # Client Setup
2
2
 
3
+ **Track:** `04-app-sdk/` — implement HowOne in the app from synced manifests; not schema/AI design.
4
+
3
5
  ## createClient
4
6
 
5
7
  `createClient(opts: CreateClientOptions)` is the single factory for everything in the HowOne SDK. Call it once at module level and export the result (or the composed `howone` client).
@@ -75,7 +77,6 @@ client.public.raw: RawHttpClient
75
77
  client.schema.listDefinitions()
76
78
  client.schema.getDefinition(entityName)
77
79
  client.schema.operate(operation)
78
- client.schema.previewPatch(patch, { expectedVersionId, reason })
79
80
  client.schema.applyPatch(patch, { expectedVersionId, reason })
80
81
  client.schema.getState()
81
82
  client.schema.listVersions()
@@ -85,7 +86,7 @@ client.schema.restore(versionId, reason?)
85
86
  // AI action runner (low-level)
86
87
  client.ai: AiClient
87
88
 
88
- // HTTP utilities (low-level — see 03-sdk/06-raw-http.md)
89
+ // HTTP utilities (low-level — see 04-app-sdk/06-raw-http.md)
89
90
  client.raw: RawHttpClient
90
91
 
91
92
  // File upload
@@ -139,7 +140,7 @@ const client = createClient({
139
140
  })
140
141
 
141
142
  // ── 2. Define entity types & bind ────────────────────────────
142
- // (see 03-sdk/02-entity-operations.md for full details)
143
+ // (see 04-app-sdk/02-entity-operations.md for full details)
143
144
  export type NoteRecord = EntityRecord & { title: string; body: string }
144
145
  export type NoteCreate = { title: string; body: string }
145
146
  export type NoteUpdate = Partial<NoteCreate>
@@ -149,7 +150,7 @@ export const entities = defineEntities({
149
150
  })
150
151
 
151
152
  // ── 3. Define AI actions ─────────────────────────────────────
152
- // (see 03-sdk/07-ai-action-calls.md for full details)
153
+ // (see 04-app-sdk/07-ai-action-calls.md for full details)
153
154
  export const summarizeInputSchema = z.object({ noteId: z.string() })
154
155
  export type SummarizeInput = z.infer<typeof summarizeInputSchema>
155
156
 
@@ -202,7 +203,7 @@ Rules:
202
203
 
203
204
  ## Auth Modes
204
205
 
205
- See `03-sdk/03-auth.md` for the full custom-login playbook.
206
+ See `04-app-sdk/03-auth.md` for the full custom-login playbook.
206
207
 
207
208
  ```ts
208
209
  // Default — HowOne hosted login (howone.dev / howone.ai)
@@ -287,7 +288,7 @@ client.auth.logout()
287
288
 
288
289
  - Use `client.entities.*` / `howone.entities.*` for authenticated app data. The backend derives owner from the JWT; do not pass owner filters or owner fields.
289
290
  - Use `client.public.entities.*` / `howone.public.entities.*` for public landing pages, public article lists, scoped QR/profile pages, and public forms.
290
- - Use `client.schema.*` only for backend contract management: definitions, schema operations, schema patch preview/apply, versions, and restore.
291
+ - Use `client.schema.*` only for backend contract management: definitions, schema operations, schema patch apply, versions, and restore.
291
292
  - Use `client.raw.*` only for custom endpoints not covered by typed SDK methods.
292
293
 
293
294
  ---
@@ -4,7 +4,7 @@
4
4
 
5
5
  **`src/lib/sdk.ts` must be generated from `.howone/ai/manifest.json`. Do not write it from memory or from generic examples.**
6
6
 
7
- For AI capability and workflow design, read `04-ai/` first. This file is only for app-side SDK
7
+ For AI capability and workflow design, read `03-ai-capabilities/` first. This file is only for app-side SDK
8
8
  bindings and runtime calls after the manifest exists.
9
9
 
10
10
  For every capability in `manifest.json`:
@@ -27,8 +27,8 @@ Correct sequence:
27
27
  1. `ai-capability-design` — design the capability contract
28
28
  2. `sync_ai_artifacts` — sync manifest to disk
29
29
  3. `external-ai-capability` — submit workflow create/update to EAX from the synced manifest
30
- 4. Workflow status/background-task layer confirms readiness and captures `workflowConfigID` for future edits
31
- 5. Read `.howone/ai/manifest.json` → write `src/lib/sdk.ts` with `workflowId`
30
+ 4. Re-read `.howone/ai/manifest.json`; update may have rotated `workflowId`
31
+ 5. Write `src/lib/sdk.ts` with the current manifest `workflowId`
32
32
 
33
33
  Building without errors does **not** mean the AI workflow binding is correct. A missing `workflowId` causes a runtime UUID error at the EAX execution call.
34
34
 
@@ -98,7 +98,7 @@ type AiEvent = {
98
98
  ```
99
99
 
100
100
  Stream terminates after exactly one of: `run_complete`, `credit_insufficient`, or `run_error`.
101
- For the full wire protocol, read `03-sdk/09-workflow-execute-sse.md`.
101
+ For the full wire protocol, read `04-app-sdk/10-workflow-execute-sse.md`.
102
102
 
103
103
  ---
104
104
 
@@ -419,7 +419,7 @@ try {
419
419
  ## AI Result Persistence
420
420
 
421
421
  When AI-generated content should be saved to an entity, prefer the SDK persistence helper for
422
- history-style products. It standardizes the pending-first pattern from `02-database/05-ai-persistence-patterns.md`
422
+ history-style products. It standardizes the pending-first pattern from `02-entity-schema/05-ai-persistence-patterns.md`
423
423
  without adding UI behavior.
424
424
 
425
425
  ```ts
@@ -1,4 +1,4 @@
1
- # AI SDK Handoff
1
+ # AI Manifest Handoff (App SDK)
2
2
 
3
3
  Use this reference after AI capability artifacts have been synced and app code must call the
4
4
  workflow through `@howone/sdk`.
@@ -6,7 +6,7 @@ workflow through `@howone/sdk`.
6
6
  This file answers: **how does `.howone/ai/manifest.json` become `src/lib/sdk.ts`, and how should UI
7
7
  call it?**
8
8
 
9
- For live stream wire details, read `03-sdk/09-workflow-execute-sse.md`. The current endpoint emits
9
+ For live stream wire details, read `04-app-sdk/10-workflow-execute-sse.md`. The current endpoint emits
10
10
  only `run_start`, `progress`, `run_complete`, `run_error`, and `credit_insufficient`.
11
11
 
12
12
  ## Binding Source
@@ -217,12 +217,13 @@ Do not ask the workflow to write records. Do not pass owner fields for authentic
217
217
  When changing external workflow behavior later:
218
218
 
219
219
  1. If schema changes, update AI capability contract first and sync manifest.
220
- 2. Use `workflowConfigID` from a completed status result.
221
- 3. Submit update with `capabilityName`, `workflowConfigID`, and `updatePrompt`.
222
- 4. Preserve the new status result and config ID if it changes.
223
- 5. Regenerate SDK only if manifest contract changed.
220
+ 2. Submit update through `external-ai-capability` with `updates: [{ capabilityName, updatePrompt }]`.
221
+ 3. Re-read `.howone/ai/manifest.json`; update may rotate `workflowId` to a fresh config UUID.
222
+ 4. Regenerate SDK bindings whenever the manifest `workflowId`, input schema, or output schema changed.
223
+ 5. Behavior-only updates still require checking the manifest before deciding SDK is unchanged.
224
224
 
225
- `workflowConfigID` is not `workflowId`.
225
+ The SDK does not use old `workflowConfigID` status values. It binds to the current manifest
226
+ `workflowId`, which is the EAX config id used in execution URLs.
226
227
 
227
228
  ## Handoff Checklist
228
229
 
@@ -61,7 +61,7 @@ Do not add one-off flags when an adapter/callback can express the behavior.
61
61
  | Auth | token source, session state, login/logout destination policy, hosted HowOne defaults | login page visuals, account menu, loading states, auth error UI |
62
62
  | React provider | context, auth callbacks, optional bottom-right HowOne `FloatingButton` logo | layout, toasts, overlays, route components, theme system |
63
63
  | Entities | typed CRUD/query clients, public/private routing, payload normalization | forms, list rendering, optimistic UI, field-level UX |
64
- | Schema | definition operations, preview/apply/version/restore calls | migration approval UI, admin experience |
64
+ | Schema | definition operations, apply/version/restore calls | migration approval UI, admin experience |
65
65
  | Entity contract utilities | payload whitelisting, public query guardrail validation, structured validation issues | deciding product copy, rendering validation errors |
66
66
  | AI workflows | run/stream/events, Zod validation, workflowId binding | progress UI, result rendering, failure surfaces |
67
67
  | AI persistence | pending-first orchestration helper, state callbacks, completed/failed mapping hook | choosing schema fields, retry UX, visible state UI |
@@ -1,10 +1,10 @@
1
- # Data Access Patterns
1
+ # Entity Data Access Patterns (App SDK)
2
2
 
3
3
  Use this reference to connect backend `access` design to frontend SDK calls. It answers:
4
4
  **which namespace should the app call, which filters are legal, and what must not be persisted?**
5
5
 
6
- For schema design, read `01-schema-design.md`. For query syntax details, read
7
- `04-query-dsl-and-responses.md`.
6
+ For schema design, read `02-entity-schema/01-schema-design.md`. For query syntax details, read
7
+ `12-query-dsl-and-responses.md`.
8
8
 
9
9
  ## Namespace Decision
10
10
 
@@ -14,7 +14,7 @@ For schema design, read `01-schema-design.md`. For query syntax details, read
14
14
  | Logged-in shared records | `howone.entities.Entity` | yes | `query`, `get`, CRUD |
15
15
  | Public list page | `howone.public.entities.Entity` | no | `query` |
16
16
  | Public scoped share/detail | `howone.public.entities.Entity` | no | `queryScoped`, `get` with scope options |
17
- | Schema tooling | `howone.schema` | yes | `previewPatch`, `applyPatch` |
17
+ | Schema tooling | `howone.schema` | yes | `applyPatch`, versions, restore |
18
18
  | Low-level fallback | `howone.raw` / `howone.public.raw` | depends | only when typed method missing |
19
19
 
20
20
  Do not mix authenticated and public namespaces for the same page without a clear reason.
@@ -1,4 +1,4 @@
1
- # Query DSL And Responses
1
+ # Entity Query DSL And Responses (App SDK)
2
2
 
3
3
  Use this reference when implementing list/detail pages, filters, sorting, pagination, or response
4
4
  normalization for HowOne dynamic entities.
@@ -1,143 +1,147 @@
1
1
  ---
2
2
  name: howone
3
- description: Operating manual for HowOne generated app architecture and runtime contracts. Use when a task touches app generation flow, backend/dynamic entity schema design, data access, SDK bindings, frontend code that uses HowOne data, auth, uploads, public/private access, AI capabilities/workflows, AI result persistence, realtime/status/event flows, or any @howone/sdk / howone.entities / howone.public / howone.ai calls. Load first, then read the smallest relevant numbered track: 01-architect, 02-database, 03-sdk, or 04-ai.
3
+ description: 'Use when the task touches HowOne platform contracts or app runtime: designing/changing backend dynamic entity schemas, public/private access, Mongo-backed persisted data, AI capabilities/workflows, external-ai workflow create/update/status, syncing .howone manifests, generating src/lib/sdk.ts, auth/uploads, or app code that calls @howone/sdk/howone.*. Also use when files mention backend-api-design, ai-capability-design, sync_schema_artifacts, sync_ai_artifacts, external-ai-capability, .howone/database, or .howone/ai. Do not use for UI-only edits with no HowOne data, AI, auth, upload, manifest, or SDK surface.'
4
4
  ---
5
5
 
6
- # HowOne App Architecture Skill
6
+ # HowOne
7
7
 
8
- This skill is the operating manual for generated HowOne apps. Use it before making platform
9
- decisions for backend data, frontend data access, auth, AI capabilities, SDK bindings, or generated
10
- app code that depends on HowOne runtime behavior.
8
+ HowOne builds generated full-stack AI apps. Platform contracts are separate from app implementation:
11
9
 
12
- Load the smallest set of numbered references that match the task, but do not skip this skill for
13
- backend schema design, frontend implementation, or AI features. The references define the contracts
14
- that app code must follow.
10
+ - Backend: dynamic entity contracts backed by HowOne's MongoDB runtime.
11
+ - AI: capability contracts and external workflow generation/editing.
12
+ - SDK: app-side runtime bindings and calls after manifests are synced.
15
13
 
16
- ## Active Tracks
14
+ Load only the track needed for the user's request. Do not read SDK files while designing backend or AI contracts unless the task has reached manifest-to-code implementation.
17
15
 
18
- | Track | Folder | Use For |
16
+ ## Trigger Preconditions
17
+
18
+ Use this skill before work when any condition is true:
19
+
20
+ - The user asks for persisted app data, backend schema, entity fields, access, indexes, public pages, private history, or Mongo-backed records.
21
+ - The user asks for HowOne AI behavior, capability contracts, workflow generation/update/status, or `external-ai`.
22
+ - The work reads or writes `.howone/database/*`, `.howone/ai/*`, `src/lib/sdk.ts`, or app code using `@howone/sdk` / `howone.*`.
23
+ - The selected tool is `backend-api-design`, `ai-capability-design`, `sync_schema_artifacts`, `sync_ai_artifacts`, or `external-ai-capability`.
24
+ - The implementation needs HowOne auth, upload URLs, public/private entity access, or manifest-to-SDK bindings.
25
+
26
+ Skip this skill only when the task is purely UI/static code and does not touch HowOne data, AI,
27
+ auth, upload, manifests, or SDK calls.
28
+
29
+ ## First Decision
30
+
31
+ Classify the request before tool writes:
32
+
33
+ | User need | Track | Tools/files |
19
34
  |---|---|---|
20
- | `01-architect/` | App generation + manifest flow | End-to-end HowOne app generation flow: when to design backend, when to sync manifests, when to update SDK bindings, and how to choose auth/data posture. |
21
- | `02-database/` | Backend schema + data access design | Entity schema contract, schema operations, access modes, owner/public data posture, indexes, query DSL, AI output persistence, versions, and guardrails. |
22
- | `03-sdk/` | Frontend SDK usage | `src/lib/sdk.ts`, auth, React provider, entity calls, public data, uploads, raw HTTP, AI action calls. |
23
- | `04-ai/` | AI capability + workflow design | HowOne AI capability contracts, service capability selection, workflow create/update/status, schema rules, playbooks, persistence boundaries, and SDK handoff. |
24
-
25
- ## Routing
26
-
27
- Read references by task shape. Prefer exact references over generic examples.
28
-
29
- - New HowOne app or broad feature planning: read `01-architect/01-app-generation.md`.
30
- - Any feature touching backend data, frontend data access, or saved records: read the architect
31
- flow first, then the relevant database and SDK references below.
32
- - Any feature touching AI generation, AI workflow behavior, or AI outputs: read the AI references
33
- first, then the SDK handoff/action-call references.
34
- - AI capability, AI workflow generation/editing, or full-stack AI feature planning: read
35
- `04-ai/01-ai-capability-architecture.md`, `04-ai/04-service-capability-catalog.md`, and
36
- `04-ai/02-workflow-contract-rules.md`.
37
- - Backend database/schema creation or change: read `02-database/01-schema-design.md` and
38
- `02-database/02-schema-operations.md`.
39
- - AI output persistence, generation history, retry/resume, or saved AI results: read the `04-ai/`
40
- files first, then `02-database/05-ai-persistence-patterns.md` and
41
- `02-database/01-schema-design.md`.
42
- - After schema sync, when app code must call the entity: read
43
- `01-architect/02-manifest-codegen.md` and `03-sdk/02-entity-operations.md`.
44
- - Custom login page (your UI, HowOne APIs): `auth: 'custom'` in `createClient` (see `03-sdk/03-auth.md`),
45
- `HowOneProvider auth="none"` and keep the default bottom-right HowOne logo unless explicitly hidden. Default without `auth` = hosted HowOne login.
46
- - `src/lib/sdk.ts`, `createClient`, env vars, or generated bindings: read
47
- `03-sdk/01-client-setup.md` and `01-architect/02-manifest-codegen.md`.
48
- - Public landing pages or share URLs: read `02-database/03-data-access-patterns.md`,
49
- `03-sdk/02-entity-operations.md`, and `01-architect/02-manifest-codegen.md`.
50
- - File upload: read `03-sdk/05-file-upload.md`.
51
- - Raw HTTP escape hatch: read `03-sdk/06-raw-http.md`.
52
- - App-side AI action calls after `.howone/ai/manifest.json` exists: read
53
- `03-sdk/07-ai-action-calls.md` and `03-sdk/09-workflow-execute-sse.md`.
54
- - External workflow create/update/status: read `04-ai/05-workflow-operations.md`.
55
- - Common AI feature templates: read `04-ai/06-ai-feature-playbooks.md`.
56
-
57
- ## Reference Selection Protocol
58
-
59
- Before writing code, classify the touched surfaces:
60
-
61
- | Touched surface | Required references |
35
+ | Persist HowOne app data | Backend | `backend-api-design`, `sync_schema_artifacts`, backend files under `02-entity-schema/` |
36
+ | Add/change HowOne AI behavior | AI | `ai-capability-design`, `sync_ai_artifacts`, `external-ai-capability`, `03-ai-capabilities/*` |
37
+ | Call HowOne from generated app code | SDK | `src/lib/sdk.ts`, synced manifests, `04-app-sdk/*` |
38
+ | UI only, no HowOne data or AI | None | edit app code only |
39
+ | User-owned external services | App-owned | integrate in app code/config; do not fake platform contracts |
40
+
41
+ If multiple tracks apply, process them in dependency order:
42
+
43
+ ```text
44
+ architect -> backend contract and/or AI contract -> sync manifests -> SDK bindings -> UI
45
+ ```
46
+
47
+ ## Mandatory Reads
48
+
49
+ Always read `01-architect/01-app-generation.md` before the first write to a HowOne platform contract or SDK binding.
50
+
51
+ Then read the minimum track files:
52
+
53
+ | Track | Required before writes |
54
+ |---|---|
55
+ | Backend contract | `02-entity-schema/01-schema-design.md`, `02-entity-schema/02-schema-operations.md` |
56
+ | AI contract | `03-ai-capabilities/01-ai-capability-architecture.md`, `03-ai-capabilities/02-workflow-contract-rules.md`, `03-ai-capabilities/03-service-capability-catalog.md` |
57
+ | External AI workflow submit/update | `03-ai-capabilities/04-workflow-operations.md` |
58
+ | SDK binding/code | `01-architect/02-manifest-codegen.md` plus the relevant `04-app-sdk/` file |
59
+ | AI output persistence | Backend required reads plus `02-entity-schema/05-ai-persistence-patterns.md` after AI output schema is known |
60
+
61
+ Do not load all references preemptively.
62
+
63
+ ## Tool Flow
64
+
65
+ Backend contract:
66
+
67
+ ```text
68
+ get_current_schema -> apply_schema_patch -> sync_schema_artifacts -> read .howone/database/manifest.json
69
+ ```
70
+
71
+ AI contract:
72
+
73
+ ```text
74
+ get_current_ai_capabilities -> apply_capability_patch -> sync_ai_artifacts -> external-ai-capability -> read .howone/ai/manifest.json
75
+ ```
76
+
77
+ No contract dry-run step. Normal generation applies one well-formed patch directly. For destructive,
78
+ narrowing, or public-access-expanding changes, stop for user alignment first, then apply the exact
79
+ approved patch.
80
+
81
+ SDK/code:
82
+
83
+ ```text
84
+ read synced manifests -> update src/lib/sdk.ts -> implement UI/server code using src/lib/sdk.ts imports
85
+ ```
86
+
87
+ ## Source Of Truth
88
+
89
+ - Backend fields/access/indexes: `{appRoot}/.howone/database/manifest.json` after sync.
90
+ - AI names/workflow IDs/schemas: `{appRoot}/.howone/ai/manifest.json` after sync.
91
+ - App runtime entry: `{appRoot}/src/lib/sdk.ts`.
92
+ - Do not handwrite `.howone/` metadata.
93
+ - Do not infer contract identifiers from prompts, memory, or dependency source.
94
+
95
+ ## Track Index
96
+
97
+ ### Architect
98
+
99
+ | File | Use |
100
+ |---|---|
101
+ | `01-architect/01-app-generation.md` | Scope classification, platform boundary, ordering |
102
+ | `01-architect/02-manifest-codegen.md` | Synced manifests to `src/lib/sdk.ts` |
103
+
104
+ ### Backend
105
+
106
+ | File | Use |
107
+ |---|---|
108
+ | `02-entity-schema/01-schema-design.md` | Entity fields, access, indexes |
109
+ | `02-entity-schema/02-schema-operations.md` | Patch/apply/sync/version rules |
110
+ | `02-entity-schema/03-access-models.md` | Backend authenticated/public access models |
111
+ | `02-entity-schema/04-query-contracts.md` | Backend filter/sort/pagination/index contracts |
112
+ | `02-entity-schema/05-ai-persistence-patterns.md` | Saving AI results into entities |
113
+
114
+ ### AI
115
+
116
+ | File | Use |
117
+ |---|---|
118
+ | `03-ai-capabilities/01-ai-capability-architecture.md` | AI layers and design order |
119
+ | `03-ai-capabilities/02-workflow-contract-rules.md` | Capability JSON schema rules |
120
+ | `03-ai-capabilities/03-service-capability-catalog.md` | Supported workflow families |
121
+ | `03-ai-capabilities/04-workflow-operations.md` | External workflow create/update/status |
122
+ | `03-ai-capabilities/05-ai-feature-playbooks.md` | Reusable AI product patterns |
123
+
124
+ ### SDK
125
+
126
+ | File | Use |
62
127
  |---|---|
63
- | New app, feature architecture, or uncertain data posture | `01-architect/01-app-generation.md` |
64
- | Entity/schema/access/index change | `02-database/01-schema-design.md`, `02-database/02-schema-operations.md` |
65
- | Existing synced manifest to TypeScript bindings | `01-architect/02-manifest-codegen.md` |
66
- | UI reads/writes entities | `03-sdk/01-client-setup.md`, `03-sdk/02-entity-operations.md` |
67
- | Public read/share flow | `02-database/03-data-access-patterns.md`, `03-sdk/02-entity-operations.md` |
68
- | Query filters/sort/pagination/response mapping | `02-database/04-query-dsl-and-responses.md` |
69
- | AI output persistence / generation history | `02-database/05-ai-persistence-patterns.md`, `04-ai/01-ai-capability-architecture.md` |
70
- | Auth/session/login behavior | `03-sdk/03-auth.md`, `03-sdk/04-react-integration.md` |
71
- | AI capability or workflow design | `04-ai/01-ai-capability-architecture.md`, `04-ai/04-service-capability-catalog.md`, `04-ai/02-workflow-contract-rules.md` |
72
- | External workflow create/update/status | `04-ai/05-workflow-operations.md` |
73
- | Common AI feature examples | `04-ai/06-ai-feature-playbooks.md` |
74
- | AI manifest handoff to app code | `04-ai/03-ai-sdk-handoff.md`, `03-sdk/07-ai-action-calls.md`, `03-sdk/09-workflow-execute-sse.md` |
75
- | File upload | `03-sdk/05-file-upload.md` |
76
- | Raw HTTP escape hatch | `03-sdk/06-raw-http.md` |
77
- | SDK extensibility / adapter boundaries | `03-sdk/08-extension-boundaries.md` |
78
-
79
- If a task spans multiple surfaces, read one reference from each surface before editing. Do not
80
- invent API parameters, response shapes, owner fields, workflow IDs, or output paths from memory.
81
-
82
- ## Core Workflow
83
-
84
- For app features that touch backend data:
85
-
86
- 1. Decide the data posture in the architect track: private user data, authenticated shared data,
87
- public list data, or public scoped share data.
88
- 2. Design or update the entity contract in the database track.
89
- 3. Use schema tools to preview/apply the same operations, then sync schema artifacts.
90
- 4. Read `.howone/database/manifest.json`.
91
- 5. Generate or update app SDK bindings from the manifest.
92
- 6. Implement frontend calls using the SDK track.
93
- 7. Validate with the app's typecheck/build.
94
-
95
- For app features that touch AI:
96
-
97
- 1. Decide the AI feature boundary in the AI track: one workflow per feature, except RAG uses
98
- indexing and query workflows.
99
- 2. Design or update the AI capability contract with `ai-capability-design`.
100
- 3. Preview/apply the same AI patch, then sync AI artifacts.
101
- 4. Submit external workflow create/update with `external-ai-capability`.
102
- 5. Preserve returned request IDs for the workflow status/background-task layer.
103
- 6. Read `.howone/ai/manifest.json`.
104
- 7. Generate or update app SDK bindings from the manifest.
105
- 8. Implement frontend calls using `howone.ai.*`.
106
- 9. If outputs are saved, map only durable product fields from the AI result into an entity schema,
107
- then follow the database workflow.
108
-
109
- For frontend-only SDK work:
110
-
111
- 1. Read existing `src/lib/sdk.ts`.
112
- 2. Read only the SDK reference for the touched surface.
113
- 3. Preserve existing generated bindings and import style.
114
- 4. Validate.
115
-
116
- ## Non-Negotiable Rules
117
-
118
- - Generate SDK bindings from synced manifests, not from memory.
119
- - Keep `.howone/` as manifest storage only; do not write generated source files there.
120
- - Configure `projectId` and `env` only in `createClient`. Auth APIs follow the same `env` (dev → `api.howone.dev`, not `api.howone.ai`).
121
- - Import `src/lib/sdk.ts` before any `@howone/sdk` auth call so environment is pinned.
122
- - Use `import.meta.env.VITE_HOWONE_PROJECT_ID` and `import.meta.env.VITE_HOWONE_ENV`; do not
123
- hardcode project IDs or add fallback env values.
124
- - For private user-owned data, authenticated APIs derive owner from JWT. Do not pass
125
- `created_by_id`, `created_by_user_id`, `createdById`, `ownerId`, or `puid`.
126
- - For `access.authenticated.read = "own"`, prefer `howone.entities.Entity.query.mine(...)`.
127
- - Public pages use `howone.public.entities.*` only when manifest access explicitly allows public
128
- reads or writes.
129
- - Default `createClient({ projectId, env })` uses **HowOne hosted login**. For a custom `/login` UI
130
- that still calls HowOne OTP/OAuth APIs, add `auth: 'custom'` and `HowOneProvider auth="none"`.
131
- - `HowOneProvider` may render the bottom-right HowOne `FloatingButton` logo by default. Do not remove
132
- it unless the user explicitly asks for `brand="hidden"` or `showBrandButton={false}`.
133
- - Do not add SDK-owned toast APIs, redirect overlays, or app-specific UI. Expose data, state, events,
134
- and callbacks; implement visible feedback in the generated frontend app.
135
- - SDK extensibility rule: default behavior must work without configuration, and custom behavior must
136
- enter through typed adapters/callbacks instead of hardcoded app UI or provider-specific branches.
137
- - AI workflows are implementation, not persistence. Never put CRUD, auth, upload handling, or app
138
- state management into the workflow capability contract.
139
- - For external workflow edits, pass `workflowConfigID` from a confirmed workflow status result; do
140
- not invent it or omit it.
141
- - If the user explicitly requires AI behavior that the available workflow service cannot support,
142
- stop that AI implementation path and report the unsupported requirement instead of faking,
143
- silently omitting, or replacing the AI capability with static behavior.
128
+ | `04-app-sdk/01-client-setup.md` | `createClient`, env, provider |
129
+ | `04-app-sdk/02-entity-operations.md` | `howone.entities` and public namespace |
130
+ | `04-app-sdk/03-auth.md` | Login/session/custom auth |
131
+ | `04-app-sdk/04-react-integration.md` | Provider and hooks |
132
+ | `04-app-sdk/05-file-upload.md` | Upload URLs/files |
133
+ | `04-app-sdk/06-raw-http.md` | Typed escape hatch |
134
+ | `04-app-sdk/07-ai-action-calls.md` | `howone.ai.*` runtime calls |
135
+ | `04-app-sdk/08-ai-manifest-handoff.md` | AI manifest to SDK bindings |
136
+ | `04-app-sdk/09-extension-boundaries.md` | Adapter/extension boundaries |
137
+ | `04-app-sdk/10-workflow-execute-sse.md` | Workflow run/stream wire format |
138
+ | `04-app-sdk/11-entity-data-access-patterns.md` | App entity access calls from synced manifest |
139
+ | `04-app-sdk/12-query-dsl-and-responses.md` | App query/filter/sort/pagination calls |
140
+
141
+ ## Hard Rules
142
+
143
+ - Backend and AI design references must not include SDK implementation work.
144
+ - SDK references must not invent backend or AI contracts; they consume synced manifests.
145
+ - AI workflows must not perform database CRUD; persistence is app code through entities.
146
+ - User-owned infrastructure is app code, not a platform gap.
147
+ - Platform gap means missing HowOne contract/tool/catalog support, not an unsupported technology name.
@@ -1,4 +1,4 @@
1
1
  interface:
2
- display_name: "HowOne App Architecture"
3
- short_description: "Design HowOne database schemas, AI workflows, SDK bindings, auth, and app integration."
4
- default_prompt: "Use this skill to choose the right HowOne architecture track, then implement database schema, AI capability/workflow, SDK bindings, auth, or frontend SDK calls from synced manifests."
2
+ display_name: "HowOne"
3
+ short_description: "Generated app platform: scope-first architecture, optional entity schema, AI capabilities, and SDK integration from synced contracts."
4
+ default_prompt: "Load howone, read 01-architect/01-app-generation.md, then the smallest track files from SKILL.md for this request. Scope follows the user—not every app needs AI or backend."
@@ -69,8 +69,8 @@ Prefer failure-driven inspection over speculative context loading.
69
69
  ## HowOne Runtime and Auth
70
70
 
71
71
  - Use synced HowOne manifests plus `src/lib/sdk.ts` as the source of truth for generated entity and AI bindings.
72
- - Use the `howone-sdk` skill for HowOne app architecture, backend database schema design, manifest-to-SDK binding, and app-side SDK code.
73
- - Inside `howone-sdk`, read the smallest relevant numbered track: `01-architect/` for app flow, `02-database/` for schema/access/data design, and `03-sdk/` for frontend SDK/auth/entity calls.
72
+ - Use the `howone` skill: `skill(howone)` `SKILL.md` → `01-architect/01-app-generation.md` smallest track reads from the skill index. Scope follows the user request.
73
+ - Tracks: `01-architect/`, `02-entity-schema/`, `03-ai-capabilities/`, `04-app-sdk/` include only what the user needs.
74
74
  - Choose auth posture from the schema access contract, not from guesswork:
75
75
  - authenticated/private app data uses `howone.entities.*`; the backend derives ownership from the JWT
76
76
  - public pages use `howone.public.entities.*` only when the manifest explicitly allows public access