Skip to content

Enhancement: Monorepo-aware features for multi-service architectures #163

@frankbria

Description

@frankbria

Background

Split from #64. The core existing-project support and .ralphrc configuration are now complete. This issue captures the monorepo-specific features that were proposed but not yet implemented.

Proposed Features

1. MONOREPO_SERVICES configuration in .ralphrc

Add support for declaring service boundaries in .ralphrc:

# Example .ralphrc additions
MONOREPO_SERVICES="api,web,shared,workers"
MONOREPO_ROOT="services/"

Use case: Projects with multiple services (e.g., services/api/, services/web/, packages/shared/) where Ralph needs awareness of the structure.

2. Monorepo-aware PROMPT.md template

Add guidance in the generated PROMPT.md for:

  • Service boundary detection: Help Ralph understand which service it's modifying
  • Cross-service change handling: When changes in one service require updates to another (e.g., shared types, API contracts)
  • Scoped testing: Run tests only for affected services

Example additions to PROMPT.md:

## Monorepo Guidelines
- This project contains multiple services: {{SERVICES}}
- When modifying shared code, check for impacts in dependent services
- Run service-specific tests: `npm test --workspace={{service}}`

3. Service-scoped Ralph execution (optional)

Allow running Ralph on a specific service:

ralph --service api

This would:

  • Set working context to that service
  • Adjust PROMPT.md scope dynamically
  • Run only relevant tests

Questions to evaluate

Before implementing, consider:

  1. Is this needed? Do users actually run Ralph at repo root for monorepos, or do they cd into each service?
  2. Complexity vs. value: Would simple documentation suffice, or does Ralph need code changes?
  3. Alternative: Could this be solved with multiple .ralph/ directories (one per service)?

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions