@@ -51,3 +51,115 @@ install:
5151# Run panic-attacker pre-commit scan
5252assail :
5353 @ command -v panic-attack >/ dev/ null 2 >&1 && panic-attack assail . || echo " panic-attack not found — install from https://github.com/hyperpolymath/panic-attacker"
54+
55+ # ═══════════════════════════════════════════════════════════════════════════════
56+ # ONBOARDING & DIAGNOSTICS
57+ # ═══════════════════════════════════════════════════════════════════════════════
58+
59+ # Check all required toolchain dependencies and report health
60+ doctor :
61+ #!/usr/bin/env bash
62+ echo " ═══════════════════════════════════════════════════"
63+ echo " Chapeliser Doctor — Toolchain Health Check"
64+ echo " ═══════════════════════════════════════════════════"
65+ echo " "
66+ PASS=0; FAIL=0; WARN=0
67+ check () {
68+ local name=" $1 " cmd=" $2 " min=" $3 "
69+ if command -v " $cmd " > /dev/null 2>&1 ; then
70+ VER=$( " $cmd " --version 2>&1 | head -1)
71+ echo " [OK] $name — $VER "
72+ PASS=$(( PASS + 1 ))
73+ else
74+ echo " [FAIL] $name — not found (need $min +)"
75+ FAIL=$(( FAIL + 1 ))
76+ fi
77+ }
78+ check " just" just " 1.25"
79+ check " git" git " 2.40"
80+ check " Rust (cargo)" cargo " 1.80"
81+ check " Zig" zig " 0.13"
82+ # Optional tools
83+ if command -v panic-attack >/ dev/ null 2 >&1 ; then
84+ echo " [OK] panic-attack — available"
85+ PASS=$((PASS + 1 ))
86+ else
87+ echo " [WARN] panic-attack — not found (pre-commit scanner)"
88+ WARN=$((WARN + 1 ))
89+ fi
90+ echo " "
91+ echo " Result: $PASS passed, $FAIL failed, $WARN warnings"
92+ if [ " $FAIL" -gt 0 ]; then
93+ echo " Run 'just heal' to attempt automatic repair."
94+ exit 1
95+ fi
96+ echo " All required tools present."
97+
98+ # Attempt to automatically install missing tools
99+ heal :
100+ #!/usr/bin/env bash
101+ echo " ═══════════════════════════════════════════════════"
102+ echo " Chapeliser Heal — Automatic Tool Installation"
103+ echo " ═══════════════════════════════════════════════════"
104+ echo " "
105+ if ! command -v cargo >/ dev/ null 2 >&1 ; then
106+ echo " Installing Rust via rustup..."
107+ curl --proto ' =https' --tlsv1.2 -sSf https:// sh.rustup.rs | sh -s -- -y
108+ source " $HOME/.cargo/env"
109+ fi
110+ if ! command -v just >/ dev/ null 2 >&1 ; then
111+ echo " Installing just..."
112+ cargo install just 2 >/ dev/ null || echo " Install just from https://just.systems"
113+ fi
114+ echo " "
115+ echo " Heal complete. Run 'just doctor' to verify."
116+
117+ # Guided tour of the project structure and key concepts
118+ tour :
119+ #!/usr/bin/env bash
120+ echo " ═══════════════════════════════════════════════════"
121+ echo " Chapeliser — Guided Tour"
122+ echo " ═══════════════════════════════════════════════════"
123+ echo " "
124+ echo ' // SPDX-License-Identifier: PMPL-1.0-or-later'
125+ echo " "
126+ echo " Key directories:"
127+ echo " src/ Source code"
128+ echo " ffi/ Foreign function interface (Zig)"
129+ echo " src/abi/ Idris2 ABI definitions"
130+ echo " docs/ Documentation"
131+ echo " tests/ Test suite"
132+ echo " .github/workflows/ CI/CD workflows"
133+ echo " .machine_readable/ Machine-readable metadata"
134+ echo " container/ Container configuration"
135+ echo " examples/ Usage examples"
136+ echo " "
137+ echo " Quick commands:"
138+ echo " just doctor Check toolchain health"
139+ echo " just heal Fix missing tools"
140+ echo " just help-me Common workflows"
141+ echo " just default List all recipes"
142+ echo " "
143+ echo " Read more: README.adoc, EXPLAINME.adoc"
144+
145+ # Show help for common workflows
146+ help-me :
147+ #!/usr/bin/env bash
148+ echo " ═══════════════════════════════════════════════════"
149+ echo " Chapeliser — Common Workflows"
150+ echo " ═══════════════════════════════════════════════════"
151+ echo " "
152+ echo "FIRST TIME SETUP : "
153+ echo " just doctor Check toolchain"
154+ echo " just heal Fix missing tools"
155+ echo " "
156+ echo " DEVELOPMENT:"
157+ echo " cargo build Build the project"
158+ echo " cargo test Run tests"
159+ echo " "
160+ echo "PRE -COMMIT : "
161+ echo " just assail Run panic-attacker scan"
162+ echo " "
163+ echo "LEARN : "
164+ echo " just tour Guided project tour"
165+ echo " just default List all recipes"
0 commit comments