howone 0.1.23 → 0.1.25

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 (24) hide show
  1. package/package.json +1 -1
  2. package/templates/vite/.howone/skills/howone-sdk/01-architect/01-app-generation.md +180 -91
  3. package/templates/vite/.howone/skills/howone-sdk/01-architect/02-manifest-codegen.md +67 -4
  4. package/templates/vite/.howone/skills/howone-sdk/02-database/01-schema-design.md +463 -69
  5. package/templates/vite/.howone/skills/howone-sdk/02-database/02-schema-operations.md +366 -64
  6. package/templates/vite/.howone/skills/howone-sdk/02-database/03-data-access-patterns.md +204 -67
  7. package/templates/vite/.howone/skills/howone-sdk/02-database/04-query-dsl-and-responses.md +237 -0
  8. package/templates/vite/.howone/skills/howone-sdk/02-database/05-ai-persistence-patterns.md +372 -0
  9. package/templates/vite/.howone/skills/howone-sdk/03-sdk/01-client-setup.md +58 -36
  10. package/templates/vite/.howone/skills/howone-sdk/03-sdk/02-entity-operations.md +67 -0
  11. package/templates/vite/.howone/skills/howone-sdk/03-sdk/03-auth.md +267 -469
  12. package/templates/vite/.howone/skills/howone-sdk/03-sdk/04-react-integration.md +113 -320
  13. package/templates/vite/.howone/skills/howone-sdk/03-sdk/07-ai-action-calls.md +66 -16
  14. package/templates/vite/.howone/skills/howone-sdk/03-sdk/08-extension-boundaries.md +226 -0
  15. package/templates/vite/.howone/skills/howone-sdk/04-ai/01-ai-capability-architecture.md +159 -96
  16. package/templates/vite/.howone/skills/howone-sdk/04-ai/02-workflow-contract-rules.md +353 -96
  17. package/templates/vite/.howone/skills/howone-sdk/04-ai/03-ai-sdk-handoff.md +181 -42
  18. package/templates/vite/.howone/skills/howone-sdk/04-ai/04-service-capability-catalog.md +281 -0
  19. package/templates/vite/.howone/skills/howone-sdk/04-ai/05-workflow-operations.md +256 -0
  20. package/templates/vite/.howone/skills/howone-sdk/04-ai/06-ai-feature-playbooks.md +296 -0
  21. package/templates/vite/.howone/skills/howone-sdk/SKILL.md +29 -12
  22. package/templates/vite/.howone/skills/howone-sdk/agents/openai.yaml +2 -2
  23. package/templates/vite/package.json +1 -1
  24. package/templates/vite/.howone/skills/howone-sdk/04-ai/.gitkeep +0 -1
@@ -1,21 +1,64 @@
1
1
  # Workflow Contract Rules
2
2
 
3
- Use this reference when designing `inputSchema`, `outputSchema`, and capability descriptions for
4
- HowOne AI workflows.
3
+ Use this reference when designing `capability.description`, `inputSchema`, `outputSchema`, and
4
+ `outputEntityName` for HowOne AI workflows.
5
+
6
+ These rules come from `docs/ai-worlfow-guide-schema.md`. Violating them can make the workflow
7
+ service reject the request or produce a workflow that the SDK cannot call reliably.
8
+
9
+ ## Contract Shape
10
+
11
+ ```json
12
+ {
13
+ "name": "summarizeDocument",
14
+ "description": "Reads an uploaded document and produces a concise summary highlighting the key points.",
15
+ "inputSchema": {
16
+ "type": "object",
17
+ "properties": {
18
+ "document_url": {
19
+ "type": "string",
20
+ "format": "uri",
21
+ "description": "Supabase Storage URL of the uploaded document."
22
+ },
23
+ "summary_length": {
24
+ "type": "string",
25
+ "description": "Desired summary length, e.g. short, medium, long, or a specific sentence count."
26
+ }
27
+ },
28
+ "required": ["document_url"]
29
+ },
30
+ "outputSchema": {
31
+ "type": "object",
32
+ "properties": {
33
+ "summary": {
34
+ "type": "string",
35
+ "description": "The generated summary in the same language as the source document."
36
+ }
37
+ },
38
+ "required": ["summary"]
39
+ },
40
+ "outputEntityName": "DocumentSummary"
41
+ }
42
+ ```
5
43
 
