Mosaic Agent Framework

~/.mosaic is the universal userspace standards layer (master) for all agent runtimes.

Install Master Layer

From the standalone source repo:

git clone https://git.mosaicstack.dev/mosaic/bootstrap.git ~/src/mosaic-bootstrap
bash ~/src/mosaic-bootstrap/install.sh

What It Provides

  • Shared standards document: ~/.mosaic/STANDARDS.md
  • Shared operational guides: ~/.mosaic/guides/
  • Shared quality rails/scripts: ~/.mosaic/rails/
  • Shared runtime-neutral presets/profiles: ~/.mosaic/profiles/
  • Runtime adapter docs: ~/.mosaic/adapters/
  • Runtime overlays: ~/.mosaic/runtime/
  • Shared wrapper commands: ~/.mosaic/bin/
  • Canonical skills directory: ~/.mosaic/skills
  • Local cross-runtime skills: ~/.mosaic/skills-local

Universal Skills

The installer syncs skills from:

  • https://git.mosaicstack.dev/mosaic/agent-skills

into:

  • ~/.mosaic/skills

Then links each skill into runtime directories:

  • ~/.claude/skills
  • ~/.codex/skills
  • ~/.config/opencode/skills

Local skills under ~/.mosaic/skills-local are also linked into runtimes.

Manual commands:

~/.mosaic/bin/mosaic-sync-skills
~/.mosaic/bin/mosaic-sync-skills --link-only

Runtime Compatibility Sync

Installer syncs runtime overlays as regular files (not symlinks):

  • ~/.claude/{CLAUDE.md,settings.json,hooks-config.json,context7-integration.md} <- ~/.mosaic/runtime/claude/...
  • ~/.config/opencode/AGENTS.md <- ~/.mosaic/runtime/opencode/AGENTS.md

Legacy symlink trees under ~/.claude for migrated guides/scripts/templates/presets are pruned during sync.

Run manually:

~/.mosaic/bin/mosaic-link-runtime-assets
~/.mosaic/bin/mosaic-migrate-local-skills --apply

Prune migrated legacy backups from runtime folders (dry-run by default):

~/.mosaic/bin/mosaic-prune-legacy-runtime --runtime claude
~/.mosaic/bin/mosaic-prune-legacy-runtime --runtime claude --apply

Clean empty legacy runtime directories:

~/.mosaic/bin/mosaic-clean-runtime --runtime claude
~/.mosaic/bin/mosaic-clean-runtime --runtime claude --apply
~/.mosaic/bin/mosaic-clean-runtime --runtime claude --all-empty --apply

Audit runtime drift:

~/.mosaic/bin/mosaic-doctor
~/.mosaic/bin/mosaic-doctor --fail-on-warn

Opt-out during install:

MOSAIC_SKIP_SKILLS_SYNC=1 bash ~/src/mosaic-bootstrap/install.sh

Usage

Inside any compatible repository:

~/.mosaic/bin/mosaic-session-start
~/.mosaic/bin/mosaic-critical
~/.mosaic/bin/mosaic-session-end

Wrapper commands call local repo scripts under scripts/agent/.

Quality Rails (Generalized)

Mosaic includes vendored quality-rails templates and scripts at:

  • ~/.mosaic/rails/quality/

Apply to a repo:

~/.mosaic/bin/mosaic-quality-apply --template typescript-node --target /path/to/repo

Verify enforcement:

~/.mosaic/bin/mosaic-quality-verify --target /path/to/repo

Templates currently supported:

  • typescript-node
  • typescript-nextjs
  • monorepo

Matrix Orchestrator Rail

Mosaic includes a runtime-agnostic orchestrator rail at:

  • ~/.mosaic/rails/orchestrator-matrix/

Run from a bootstrapped repo:

~/.mosaic/bin/mosaic-orchestrator-matrix-cycle
~/.mosaic/bin/mosaic-orchestrator-run --once
~/.mosaic/bin/mosaic-orchestrator-run --poll-sec 10
~/.mosaic/bin/mosaic-orchestrator-matrix-publish
~/.mosaic/bin/mosaic-orchestrator-matrix-consume

The controller reads/writes repo-local state in .mosaic/orchestrator/ and emits structured events to .mosaic/orchestrator/events.ndjson for Matrix bridge consumption.

Bootstrap Any Repo (Slave Linkage)

Attach any repository/workspace to the master layer:

~/.mosaic/bin/mosaic-bootstrap-repo /path/to/repo

Attach and apply quality rails in one step:

~/.mosaic/bin/mosaic-bootstrap-repo --quality-template typescript-node /path/to/repo

This creates/updates:

  • .mosaic/ (repo-specific hook/config surface)
  • scripts/agent/ (portable lifecycle scripts)
  • AGENTS.md (if missing)

Upgrade Existing Slave Repos

Preview upgrades (dry-run):

~/.mosaic/bin/mosaic-upgrade-slaves

Apply upgrades:

~/.mosaic/bin/mosaic-upgrade-slaves --apply
Description
Mosaic universal agent bootstrap framework
Readme 1.8 MiB
Languages
Shell 69.3%
PowerShell 14%
TypeScript 12.2%
Python 3.9%
Vim Snippet 0.6%