feat(wix-cli-auto-patterns-dashboard): add auto patterns dashboard skill#78
feat(wix-cli-auto-patterns-dashboard): add auto patterns dashboard skill#78AlonTzukermanWIX wants to merge 9 commits into
Conversation
cdd3e1a to
8cd5fe9
Compare
|
Update — actually typechecked the snippets against Built a harness (TS strict, real What the typecheck did surface, in order of impact:
Net: snippets are mostly type-safe in spirit, but the inline type definitions in the markdown drift from the real package types in the four spots above. Long-term fix is a proper typecheck harness in CI; short-term fix is reconciling those four declarations with the published |
|
|
||
| 3. **Where will it appear?** | ||
| - Dashboard sidebar/page → Dashboard Page or Modal | ||
| - Dashboard sidebar/page → Dashboard Page or Modal (for simple single-collection CRUD with no custom logic, prefer [Auto Patterns Dashboard](references/AUTO_PATTERNS_DASHBOARD.md)) |
There was a problem hiding this comment.
Please add more info about auto patters (e.g faster and cheaper way... )
And also add about iteration (e.g pattern.json...)
There was a problem hiding this comment.
Done — moved the decision criteria into SKILL.md with the why (declarative patterns.json, faster to author, iterate by editing JSON) and disqualifiers inline. See skills/wix-app/SKILL.md:63-64.
| ## When to Use Auto Patterns | ||
|
|
||
| **Use auto patterns when ALL are true:** | ||
| - Single-collection CRUD operations (Create, Read, Update, Delete) | ||
| - Standard table/grid views with sorting and filtering | ||
| - Basic form layouts for entity pages | ||
| - No custom business logic or calculations | ||
| - No embedded script configuration | ||
| - No external API integrations | ||
|
|
||
| **Use custom code ([DASHBOARD_PAGE.md](DASHBOARD_PAGE.md)) when ANY are true:** | ||
| - Multi-collection data joining or aggregation | ||
| - Custom business logic or calculations | ||
| - External API integrations or webhooks | ||
| - Embedded script parameter management | ||
| - Custom UI components beyond standard forms/tables | ||
| - Complex workflows or state management | ||
| - Advanced search or filtering logic | ||
|
|
||
| --- |
There was a problem hiding this comment.
I think you should move it into SKILL.md
There was a problem hiding this comment.
Done — "When to Use" section dropped from this file; criteria now live in SKILL.md so the model self-routes without needing to load this reference.
| 1. **Create `extensions.ts`** in the page directory: | ||
| ```typescript | ||
| import { createDashboardExtension } from '@wix/cli-app'; | ||
|
|
||
| export const myPageExtension = createDashboardExtension(); | ||
| ``` |
There was a problem hiding this comment.
This is not how we write a dashboard page extension, please go over the dashboard page extension, for example:
### Step 1: Create Page-Specific Extension File
Each dashboard page requires an `extensions.ts` file in its folder:
**File:** `src/extensions/dashboard/pages/<page-name>/extensions.ts`
```typescript
import { extensions } from "@wix/astro/builders";
export const dashboardpageMyPage = extensions.dashboardPage({
id: "{{GENERATE_UUID}}",
title: "My Page",
routePath: "my-page",
component: "./extensions/dashboard/pages/my-page/page.tsx",
});
There was a problem hiding this comment.
Also add about UUID Generation same as in dashboard page
There was a problem hiding this comment.
Can you maybe also add how the directory should look like (e.g patterns.json, page.tsx, extensions.ts ...) ? we have it in our other extensions refernces.
There was a problem hiding this comment.
Done — rewrote the snippet to use extensions.dashboardPage() from @wix/astro/builders matching the canonical pattern in DASHBOARD_PAGE.md. Also added directory-layout block and UUID generation note in the same edit (replying to your follow-ups on this thread).
| # Auto-Patterns Core Rules | ||
|
|
||
| ## Logic | ||
| ### Configuration Generation | ||
| 1. **Analyze** schema requirements. | ||
| 2. **Select** fields based on data types (max 3 initially). | ||
| 3. **Validate** against Core Rules. | ||
|
|
||
| ### Enum Handling | ||
| - **IF** `enumConfig` is required (implicit or explicit): | ||
| - **THEN** ASK user for possible option values. | ||
| - **THEN** Derive `label` from `value` (e.g., "dog" -> "Dog") unless specified. | ||
| - **NEVER** guess or invent enum values. | ||
|
|
||
| ## Constraints | ||
| ### Structural Limits | ||
| - **MUST** have exactly 2 pages in `pages` array (`collectionPage` + `entityPage`). | ||
| - **MUST** have exactly 1 component with `layout` array in `collectionPage`. | ||
| - **MUST** use TypeScript for configuration. | ||
|
|
||
| ### Field Selection | ||
| - **MAX** 3 columns initially for `collectionPage`. | ||
| - **MUST** include `create` action in `collectionPage` navigating to `entityPage`. | ||
| - **NEVER** fill optional fields unless explicitly requested. | ||
|
|
||
| ### Type Binding | ||
| - **IF** `type: 'collectionPage'` **THEN** only `collectionPage` field allowed. | ||
| - **IF** `type: 'entityPage'` **THEN** only `entityPage` field allowed. | ||
| - **NEVER** mix types in single page config. | ||
|
|
||
| ### Validation | ||
| - **MUST** align with `AppConfig` structure. | ||
| - **MUST** remove unsupported configuration entries. |
There was a problem hiding this comment.
I think you can put it in AUTO_PATTERNS_DASHBOARD.md, it's very short, and adding us more tool calls to read this very short file
There was a problem hiding this comment.
Done — inlined as a new "Core Rules" section at the top of AUTO_PATTERNS_DASHBOARD.md and deleted the file. Topic-index row removed too.
8cd5fe9 to
4d72098
Compare
|
Thanks for the typecheck pass — addressed all four findings:
Force-pushed as |
|
|
||
| 3. **Where will it appear?** | ||
| - Dashboard sidebar/page → Dashboard Page or Modal | ||
| - Default for single-collection CRUD: [Auto Patterns Dashboard](references/AUTO_PATTERNS_DASHBOARD.md) — declarative `patterns.json` (faster to author, iterate by editing JSON, no React rewrite). Skip when you need multi-collection joins, custom business logic, embedded scripts, or external APIs. |
There was a problem hiding this comment.
Make it more stronger, add more description, i tried to run it 4 times and it keep ignoring AUTO_PATTERNS_DASHBOARD.md and not loading it at all.
Another solution is maybe move it into the Dashboard Page file? and there add explanation about auto patterns.
4d72098 to
76444e5
Compare
|
Routing fix for real-world feedback: agents weren't picking auto-patterns unless the user explicitly said "use auto patterns". Promoted auto-patterns from suggestion to MANDATORY default for single-collection CRUD admin pages (with disqualifiers as the explicit opt-out). 5 surgical edits across 2 files:
Disqualifiers (multi-collection joins / custom business logic / embedded scripts / external APIs / explicit user request for custom React) are listed inline at every gate so the model evaluates them before descending. Force-pushed as |
324efdc to
f36732f
Compare
|
Iteration-flow fix for second round of real-world feedback: when iterating on an existing auto-patterns page, agents were editing 3 edits, same shape as the previous routing fix:
Force-pushed as |
c605269 to
11f72a9
Compare
11f72a9 to
db4538a
Compare
| ## Part A: Creating a New Auto-Patterns Page | ||
|
|
||
| ### Directory Layout | ||
|
|
||
| Create the page folder under `src/extensions/dashboard/pages/<page-name>/` with this structure: | ||
|
|
||
| ``` | ||
| src/extensions/dashboard/pages/<page-name>/ | ||
| ├── extensions.ts # Extension registration | ||
| ├── page.tsx # Thin React wrapper (generated) | ||
| └── patterns.json # Declarative AppConfig — edit this to iterate | ||
| ``` |
There was a problem hiding this comment.
We have switched to non-interactive mode, so please delete this. Make sure Auto Patterns generates extensions.ts with commands instead of writing it manually (see #196)
There was a problem hiding this comment.
Done in 7be38c8 — replaced the manual directory block with a new Step 1: Scaffold the Dashboard Page that uses wix generate --params '{"extensionType":"DASHBOARD_PAGE",...}'. The CLI now creates the folder, page.tsx, builder file, UUID, and src/extensions.ts registration; the "resulting structure" snippet is now just orientation, not something to hand-create.
| 1. **Create `extensions.ts`** in the page directory: | ||
|
|
||
| **File:** `src/extensions/dashboard/pages/<page-name>/extensions.ts` | ||
|
|
||
| ```typescript | ||
| import { extensions } from "@wix/astro/builders"; | ||
|
|
||
| export const dashboardpageMyPage = extensions.dashboardPage({ | ||
| id: "{{GENERATE_UUID}}", | ||
| title: "My Page", | ||
| routePath: "my-page", | ||
| component: "./extensions/dashboard/pages/my-page/page.tsx", | ||
| }); | ||
| ``` |
There was a problem hiding this comment.
We have switched to non-interactive mode, so please delete this. Make sure Auto Patterns generates extensions.ts with commands instead of writing it manually (see #196)
There was a problem hiding this comment.
Done in 7be38c8 — dropped the manual "Create extensions.ts" and "Register the extension" sub-steps entirely. The page is scaffolded via wix generate (new Step 1), and the generator script's --output now targets that scaffolded folder, overwriting the stub page.tsx and adding patterns.json. No hand-written registration anymore — aligned with #196.
Migrates the auto-patterns dashboard content into the consolidated wix-app skill: - New top-level reference: skills/wix-app/references/AUTO_PATTERNS_DASHBOARD.md - 20 sub-references + example JSON in skills/wix-app/references/auto-patterns-dashboard/ - Generator script at skills/wix-app/scripts/generate-auto-patterns.js - Discoverability hooks in skills/wix-app/SKILL.md (Quick Decision Helper + Cross-Cutting References)
Auto-patterns calls @wix/data at runtime but the app-builder flow does not add app scopes automatically. Make AUTO_PATTERNS_DASHBOARD.md self-contained for users running auto-patterns outside the app-builder context by listing the required SCOPE.DC-DATA.READ / WRITE scopes and the Dev Center URL where they are configured. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ca297cc to
320dd92
Compare
Address review feedback (PR wix#78): the skill switched to non-interactive mode, so the auto-patterns page must be scaffolded with `wix generate --params` (extensionType DASHBOARD_PAGE) instead of hand-writing extensions.ts. The CLI now creates the folder, page.tsx, builder file, UUID, and src/extensions.ts registration; the generator script overwrites the scaffolded page.tsx and adds patterns.json. - New Step 1: scaffold via wix generate - Renumber schema/generator steps to 2-5 - Drop the manual "Create extensions.ts" + "Register the extension" steps - Point generator --output at the scaffolded page folder Aligns auto-patterns with the CLI-delegated scaffolding from wix#196. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Empty commit to move the branch tip to a fresh, fetchable SHA without rewriting history. Used to verify whether the App Builder re-extracts skills from branch HEAD (restoring auto-patterns) after the prior force-push orphaned its cached commit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Bug: auto-patterns scaffolding leaves a stray default component and the registered component is never the auto-patterns wrapper When the skill runs End result: two component files exist side-by-side: The |
The CLI scaffolds the page component as `<folder>.tsx` and registers it in `<folder>.extension.ts`, but the generator wrote `page.tsx` — leaving the auto-patterns wrapper unregistered next to the empty CLI stub, so the dashboard rendered blank (reported on PR wix#78). Fix: the generator now writes the wrapper to `<folder>.tsx` (derived from the --output basename), overwriting the stub the builder already points at — no manual registration edit, no stray page.tsx. Docs corrected: builder is `<page-name>.extension.ts`, CLI component is `<page-name>.tsx`, and the override references' "page.tsx" shorthand means that component (don't create a new page.tsx). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rdless of size An agent added a working column (badge) override but placed it inline in the page component instead of components/columns/, citing CODE_QUALITY's "split only if >300 lines" rule (the page was 34 lines). The specific placement mandate in the override references lost to the general size heuristic. - CODE_QUALITY.md: carve-out so the ~300-line rule never licenses inlining an auto-patterns override; overrides are a structural split, not size-based. - AUTO_PATTERNS_DASHBOARD.md Part B: state up front that every override lives in components/<type>/ with a use* hook regardless of size, never inline — covering all override types in one place. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Summary
wix-cli-auto-patterns-dashboardskill for declarative CRUD dashboard pages (single-collection management with standard table/grid views and forms)wix-cli-orchestratorSKILL.md with auto-patterns routing logic and decision tree.claude-plugin/plugin.jsonskills arrayTest plan
wix-cli-auto-patterns-dashboardskill loads correctly in Claude Codewix-cli-dashboard-pagefor complex use cases🤖 Generated with Claude Code