feat: add prdy-status command and PRD status injection into system prompt
- Add prdy-status.sh for quick one-liner PRD health check (short/json output) - Inject PRD section count and assumption count into agent system prompt so the agent knows PRD state at session start without running validate - Add status subcommand to mosaic prdy routing and help text Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
39
bin/mosaic
39
bin/mosaic
@@ -56,6 +56,7 @@ PRD:
|
||||
init Create docs/PRD.md via guided runtime session
|
||||
update Update existing PRD via guided runtime session
|
||||
validate Check PRD completeness (bash-only)
|
||||
status Quick PRD health check (one-liner)
|
||||
|
||||
Coordinator (r0):
|
||||
coord <subcommand> Manual coordinator tools
|
||||
@@ -183,6 +184,40 @@ MISSION_EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
# Inject PRD status so the agent knows requirements state
|
||||
local prd_file="docs/PRD.md"
|
||||
if [[ -f "$prd_file" ]]; then
|
||||
local prd_sections=0
|
||||
local prd_assumptions=0
|
||||
for entry in "Problem Statement|^#{2,3} .*(problem statement|objective)" \
|
||||
"Scope / Non-Goals|^#{2,3} .*(scope|non.goal|out of scope|in.scope)" \
|
||||
"User Stories / Requirements|^#{2,3} .*(user stor|stakeholder|user.*requirement)" \
|
||||
"Functional Requirements|^#{2,3} .*functional requirement" \
|
||||
"Non-Functional Requirements|^#{2,3} .*non.functional" \
|
||||
"Acceptance Criteria|^#{2,3} .*acceptance criteria" \
|
||||
"Technical Considerations|^#{2,3} .*(technical consideration|constraint|dependenc)" \
|
||||
"Risks / Open Questions|^#{2,3} .*(risk|open question)" \
|
||||
"Success Metrics / Testing|^#{2,3} .*(success metric|test|verification)" \
|
||||
"Milestones / Delivery|^#{2,3} .*(milestone|delivery|scope version)"; do
|
||||
local pattern="${entry#*|}"
|
||||
grep -qiE "$pattern" "$prd_file" 2>/dev/null && prd_sections=$((prd_sections + 1))
|
||||
done
|
||||
prd_assumptions=$(grep -c 'ASSUMPTION:' "$prd_file" 2>/dev/null || echo 0)
|
||||
|
||||
local prd_status="ready"
|
||||
(( prd_sections < 10 )) && prd_status="incomplete ($prd_sections/10 sections)"
|
||||
|
||||
cat <<PRD_EOF
|
||||
|
||||
# PRD Status
|
||||
|
||||
- **File:** docs/PRD.md
|
||||
- **Status:** $prd_status
|
||||
- **Assumptions:** $prd_assumptions
|
||||
|
||||
PRD_EOF
|
||||
fi
|
||||
|
||||
cat <<'EOF'
|
||||
# Mosaic Launcher Runtime Contract (Hard Gate)
|
||||
|
||||
@@ -639,6 +674,9 @@ run_prdy() {
|
||||
validate|check)
|
||||
MOSAIC_PRDY_RUNTIME="$runtime" exec bash "$tool_dir/prdy-validate.sh" "$@"
|
||||
;;
|
||||
status)
|
||||
exec bash "$tool_dir/prdy-status.sh" "$@"
|
||||
;;
|
||||
help|*)
|
||||
cat <<PRDY_USAGE
|
||||
mosaic prdy — PRD creation and validation tools
|
||||
@@ -647,6 +685,7 @@ Commands:
|
||||
init [--project <path>] [--name <feature>] Create docs/PRD.md via guided runtime session
|
||||
update [--project <path>] Update existing docs/PRD.md via guided runtime session
|
||||
validate [--project <path>] Check PRD completeness against Mosaic guide (bash-only)
|
||||
status [--project <path>] [--format short|json] Quick PRD health check (one-liner)
|
||||
|
||||
Runtime:
|
||||
--claude Use Claude runtime (default)
|
||||
|
||||
Reference in New Issue
Block a user