diff --git a/README.md b/README.md index 8f4c502..6880c66 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,30 @@ Inside any compatible repository: 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: + +```bash +~/.mosaic/bin/mosaic-quality-apply --template typescript-node --target /path/to/repo +``` + +Verify enforcement: + +```bash +~/.mosaic/bin/mosaic-quality-verify --target /path/to/repo +``` + +Templates currently supported: + +- `typescript-node` +- `typescript-nextjs` +- `monorepo` + ## Bootstrap Any Repo (Slave Linkage) Attach any repository/workspace to the master layer: @@ -111,6 +135,12 @@ Attach any repository/workspace to the master layer: ~/.mosaic/bin/mosaic-bootstrap-repo /path/to/repo ``` +Attach and apply quality rails in one step: + +```bash +~/.mosaic/bin/mosaic-bootstrap-repo --quality-template typescript-node /path/to/repo +``` + This creates/updates: - `.mosaic/` (repo-specific hook/config surface) diff --git a/STANDARDS.md b/STANDARDS.md index e47ab68..d7a98c2 100644 --- a/STANDARDS.md +++ b/STANDARDS.md @@ -20,6 +20,7 @@ Master/slave model: - Pull before edits when collaborating in shared repos. - Run validation checks before claiming completion. - Apply quality rails from `~/.mosaic/rails/` when relevant (review, QA, git workflow). +- For project-level mechanical enforcement templates, use `~/.mosaic/rails/quality/` via `~/.mosaic/bin/mosaic-quality-apply`. - Avoid hardcoded secrets and token leakage in remotes/commits. - Do not perform destructive git/file actions without explicit instruction. diff --git a/bin/mosaic-bootstrap-repo b/bin/mosaic-bootstrap-repo index efea456..71d09d5 100755 --- a/bin/mosaic-bootstrap-repo +++ b/bin/mosaic-bootstrap-repo @@ -3,6 +3,7 @@ set -euo pipefail TARGET_DIR="$(pwd)" FORCE=0 +QUALITY_TEMPLATE="" while [[ $# -gt 0 ]]; do case "$1" in @@ -10,6 +11,10 @@ while [[ $# -gt 0 ]]; do FORCE=1 shift ;; + --quality-template) + QUALITY_TEMPLATE="${2:-}" + shift 2 + ;; *) TARGET_DIR="$1" shift @@ -48,6 +53,7 @@ copy_file() { copy_file "$TEMPLATE_ROOT/.mosaic/README.md" "$TARGET_DIR/.mosaic/README.md" copy_file "$TEMPLATE_ROOT/.mosaic/repo-hooks.sh" "$TARGET_DIR/.mosaic/repo-hooks.sh" +copy_file "$TEMPLATE_ROOT/.mosaic/quality-rails.yml" "$TARGET_DIR/.mosaic/quality-rails.yml" for file in "$TEMPLATE_ROOT"/scripts/agent/*.sh; do base="$(basename "$file")" @@ -90,3 +96,17 @@ fi echo "[mosaic] Repo bootstrap complete: $TARGET_DIR" echo "[mosaic] Next: edit $TARGET_DIR/.mosaic/repo-hooks.sh with project workflows" +echo "[mosaic] Optional: apply quality rails via ~/.mosaic/bin/mosaic-quality-apply --template