@@ -31,3 +31,105 @@ lint:
3131# Run panic-attacker pre-commit scan
3232assail :
3333 @ command -v panic-attack >/ dev/ null 2 >&1 && panic-attack assail . || echo " panic-attack not found — install from https://github.com/hyperpolymath/panic-attacker"
34+
35+ # ═══════════════════════════════════════════════════════════════════════════════
36+ # ONBOARDING & DIAGNOSTICS
37+ # ═══════════════════════════════════════════════════════════════════════════════
38+
39+ # Check all required toolchain dependencies and report health
40+ doctor :
41+ #!/usr/bin/env bash
42+ echo " ═══════════════════════════════════════════════════"
43+ echo " Defiant Doctor — Toolchain Health Check"
44+ echo " ═══════════════════════════════════════════════════"
45+ echo " "
46+ PASS=0; FAIL=0; WARN=0
47+ check () {
48+ local name=" $1 " cmd=" $2 " min=" $3 "
49+ if command -v " $cmd " > /dev/null 2>&1 ; then
50+ VER=$( " $cmd " --version 2>&1 | head -1)
51+ echo " [OK] $name — $VER "
52+ PASS=$(( PASS + 1 ))
53+ else
54+ echo " [FAIL] $name — not found (need $min +)"
55+ FAIL=$(( FAIL + 1 ))
56+ fi
57+ }
58+ check " just" just " 1.25"
59+ check " git" git " 2.40"
60+ check " Zig" zig " 0.13"
61+ # Optional tools
62+ if command -v panic-attack >/ dev/ null 2 >&1 ; then
63+ echo " [OK] panic-attack — available"
64+ PASS=$((PASS + 1 ))
65+ else
66+ echo " [WARN] panic-attack — not found (pre-commit scanner)"
67+ WARN=$((WARN + 1 ))
68+ fi
69+ echo " "
70+ echo " Result: $PASS passed, $FAIL failed, $WARN warnings"
71+ if [ " $FAIL" -gt 0 ]; then
72+ echo " Run 'just heal' to attempt automatic repair."
73+ exit 1
74+ fi
75+ echo " All required tools present."
76+
77+ # Attempt to automatically install missing tools
78+ heal :
79+ #!/usr/bin/env bash
80+ echo " ═══════════════════════════════════════════════════"
81+ echo " Defiant Heal — Automatic Tool Installation"
82+ echo " ═══════════════════════════════════════════════════"
83+ echo " "
84+ if ! command -v just >/ dev/ null 2 >&1 ; then
85+ echo " Installing just..."
86+ cargo install just 2 >/ dev/ null || echo " Install just from https://just.systems"
87+ fi
88+ echo " "
89+ echo " Heal complete. Run 'just doctor' to verify."
90+
91+ # Guided tour of the project structure and key concepts
92+ tour :
93+ #!/usr/bin/env bash
94+ echo " ═══════════════════════════════════════════════════"
95+ echo " Defiant — Guided Tour"
96+ echo " ═══════════════════════════════════════════════════"
97+ echo " "
98+ echo ' // SPDX-License-Identifier: PMPL-1.0-or-later'
99+ echo " "
100+ echo " Key directories:"
101+ echo " src/ Source code"
102+ echo " ffi/ Foreign function interface (Zig)"
103+ echo " src/abi/ Idris2 ABI definitions"
104+ echo " docs/ Documentation"
105+ echo " tests/ Test suite"
106+ echo " .github/workflows/ CI/CD workflows"
107+ echo " contractiles/ Must/Trust/Dust contracts"
108+ echo " .machine_readable/ Machine-readable metadata"
109+ echo " examples/ Usage examples"
110+ echo " "
111+ echo " Quick commands:"
112+ echo " just doctor Check toolchain health"
113+ echo " just heal Fix missing tools"
114+ echo " just help-me Common workflows"
115+ echo " just default List all recipes"
116+ echo " "
117+ echo " Read more: README.adoc, EXPLAINME.adoc"
118+
119+ # Show help for common workflows
120+ help-me :
121+ #!/usr/bin/env bash
122+ echo " ═══════════════════════════════════════════════════"
123+ echo " Defiant — Common Workflows"
124+ echo " ═══════════════════════════════════════════════════"
125+ echo " "
126+ echo "FIRST TIME SETUP : "
127+ echo " just doctor Check toolchain"
128+ echo " just heal Fix missing tools"
129+ echo " "
130+ echo "PRE -COMMIT : "
131+ echo " just assail Run panic-attacker scan"
132+ echo " "
133+ echo "LEARN : "
134+ echo " just tour Guided project tour"
135+ echo " just default List all recipes"
0 commit comments