Skip to content

Epic: Monorepo Package-Aware Commands #938

@acreeger

Description

@acreeger

Summary

Add monorepo awareness to iloom so that AI agents can declare which packages they're working on, and il commands (test, lint, compile, build, dev-server) automatically scope themselves to those packages.

Context

iloom currently treats every project as a single unit. In monorepos (pnpm workspaces, yarn/npm workspaces), this means validation runs against ALL packages even when changes are isolated, dev servers can't target specific packages, and agents have no structured way to communicate which packages are relevant.

Design

The AI agent (swarm orchestrator or issue implementer) is the intelligence layer. It explores the monorepo, reads the issue, and writes two metadata fields via MCP tools:

  • packagesToRun: string[] — which package to launch a dev server for (MCP accepts singular, stored as array for future compat)
  • packagesToValidate: string[] — which packages to scope test/lint/compile/build to

A new "monorepo" capability (alongside "web" and "cli") gates all monorepo behavior. It's detected during il init and stored in package.iloom.json.

A dedicated iloom-monorepo-package-detector agent runs:

  • Non-swarm mode: before implementation, to set both metadata fields
  • Swarm mode: after swarm completion, called by the orchestrator for final validation setup

All il commands read from metadata. Auto-fix agents receive --append-system-prompt instructing them to use il commands. A user-prompt-submit hook reminds agents to update metadata when touching new packages.

The dev server command, when both web and monorepo capabilities are present, watches the metadata file and launches once packagesToRun is set.

Acceptance Criteria

  • Agents can set monorepo package metadata via MCP tools
  • il test, il lint, il compile, il build scope to declared packages when metadata is set
  • il dev-server launches the correct package's dev server based on metadata
  • il init detects monorepos and sets the "monorepo" capability
  • A dedicated detection agent runs at the right lifecycle points (before impl in non-swarm, after completion in swarm)
  • Non-monorepo projects are completely unaffected
  • Works with pnpm, yarn, and npm workspace package managers

Scope Boundaries

  • v1 supports JavaScript/TypeScript monorepos only (pnpm + yarn/npm workspaces)
  • Non-JS workspace extensions (Rust, Go, Python) are tracked separately
  • Dev server supports one package at a time (reads packagesToRun[0])
  • No programmatic monorepo detection utility — the AI agent handles all detection intelligence

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions