feat: integrate framework files into monorepo under packages/mosaic/framework/
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).
This commit is contained in:
94
packages/mosaic/framework/tools/prdy/prdy-status.sh
Executable file
94
packages/mosaic/framework/tools/prdy/prdy-status.sh
Executable file
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
#
|
||||
# prdy-status.sh — Quick PRD health check (one-liner output)
|
||||
#
|
||||
# Usage:
|
||||
# prdy-status.sh [--project <path>] [--format short|json]
|
||||
#
|
||||
# Exit codes:
|
||||
# 0 = PRD ready (all required sections present)
|
||||
# 1 = PRD incomplete
|
||||
# 2 = PRD missing
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/_lib.sh"
|
||||
|
||||
# ─── Parse arguments ─────────────────────────────────────────────────────────
|
||||
|
||||
PROJECT="."
|
||||
FORMAT="short"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--project) PROJECT="$2"; shift 2 ;;
|
||||
--format) FORMAT="$2"; shift 2 ;;
|
||||
-h|--help)
|
||||
cat <<'USAGE'
|
||||
prdy-status.sh — Quick PRD health check
|
||||
|
||||
Usage: prdy-status.sh [--project <path>] [--format short|json]
|
||||
|
||||
Options:
|
||||
--project <path> Project directory (default: CWD)
|
||||
--format <f> Output format: short (default) or json
|
||||
|
||||
Exit codes:
|
||||
0 = PRD ready (all required sections present)
|
||||
1 = PRD incomplete
|
||||
2 = PRD missing
|
||||
USAGE
|
||||
exit 0
|
||||
;;
|
||||
*) echo "Unknown option: $1" >&2; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
PROJECT="${PROJECT/#\~/$HOME}"
|
||||
|
||||
# ─── Status check ────────────────────────────────────────────────────────────
|
||||
|
||||
PRD_PATH="$(find_prd "$PROJECT")"
|
||||
|
||||
if [[ -z "$PRD_PATH" ]]; then
|
||||
if [[ "$FORMAT" == "json" ]]; then
|
||||
echo '{"status":"missing"}'
|
||||
else
|
||||
echo "PRD: missing"
|
||||
fi
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Count present sections using the shared manifest
|
||||
PRD_CONTENT="$(cat "$PRD_PATH")"
|
||||
total=${#PRDY_REQUIRED_SECTIONS[@]}
|
||||
present=0
|
||||
|
||||
for entry in "${PRDY_REQUIRED_SECTIONS[@]}"; do
|
||||
pattern="${entry#*|}"
|
||||
if echo "$PRD_CONTENT" | grep -qiE "$pattern"; then
|
||||
present=$((present + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
# Count additional metrics
|
||||
fr_count=$(echo "$PRD_CONTENT" | grep -cE '^\- FR-[0-9]+:|^FR-[0-9]+:' || true)
|
||||
us_count=$(echo "$PRD_CONTENT" | grep -cE '^#{1,4} US-[0-9]+' || true)
|
||||
assumptions=$(echo "$PRD_CONTENT" | grep -c 'ASSUMPTION:' || true)
|
||||
|
||||
if (( present == total )); then
|
||||
status="ready"
|
||||
exit_code=0
|
||||
else
|
||||
status="incomplete"
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
if [[ "$FORMAT" == "json" ]]; then
|
||||
printf '{"status":"%s","sections":%d,"total":%d,"frs":%d,"stories":%d,"assumptions":%d}\n' \
|
||||
"$status" "$present" "$total" "$fr_count" "$us_count" "$assumptions"
|
||||
else
|
||||
echo "PRD: $status ($present/$total sections, ${fr_count} FRs, ${us_count} stories, $assumptions assumptions)"
|
||||
fi
|
||||
|
||||
exit "$exit_code"
|
||||
Reference in New Issue
Block a user