kingwill101/stem/stem-flutter-lifecycle
Claude Code and agent skill by kingwill101/stem
- community
Checking that the SKILL.md file is still in the repository.
Use when hosting StemApp or WorkflowHost in Flutter, wiring task registration and workflow observation to app lifecycle, or deciding what workers can do in the foreground and background.
Install
npx vskill@latest install kingwill101/stem/stem-flutter-lifecycleSKILL.md
The same SKILL.md was published earlier as kingwill101/stem/stem-flutter-lifecycle.
Stem Flutter lifecycle
Rules
- Call
StemFlutter.createAppafter Flutter binding initialization (the method
ensures it) and retain the returned app above individual screens.
createAppdoes not start consumption. Start explicitly after registration
and after the app has established the resources it needs.
- Call
app.shutdown()exactly once during orderly teardown. Do not close the
app from a transient widget unless that widget owns the whole runtime.
- The worker runs in the calling isolate. Inline asynchronous handlers may use
Flutter plugins; CPU-heavy handlers need an isolate-capable task design.
StemFlutter.defaultWorkerConfigdisables desktop process signal handlers and
defaults local concurrency/prefetch to one. Override deliberately and test the selected configuration on the target platform.
- Flutter lifecycle callbacks are not an OS scheduler. Paused/terminated apps
may not execute Dart code; use platform-approved background facilities and reopen/recover persisted work when the platform invokes the app.
- Persistence, retries, and lease recovery do not make external side effects
exactly once. Handlers must be idempotent.
Workflow host ownership
- Use
WorkflowHostController(factory: ...)for an owned host or
WorkflowHostController(host: ...) for a borrowed host.
WorkflowHostScopeborrows its controller. Removing the widget does not
dispose the controller; the application owner must close/dispose it.
- The factory is responsible for mobile-safe worker and storage configuration.
The controller does not reconfigure the host returned by the factory.
- Startup and foreground resume coalesce bounded recovery scans. Inspect
controller.recoveryReport.errors as well as controller.error; a completed scan may still report individual run failures.
- Pausing does not cancel workflows. Closing an owned controller closes its
host, not persisted workflow runs. A borrowed host remains caller-owned.
HostedRunBuilder<R>rendersWorkflowRunViewsnapshots, not decoded
results or every lifecycle event. Use run.result for the typed result.
- Prefer
await controller.close()before disposing the controller during
awaited teardown; never assume the OS will allow a final teardown callback.
Example
Pass registered handlers or a generated StemModule to createApp in a real application; the empty call above only shows the lifecycle boundary. In production, keep the app in a service/provider and dispose it when that owner is destroyed.
Validation checklist
- Test cold start, hot restart, pause/resume, and orderly shutdown.
- Verify plugins used by handlers are legal in the isolate and lifecycle where
they run.
- Verify the platform background mechanism separately; Stem does not grant
background execution.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/stem_flutter/skills/stem_flutter-lifecycle/SKILL.md
Popularity
- Repository stars
- 4
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kingwill101/stem/stem-flutter-lifecycle)