feat: add USER.md and TOOLS.md to bootstrap framework

Introduce user profile (USER.md) and machine tool reference (TOOLS.md)
as first-class framework files. Both ship as generic defaults and are
personalized via mosaic init.

- Add USER.md/TOOLS.md defaults and parameterized templates
- Update AGENTS.md load order (6 → 8 steps)
- Update SOUL.md: default name "Assistant", add trash/mental-notes guardrails
- Update install.sh: preserve USER.md/TOOLS.md on reinstall
- Update mosaic-init: interactive USER.md + TOOLS.md generation
- Update mosaic-doctor: existence checks for new files
- Update mosaic launcher: inject USER.md/TOOLS.md into runtime prompt
- Update README: architecture diagram, generic-repo policy note

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 11:36:16 -06:00
parent e3ec3e32e5
commit 9ccd13fae7
12 changed files with 454 additions and 30 deletions

View File

@@ -4,7 +4,7 @@ set -euo pipefail
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TARGET_DIR="${MOSAIC_HOME:-$HOME/.config/mosaic}"
INSTALL_MODE="${MOSAIC_INSTALL_MODE:-prompt}" # prompt|keep|overwrite
PRESERVE_PATHS=("SOUL.md" "memory")
PRESERVE_PATHS=("SOUL.md" "USER.md" "TOOLS.md" "memory")
# Colors (disabled if not a terminal)
if [[ -t 1 ]]; then
@@ -46,7 +46,7 @@ select_install_mode() {
echo ""
echo "Existing Mosaic install detected at: $TARGET_DIR"
echo "Choose reinstall mode:"
echo " 1) keep Keep local files (SOUL.md, memory/) while updating framework"
echo " 1) keep Keep local files (SOUL.md, USER.md, TOOLS.md, memory/) while updating framework"
echo " 2) overwrite Replace everything in $TARGET_DIR"
echo " 3) cancel Abort install"
printf "Selection [1/2/3] (default: 1): "
@@ -131,7 +131,7 @@ mkdir -p "$TARGET_DIR"
select_install_mode
if [[ "$INSTALL_MODE" == "keep" ]]; then
ok "Install mode: keep local SOUL.md/memory while updating framework"
ok "Install mode: keep local SOUL.md/USER.md/TOOLS.md/memory while updating framework"
else
ok "Install mode: overwrite existing files"
fi
@@ -226,7 +226,9 @@ if [[ "$PATH_CHANGED" == "true" ]]; then
fi
if [[ ! -f "$TARGET_DIR/SOUL.md" ]]; then
NEXT_STEPS+=("Run ${CYAN}mosaic init${RESET} to set up your agent identity (SOUL.md).")
NEXT_STEPS+=("Run ${CYAN}mosaic init${RESET} to set up your agent identity (SOUL.md), user profile (USER.md), and tool config (TOOLS.md).")
elif grep -q "not configured" "$TARGET_DIR/USER.md" 2>/dev/null; then
NEXT_STEPS+=("Run ${CYAN}mosaic init${RESET} to personalize your user profile (USER.md) and tool config (TOOLS.md).")
fi
if [[ ${#NEXT_STEPS[@]} -gt 0 ]]; then