Files
bootstrap/install.sh
Jason Woltje 7c2eba4e15 feat: centralized SOUL.md, mosaic-init generator, and unified launcher
- Add SOUL.md.template with {{PLACEHOLDERS}} for interactive generation
- Add mosaic-init (bash + PS1) for interactive SOUL.md creation with flag overrides
- Add mosaic launcher (bash + PS1) — unified CLI for claude/opencode/codex with SOUL.md injection
- Add codex runtime adapter (runtime/codex/instructions.md)
- Update runtime adapters (claude, opencode) with SOUL.md read directive
- Update mosaic-link-runtime-assets to push codex adapter to ~/.codex/
- Update installers to prompt for mosaic init when SOUL.md is missing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:38:22 -06:00

52 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TARGET_DIR="${MOSAIC_HOME:-$HOME/.config/mosaic}"
mkdir -p "$TARGET_DIR"
if command -v rsync >/dev/null 2>&1; then
rsync -a --delete "$SOURCE_DIR/" "$TARGET_DIR/"
else
rm -rf "$TARGET_DIR"/*
cp -R "$SOURCE_DIR"/* "$TARGET_DIR"/
fi
chmod +x "$TARGET_DIR"/bin/*
chmod +x "$TARGET_DIR"/install.sh
echo "[mosaic-install] Installed framework to $TARGET_DIR"
echo "[mosaic-install] Linking runtime compatibility assets"
if ! "$TARGET_DIR/bin/mosaic-link-runtime-assets"; then
echo "[mosaic-install] WARNING: runtime asset linking failed (framework install still complete)" >&2
fi
echo "[mosaic-install] Syncing universal skills"
if [[ "${MOSAIC_SKIP_SKILLS_SYNC:-0}" == "1" ]]; then
echo "[mosaic-install] Skipping skills sync (MOSAIC_SKIP_SKILLS_SYNC=1)"
else
if ! "$TARGET_DIR/bin/mosaic-sync-skills"; then
echo "[mosaic-install] WARNING: skills sync failed (framework install still complete)" >&2
fi
fi
echo "[mosaic-install] Migrating runtime-local skills to Mosaic links"
if ! "$TARGET_DIR/bin/mosaic-migrate-local-skills" --apply; then
echo "[mosaic-install] WARNING: local skill migration failed (framework install still complete)" >&2
fi
echo "[mosaic-install] Running health audit"
if ! "$TARGET_DIR/bin/mosaic-doctor"; then
echo "[mosaic-install] WARNING: doctor reported issues (run ~/.config/mosaic/bin/mosaic-doctor --fail-on-warn)" >&2
fi
echo "[mosaic-install] Add to PATH: export PATH=\"$TARGET_DIR/bin:$PATH\""
if [[ ! -f "$TARGET_DIR/SOUL.md" ]]; then
echo ""
echo "[mosaic-install] Set up your agent identity by running: mosaic init"
echo "[mosaic-install] This generates SOUL.md — the universal behavioral contract for all agent sessions."
fi