Moves all Mosaic framework runtime files from the separate bootstrap repo into the monorepo as canonical source. The @mosaic/mosaic npm package now ships the complete framework — bin scripts, runtime configs, tools, and templates — enabling standalone installation via npm install. Structure: packages/mosaic/framework/ ├── bin/ 28 CLI scripts (mosaic, mosaic-doctor, mosaic-sync-skills, etc.) ├── runtime/ Runtime adapters (claude, codex, opencode, pi, mcp) ├── tools/ Shell tooling (git, prdy, orchestrator, quality, etc.) ├── templates/ Agent and repo templates ├── defaults/ Default identity files (AGENTS.md, STANDARDS.md, SOUL.md, etc.) ├── install.sh Legacy bash installer └── remote-install.sh One-liner remote installer Key files with Pi support and recent fixes: - bin/mosaic: launch_pi() with skills-local loop - bin/mosaic-doctor: --fix auto-wiring for all 4 harnesses - bin/mosaic-sync-skills: Pi as 4th link target, symlink-aware find - bin/mosaic-link-runtime-assets: Pi settings.json patching - bin/mosaic-migrate-local-skills: Pi skill roots, symlink find - runtime/pi/RUNTIME.md + mosaic-extension.ts Package ships 251 framework files in the npm tarball (278KB compressed).
82 lines
2.3 KiB
Bash
Executable File
82 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# Quality Rails Installation Script
|
|
# Usage: ./install.sh --template typescript-node [--target /path/to/project]
|
|
|
|
TEMPLATE=""
|
|
TARGET_DIR="."
|
|
|
|
# Parse arguments
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
--template)
|
|
TEMPLATE="$2"
|
|
shift 2
|
|
;;
|
|
--target)
|
|
TARGET_DIR="$2"
|
|
shift 2
|
|
;;
|
|
*)
|
|
echo "Unknown option: $1"
|
|
echo "Usage: $0 --template <template-name> [--target <directory>]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ -z "$TEMPLATE" ]; then
|
|
echo "Error: --template is required"
|
|
echo "Available templates: typescript-node, typescript-nextjs, python, monorepo"
|
|
exit 1
|
|
fi
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
TEMPLATE_DIR="$REPO_ROOT/templates/$TEMPLATE"
|
|
|
|
if [ ! -d "$TEMPLATE_DIR" ]; then
|
|
echo "Error: Template '$TEMPLATE' not found at $TEMPLATE_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Installing Quality Rails: $TEMPLATE"
|
|
echo "Target directory: $TARGET_DIR"
|
|
echo ""
|
|
|
|
# Copy template files
|
|
echo "Copying template files..."
|
|
cp -r "$TEMPLATE_DIR/.husky" "$TARGET_DIR/" 2>/dev/null || true
|
|
cp "$TEMPLATE_DIR/.lintstagedrc.js" "$TARGET_DIR/" 2>/dev/null || true
|
|
cp "$TEMPLATE_DIR/.eslintrc.strict.js" "$TARGET_DIR/.eslintrc.js" 2>/dev/null || true
|
|
cp "$TEMPLATE_DIR/tsconfig.strict.json" "$TARGET_DIR/tsconfig.json" 2>/dev/null || true
|
|
cp "$TEMPLATE_DIR/.woodpecker.yml" "$TARGET_DIR/" 2>/dev/null || true
|
|
|
|
# Copy shared gitleaks config from templates root
|
|
SHARED_TEMPLATES="$(dirname "$TEMPLATE_DIR")"
|
|
cp "$SHARED_TEMPLATES/.gitleaks.toml" "$TARGET_DIR/" 2>/dev/null || true
|
|
|
|
echo "✓ Files copied"
|
|
|
|
# Check if package.json exists
|
|
if [ -f "$TARGET_DIR/package.json" ]; then
|
|
echo ""
|
|
echo "⚠ package.json exists. Please manually merge dependencies from:"
|
|
echo " $TEMPLATE_DIR/package.json.snippet"
|
|
else
|
|
echo "⚠ No package.json found. Create one and add dependencies from:"
|
|
echo " $TEMPLATE_DIR/package.json.snippet"
|
|
fi
|
|
|
|
echo ""
|
|
echo "✓ Quality Rails installed successfully!"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo "1. Install dependencies: npm install"
|
|
echo "2. Initialize husky: npx husky install"
|
|
echo "3. Install gitleaks: https://github.com/gitleaks/gitleaks#installing"
|
|
echo "4. Run verification: ~/.config/mosaic/bin/mosaic-quality-verify --target $TARGET_DIR"
|
|
echo "5. (Optional) Scan full history: gitleaks git --redact --verbose"
|
|
echo ""
|