Writing a team automation
Build a repeatable workflow from team setup, seeding, prompts, checks, and a final handoff.
The script checks the supplied teamfile before seeding it, then asks Lead to work and Review to inspect Lead's report. lm_prompt waits for each reply. The require calls stop on a failed status so the next step cannot silently continue with an empty result. Prepare a teamfile with Lead and Review aliases before using live mode.
Script: team-automation.lms
# Offline by default. Pass --live and a prepared teamfile to run the workflow.
if (ARGV.get(0, "") == "--live") {
team = ARGV.get(1, "team.lmctl");
checked = lm_lint(team);
require(checked.status == "ok", f"Teamfile is invalid: {checked.error}");
seeded = lm_seed(team);
require(seeded.status == "ok", f"Could not seed team: {seeded.error}");
work = lm_prompt(team, "Lead", "Complete the task in the teamfile and report the changed files.");
require(work.status == "ok", f"Lead failed: {work.error}");
review = lm_prompt(team, "Review", f"Review the Lead's report and changes. Findings: {work.reply}");
require(review.status == "ok", f"Review failed: {review.error}");
println(review.reply);
if (!NonInteractive) { lm_terminal(team, "Lead"); }
} else {
println("Preview only. Run with --live TEAMFILE to lint, seed, work, review and open the Lead terminal.");
}
Run it
lmscript examples/team-automation.lms
Output
Preview only. Run with --live TEAMFILE to lint, seed, work, review and open the Lead terminal.
Previous: Driving teams · Next: A small multi-agent workflow
Try it: download examples/team-automation.lms, save it under examples/ in a writable working directory, then run the command above from that directory.