# Predecessor-Bot Integration

When a user arrives from another AI agent (OpenClaw, Claude Code, custom bot), this guide covers what to discover, what to adopt, and what to discard.

## Discovery Checklist

### 1. Is the predecessor still running?

```bash
ps aux | grep -iE 'openclaw|claude|codex' | grep -v grep
ss -tlnp | grep <known_port>
systemctl status <predecessor-service> 2>/dev/null || true
```

### 2. Where is its data?

Common locations to probe:
- `/DATA/.casaos/apps/<name>` (CasaOS Docker apps)
- `/DATA/AppData/<name>` (direct install)
- `~/.config/<name>` (user config)
- `/opt/<name>` (system install)
- `/tmp/<name>.json` (backup dumps)
- `/var/lib/casaos_data/<name>-backup.json`

### 3. What can we read?

Try `read_file` on likely files. If permission denied, the predecessor ran as root/Docker and the agent runs as user. In that case:
- Ask user to `chmod` or copy the file
- Or accept that some data is unreachable and move on

### 4. What is valuable vs discardable?

| Adopt | Discard |
|-------|---------|
| User profile (name, family, preferences) | Predecessor's own identity/name |
| Active projects and deadlines | Predecessor's internal gateway URLs |
| Communication style preferences (if user confirms) | Infrastructure configs (supervisor, Docker compose) |
| Recurring tasks and automations | "Mission: replace me" instructions |
| External service connections (Notion, Email, etc.) | Hardcoded credentials (store securely instead) |
| Cultural/religious values | Rigid formatting rules (unless user confirms) |

## Conversation Strategy

1. Ask: **"Soll ich alles übernehmen, oder nur auswählen?"**
2. Filter: Read predecessor data, extract metadata, **never echo raw credentials**
3. Confirm: Present a summary list, let user approve each block
4. Store: Save approved facts to `memory` (not chat context)
5. Clarify: Reject identity-clash rules gracefully — "Monti war streng mit Emojis. Soll ich auch so sein, oder darf ich freier sein?"

## Common Predecessor Types

### OpenClaw

- Often runs as root via Docker/CasaOS
- May have `.secrets/*.env` that the user agent cannot read
- Backup JSONs may exist at `/DATA/openclaw-backup.json`
- Hermes has official `openclaw-migration` scripts in `optional-skills/migration/`

### Claude Code / Codex CLI

- CLI-only, no gateway → no Telegram/Discord integration
- Data is mostly local project state (git, files)
- User profile must be built from scratch unless exported

### Custom/self-built bots

- Highly variable. Probe for:
  - `.env` files
  - SQLite databases
  - JSON backups
  - systemd or cron jobs
  - Docker volumes

## Style Rule Evaluation

When a predecessor bot had rigid style rules, **evaluate each one** rather than blindly inheriting:

**Rules to REJECT (unless user explicitly wants them):**
- Identity-clash rules (e.g., "call me Boss 40% of the time") — unnatural and distracting
- Character-suppression rules (e.g., "no emojis ever") — if the agent's natural style benefits from occasional emoji for structure
- Language-mangling rules (e.g., "use ae/oe/ue instead of ä/ö/ü") — respects the user's language less, not more
- Mechanical formatting rules that reduce readability

**Rules to ADAPT:**
- Communication frequency preferences (e.g., heartbeat timing)
- Autonomy boundaries (e.g., "ask before sending emails")
- Cultural sensitivity guidelines

**Ask the user:** *"Monti never used emojis. Should I also avoid them, or use them sparingly when helpful?"*