@imdeadpool/guardex 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ if [[ $# -lt 1 ]]; then
5
+ echo "Usage: $0 <plan-slug> [role ...]"
6
+ echo "Example: $0 stabilize-dashboard planner architect critic executor writer verifier"
7
+ exit 1
8
+ fi
9
+
10
+ PLAN_SLUG="$1"
11
+ shift || true
12
+
13
+ if [[ "$PLAN_SLUG" =~ [^a-z0-9-] ]]; then
14
+ echo "Error: plan slug must be kebab-case (lowercase letters, numbers, hyphens)." >&2
15
+ exit 1
16
+ fi
17
+
18
+ if [[ $# -gt 0 ]]; then
19
+ ROLES=("$@")
20
+ else
21
+ ROLES=(planner architect critic executor writer verifier)
22
+ fi
23
+
24
+ PLAN_DIR="openspec/plan/${PLAN_SLUG}"
25
+ mkdir -p "$PLAN_DIR"
26
+
27
+ write_if_missing() {
28
+ local file="$1"
29
+ shift
30
+ if [[ ! -f "$file" ]]; then
31
+ mkdir -p "$(dirname "$file")"
32
+ cat > "$file" <<EOF
33
+ $*
34
+ EOF
35
+ fi
36
+ }
37
+
38
+ write_if_missing "$PLAN_DIR/summary.md" "# Plan Summary: ${PLAN_SLUG}
39
+
40
+ - **Mode:** ralplan
41
+ - **Status:** draft
42
+
43
+ ## Context
44
+
45
+ Describe the problem, constraints, and intended outcomes.
46
+ "
47
+
48
+ write_if_missing "$PLAN_DIR/checkpoints.md" "# Plan Checkpoints: ${PLAN_SLUG}
49
+
50
+ Chronological checkpoint log for all roles.
51
+ "
52
+
53
+ write_if_missing "$PLAN_DIR/README.md" "# Plan Workspace: ${PLAN_SLUG}
54
+
55
+ Durable pre-implementation planning workspace.
56
+
57
+ Use this command to update checkpoints:
58
+
59
+ \`\`\`bash
60
+ /opsx:checkpoint ${PLAN_SLUG} <role> <checkpoint-id> <state> <note...>
61
+ \`\`\`
62
+ "
63
+
64
+ write_if_missing "$PLAN_DIR/planner/plan.md" "# ExecPlan: ${PLAN_SLUG}
65
+
66
+ This document is a living plan. Keep progress and decisions current.
67
+
68
+ ## Purpose / Big Picture
69
+
70
+ ## Progress
71
+
72
+ - [ ] Initial draft
73
+ - [ ] Review + iterate
74
+ - [ ] Approved for execution
75
+
76
+ ## Surprises & Discoveries
77
+
78
+ ## Decision Log
79
+
80
+ ## Outcomes & Retrospective
81
+
82
+ ## Validation and Acceptance
83
+ "
84
+
85
+ for role in "${ROLES[@]}"; do
86
+ ROLE_DIR="$PLAN_DIR/$role"
87
+ mkdir -p "$ROLE_DIR"
88
+
89
+ write_if_missing "$ROLE_DIR/README.md" "# ${role}
90
+
91
+ Role workspace for \`${role}\`.
92
+ "
93
+
94
+ write_if_missing "$ROLE_DIR/tasks.md" "# ${role} tasks
95
+
96
+ ## 1. Spec
97
+
98
+ - [ ] Define requirements and scope for ${role}
99
+ - [ ] Confirm acceptance criteria are explicit and testable
100
+
101
+ ## 2. Tests
102
+
103
+ - [ ] Define verification approach and evidence requirements
104
+ - [ ] List concrete commands for verification
105
+
106
+ ## 3. Implementation
107
+
108
+ - [ ] Execute role-specific deliverables
109
+ - [ ] Capture decisions, risks, and handoff notes
110
+
111
+ ## 4. Checkpoints
112
+
113
+ - [ ] Publish checkpoint update for this role
114
+ "
115
+ done
116
+
117
+ echo "[guardex] OpenSpec plan workspace ready: ${PLAN_DIR}"
118
+ echo "[guardex] Roles: ${ROLES[*]}"