lamdera-app-implementation
npx skills add https://github.com/clojj/lamdera-app-implementation --skill lamdera-app-implementation
Agent 安装分布
Skill 文档
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 ...
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 liveand 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. -
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. - 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. - Run relevant build/compile verification and report the result.
- If tests are present, run relevant tests and report the result.
- Keep command guidance Lamdera-only; do not introduce
elm ...command recommendations. - 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.
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