create-foldkit-app 0.5.10 → 0.5.11
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/package.json +1 -1
- package/templates/base/AGENTS.md +8 -0
package/package.json
CHANGED
package/templates/base/AGENTS.md
CHANGED
|
@@ -93,6 +93,14 @@ Use uppercase section headers (`// MODEL`, `// MESSAGE`, `// INIT`, `// UPDATE`,
|
|
|
93
93
|
|
|
94
94
|
Even after extracting some sections to their own files (e.g. `message.ts`), the remaining file may still benefit from headers. Extract to separate files when it helps with organization.
|
|
95
95
|
|
|
96
|
+
### Testing
|
|
97
|
+
|
|
98
|
+
Test update functions with `foldkit/test`. Since update is pure — `(Model, Message) → [Model, Commands]` — tests run without a runtime, DOM, or side effects.
|
|
99
|
+
|
|
100
|
+
Use `Test.story` to chain steps into a readable narrative: set initial Model → send Message → assert → resolve Command → assert again. Every `Command.define` must include result Message schemas so Commands can be resolved in tests.
|
|
101
|
+
|
|
102
|
+
If the `repos/foldkit` submodule is available, study the `.test.ts` files in `repos/foldkit/examples/` for patterns — they cover simple Command resolution, multi-step interactions, and Submodel OutMessage assertions.
|
|
103
|
+
|
|
96
104
|
## Code Quality Standards
|
|
97
105
|
|
|
98
106
|
- Every name should eliminate ambiguity. Prefix Option-typed values with `maybe` (e.g. `maybeSession`). Name functions by their precise effect (e.g. `enqueueMessage` not `addMessage`). A reader should never need to check a type signature to understand what a name refers to.
|