@wireweave/agent-prompts 0.2.0-beta.3 → 0.2.0-beta.4

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/dist/index.cjs CHANGED
@@ -87,6 +87,7 @@ Screens in one .wf file share a shell (header, sidebar, footer). Restating it on
87
87
  - component NAME(param: string, other: number) { \u2026 } \u2014 declare typed parameters so one fragment serves several call sites. Types are string, number, boolean.
88
88
  - use NAME(arg="value") { \u2026 } \u2014 draw a component defined above. Arguments are parenthesized name=value pairs; the optional braces fill the component's slots.
89
89
  - page "Title" uses=NAME { \u2026 } \u2014 draw this page inside layout NAME. The page body holds only what is unique to that screen.
90
+ - repeat N { \u2026 } \u2014 draw the body N times. N is a bare non-negative integer, NOT quoted and NOT an attribute. Use it instead of pasting the same child N times.
90
91
 
91
92
  \`\`\`
92
93
  layout app {
@@ -123,6 +124,20 @@ page "Home" {
123
124
  - "$to" substitutes only as an entire value. "go to $to" is literal text, not a reference.
124
125
  - Every "$name" must match a declared parameter. An undeclared name is a validation error, so check the spelling against the component's parameter list.
125
126
 
127
+ Repeated siblings \u2014 WRITE THE BODY ONCE:
128
+ Six identical skeleton cards are one body repeated, not six pasted copies.
129
+
130
+ \`\`\`
131
+ row gap=4 {
132
+ repeat 6 { use skeletonCard() }
133
+ }
134
+ \`\`\`
135
+
136
+ - There is NO index variable. \`repeat 6 as i\` does NOT exist and FAILS TO PARSE. Every copy is identical \u2014 that is what a wireframe shows.
137
+ - If the items genuinely differ (different labels, different icons), do NOT use repeat. Write them out, or pass the difference as a component parameter.
138
+ - The count is positional: write \`repeat 6\`, never \`repeat count=6\`.
139
+ - \`repeat 0\` draws nothing; \`repeat 1\` draws the body once. Nesting multiplies, so keep nested counts small.
140
+
126
141
  Rules:
127
142
  - layout and component are TOP-LEVEL only \u2014 siblings of page, never nested inside one.
128
143
  - Define a layout as soon as two or more pages share a shell. Three pages that each repeat a header is a defect, not a style.
@@ -318,6 +333,7 @@ function buildCompactGrammarPrompt() {
318
333
  - Multi-view apps default to separate top-level pages (not sidebar collapse).
319
334
 
320
335
  # REUSE: layout NAME { \u2026 } defines a shared shell (name is a bare identifier, not a quoted string); slot marks where a referencing page's own content goes inside that shell (bare keyword, no name, no braces); component NAME { \u2026 } defines a reusable fragment; use NAME(arg="value") { \u2026 } draws that fragment, passing parenthesized arguments and optionally filling its slots; page "Title" uses=NAME draws that page inside the layout and states only its own content. layout/component are top-level siblings of page. Two or more pages sharing a shell \u2192 define a layout instead of repeating it.
336
+ repeat N { \u2026 } draws its body N times \u2014 write repeat 6 { use skeletonCard() } instead of pasting six copies. N is a bare integer. There is NO index variable (repeat 6 as i fails to parse) and every copy is identical, so write items out individually when they differ.
321
337
  # PARAMETERS: component NAME(label: string, to: string) { \u2026 } declares typed parameters (string/number/boolean); inside the body "$label" stands for the passed value. ALWAYS quote the reference \u2014 navigate="$to" and target="$to" work anywhere, including nested effect targets. NEVER write it bare (navigate=$to): an identifier cannot start with $, so the file fails to parse. A reference must be the whole value ("go to $to" is literal text), and every "$name" must match a declared parameter or validation fails.
322
338
  # LAYOUT: page(at, viewport, width, height, device, centered, uses), header(h, border), main(p, scroll), footer(h, border), sidebar(w, border, position), section, row(gap, justify, align, wrap), col(gap, flex, span), stack, relative
323
339
  # CONTAINERS: card(p, shadow), modal(w, id), drawer(w, position, id), accordion
package/dist/index.js CHANGED
@@ -60,6 +60,7 @@ Screens in one .wf file share a shell (header, sidebar, footer). Restating it on
60
60
  - component NAME(param: string, other: number) { \u2026 } \u2014 declare typed parameters so one fragment serves several call sites. Types are string, number, boolean.
61
61
  - use NAME(arg="value") { \u2026 } \u2014 draw a component defined above. Arguments are parenthesized name=value pairs; the optional braces fill the component's slots.
62
62
  - page "Title" uses=NAME { \u2026 } \u2014 draw this page inside layout NAME. The page body holds only what is unique to that screen.
63
+ - repeat N { \u2026 } \u2014 draw the body N times. N is a bare non-negative integer, NOT quoted and NOT an attribute. Use it instead of pasting the same child N times.
63
64
 
64
65
  \`\`\`
65
66
  layout app {
@@ -96,6 +97,20 @@ page "Home" {
96
97
  - "$to" substitutes only as an entire value. "go to $to" is literal text, not a reference.
97
98
  - Every "$name" must match a declared parameter. An undeclared name is a validation error, so check the spelling against the component's parameter list.
98
99
 
100
+ Repeated siblings \u2014 WRITE THE BODY ONCE:
101
+ Six identical skeleton cards are one body repeated, not six pasted copies.
102
+
103
+ \`\`\`
104
+ row gap=4 {
105
+ repeat 6 { use skeletonCard() }
106
+ }
107
+ \`\`\`
108
+
109
+ - There is NO index variable. \`repeat 6 as i\` does NOT exist and FAILS TO PARSE. Every copy is identical \u2014 that is what a wireframe shows.
110
+ - If the items genuinely differ (different labels, different icons), do NOT use repeat. Write them out, or pass the difference as a component parameter.
111
+ - The count is positional: write \`repeat 6\`, never \`repeat count=6\`.
112
+ - \`repeat 0\` draws nothing; \`repeat 1\` draws the body once. Nesting multiplies, so keep nested counts small.
113
+
99
114
  Rules:
100
115
  - layout and component are TOP-LEVEL only \u2014 siblings of page, never nested inside one.
101
116
  - Define a layout as soon as two or more pages share a shell. Three pages that each repeat a header is a defect, not a style.
@@ -291,6 +306,7 @@ function buildCompactGrammarPrompt() {
291
306
  - Multi-view apps default to separate top-level pages (not sidebar collapse).
292
307
 
293
308
  # REUSE: layout NAME { \u2026 } defines a shared shell (name is a bare identifier, not a quoted string); slot marks where a referencing page's own content goes inside that shell (bare keyword, no name, no braces); component NAME { \u2026 } defines a reusable fragment; use NAME(arg="value") { \u2026 } draws that fragment, passing parenthesized arguments and optionally filling its slots; page "Title" uses=NAME draws that page inside the layout and states only its own content. layout/component are top-level siblings of page. Two or more pages sharing a shell \u2192 define a layout instead of repeating it.
309
+ repeat N { \u2026 } draws its body N times \u2014 write repeat 6 { use skeletonCard() } instead of pasting six copies. N is a bare integer. There is NO index variable (repeat 6 as i fails to parse) and every copy is identical, so write items out individually when they differ.
294
310
  # PARAMETERS: component NAME(label: string, to: string) { \u2026 } declares typed parameters (string/number/boolean); inside the body "$label" stands for the passed value. ALWAYS quote the reference \u2014 navigate="$to" and target="$to" work anywhere, including nested effect targets. NEVER write it bare (navigate=$to): an identifier cannot start with $, so the file fails to parse. A reference must be the whole value ("go to $to" is literal text), and every "$name" must match a declared parameter or validation fails.
295
311
  # LAYOUT: page(at, viewport, width, height, device, centered, uses), header(h, border), main(p, scroll), footer(h, border), sidebar(w, border, position), section, row(gap, justify, align, wrap), col(gap, flex, span), stack, relative
296
312
  # CONTAINERS: card(p, shadow), modal(w, id), drawer(w, position, id), accordion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireweave/agent-prompts",
3
- "version": "0.2.0-beta.3",
3
+ "version": "0.2.0-beta.4",
4
4
  "description": "Canonical grammar prompts for LLM agents generating Wireweave DSL (multi-page aware)",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -52,7 +52,7 @@
52
52
  "typescript": "^5.7.2",
53
53
  "typescript-eslint": "^8.60.0",
54
54
  "vitest": "^3.1.1",
55
- "@wireweave/core": "3.1.0-beta.6"
55
+ "@wireweave/core": "3.1.0-beta.7"
56
56
  },
57
57
  "keywords": [
58
58
  "wireframe",