6
44
  ## Loose JSON Schema
7
45
 
8
- Workflow schemas should be loose enough for an AI workflow engine.
46
+ The workflow engine is agentic. Overly strict schemas reduce reliability.
9
47
 
10
- Rules:
48
+ Do:
49
+
50
+ - require only essential inputs;
51
+ - make non-essential options optional;
52
+ - use strings with good descriptions for open-ended user choices;
53
+ - use nested objects only when the product truly needs structured output;
54
+ - use `format: "uri"` for URLs.
55
+
56
+ Avoid:
11
57
 
12
- - Require only essential inputs.
13
- - Mark non-essential options optional.
14
- - Prefer `string` with a clear description over restrictive enums when user values are open-ended.
15
- - Avoid `minLength`, `maxLength`, `pattern`, and narrow validation unless there is a concrete
16
- technical reason.
17
- - Avoid nested objects when a simple described string is enough.
18
- - Avoid exposing implementation knobs the user does not need.
58
+ - `minLength`, `maxLength`, `pattern` unless technically required;
59
+ - enum for open-ended values like tone, style, audience, mood;
60
+ - many required knobs that normal users do not understand;
61
+ - provider/model/tool names in schema fields.
19
62
 
20
63
  Good:
21
64
 
@@ -28,142 +71,356 @@ Good:
28
71
  }
29
72
  ```
30
73
 
31
- Use enums only for truly closed domains.
74
+ Bad:
75
+
76
+ ```json
77
+ {
78
+ "tone": {
79
+ "type": "string",
80
+ "enum": ["formal", "casual", "humorous"],
81
+ "minLength": 3,
82
+ "maxLength": 20
83
+ }
84
+ }
85
+ ```
86
+
87
+ Use enum only for closed domains such as `"daily" | "minute"` or known output modes.
88
+
89
+ ## URLs Only For Files
90
+
91
+ All file exchange uses cloud storage URLs.
92
+
93
+ Correct inputs:
94
+
95
+ ```json
96
+ {
97
+ "source_image_url": {
98
+ "type": "string",
99
+ "format": "uri",
100
+ "description": "Public URL of the source image to edit."
101
+ }
102
+ }
103
+ ```
104
+
105
+ Correct outputs:
32
106
 
33
- ## URLs, Not Raw Files
107
+ ```json
108
+ {
109
+ "edited_image_url": {
110
+ "type": "string",
111
+ "format": "uri",
112
+ "description": "Public URL of the edited image."
113
+ }
114
+ }
115
+ ```
34
116
 
35
- All file exchange uses URLs.
117
+ Forbidden:
36
118
 
37
- Rules:
119
+ - raw `File` / `Blob`;
120
+ - base64 content;
121
+ - `contentEncoding`;
122
+ - inline PDF/image/audio bytes;
123
+ - browser upload logic in workflow.
38
124
 
39
- - File inputs are strings with `format: "uri"`, such as `document_url`, `source_image_url`, or
40
- `audio_file_url`.
41
- - File outputs are strings with `format: "uri"`, such as `generated_image_url`, `edited_video_url`,
42
- or `result_pdf_url`.
43
- - Never use base64, raw bytes, inline file content, or `contentEncoding`.
44
- - The app uploads user files first, then passes the URL to the workflow.
125
+ The app uploads first through `howone.upload.*`, then passes the URL to the workflow.
45
126
 
46
127
  ## Output Minimalism
47
128
 
48
- The workflow will try to fill every output field. Only ask for fields the product needs.
129
+ Every output field costs model attention. Only include what the product will render or persist.
49
130
 
50
131
  Usually forbidden unless explicitly requested:
51
132
 
52
- - timestamps and processing time
53
- - file size, MIME type, encoding, dimensions, frame rate, bitrate
54
- - confidence scores and bounding boxes
55
- - model, provider, version, cost, or internal execution metadata
56
- - style/tone metadata when the user only asked for an asset
133
+ - `processing_time`, `timestamp`, `created_at`;
134
+ - `model_used`, `provider`, `version`;
135
+ - `file_size`, `mime_type`, `resolution`, `frame_rate`;
136
+ - `confidence_score`, `bounding_boxes`, `coordinates`;
137
+ - style/color/tone metadata when user only asked for an asset.
57
138
 
58
139
  Examples:
59
140
 
60
- | User Need | Good Output | Avoid |
141
+ | User asks | Good output | Avoid |
61
142
  |---|---|---|
62
- | Summarize a document | `summary` | `summary`, `word_count`, `reading_time` |
63
- | Generate an image | `generated_image_url` | `generated_image_url`, `model_used`, `color_palette` |
64
- | OCR an image | `extracted_text` | `extracted_text`, `confidence_score`, `bounding_boxes` |
143
+ | Summarize a PDF | `summary` | `summary`, `word_count`, `reading_time` |
144
+ | Generate image | `generated_image_url` | `generated_image_url`, `model_used`, `color_palette` |
145
+ | OCR image | `extracted_text` | `extracted_text`, `confidence_score`, `bounding_boxes` |
146
+ | Generate video | `video_url` | `video_url`, `duration_seconds`, `frame_rate` |
147
+
148
+ If the app needs history metadata, put it in the entity schema, not workflow output.
65
149
 
66
- ## No Input/Output Name Overlap
150
+ ## Input / Output Names Must Not Overlap
67
151
 
68
- Input and output property names must not overlap. The workflow engine uses a shared parameter
69
- namespace.
152
+ Input and output property names share a routing namespace. Do not reuse names.
153
+
154
+ | Scenario | Bad | Good |
155
+ |---|---|---|
156
+ | Translation | input `text`, output `text` | input `source_text`, output `translated_text` |
157
+ | Summary | input `content`, output `content` | input `source_content`, output `summary` |
158
+ | Image edit | input `image_url`, output `image_url` | input `source_image_url`, output `edited_image_url` |
159
+ | Audio transcript | input `audio_url`, output `audio_url` | input `source_audio_url`, output `transcript_text` |
160
+
161
+ ## Description Says What, Not How
162
+
163
+ `capability.description` describes the user-visible outcome.
164
+
165
+ Good:
166
+
167
+ ```json
168
+ "description": "Searches the web for recent news on a topic and produces a structured briefing with source links."
169
+ ```
70
170
 
71
171
  Bad:
72
172
 
73
173
  ```json
