Skip to content

feat(cli): Add squad loop command — prompt-driven continuous work loop #761

Closed

Description

@bradygaster

Summary

Add a squad loop command that runs a continuous work loop driven by a loop.md prompt file — no GitHub issues required.

Today, squad watch is issue-centric: it polls for squad-labeled issues, triages them, and optionally executes them. But many users want a simpler pattern: write a prompt that describes what you want your squad to do, and let it loop.

What this adds

squad loop command

A new top-level command that:

  1. Reads loop.md from the repo root (configurable path via --file)
  2. Validates YAML frontmatter (must include configured: true to confirm intentional setup)
  3. Each cycle: spawns a Copilot agent with the loop prompt as the work driver
  4. Sleeps for the configured interval, then repeats
  5. Ctrl+C to stop

Frontmatter contract

loop.md requires YAML frontmatter to tell the loop it's been configured:

---
configured: true
interval: 10        # minutes between cycles
timeout: 30         # max minutes per cycle
description: "What this loop does (shown in status output)"
---

The configured: true field is required — it ensures the user has intentionally set up their loop prompt rather than leaving a blank scaffold.

squad loop --init

Generates a boilerplate loop.md with:

  • Frontmatter template (configured: false — user must flip to true)
  • Guidance sections explaining how to structure a loop prompt
  • Example patterns (work queue, monitoring, mixed mode)

Missing loop.md handling

If loop.md doesn't exist, exit cleanly with:

💤 No loop.md found. Create one with: squad loop --init

In-product help

  • squad loop --help prints usage, flags, and frontmatter docs
  • squad --help lists loop as a first-class command

Capabilities integration

The existing watch capability system (email/Teams monitors, self-pull, decision-hygiene) can be composed with the loop:

squad loop --monitor-email --monitor-teams --self-pull

Architecture

This reuses the watch capability plugin system. The key difference:

  • watch: runCheck() (issue triage) is the core driver, capabilities are additive
  • loop: loop.md prompt is the core driver, runCheck() is skipped entirely

The loop command shares: capability registry, config loading, circuit breaker, platform adapter (for monitors that need it).

Implementation plan

  • New packages/squad-cli/src/cli/commands/loop.ts — loop runner + frontmatter parser
  • CLI wiring in cli-entry.ts — squad loop, --init, --help
  • In-product help update in cli-entry.ts
  • loop.md scaffold template in packages/squad-cli/templates/loop.md
  • Docs: docs/src/content/docs/features/loop.md
  • Tests: test/cli/loop.test.ts
  • Changeset for insiders release

Prior art

This pattern has been battle-tested in Brady's personal squad (bradyland) where loop.md drives a continuous work loop with Teams DM routing, email monitoring, and personal interest updates. The productized version will be simpler and more generic, with the frontmatter contract ensuring intentional configuration.

Labels

  • squad
  • enhancement

Activity

  1. added
    squadSquad triage inbox — Lead will assign to a member
    on Apr 2, 2026
  2. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor

    🏗️ Squad Triage — Flight (Lead)

    Issue: #761 — feat(cli): Add squad loop command — prompt-driven continuous work loop
    Assigned to: FIDO (Quality Owner)
    Reason: Issue relates to testing/quality work

    @copilot evaluation: 🔴 Not suitable — issue involves work outside the coding agent's capability profile.

    Team roster:

    • Flight (Lead) → label: squad:flight
    • Procedures (Prompt Engineer) → label: squad:procedures
    • EECOM (Core Dev) → label: squad:eecom
    • FIDO (Quality Owner) → label: squad:fido
    • PAO (DevRel) → label: squad:pao
    • CAPCOM (SDK Expert) → label: squad:capcom
    • CONTROL (TypeScript Engineer) → label: squad:control
    • Surgeon (Release Manager) → label: squad:surgeon
    • Booster (CI/CD Engineer) → label: squad:booster
    • GNC (Node.js Runtime) → label: squad:gnc
    • Network (Distribution) → label: squad:network
    • RETRO (Security) → label: squad:retro
    • INCO (CLI UX & Visual Design) → label: squad:inco
    • GUIDO (VS Code Extension) → label: squad:guido
    • Telemetry (Aspire & Observability) → label: squad:telemetry
    • VOX (REPL & Interactive Shell) → label: squad:vox
    • DSKY (TUI Engineer) → label: squad:dsky
    • Sims (E2E Test Engineer) → label: squad:sims
    • Handbook (SDK Usability) → label: squad:handbook
    • Ralph (Work Monitor) → label: squad:ralph
    • @copilot (Coding Agent) → label: squad:copilot

    To reassign, remove the current squad:* label and add the correct one.

  3. added 3 commits that reference this issue on Apr 2, 2026
    5bb6f43
    1c5a468
    897ca9f
  4. added a commit that references this issue on Apr 2, 2026
    f276f55
  5. added a commit that references this issue on Apr 3, 2026
    fe8af61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a member

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions