lmweblab authoring skill

Guidance for authoring, running, and verifying lmweblab AWS web stack integration scenarios with lmaws, lmcloud, lmcurl, lmdraw, and lmplot.

Purpose

Help run, extend, and verify the lmweblab integration suite, which provisions, tests, and tears down identical tagged AWS web stacks and 12 serverless/cloud scenarios using both native lmaws (Part A) and OpenTofu-based lmcloud (Part B), verified with lmcurl HTTP/load contracts and zero-leftover audits.

When to use it

Use lmweblab when validating end-to-end cloud web infrastructure lifecycles (up, test, phase2 HTTPS, status, down, all) across private S3 origins, CloudFront Origin Access Control, Route 53 aliases and weighted DNS, ACM DNS-validated certificates, EC2 Spot nano servers, Lambda Function URLs, DynamoDB, SQS workers, and EventBridge schedules.

Install

Install the lmctl CLI toolchain with npm i -g @lmctl-ai/lmctl and clone the lmweblab repository. Scripts automatically resolve or install the required native hosts (lmaws v0.1.16+, lmcloud v0.1.11+, lmcurl, lmdraw, and lmplot). Offline runs require zero AWS credentials and cost $0.00; live runs require Linux, an existing public Route 53 hosted zone in LMWEBLAB_DOMAIN, and the least-privilege AWS_PROFILE=lmaws in us-east-1.

Commands

lmctl lmaws/web_stack.lms all --offline
lmctl lmaws/web_stack.lms all --offline --phase2
lmctl lmaws/report.lms
lmctl lmcloud/validate.lms
lmctl lmcloud/all.lms
cd scenarios/01-static-site-s3-cloudfront/lmaws && lmctl all.lms --offline
bash test.sh

Inputs and outputs

Safety rules

Worked examples

# Run the complete offline Part A (lmaws) two-phase HTTP + HTTPS stack lifecycle
lmctl lmaws/web_stack.lms all --offline --phase2

# Compose individual guarded provisioning steps from lmaws/recipes/steps.lms
import "./lmaws/recipes/steps.lms";
let cfg = {run_id: "cafe01", domain: "example.com", live: false, profile: "lmaws"};
let b = web_bucket(cfg, "shared/site");
let c = web_certificate(cfg);
let d = web_distribution(cfg);
let s = web_site_dns(cfg);
assert(b.demo == "true", "recipe preview failed");

Errors and exit codes

Exit 0 indicates that provisioning, HTTP and p95 load assertions, teardown, and independent zero-leftover inventory checks all succeeded. Exit 1 (assertion or driver failure) occurs when any lifecycle phase fails; the all driver still runs down.lms before exiting 1. Underlying lmcode hosts (lmaws, lmcloud, lmcurl, lmdraw, lmplot) exit 2 on CLI/usage errors, 3 on load/runtime/guard/cost-cap errors, and 4 on application failures.

How to verify

  1. Run bash test.sh from the repository root to execute the isolated offline gate across Part A recipes, both HTTP/HTTPS phases, the loopback Python user-data test, PNG header/size checks, and the scenario catalog gates.
  2. Run lmctl lmcloud/validate.lms to verify OpenTofu formatting, initialization, schema validation, and Phase 1/Phase 2 mock plans.
  3. After any live run, execute down.lms and confirm via an independent Cloud.web_find(run_id, domain) or status.lms check that active leftovers equal zero across the run namespace.