# Ralph Weegund - SmartStack Automation Loop

Ralph Weegund is an iterative AI loop that enables autonomous feature development with mandatory MCP server integration.

## Directory Structure

```
.ralph/
├── ralph.config.yaml    # Configuration (DO NOT DELETE)
├── logs/                # Execution logs
│   └── ralph-YYYY-MM-DD.log
├── reports/             # Feature completion reports
│   └── feature-name-TIMESTAMP.md
└── README.md            # This file
```

## Configuration

Edit `ralph.config.yaml` to customize:

- **MCP servers**: Required servers and behavior
- **Logging**: What to log and retention
- **Reports**: Auto-generation and format
- **Iteration**: Max iterations and completion detection

## Required MCP Servers

Ralph **requires** these MCP servers to function:

### 1. Install packages
```bash
npm install -g @atlashub/smartstack-cli
npm install -g @upstash/context7-mcp
```

### 2. Register in Claude Code
```bash
claude mcp add smartstack -- npx --package @atlashub/smartstack-cli smartstack-mcp
claude mcp add context7 -- npx @upstash/context7-mcp
```

## Usage

1. Ensure MCP servers are installed:
   ```bash
   smartstack check-mcp
   ```

2. Start Ralph:
   ```bash
   smartstack ralph start
   ```

3. In Claude Code, use:
   ```
   /business-analyse-develop "Your feature description"
   ```

## Logs

Logs are stored in `.ralph/logs/` with daily rotation.

View recent logs:
```bash
smartstack ralph logs
```

## Reports

Feature completion reports are auto-generated in `.ralph/reports/`.

View last report:
```bash
smartstack ralph report --last
```

## Troubleshooting

### Ralph won't start

1. Check MCP servers: `smartstack check-mcp`
2. Run diagnostics: `smartstack doctor`
3. Check logs: `smartstack ralph logs`

### MCP server unavailable

Ralph will abort if required MCP servers are unavailable.
This is by design - no fallback mode exists.

## More Information

- Documentation: https://atlashub.ch/docs/ralph
- Issues: https://github.com/atlashub/smartstack-cli/issues
