Lamdera App Implementation
Purpose
Use this skill for Lamdera app development workflows from project setup through deployment, with Elm-informed decisions for Lamdera architecture.
This skill is Lamdera-only:
- Do not use
elm ...commands. - Do not use LLVM toolchain commands (
clang,llc,opt, etc.).
Elm documentation may be used for language/frontend concepts only.
Required Tools
Use these Lamdera commands as the core toolchain:
lamdera initlamdera livelamdera checklamdera deploylamdera resetlamdera loginlamdera make
Optional diagnostics:
lamdera backend --helplamdera backend ...
Optional static analysis:
npx elm-review(preferred, works with local installs)elm-review(global-install fallback)
Task Classification Loop
For every request, classify intent first:
generatefor implementing or changing code.architecturefor design and module/boundary decisions.review-debugfor issue analysis, review, or diagnosis.mixedwhen multiple intents are present.
Then run:
- Apply beginner-safe defaults.
- Apply the checklist for the classified intent.
- If intent is
mixed, apply checklists in this order:architecture->generate->review-debug. - Load deep references only if needed.
- Return output using the required response contract.
Beginner-Safe Defaults
- Prefer explicit custom types for domain states over ad-hoc flags.
- Keep messages small and purposeful; avoid catch-all messages.
- Keep update flows deterministic and side effects explicit.
- Start with simple module boundaries; add complexity only when forced.
- Highlight migration-sensitive type changes early.
Intent Checklists
Generate
- Validate model shape against feature intent.
- Validate message set is minimal but complete.
- Validate update transitions are explicit and testable.
- Validate effect boundaries and data flow are clear.
Architecture
- Decide frontend/backend/shared type ownership explicitly.
- Flag boundary leakage and unnecessary coupling.
- Check likely impact on migrations and deploy safety.
- Prefer simplest viable boundary split.
Review-Debug
- Identify symptom and reproducible path first.
- Check state transitions and message paths before deep changes.
- Check boundary mismatches and stale assumptions.
- Report likely root cause and smallest safe next fix.
Output Contract
Responses must include:
DecisionWhyRisksNext checks
Hard Gates
- Do not deploy until account/auth prerequisites are satisfied.
- Do not deploy until
lamdera checksucceeds. - Do not switch to
elmCLI commands in this workflow. - If auth is missing for app-linked operations (
lamdera login,lamdera check,lamdera deploy), stop and resolve login/signup first. - Do not claim success without verification evidence.
- Treat
lamderagit remote as required app context forlamdera login,lamdera check, andlamdera deploy.
Workflow
-
Validate context. Confirm this is a Lamdera app workspace. If no app exists yet, start with
lamdera initin an empty directory. In non-interactive agent execution, useprintf 'Y\n' | lamdera initto satisfy the init prompt. Before login/check/deploy, ensure app context exists: git repository with a configuredlamderaremote. -
Start local development. Run
lamdera livein an attached PTY session (not detached/background) and iterate using Lamdera compiler feedback and live reload. -
Resolve build/runtime blockers. If caches/tooling are inconsistent, run
lamdera reset, then continue withlamdera live. Only continue withlamdera checkwhen app context exists (git repo +lamderaremote). -
Enforce pre-deploy checks. If
lamderaapp context is present (git repo +lamderaremote), runlamdera checkand address all reported migration/config/type issues. If app context is missing, reportlamdera checkas blocked by missinglamderaremote and run local compile verification withlamdera make <entry-elm-file> --output=/dev/nullinstead. This local compile fallback is for local verification only and does not satisfy deploy readiness; deploy remains blocked until app context exists andlamdera checksucceeds. -
Run optional
elm-review(only after compile success). If code changed and compile verification succeeded (lamdera checkor locallamdera makefallback), runelm-reviewonly when the project already hasreview/configured or the user explicitly opts in. For setup/execution, prefer local install withnpm install --save-dev elm-reviewand run vianpx elm-review; global install vianpm install -g elm-reviewis allowed but less preferred. Ifreview/is missing and user opts in toelm-review, initialize once withnpx elm-review init --template jfmengels/elm-review-config/applicationfor local installs, orelm-review init --template jfmengels/elm-review-config/applicationfor global installs. When eligible (and initialized when needed), runnpx elm-review --report=jsonfor local installs, orelm-review --report=jsonfor global installs. Report each finding with a markdown source link usingpath:line:columnfromregion.start(prefer absolute file links when workspace path is known), plus rule and message. If findings are reported, offer the user an optional auto-fix run withnpx elm-review --fix-all-without-prompt --allow-remove-filesfor local installs, orelm-review --fix-all-without-prompt --allow-remove-filesfor global installs. After auto-fix, re-run compile verification, then re-runelm-review --report=json, and report what was fixed vs what remains. If compile verification failed, skipelm-reviewand report it as blocked by compile failure. -
Enforce deployment prerequisites. If the user has no account, direct them to sign up first. If not authenticated, run
lamdera loginfrom a repository linked to the app vialamderaremote. -
Deploy. Run
lamdera deployonce checks and auth are satisfied. You may mention git-push deployment as informational fallback only after explicitly confirminglamdera checksucceeded.
Verification Gate
After providing code or concrete implementation advice:
- If
lamderaCLI is available and app context exists (git repo +lamderaremote), you must runlamdera checkas the minimum verification command. - If
lamderaCLI is available but app context is missing, run local compile verification withlamdera make <entry-elm-file> --output=/dev/nulland report thatlamdera checkwas blocked by missinglamderaremote. - Run relevant build/compile verification and report the result.
- If code changed and compile verification succeeded, run optional
elm-reviewonly whenreview/already exists or user explicitly opts in. - If
review/is missing and user opts in, initialize once withnpx elm-review init --template jfmengels/elm-review-config/applicationfor local installs, orelm-review init --template jfmengels/elm-review-config/applicationfor global installs. - When eligible (and initialized when needed), run
npx elm-review --report=jsonfor local installs, orelm-review --report=jsonfor global installs. - Report
elm-reviewfindings as markdown links withpath:line:columnusing each error'sregion.start. - If findings exist, offer optional auto-fix (
npx elm-review --fix-all-without-prompt --allow-remove-filesfor local installs, orelm-review --fix-all-without-prompt --allow-remove-filesfor global installs). - If auto-fix runs, re-run compile verification, then re-run
elm-review --report=json, and report resolved vs remaining findings. - Then select any additional verification commands from project-local scripts/config.
- If
lamderaCLI is not available and no project-defined verification command exists, report "not runnable with current project metadata" instead of guessing commands. - If tests are present, run relevant tests and report the result.
- Keep command guidance Lamdera-first; allow optional
elm-reviewcommands. - If verification cannot run, state exactly what was not run and why.
- Never say "done/fixed/works" without command-backed evidence.
Use this entry file selection rule for local compile fallback:
- Prefer
src/Frontend.elmwhen present. - Otherwise use the project's actual entry module path as
<entry-elm-file>. - If entry file cannot be determined, report verification as partially blocked and state why.
Error Handling Rules
-
Auth/session issue: Ensure the repository is linked with
lamderaremote, then runlamdera login, then re-runlamdera check. -
Compiler/cache mismatch: Use
lamdera reset, then re-runlamdera live. Only re-runlamdera checkwhen app context exists (git repo +lamderaremote). -
Migration/config issue: Treat
lamdera checkoutput as blocking and resolve before deploy. -
Unknown app / missing remote issue: If Lamdera reports unknown app, configure the
lamderagit remote for the repository, then retrylamdera login/lamdera check/lamdera deploy.
Source Policy
Use these sources for guidance:
- Lamdera docs for commands and platform workflow.
- Elm guide for Elm language/frontend design concepts only.
- Elm package catalog (
https://package.elm-lang.org/) for package discovery in Lamdera frontend code only. elm-reviewdocs (https://github.com/jfmengels/elm-review) for workflow and configuration concepts.elm-reviewCLI docs (https://github.com/jfmengels/node-elm-review) for setup/report formats.
Keep command recommendations aligned with documented Lamdera CLI behavior.
References
For deeper guidance, load:
references/elm-for-lamdera-core.mdreferences/shared-types-and-boundaries.mdreferences/evolution-and-migration-safety.mdreferences/review-and-debug-playbook.mdreferences/source-map.mdreferences/commands-and-gates.mdreferences/sources.mdreferences/troubleshooting.md