@davevdveen/spec-reader 0.1.2
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.
- package/LICENSE +21 -0
- package/README.md +107 -0
- package/package.json +28 -0
- package/read-specs +210 -0
- package/skills/read-specs/SKILL.md +35 -0
- package/spec-reader +104 -0
- package/spec-viewer.html +2366 -0
- package/view-proposal +30 -0
package/view-proposal
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Usage: view-proposal <feature-name> [openspec-dir]
|
|
5
|
+
# Opens the spec-viewer focused on a proposal after openspec propose.
|
|
6
|
+
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
8
|
+
PORT="${PORT:-3333}"
|
|
9
|
+
FEATURE="${1:?Usage: view-proposal <feature-name> [openspec-dir]}"
|
|
10
|
+
OPENSPEC_DIR="${2:-.}"
|
|
11
|
+
|
|
12
|
+
FOCUS_PATH="changes/${FEATURE}/proposal.md"
|
|
13
|
+
ENCODED=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$FOCUS_PATH")
|
|
14
|
+
URL="http://localhost:${PORT}/spec-viewer.html#${ENCODED}"
|
|
15
|
+
|
|
16
|
+
# Check if server is already running
|
|
17
|
+
if curl -sf "http://localhost:${PORT}/manifest.json" > /dev/null 2>&1; then
|
|
18
|
+
echo "Server running on port $PORT — refreshing manifest..."
|
|
19
|
+
curl -sf "http://localhost:${PORT}/api/refresh" > /dev/null 2>&1 || true
|
|
20
|
+
|
|
21
|
+
if command -v open &>/dev/null; then
|
|
22
|
+
open "$URL"
|
|
23
|
+
elif command -v xdg-open &>/dev/null; then
|
|
24
|
+
xdg-open "$URL"
|
|
25
|
+
fi
|
|
26
|
+
echo "Opened: $URL"
|
|
27
|
+
else
|
|
28
|
+
echo "Starting spec viewer..."
|
|
29
|
+
exec "$SCRIPT_DIR/read-specs" --focus "$FOCUS_PATH" "$OPENSPEC_DIR"
|
|
30
|
+
fi
|