create-bloclisted
Install: claude install-skill ghozimahdi/gm-aiagent-plugins
Use the current user request as this skill's input. In Claude Code invoke it as
`/ufil:create-bloc`; in Codex invoke it as `$ufil:create-bloc`. Resolve
`UFIL_ROOT` to the plugin root containing this skill; Claude Code may provide
`CLAUDE_PLUGIN_ROOT`, while Codex can resolve it from the installed skill path.
Create a BLoC (3 files) following GM `docs/BLOC_PATTERN.md` and `docs/NAMING_CONVENTIONS.md`.
Inspired by [vscode-flutter-bloc-generator](https://github.com/ghozimahdi/vscode-flutter-bloc-generator) — same `{name}_bloc.dart` / `{name}_event.dart` / `{name}_state.dart` layout, but tuned for GM BLoC conventions: freezed events/states, sub-state unions per async action, AlertState, and optional `Failure` params for modular projects.
**Script:** `${UFIL_ROOT}/scripts/create-bloc.sh`
```
create-bloc.sh <bloc_name> [--path <dir>] [--actions <a1,a2,...>] [--alert] [--with-failure]
```
Arguments: <requested arguments>
## Steps
### 1. Parse arguments
- `<bloc_name>` — snake_case (e.g., `home`, `login`, `property_detail`).
- `--path <dir>` — target directory (default: `.`). The folder `<bloc_name>/` is created inside.
- `--actions <a1,a2>` — comma-separated action names. Each one generates:
- a sub-state class `{Action}State` with `idle` / `loading` / `done` / `error` variants
- an event factory on the bloc event union
- a handler stub in the bloc
- `--alert` — include `AlertState` (`idle` / `error` / `done`) on the main state. Reset to `idle` on loading; switched to