local_draft_leaf_code
Draft a standalone leaf file such as a unit test, schema, DTO, or boilerplate using the local GPU LLM with zero cloud quota, then validate and write it to disk with automatic cloud escalation if drafting fails.
Instructions
Draft standalone leaf-node boilerplate, unit test files, DTOs, or schemas on disk using the Local GPU LLM (0x cloud quota). Reads reference_files on the server side, validates that the drafted code is >=15 chars with closed markdown fences and no truncation placeholders before writing target_file (automatically aborting disk write and escalating to agy_delegate_edit flash-high if invalid or offline). WHEN TO USE: Creating or updating a single self-contained leaf file (unit tests, schemas, types, boilerplate). DO NOT USE FOR: Complex multi-file refactoring or cross-module architectural edits (use agy_delegate_edit instead). RETURNS: Write confirmation, byte/line counts, and git diff --stat summary.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Optional working directory path (defaults to workspace root). | |
| spec | Yes | Detailed specification of the leaf code, boilerplate, schema, or unit test cases to generate. | |
| target_file | Yes | Relative or absolute path to the single leaf file to create or update on disk. | |
| reference_files | Yes | List of existing file paths to read from disk on the server side as style, type, and import references. |