create_file
Create an empty file shell for Laravel/Vue projects, returning a file UUID. Supports PHP classes, models, controllers, and Vue components with automatic dependency resolution and module grouping.
Instructions
Create an empty file shell in a Stellify project. Returns file UUID.
For PHP: type='class', 'model', 'controller', or 'middleware'. For Vue: type='js', extension='vue'. Auto-creates app.js and template route.
Pass 'includes' array for framework class dependencies (auto-resolved to UUIDs). Use 'models' array in save_file for project models.
IMPORTANT - Check appJs response for Vue components:
If
appJs.action_required === "create_or_select_mount_file": No mount file exists. You MUST ask the user if they want to create a new app.js mount file before proceeding.If
appJs.action_required === "register_component": Mount file exists but component isn't registered. Call save_file on the mount file to add the component UUID to its includes array.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory | Yes | The UUID of the directory to create the file in (get from get_project directories array) | |
| name | Yes | File name without extension (e.g., "Counter", "UserController") | |
| type | Yes | Type of file: "js" for JavaScript/Vue, others for PHP | |
| extension | No | File extension. Use "vue" for Vue components, omit for PHP files. | |
| namespace | No | PHP namespace (e.g., "App\Services\"). Only for PHP files. | |
| includes | No | Array of namespace strings to include as dependencies (e.g., ["App\Models\User", "Illuminate\Support\Facades\Hash"]). These are resolved to UUIDs automatically. | |
| module | No | Optional module name to group this file with related code (e.g., "blog-posts", "user-auth"). Module is auto-created if it doesn't exist. | |
| attributes | No | PHP 8 class-level attributes (e.g., ["Fillable(['name', 'email'])"], ["ObservedBy(UserObserver::class)"]). Use search_attributes tool to find available attributes. |