5,438,349 AI resources indexedWorking toward the world’s largest AI resource index.

PDF

Add Generation Parameter (MooshieUI)

Facilitates the addition of generation parameters in MooshieUI's Svelte store and Rust types for enhanced UI settings.

Installable skillAGPL-3.0-onlyBy Mooshieblob1Updated Nov 1, 2026
INTENDED FORClaude CodeCodexOpenClawCursorInstall in a listed agent.

instructions.md

---
name: add-generation-param-2ffdecbe1518
description: >-
  Adds a generation parameter across MooshieUI's Svelte store, TypeScript types,
  Rust GenerationParams, and workflow templates. Use for new UI settings, ComfyUI
  inputs, or /add-generation-param.
model: sonnet
---

# Add Generation Parameter (MooshieUI)

**6 touchpoints**, in order. New workflow-only params still need Rust + TS types if exposed in UI.

## Gather from user

1. Name (TS `camelCase`, Rust/iface `snake_case`)
2. Type + default
3. Templates: txt2img | img2img | inpainting | upscale | all
4. ComfyUI node + input field name

## 1. `src/lib/types/index.ts`

```typescript
export interface GenerationParams {
  new_param: SomeType;
}
```

## 2–4. `src/lib/stores/generation.svelte.ts`

```typescript
newParam = $state<SomeType>(defaultValue);

// loadSettings()
if (saved.newParam !== undefined) this.newParam = saved.newParam;

// saveSettings()
newParam: this.newParam,

// toParams()
new_param: this.newParam,
```

Use `!== undefined` for bool/number defaults that can be `0` or `false`.

## 5. `src-tauri/src/comfyui/types.rs`

```rust
pub new_param: Type,
// or
pub new_param: Option<Type>,
```

## 6. `src-tauri/src/templates/{mode}.rs`

```rust
"node_input": params.new_param,
```

## 7. MCP check — `src-tauri/src/mcp/setups.rs`

The MCP server reuses the owner's last txt2img request per model (see `docs/MCP.md`). Decide which case the param is:

- **Points at one image** (ComfyUI input filename, mask, reference): clear it in `snapshot()`, or assistants re-send a stale file.
- **Something an assistant should set** (like steps or size): add it to `Overrides`, `apply()` (with bounds) and the `generate_image` schema in `mcp/tools.rs`, plus a test.
- **Neither** (a tuning knob the setup should carry over): nothing to do.

## Verify

```powershell
cargo check --manifest-path src-tauri/Cargo.toml
```

```
- [ ] Interface snake_case field
- [ ] Store $state + load/save + toParams()
- [ ] Rust GenerationParams field
- [ ] ≥1 template references param
- [ ] MCP check done (snapshot / Overrides / nothing)
```

If UI needs i18n: add keys to **all** files in `src/lib/locales/` (parity with `en.ts`).

For new workflow **modes**, use **workflow-template-builder** skill after params exist.

Discuss this resource

Platform guidance

Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.