@stellisoft/stellify-mcp 0.1.36 → 0.1.37

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.js CHANGED
@@ -600,16 +600,24 @@ Use the returned UUID with html_to_elements (page parameter) or get_route for fu
600
600
  **For elements inside @foreach loops (SSR/Blade):**
601
601
  Use these attributes to reference the loop variable (defaults to \`$item\`):
602
602
  - \`textField\`: Field name for text content → outputs \`{{ $item->fieldName }}\`
603
- - \`hrefField\`: Field name for href → outputs \`href="{{ $item->fieldName }}"\`
603
+ - \`hrefField\`: Field name for href → outputs \`href="{{ $item->fieldName }}"\` (field value ONLY, no prefix)
604
604
  - \`srcField\`: Field name for src → outputs \`src="{{ $item->fieldName }}"\`
605
605
 
606
+ **For hrefs with path prefixes (IMPORTANT):**
607
+ \`hrefField\` outputs ONLY the field value. There is NO \`hrefPrefix\` attribute.
608
+ For links like \`/post/slug-here\`, you MUST use \`hrefExpression\`:
609
+ - \`hrefExpression: "/post/{{ $item->slug }}"\` → outputs \`href="/post/{{ $item->slug }}"\`
610
+ - \`hrefExpression: "/category/{{ $item->slug }}"\` → outputs \`href="/category/{{ $item->slug }}"\`
611
+
606
612
  **For complex Blade expressions in attributes:**
607
- Use expression attributes when you need more than simple field access (e.g., route helpers, method calls):
613
+ Use expression attributes when you need more than simple field access:
608
614
  - \`hrefExpression\`: Blade expression for href → outputs \`href="..."\` with the expression
609
615
  - \`srcExpression\`: Blade expression for src → outputs \`src="..."\` with the expression
610
616
  - \`altExpression\`: Blade expression for alt → outputs \`alt="..."\` with the expression
611
617
 
612
- Example: \`hrefExpression: "{{ route('posts.show', $item->slug) }}"\`
618
+ Examples:
619
+ - Path prefix: \`hrefExpression: "/post/{{ $item->slug }}"\`
620
+ - Route helper: \`hrefExpression: "{{ route('posts.show', $item->slug) }}"\`
613
621
 
614
622
  **For Blade text content:**
615
623
  Use the \`statements\` array with statement UUIDs containing Blade code. The statement's \`code\` property will be output directly for Blade to evaluate.`,
@@ -739,10 +747,14 @@ For SSR/Blade pages, do NOT pass raw Blade expressions in text or attributes. Th
739
747
  1. **For static HTML:** Pass clean HTML without Blade syntax, then use \`update_element\` to add dynamic behavior
740
748
  2. **For loop content:** After creating elements, use \`update_element\` with:
741
749
  - \`textField\`, \`hrefField\`, \`srcField\` for simple field access (outputs \`{{ $item->field }}\`)
742
- - \`hrefExpression\`, \`srcExpression\`, \`altExpression\` for complex expressions
750
+ - \`hrefExpression\`, \`srcExpression\`, \`altExpression\` for paths with prefixes or complex expressions
743
751
  - \`statements\` array with statement UUIDs for text content with Blade code
744
752
  3. **For conditionals:** Use \`s-directive\` elements as siblings (see update_element docs)
745
753
 
754
+ **IMPORTANT - Links with path prefixes:**
755
+ \`hrefField\` outputs ONLY the field value with no prefix. There is NO \`hrefPrefix\` attribute.
756
+ For links like \`/post/my-slug\`, use \`hrefExpression: "/post/{{ $item->slug }}"\` instead.
757
+
746
758
  **Loop variable:** Inside \`@foreach\` loops created with \`s-directive\`, the default loop variable is \`$item\`. Use \`textField: "title"\` to output \`{{ $item->title }}\`.
747
759
 
748
760
  Prefer SVG icons over emoji (encoding issues).`,
@@ -1497,7 +1509,7 @@ const SERVER_INSTRUCTIONS = `Stellify is a coding platform where code is stored
1497
1509
  // Create MCP server
1498
1510
  const server = new Server({
1499
1511
  name: 'stellify-mcp',
1500
- version: '0.1.36',
1512
+ version: '0.1.37',
1501
1513
  }, {
1502
1514
  capabilities: {
1503
1515
  tools: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellisoft/stellify-mcp",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "mcpName": "io.github.MattStellisoft/stellify-mcp",
5
5
  "description": "MCP server for Stellify - AI-native code generation platform",
6
6
  "main": "dist/index.js",
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/Stellify-Software-Ltd/stellify-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.1.36",
9
+ "version": "0.1.37",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@stellisoft/stellify-mcp",
14
- "version": "0.1.36",
14
+ "version": "0.1.37",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },
@@ -72,6 +72,17 @@ Execute the plan using Stellify MCP tools in this order. This order matters —
72
72
 
73
73
  Use the `create_resources` tool with `api: false` to generate models and controllers together. The `api: false` flag ensures controller methods return data arrays (for Blade views) rather than JSON responses.
74
74
 
75
+ **Route Model Binding with Slugs:** WordPress URLs use slugs (e.g., `/post/my-article-title`). After creating each model with a `slug` field, add a `getRouteKeyName()` method so Laravel's route model binding works correctly:
76
+
77
+ ```php
78
+ public function getRouteKeyName(): string
79
+ {
80
+ return 'slug';
81
+ }
82
+ ```
83
+
84
+ Add this method to **Post**, **Category**, **Tag**, and any custom post type models that use slugs in their URLs. Without this, routes like `/post/{post}` will try to look up by ID instead of slug, causing 404 errors.
85
+
75
86
  **If Mode A (connect to existing WordPress database):**
76
87
 
77
88
  Create resources that map to the existing WordPress tables. No migrations. Set the model's table and primary key to match WordPress.
@@ -81,7 +92,13 @@ Create resources that map to the existing WordPress tables. No migrations. Set t
81
92
  class Post extends Model {
82
93
  protected $table = 'wp_posts';
83
94
  protected $primaryKey = 'ID';
84
-
95
+
96
+ // Enable slug-based route model binding (WordPress uses post_name for slugs)
97
+ public function getRouteKeyName(): string
98
+ {
99
+ return 'post_name';
100
+ }
101
+
85
102
  // Scope to only published posts (not revisions, drafts, etc.)
86
103
  public function scopePublished($query) {
87
104
  return $query->where('post_status', 'publish')
@@ -110,6 +127,15 @@ In Blade templates, use WordPress column names:
110
127
 
111
128
  Create new resources with clean Laravel migrations for each model identified in Step 4. Use clean column names (`title`, `slug`, `content`, `excerpt`, `status`, `published_at`, etc.). After the import is complete, suggest a data migration SQL query or artisan command that maps data from the WordPress tables to the new schema.
112
129
 
130
+ For each model with a `slug` field, add `getRouteKeyName()`:
131
+
132
+ ```php
133
+ public function getRouteKeyName(): string
134
+ {
135
+ return 'slug';
136
+ }
137
+ ```
138
+
113
139
  ### 5b. Refine Controller Methods
114
140
 
115
141
  `create_resources` (Step 5a) scaffolds controllers automatically. Review and refine the generated methods to ensure they query the right data. Controller methods in Stellify return data arrays — Stellify automatically merges these into the Blade view context. For example: