---
roadcrew_template_name: "enrich-project.md"
roadcrew_template_type: "command"
execution_mode: "auto-execute"
roadcrew_template_version: "v1.0"
roadcrew_last_updated: "2025-11-03"
roadcrew_min_version: "1.6.0"
roadcrew_license: "See LICENSE file in .roadcrew folder"
roadcrew_copyright: "Copyright (c) 2025 North Star Holdings, LLC"
spdx_license_identifier: "LicenseRef-RoadcrewLicense-1.0"
---

# Enrich Project

Coordinator command for transforming source documents into optimized memory bank and rules files.

## Overview

`/enrich-project` is a family of three specialized commands that each handle different types of source input:

| Command | Input | Output | Purpose |
|---------|-------|--------|---------|
| `/enrich-project --business` | Business/product docs | projectBrief, productContext | Business context |
| `/enrich-project --technical` | Architecture/tech docs | systemPatterns, techContext, coding standards | Technical context |
| `/enrich-project --github` | GitHub data | activeContext | Current work/decisions |

## Quick Start

```bash
# Enrich business context
/enrich-project --business

# Enrich technical context (runs analyze-architecture-full)
/enrich-project --technical

# Enrich active context from GitHub
/enrich-project --github

# Enrich all contexts
/enrich-project --all

# Dry run to preview
/enrich-project --business --dry-run
```

## Source Folders

Place your source documents here:

```
memory-bank/requirements/source-docs/_enrich-project/
├── business/
│   ├── overview.md
│   ├── problems.md
│   ├── users.md
│   └── (any business docs)
├── technical/
│   ├── architecture.md
│   ├── tech-stack.md
│   ├── decisions.md
│   └── (any tech docs)
└── README.md (guidance for each folder)
```

## Command 1: Enrich Project (Business)

**Input:** Unstructured business/product documentation  
**Output:** projectBrief, productContext, parts of 00-project-context.mdc

```bash
/enrich-project --business
```

**What it does:**
1. Reads all `.md` and `.txt` files from `memory-bank/requirements/source-docs/_enrich-project/business/`
2. Extracts business context:
   - Why the project exists (vision, motivation, problems)
   - Target users and personas
   - User flows and interactions
   - UX principles and requirements
3. Formats into memory bank files with word constraints
4. Outputs: `memory-bank/projectbrief.md`, `memory-bank/productContext.md`

**Example input:**
```
business/
├── overview.md: "Our product helps teams manage workflow..."
├── problems.md: "Users struggle with X, Y, Z..."
├── personas.md: "User types: PMs, developers, designers..."
└── flows.md: "Main workflow: 1. Connect repo 2. Analyze..."
```

**Expected output:**
- ✅ `memory-bank/projectbrief.md` (800 words)
- ✅ `memory-bank/productContext.md` (1200 words)
- ⚠️ Partial: 00-project-context.mdc (business sections)

---

## Command 2: Enrich Project (Technical)

**Input:** Technical/architecture documentation (optionally runs analyze-architecture-full)  
**Output:** systemPatterns, techContext, 04-coding-standards, 06-testing, parts of 00-project-context

```bash
# Process technical docs only
/enrich-project --technical

# Include architecture analysis
/enrich-project --technical --analyze

# Just run analysis (don't process source docs)
/enrich-project --technical --analyze-only
```

**What it does:**
1. **If `--analyze`:** Runs `/analyze-architecture-full` to scan codebase
2. Reads technical source files from `memory-bank/requirements/source-docs/_enrich-project/technical/`
3. Combines codebase analysis + source docs to extract:
   - System architecture and decisions
   - Technology stack and dependencies
   - Development setup and tools
   - Code patterns and best practices
   - Testing approach and standards
4. Formats with word constraints
5. Outputs: `memory-bank/systemPatterns.md`, `memory-bank/techContext.md`, `.cursor/rules/04-coding-standards.mdc`, `.cursor/rules/06-testing.mdc`

**Example input:**
```
technical/
├── architecture.md: "We use event-driven architecture..."
├── tech-stack.md: "TypeScript, Node 18+, Jest..."
├── decisions.md: "Decision 1: Why we chose X..."
├── patterns.md: "We follow factory pattern for..."
└── testing.md: "Test first (TDD) for all code..."
```

**Expected output:**
- ✅ `memory-bank/systemPatterns.md` (2500 words)
- ✅ `memory-bank/techContext.md` (2000 words)
- ✅ `.cursor/rules/04-coding-standards.mdc` (updated)
- ✅ `.cursor/rules/06-testing.mdc` (updated)
- ⚠️ Partial: 00-project-context.mdc (tech sections)

---

## Command 3: Enrich Project (GitHub)

**Input:** GitHub repository activity (issues, PRs, discussions)  
**Output:** activeContext

```bash
# Fetch recent GitHub activity and update activeContext
/enrich-project --github

# Last 7 days (default: 30)
/enrich-project --github --days 7

# Specific repo (default: auto-detect)
/enrich-project --github --repo tailwind-ai/roadcrew
```

**What it does:**
1. Uses GitHub API to fetch:
   - Recent PRs merged or in progress
   - Open issues and their status
   - Active discussions and decisions
   - Team activity (last 30 days by default)
2. Parses activity to extract current context:
   - What's being worked on (PRs, in-progress issues)
   - Recent completions (merged PRs, closed issues)
   - Blocked items (issues with "blocked" label)
   - Active decisions (issues/discussions with decisions)
3. Formats into activeContext template
4. Output: `memory-bank/activeContext.md` (1000 words)

**Example output:**
```markdown
## Current Focus
- PR #123: Implement feature X (in review)
- Issue #456: Performance optimization (in progress)

## Recent Changes
- Merged PR #119: Add auth module (2 days ago)
- Closed issue #110: Fix race condition (3 days ago)

## Next Steps
- Review PR #123
- Start issue #456
- Plan sprint goals

## Blocked Items
- Issue #200: Waiting on external API (blocked since 2025-11-01)
```

---

## Common Flags

All three commands support:
- `--dry-run` - Preview without writing files
- `--force` - Overwrite existing files
- `--verbose` - Show detailed processing

---

## Running All Three

```bash
# Enrich everything in sequence
/enrich-project --all

# Equivalent to:
/enrich-project --business
/enrich-project --technical --analyze
/enrich-project --github
```

---

## Prerequisites

**For `--business`:**
- Source docs in `memory-bank/requirements/source-docs/_enrich-project/business/`

**For `--technical`:**
- Source docs in `memory-bank/requirements/source-docs/_enrich-project/technical/`
- If `--analyze`: Codebase must exist (runs /analyze-architecture-full)

**For `--github`:**
- `GITHUB_TOKEN` environment variable set
- Repository must be accessible
- Public or authorized private repo

---

## Next Steps

After enrichment:

```
✅ Business context enriched
✅ Technical context enriched  
✅ Active context updated from GitHub

Next: Run /advance-release to prepare for release workflow
```