74
- {
75
- "inputSchema": { "properties": { "text": { "type": "string" } } },
76
- "outputSchema": { "properties": { "text": { "type": "string" } } }
174
+ "description": "First calls search_web, then summarizes articles with an LLM, then saves the result."
175
+ ```
176
+
177
+ Do not mention:
178
+
179
+ - internal tool names;
180
+ - step sequences;
181
+ - model/provider names;
182
+ - database writes;
183
+ - storage implementation details except URL inputs/outputs.
184
+
185
+ ## Output Language Must Be Explicit
186
+
187
+ Every text output field description must say what language to use.
188
+
189
+ Patterns:
190
+
191
+ ```json
192
+ "summary": {
193
+ "type": "string",
194
+ "description": "Summary in the same language as the source document."
77
195
  }
78
196
  ```
79
197
 
80
- Good:
198
+ ```json
199
+ "translated_text": {
200
+ "type": "string",
201
+ "description": "Translated text in the target language specified by 'target_language'."
202
+ }
203
+ ```
81
204
 
82
205
  ```json
83
- {
84
- "inputSchema": { "properties": { "source_text": { "type": "string" } } },
85
- "outputSchema": { "properties": { "translated_text": { "type": "string" } } }
206
+ "briefing": {
207
+ "type": "string",
208
+ "description": "Briefing written in the language specified by 'language'."
86
209
  }
87
210
  ```
88
211
 
89
- Common pairs:
212
+ Do not write vague descriptions like `"The translated text."`
90
213
 
91
- - `source_text` -> `translated_text`
92
- - `source_content` -> `summary`
93
- - `source_image_url` -> `edited_image_url`
94
- - `description_prompt` -> `generated_image_url`
214
+ ## No CRUD In Workflow
95
215
 
96
- ## Output Language
216
+ Workflow belongs to intelligent processing. App persistence belongs to entities.
97
217
 
98
- Every text output field description must specify the language rule.
218
+ Forbidden in capability descriptions and schemas:
99
219
 
100
- Use one of these patterns:
220
+ - "save to database";
221
+ - "create user record";
222
+ - "update task status";
223
+ - "delete previous result";
224
+ - "read current user's records";
225
+ - "assign owner".
101
226
 
102
- - fixed: "Summary in English."
103
- - input-driven: "Translated text in the target language specified by `target_language`."
104
- - source-driven: "Summary in the same language as the source document."
105
- - mixed: "Extracted text, which may contain mixed Chinese and English content."
227
+ Instead:
106
228
 
107
- Do not write vague descriptions like "The translated text."
229
+ 1. workflow returns output fields;
230
+ 2. frontend/server code calls SDK entity methods;
231
+ 3. persistence helper maps durable fields.
108
232
 
109
- ## Description Says What, Not How
233
+ ## External Data Assumptions
110
234
 
111
- `capability.description` describes the user outcome.
235
+ Do not require user-provided datasets unless the user said they have them.
112
236
 
113
- Do:
237
+ | User asks | Bad input | Better input |
238
+ |---|---|---|
239
+ | Stock analysis app | `stock_data_csv_url` | `trading_symbol`, `start_date`, `end_date` |
240
+ | Latest news app | `article_urls` | `topic`, `language` |
241
+ | Academic research | `paper_pdf_urls` | `query`, optional `year_range` |
242
+ | Product comparison | `product_dataset_url` | `product_names` or `search_topic` |
114
243
 
115
- ```json
116
- {
117
- "description": "Searches the web for the latest news on a topic and produces a structured briefing with source links."
118
- }
119
- ```
244
+ The workflow should use available retrieval/search capabilities when data is external.
245
+
246
+ ## Raw JSON Requirement
247
+
248
+ Schemas must be raw JSON objects:
120
249
 
121
- Do not:
250
+ - start with `{` and end with `}`;
251
+ - ASCII double quotes;
252
+ - no trailing commas;
253
+ - no `undefined`, `NaN`, comments, or single quotes;
254
+ - not a string containing escaped JSON.
255
+
256
+ Good:
122
257
 
123
258
  ```json
124
- {
125
- "description": "First calls search_web, then summarizes each article with an LLM, then saves JSON."
126
- }
259
+ { "type": "object", "properties": {} }
127
260
  ```
128
261
 
129
- Never mention internal tool names, step sequences, providers, or model names in the capability
130
- description.
262
+ Bad:
131
263
 
132
- ## Available Capability Families
264
+ ```json
265
+ "{ \"type\": \"object\" }"
266
+ ```
133
267
 
134
- Design only around capabilities available to the workflow service:
268
+ ## Schema Pattern Templates
135
269
 
136
- - web search and page crawling
137
- - image generation, editing, analysis, OCR
138
- - video generation, editing, concatenation, frame extraction
139
- - audio generation, recognition, merging
140
- - financial price history retrieval
141
- - academic paper search and bibliography
142
- - file storage/read for JSON, YAML, CSV, PDF, Markdown, TXT
143
- - email sending
144
- - RSS feed fetching
145
- - Airbnb search
146
- - Hacker News search
270
+ ### Text generation
147
271
 
148
- If the requested product needs unavailable functionality, redesign the feature around available
149
- capabilities or exclude it explicitly.
272
+ ```json
273
+ {
274
+ "inputSchema": {
275
+ "type": "object",
276
+ "properties": {
277
+ "topic": {
278
+ "type": "string",
279
+ "description": "Topic to write about."
280
+ },
281
+ "audience": {
282
+ "type": "string",
283
+ "description": "Intended audience, e.g. executives, children, developers, or general readers."
284
+ },
285
+ "language": {
286
+ "type": "string",
287
+ "description": "Output language, e.g. English or Chinese."
288
+ }
289
+ },
290
+ "required": ["topic"]
291
+ },
292
+ "outputSchema": {
293
+ "type": "object",
294
+ "properties": {
295
+ "generated_text": {
296
+ "type": "string",
297
+ "description": "Generated text in the language specified by 'language', or English if not specified."
298
+ }
299
+ },
300
+ "required": ["generated_text"]
301
+ }
302
+ }
303
+ ```
150
304
 
151
- When the user explicitly requires the unavailable AI behavior, terminate the AI task instead of
152
- building a fake or silently degraded implementation. Report the unsupported requirement and the
153
- closest supported alternative.
305
+ ### Image generation
154
306
 
155
- ## External Data Assumptions
307
+ ```json
308
+ {
309
+ "inputSchema": {
310
+ "type": "object",
311
+ "properties": {
312
+ "image_description": {
313
+ "type": "string",
314
+ "description": "Detailed description of the image to generate, including subject, style, mood, and composition."
315
+ },
316
+ "style_preference": {
317
+ "type": "string",
318
+ "description": "Optional style preference such as watercolor, pixel art, photorealistic, anime, or flat design."
319
+ }
320
+ },
321
+ "required": ["image_description"]
322
+ },
323
+ "outputSchema": {
324
+ "type": "object",
325
+ "properties": {
326
+ "generated_image_url": {
327
+ "type": "string",
328
+ "format": "uri",
329
+ "description": "Public URL of the generated image."
330
+ }
331
+ },
332
+ "required": ["generated_image_url"]
333
+ }
334
+ }
335
+ ```
156
336
 
157
- Do not assume the user can provide external datasets unless they explicitly say so.
337
+ ### Image editing
158
338
 
159
- For "stock analysis", use a workflow input such as `trading_symbol` and let the workflow retrieve
160
- history. Do not require `stock_data_csv_url` unless the user says they have a CSV.
339
+ ```json
340
+ {
341
+ "inputSchema": {
342
+ "type": "object",
343
+ "properties": {
344
+ "source_image_url": {
345
+ "type": "string",
346
+ "format": "uri",
347
+ "description": "Public URL of the image to edit."
348
+ },
349
+ "edit_instruction": {
350
+ "type": "string",
351
+ "description": "Natural language instruction describing the desired edit."
352
+ }
353
+ },
354
+ "required": ["source_image_url", "edit_instruction"]
355
+ },
356
+ "outputSchema": {
357
+ "type": "object",
358
+ "properties": {
359
+ "edited_image_url": {
360
+ "type": "string",
361
+ "format": "uri",
362
+ "description": "Public URL of the edited image."
363
+ }
364
+ },
365
+ "required": ["edited_image_url"]
366
+ }
367
+ }
368
+ ```
161
369
 
162
- For "latest news", use web search inside the workflow. Do not ask the user to provide article URLs
163
- unless that is the product requirement.
370
+ ### Research briefing
164
371
 
165
- ## MVP Limit
372
+ ```json
373
+ {
374
+ "inputSchema": {
375
+ "type": "object",
376
+ "properties": {
377
+ "topic": {
378
+ "type": "string",
379
+ "description": "Research topic or question."
380
+ },
381
+ "language": {
382
+ "type": "string",
383
+ "description": "Language for the output briefing."
384
+ }
385
+ },
386
+ "required": ["topic"]
387
+ },
388
+ "outputSchema": {
389
+ "type": "object",
390
+ "properties": {
391
+ "briefing": {
392
+ "type": "object",
393
+ "description": "Structured briefing written in the language specified by 'language'.",
394
+ "properties": {
395
+ "summary": { "type": "string" },
396
+ "sources": {
397
+ "type": "array",
398
+ "items": {
399
+ "type": "object",
400
+ "properties": {
401
+ "title": { "type": "string" },
402
+ "url": { "type": "string", "format": "uri" },
403
+ "key_point": { "type": "string" }
404
+ }
405
+ }
406
+ }
407
+ },
408
+ "required": ["summary", "sources"]
409
+ }
410
+ },
411
+ "required": ["briefing"]
412
+ }
413
+ }
414
+ ```
166
415
 
167
- Keep AI app generation to at most five core features. Exclude feedback forms, onboarding tutorials,
168
- notification settings, export, sharing, personalization, and preferences unless the user explicitly
169
- requests them.
416
+ ## Contract Checklist
417
+
418
+ - Required inputs are essential only.
419
+ - File inputs/outputs are URL strings.
420
+ - Output contains only the requested product result.
421
+ - Input/output property names do not overlap.
422
+ - Text output descriptions specify language.
423
+ - Description says what, not how.
424
+ - No CRUD/auth/upload/payment/app-state requirements.
425
+ - Feature fits an available capability.
426
+ - Schema is raw valid JSON.