migrate mosaic home to xdg config path
This commit is contained in:
@@ -105,7 +105,7 @@ check_agents_md() {
|
||||
# Check conditional loading/context (references guides or conditional section)
|
||||
check_conditional_loading() {
|
||||
local claude_md="$1/CLAUDE.md"
|
||||
[[ -f "$claude_md" ]] && grep -qi "agent-guides\|~/.mosaic/guides\|conditional.*loading\|conditional.*documentation\|conditional.*context" "$claude_md" 2>/dev/null
|
||||
[[ -f "$claude_md" ]] && grep -qi "agent-guides\|~/.config/mosaic/guides\|conditional.*loading\|conditional.*documentation\|conditional.*context" "$claude_md" 2>/dev/null
|
||||
}
|
||||
|
||||
# Check quality gates
|
||||
@@ -214,9 +214,9 @@ JSONEOF
|
||||
|
||||
if $FIX_HINT && ! $JSON_OUTPUT; then
|
||||
if [[ "$has_claude" == "MISS" || "$has_agents" == "MISS" ]]; then
|
||||
echo " ${DIM}Fix: ~/.mosaic/rails/bootstrap/init-project.sh --name \"$name\" --type auto${NC}"
|
||||
echo " ${DIM}Fix: ~/.config/mosaic/rails/bootstrap/init-project.sh --name \"$name\" --type auto${NC}"
|
||||
elif [[ "$has_guides" == "MISS" ]]; then
|
||||
echo " ${DIM}Fix: ~/.mosaic/rails/bootstrap/agent-upgrade.sh $dir --section conditional-loading${NC}"
|
||||
echo " ${DIM}Fix: ~/.config/mosaic/rails/bootstrap/agent-upgrade.sh $dir --section conditional-loading${NC}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ set -euo pipefail
|
||||
|
||||
# Defaults
|
||||
SRC_DIR="$HOME/src"
|
||||
FRAGMENTS_DIR="$HOME/.mosaic/templates/agent/fragments"
|
||||
TEMPLATES_DIR="$HOME/.mosaic/templates/agent"
|
||||
FRAGMENTS_DIR="$HOME/.config/mosaic/templates/agent/fragments"
|
||||
TEMPLATES_DIR="$HOME/.config/mosaic/templates/agent"
|
||||
DRY_RUN=false
|
||||
ALL_PROJECTS=false
|
||||
TARGET_PATH=""
|
||||
@@ -135,7 +135,7 @@ inject_fragment() {
|
||||
# Determine detection pattern for this fragment
|
||||
local detect_pattern
|
||||
case "$fragment_name" in
|
||||
conditional-loading) detect_pattern="agent-guides\|~/.mosaic/guides\|Conditional.*Loading\|Conditional.*Documentation\|Conditional.*Context" ;;
|
||||
conditional-loading) detect_pattern="agent-guides\|~/.config/mosaic/guides\|Conditional.*Loading\|Conditional.*Documentation\|Conditional.*Context" ;;
|
||||
commit-format) detect_pattern="<type>.*#issue\|Types:.*feat.*fix" ;;
|
||||
secrets) detect_pattern="NEVER hardcode secrets\|\.env.example.*committed" ;;
|
||||
multi-agent) detect_pattern="Multi-Agent Coordination\|pull --rebase.*before" ;;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
TEMPLATE_DIR="$HOME/.mosaic/templates/agent"
|
||||
GIT_SCRIPT_DIR="$HOME/.mosaic/rails/git"
|
||||
TEMPLATE_DIR="$HOME/.config/mosaic/templates/agent"
|
||||
GIT_SCRIPT_DIR="$HOME/.config/mosaic/rails/git"
|
||||
|
||||
# Defaults
|
||||
PROJECT_NAME=""
|
||||
@@ -373,7 +373,7 @@ echo "Created docs/scratchpads/, docs/reports/, docs/templates/"
|
||||
|
||||
# Set up CI/CD pipeline
|
||||
if [[ "$SKIP_CI" != true ]]; then
|
||||
CODEX_DIR="$HOME/.mosaic/rails/codex"
|
||||
CODEX_DIR="$HOME/.config/mosaic/rails/codex"
|
||||
if [[ -d "$CODEX_DIR/woodpecker" ]]; then
|
||||
mkdir -p .woodpecker/schemas
|
||||
cp "$CODEX_DIR/woodpecker/codex-review.yml" .woodpecker/
|
||||
@@ -386,7 +386,7 @@ fi
|
||||
|
||||
# Generate Docker build/push/link pipeline steps
|
||||
if [[ "$CICD_DOCKER" == true ]]; then
|
||||
CICD_SCRIPT="$HOME/.mosaic/rails/cicd/generate-docker-steps.sh"
|
||||
CICD_SCRIPT="$HOME/.config/mosaic/rails/cicd/generate-docker-steps.sh"
|
||||
if [[ -x "$CICD_SCRIPT" ]]; then
|
||||
# Parse org and repo from git remote
|
||||
CICD_REGISTRY=""
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
GIT_SCRIPT_DIR="$HOME/.mosaic/rails/git"
|
||||
GIT_SCRIPT_DIR="$HOME/.config/mosaic/rails/git"
|
||||
source "$GIT_SCRIPT_DIR/detect-platform.sh"
|
||||
|
||||
SKIP_MILESTONE=false
|
||||
|
||||
@@ -50,45 +50,45 @@ Security vulnerability review focusing on:
|
||||
|
||||
```bash
|
||||
# Code review
|
||||
~/.mosaic/rails/codex/codex-code-review.sh --uncommitted
|
||||
~/.config/mosaic/rails/codex/codex-code-review.sh --uncommitted
|
||||
|
||||
# Security review
|
||||
~/.mosaic/rails/codex/codex-security-review.sh --uncommitted
|
||||
~/.config/mosaic/rails/codex/codex-security-review.sh --uncommitted
|
||||
```
|
||||
|
||||
### Review a Pull Request
|
||||
|
||||
```bash
|
||||
# Review and post findings as a PR comment
|
||||
~/.mosaic/rails/codex/codex-code-review.sh -n 42
|
||||
~/.config/mosaic/rails/codex/codex-code-review.sh -n 42
|
||||
|
||||
# Security review and post to PR
|
||||
~/.mosaic/rails/codex/codex-security-review.sh -n 42
|
||||
~/.config/mosaic/rails/codex/codex-security-review.sh -n 42
|
||||
```
|
||||
|
||||
### Review Against Base Branch
|
||||
|
||||
```bash
|
||||
# Code review changes vs main
|
||||
~/.mosaic/rails/codex/codex-code-review.sh -b main
|
||||
~/.config/mosaic/rails/codex/codex-code-review.sh -b main
|
||||
|
||||
# Security review changes vs develop
|
||||
~/.mosaic/rails/codex/codex-security-review.sh -b develop
|
||||
~/.config/mosaic/rails/codex/codex-security-review.sh -b develop
|
||||
```
|
||||
|
||||
### Review a Specific Commit
|
||||
|
||||
```bash
|
||||
~/.mosaic/rails/codex/codex-code-review.sh -c abc123f
|
||||
~/.mosaic/rails/codex/codex-security-review.sh -c abc123f
|
||||
~/.config/mosaic/rails/codex/codex-code-review.sh -c abc123f
|
||||
~/.config/mosaic/rails/codex/codex-security-review.sh -c abc123f
|
||||
```
|
||||
|
||||
### Save Results to File
|
||||
|
||||
```bash
|
||||
# Save JSON output
|
||||
~/.mosaic/rails/codex/codex-code-review.sh --uncommitted -o review-results.json
|
||||
~/.mosaic/rails/codex/codex-security-review.sh --uncommitted -o security-results.json
|
||||
~/.config/mosaic/rails/codex/codex-code-review.sh --uncommitted -o review-results.json
|
||||
~/.config/mosaic/rails/codex/codex-security-review.sh --uncommitted -o security-results.json
|
||||
```
|
||||
|
||||
## Options
|
||||
@@ -113,12 +113,12 @@ Automated PR reviews in CI pipelines.
|
||||
|
||||
1. **Copy the pipeline template to your repo:**
|
||||
```bash
|
||||
cp ~/.mosaic/rails/codex/woodpecker/codex-review.yml your-repo/.woodpecker/
|
||||
cp ~/.config/mosaic/rails/codex/woodpecker/codex-review.yml your-repo/.woodpecker/
|
||||
```
|
||||
|
||||
2. **Copy the schemas directory:**
|
||||
```bash
|
||||
cp -r ~/.mosaic/rails/codex/schemas your-repo/.woodpecker/
|
||||
cp -r ~/.config/mosaic/rails/codex/schemas your-repo/.woodpecker/
|
||||
```
|
||||
|
||||
3. **Add Codex API key to Woodpecker:**
|
||||
@@ -203,7 +203,7 @@ Automated PR reviews in CI pipelines.
|
||||
|
||||
## Platform Support
|
||||
|
||||
Works with both **GitHub** and **Gitea** via the shared `~/.mosaic/rails/git/` infrastructure:
|
||||
Works with both **GitHub** and **Gitea** via the shared `~/.config/mosaic/rails/git/` infrastructure:
|
||||
- Auto-detects platform from git remote
|
||||
- Posts PR comments using `gh` (GitHub) or `tea` (Gitea)
|
||||
- Unified interface across both platforms
|
||||
@@ -260,6 +260,6 @@ For best results, use `gpt-5.2-codex` or newer for strongest review accuracy.
|
||||
|
||||
## See Also
|
||||
|
||||
- `~/.mosaic/guides/code-review.md` — Manual code review checklist
|
||||
- `~/.mosaic/rails/git/` — Git helper scripts (issue/PR management)
|
||||
- `~/.config/mosaic/guides/code-review.md` — Manual code review checklist
|
||||
- `~/.config/mosaic/rails/git/` — Git helper scripts (issue/PR management)
|
||||
- OpenAI Codex CLI docs: https://developers.openai.com/codex/cli/
|
||||
|
||||
@@ -35,26 +35,26 @@ The controller expects this layout in each bootstrapped repo:
|
||||
From a bootstrapped repo:
|
||||
|
||||
```bash
|
||||
~/.mosaic/bin/mosaic-orchestrator-matrix-cycle
|
||||
~/.mosaic/bin/mosaic-orchestrator-run --once
|
||||
~/.config/mosaic/bin/mosaic-orchestrator-matrix-cycle
|
||||
~/.config/mosaic/bin/mosaic-orchestrator-run --once
|
||||
```
|
||||
|
||||
Continuous loop:
|
||||
|
||||
```bash
|
||||
~/.mosaic/bin/mosaic-orchestrator-run --poll-sec 10
|
||||
~/.config/mosaic/bin/mosaic-orchestrator-run --poll-sec 10
|
||||
```
|
||||
|
||||
Publish new orchestrator events to Matrix:
|
||||
|
||||
```bash
|
||||
~/.mosaic/bin/mosaic-orchestrator-matrix-publish
|
||||
~/.config/mosaic/bin/mosaic-orchestrator-matrix-publish
|
||||
```
|
||||
|
||||
Consume Matrix task messages into `tasks.json`:
|
||||
|
||||
```bash
|
||||
~/.mosaic/bin/mosaic-orchestrator-matrix-consume
|
||||
~/.config/mosaic/bin/mosaic-orchestrator-matrix-consume
|
||||
```
|
||||
|
||||
## Matrix Note
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Universal QA hook handler with robust error handling
|
||||
# Location: ~/.mosaic/rails/qa/qa-hook-handler.sh
|
||||
# Location: ~/.config/mosaic/rails/qa/qa-hook-handler.sh
|
||||
|
||||
# Don't exit on unset variables initially to handle missing params gracefully
|
||||
set -eo pipefail
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# QA Hook handler that reads from stdin
|
||||
# Location: ~/.mosaic/rails/qa/qa-hook-stdin.sh
|
||||
# Location: ~/.config/mosaic/rails/qa/qa-hook-stdin.sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
@@ -51,9 +51,9 @@ if ! [[ "$FILE_PATH" =~ \.(ts|tsx|js|jsx|mjs|cjs)$ ]]; then
|
||||
fi
|
||||
|
||||
# Call the main QA handler with extracted parameters
|
||||
if [ -f ~/.mosaic/rails/qa/qa-hook-handler.sh ]; then
|
||||
if [ -f ~/.config/mosaic/rails/qa/qa-hook-handler.sh ]; then
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Calling QA handler for $FILE_PATH" >> "$LOG_FILE"
|
||||
~/.mosaic/rails/qa/qa-hook-handler.sh "$TOOL_NAME" "$FILE_PATH" 2>&1 | tee -a "$LOG_FILE"
|
||||
~/.config/mosaic/rails/qa/qa-hook-handler.sh "$TOOL_NAME" "$FILE_PATH" 2>&1 | tee -a "$LOG_FILE"
|
||||
else
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [ERROR] QA handler script not found" >> "$LOG_FILE"
|
||||
fi
|
||||
|
||||
@@ -13,7 +13,7 @@ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Hook wrapper called: tool=$TOOL_NAME file=$
|
||||
|
||||
# Call the actual QA handler if we have a file
|
||||
if [ -n "$FILE_PATH" ]; then
|
||||
~/.mosaic/rails/qa/qa-hook-handler.sh "$TOOL_NAME" "$FILE_PATH"
|
||||
~/.config/mosaic/rails/qa/qa-hook-handler.sh "$TOOL_NAME" "$FILE_PATH"
|
||||
else
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] No file path available for QA check" >> logs/qa-automation.log 2>/dev/null || true
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Monitor QA queues with graceful handling of missing directories
|
||||
# Location: ~/.mosaic/rails/qa/qa-queue-monitor.sh
|
||||
# Location: ~/.config/mosaic/rails/qa/qa-queue-monitor.sh
|
||||
|
||||
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Universal remediation hook handler with error recovery
|
||||
# Location: ~/.mosaic/rails/qa/remediation-hook-handler.sh
|
||||
# Location: ~/.config/mosaic/rails/qa/remediation-hook-handler.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Based on real-world validation of 50 issues in a production codebase:
|
||||
### New Project
|
||||
```bash
|
||||
# Apply template from Mosaic
|
||||
~/.mosaic/bin/mosaic-quality-apply --template typescript-node --target /path/to/project
|
||||
~/.config/mosaic/bin/mosaic-quality-apply --template typescript-node --target /path/to/project
|
||||
|
||||
# Install dependencies
|
||||
cd /path/to/project
|
||||
@@ -29,13 +29,13 @@ npm install
|
||||
npx husky install
|
||||
|
||||
# Verify enforcement is working
|
||||
~/.mosaic/bin/mosaic-quality-verify --target /path/to/project
|
||||
~/.config/mosaic/bin/mosaic-quality-verify --target /path/to/project
|
||||
```
|
||||
|
||||
### Existing Project
|
||||
```bash
|
||||
# Same as above - works for new or existing projects
|
||||
~/.mosaic/bin/mosaic-quality-apply --template typescript-node --target /path/to/existing-project
|
||||
~/.config/mosaic/bin/mosaic-quality-apply --template typescript-node --target /path/to/existing-project
|
||||
```
|
||||
|
||||
## 🛡️ What You Get
|
||||
|
||||
@@ -71,5 +71,5 @@ echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Install dependencies: npm install"
|
||||
echo "2. Initialize husky: npx husky install"
|
||||
echo "3. Run verification: ~/.mosaic/bin/mosaic-quality-verify --target $TARGET_DIR"
|
||||
echo "3. Run verification: ~/.config/mosaic/bin/mosaic-quality-verify --target $TARGET_DIR"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user