@@ -459,3 +459,115 @@ build-riscv:
459459# Run panic-attacker pre-commit scan
460460assail :
461461 @ command -v panic-attack >/ dev/ null 2 >&1 && panic-attack assail . || echo " panic-attack not found — install from https://github.com/hyperpolymath/panic-attacker"
462+
463+ # ═══════════════════════════════════════════════════════════════════════════════
464+ # ONBOARDING & DIAGNOSTICS
465+ # ═══════════════════════════════════════════════════════════════════════════════
466+
467+ # Check all required toolchain dependencies and report health
468+ doctor :
469+ #!/usr/bin/env bash
470+ echo " ═══════════════════════════════════════════════════"
471+ echo " Docmatrix Doctor — Toolchain Health Check"
472+ echo " ═══════════════════════════════════════════════════"
473+ echo " "
474+ PASS=0; FAIL=0; WARN=0
475+ check() {
476+ local name=" $1" cmd=" $2" min=" $3"
477+ if command -v " $cmd" >/ dev/ null 2 >&1 ; then
478+ VER=$(" $cmd" --version 2 >&1 | head -1)
479+ echo " [OK] $name — $VER"
480+ PASS=$((PASS + 1 ))
481+ else
482+ echo " [FAIL] $name — not found (need $min+)"
483+ FAIL=$((FAIL + 1 ))
484+ fi
485+ }
486+ check " just" just " 1.25"
487+ check " git" git " 2.40"
488+ check " Rust (cargo)" cargo " 1.80"
489+ check " Zig" zig " 0.13"
490+ # Optional tools
491+ if command -v panic-attack >/ dev/ null 2 >&1 ; then
492+ echo " [OK] panic-attack — available"
493+ PASS=$((PASS + 1 ))
494+ else
495+ echo " [WARN] panic-attack — not found (pre-commit scanner)"
496+ WARN=$((WARN + 1 ))
497+ fi
498+ echo " "
499+ echo " Result: $PASS passed, $FAIL failed, $WARN warnings"
500+ if [ " $FAIL" -gt 0 ]; then
501+ echo " Run 'just heal' to attempt automatic repair."
502+ exit 1
503+ fi
504+ echo " All required tools present."
505+
506+ # Attempt to automatically install missing tools
507+ heal :
508+ #!/usr/bin/env bash
509+ echo " ═══════════════════════════════════════════════════"
510+ echo " Docmatrix Heal — Automatic Tool Installation"
511+ echo " ═══════════════════════════════════════════════════"
512+ echo " "
513+ if ! command -v cargo >/ dev/ null 2 >&1 ; then
514+ echo " Installing Rust via rustup..."
515+ curl --proto ' =https' --tlsv1.2 -sSf https:// sh.rustup.rs | sh -s -- -y
516+ source " $HOME/.cargo/env"
517+ fi
518+ if ! command -v just >/ dev/ null 2 >&1 ; then
519+ echo " Installing just..."
520+ cargo install just 2 >/ dev/ null || echo " Install just from https://just.systems"
521+ fi
522+ echo " "
523+ echo " Heal complete. Run 'just doctor' to verify."
524+
525+ # Guided tour of the project structure and key concepts
526+ tour :
527+ #!/usr/bin/env bash
528+ echo " ═══════════════════════════════════════════════════"
529+ echo " Docmatrix — Guided Tour"
530+ echo " ═══════════════════════════════════════════════════"
531+ echo " "
532+ echo ' // SPDX-License-Identifier: MPL-2.0-or-later'
533+ echo " "
534+ echo " Key directories:"
535+ echo " src/ Source code"
536+ echo " ffi/ Foreign function interface (Zig)"
537+ echo " src/abi/ Idris2 ABI definitions"
538+ echo " docs/ Documentation"
539+ echo " .github/workflows/ CI/CD workflows"
540+ echo " contractiles/ Must/Trust/Dust contracts"
541+ echo " .machine_readable/ Machine-readable metadata"
542+ echo " container/ Container configuration"
543+ echo " examples/ Usage examples"
544+ echo " "
545+ echo " Quick commands:"
546+ echo " just doctor Check toolchain health"
547+ echo " just heal Fix missing tools"
548+ echo " just help-me Common workflows"
549+ echo " just default List all recipes"
550+ echo " "
551+ echo " Read more: README.adoc, EXPLAINME.adoc"
552+
553+ # Show help for common workflows
554+ help-me :
555+ #!/usr/bin/env bash
556+ echo " ═══════════════════════════════════════════════════"
557+ echo " Docmatrix — Common Workflows"
558+ echo " ═══════════════════════════════════════════════════"
559+ echo " "
560+ echo "FIRST TIME SETUP : "
561+ echo " just doctor Check toolchain"
562+ echo " just heal Fix missing tools"
563+ echo " "
564+ echo " DEVELOPMENT:"
565+ echo " cargo build Build the project"
566+ echo " cargo test Run tests"
567+ echo " "
568+ echo "PRE -COMMIT : "
569+ echo " just assail Run panic-attacker scan"
570+ echo " "
571+ echo "LEARN : "
572+ echo " just tour Guided project tour"
573+ echo " just default List all recipes"
0 commit comments