mosaic init blindly overwrites existing SOUL.md, USER.md, and TOOLS.md with no detection, causing users to lose their customized agent identity on reinstall/upgrade.
Non-interactive mode exits cleanly if files exist (unless --force is passed)
Added import_existing_values() — parses agent name, role, style, user name, pronouns, timezone from existing markdown
Added --force flag to skip detection in scripts/CI
packages/cli/src/commands/launch.ts
checkSoul() now prefers mosaic wizard (TypeScript, already idempotent) over the legacy bash mosaic-init when SOUL.md is missing
Falls back to bash script if wizard isn't available
packages/mosaic/src/stages/detect-install.ts
reconfigure action now pre-loads existing config values (previously only keep did this)
Users see their current settings as defaults when reconfiguring
packages/mosaic/src/stages/soul-setup.ts
During reconfigure, shows existing agent name and communication style as pre-filled defaults
Tests
Added: reconfigure pre-populates state from existing files
Added: reset does NOT pre-populate (clean slate)
All 37 tests pass
Testing
pnpm --filter @mosaic/mosaic test # 37 passed
pnpm typecheck # 36/36 tasks passed
pnpm lint # 20/20 tasks passed
pnpm format:check # All matched files use Prettier code style
## Problem
`mosaic init` blindly overwrites existing `SOUL.md`, `USER.md`, and `TOOLS.md` with no detection, causing users to lose their customized agent identity on reinstall/upgrade.
## Changes
### `packages/mosaic/framework/tools/_scripts/mosaic-init` (bash script)
- Added `detect_existing_config()` — checks for existing config files before proceeding
- Interactive mode shows 3 options: **keep** (update runtime adapters only), **import** (re-use existing values as defaults, then re-run prompts), **overwrite** (timestamped backup + fresh)
- Non-interactive mode exits cleanly if files exist (unless `--force` is passed)
- Added `import_existing_values()` — parses agent name, role, style, user name, pronouns, timezone from existing markdown
- Added `--force` flag to skip detection in scripts/CI
### `packages/cli/src/commands/launch.ts`
- `checkSoul()` now prefers `mosaic wizard` (TypeScript, already idempotent) over the legacy bash `mosaic-init` when SOUL.md is missing
- Falls back to bash script if wizard isn't available
### `packages/mosaic/src/stages/detect-install.ts`
- `reconfigure` action now pre-loads existing config values (previously only `keep` did this)
- Users see their current settings as defaults when reconfiguring
### `packages/mosaic/src/stages/soul-setup.ts`
- During `reconfigure`, shows existing agent name and communication style as pre-filled defaults
### Tests
- Added: reconfigure pre-populates state from existing files
- Added: reset does NOT pre-populate (clean slate)
- All 37 tests pass
## Testing
```
pnpm --filter @mosaic/mosaic test # 37 passed
pnpm typecheck # 36/36 tasks passed
pnpm lint # 20/20 tasks passed
pnpm format:check # All matched files use Prettier code style
```
- mosaic-init bash script: detect existing SOUL.md/USER.md/TOOLS.md and
prompt user to keep, import (re-use values as defaults), or overwrite.
Non-interactive mode exits cleanly unless --force is passed.
Overwrite creates timestamped backups before replacing files.
- launch.ts checkSoul(): prefer 'mosaic wizard' over legacy bash script
when SOUL.md is missing, with fallback to mosaic-init.
- detect-install.ts: pre-populate wizard state with existing values when
user chooses 'reconfigure', so they see current settings as defaults.
- soul-setup.ts: show existing agent name and communication style as
defaults during reconfiguration.
- Added tests for reconfigure pre-population and reset non-population.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
mosaic initblindly overwrites existingSOUL.md,USER.md, andTOOLS.mdwith no detection, causing users to lose their customized agent identity on reinstall/upgrade.Changes
packages/mosaic/framework/tools/_scripts/mosaic-init(bash script)detect_existing_config()— checks for existing config files before proceeding--forceis passed)import_existing_values()— parses agent name, role, style, user name, pronouns, timezone from existing markdown--forceflag to skip detection in scripts/CIpackages/cli/src/commands/launch.tscheckSoul()now prefersmosaic wizard(TypeScript, already idempotent) over the legacy bashmosaic-initwhen SOUL.md is missingpackages/mosaic/src/stages/detect-install.tsreconfigureaction now pre-loads existing config values (previously onlykeepdid this)packages/mosaic/src/stages/soul-setup.tsreconfigure, shows existing agent name and communication style as pre-filled defaultsTests
Testing