Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·85 lines (73 loc) · 3.07 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·85 lines (73 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env bash
# SDAIS install script — v0.13.0
# Usage: install.sh <project-name>
#
# Run from your project root. Creates AGENTS.md, the sdais/ scaffold, and the
# managed implementation/ workspace.
# Requires: SDAIS.md in the same directory as this script.
set -euo pipefail
SDAIS_VERSION="v0.13.0"
if [[ $# -lt 1 ]]; then
echo "Usage: install.sh <project-name>" >&2
exit 1
fi
PROJECT="$1"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TODAY="$(date +%Y-%m-%d)"
echo "SDAIS $SDAIS_VERSION — installing scaffold for: $PROJECT"
# Locate scaffold. The v0.13.0 distribution archive expands beside scaffold/,
# so the unpacked directory takes precedence over the archive itself.
TGZ="$SCRIPT_DIR/sdais-$SDAIS_VERSION.tgz"
if [ -d "$SCRIPT_DIR/scaffold" ]; then
cp -rp "$SCRIPT_DIR/scaffold/." .
elif [ -f "$TGZ" ]; then
# Backward-compatible support for a scaffold-only distribution archive.
tar xzf "$TGZ"
else
echo "error: neither $TGZ nor $SCRIPT_DIR/scaffold/ found" >&2
exit 1
fi
# Copy SDAIS.md into sdais/
cp "$SCRIPT_DIR/SDAIS.md" sdais/SDAIS.md
# Install the sdais launcher into ~/.local/bin/
LOCAL_BIN="$HOME/.local/bin"
mkdir -p "$LOCAL_BIN"
cp "$SCRIPT_DIR/sdais.sh" "$LOCAL_BIN/sdais"
chmod +x "$LOCAL_BIN/sdais"
# Create empty version directories not included in the scaffold
mkdir -p sdais/library sdais/gspec/v1 sdais/tspec/v1 sdais/adf/v1 sdais/trs/v1 sdais/cdf/v1
# The scaffold supplies a zero-byte marker. Its presence activates the
# managed implementation-root contract for fresh installations.
if [ ! -f implementation/.sdais-root ]; then
echo "error: scaffold did not install implementation/.sdais-root" >&2
exit 1
fi
# Substitute placeholders in AGENTS.md
tmp=$(mktemp)
sed "s/<Project Name>/$PROJECT/g" AGENTS.md > "$tmp" && mv "$tmp" AGENTS.md
# Substitute today's date in template files
find sdais/rsf -name "*-template.md" | while read -r f; do
tmp=$(mktemp)
sed "s/YYYY-MM-DD/$TODAY/g" "$f" > "$tmp" && mv "$tmp" "$f"
done
echo "Done."
echo " AGENTS.md"
echo " sdais/SDAIS.md"
printf " sdais/prompts/ (%d prompt files)\n" "$(find sdais/prompts/ -maxdepth 1 -name "*.md" | wc -l | tr -d ' ')"
echo " sdais/library/ (empty; project-owned reference libraries)"
echo " implementation/ (managed product workspace)"
printf " sdais/rsf/v1/ (%d template files)\n" "$(find sdais/rsf/v1/ -maxdepth 1 -name "*.md" | wc -l | tr -d ' ')"
printf " %s/sdais\n" "$LOCAL_BIN"
echo ""
if ! command -v sdais >/dev/null 2>&1; then
echo "Note: $LOCAL_BIN is not in your PATH."
echo " Add it with: export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
fi
echo "Next:"
echo " Option A (SDAIS-G) — draft prose first: create sdais/gspec/v1/, write freely,"
echo " then run: ./sdais.sh <tool> <model> RequirementsEngineer"
echo " Option A (SDAIS-T) — draft transformation prose: create sdais/tspec/v1/,"
echo " then run: ./sdais.sh <tool> <model> TransformationEngineer"
echo " Option B — author RSF items directly in sdais/rsf/v1/, then run:"
echo " ./sdais.sh <tool> <model> SemanticAuditor"