Constructor Pattern (RULE ZERO). Zero behaviour change, zero flag
drift — all original CLI flags preserved verbatim.
Before: install.sh — 1238 LOC monolith
After: install.sh — 138 LOC dispatcher (sources libs in order)
install/lib-*.sh — 16 cubes, max 183 LOC (lib-menu)
Cubes:
lib-log 21 LOC — logging primitives
lib-backup 63 LOC — rollback trap + BACKUP_PAIRS
lib-profile 115 LOC — MANIFEST.toml profile resolution
lib-args 92 LOC — CLI parsing + --help heredoc
lib-menu 183 LOC — whiptail/dialog/plain-text interactive picker
lib-plan 150 LOC — dry-run --no-execute output
lib-prereqs 91 LOC — hard + soft dependency checks
lib-primitives 131 LOC — primitive copy + MANIFEST drive
lib-rust 114 LOC — cargo workspace build + pre-built support
lib-scaffold 144 LOC — agent/skill/block scaffolding
lib-bridges 31 LOC — project-bridge install
lib-hooks 104 LOC — settings.json jq merge
lib-agents 77 LOC — assembled agent output
lib-skills 23 LOC — skill copy
lib-wizard 20 LOC — sleep-setup wizard invocation
lib-summary 59 LOC — post-install summary
Invariants preserved:
- macOS bash 3.2 compat (no associative arrays, no [[ ]], no ${,,})
- rollback trap wired via setup_backup_trap early in dispatcher
- jq-merge behaviour verbatim in lib-hooks
- scoped Cargo.toml regeneration in lib-rust
Function LOC limits: largest non-heredoc fn 22 LOC (check_soft_prereqs).
Three functions kept >30 LOC because heredoc-dominated (print_help,
print_summary, profile_members); splitting would fragment logical unit.
62 unique function names across cubes, zero duplicates (grep-verified).
bash -n passes on all 17 files. Runtime smoke test deferred to user's
shell (bash-readonly sandbox constraint).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
59 lines
2 KiB
Bash
59 lines
2 KiB
Bash
# shellcheck shell=bash
|
|
# lib-summary.sh — final success banner with next-step hints.
|
|
#
|
|
# Two shapes: "hooks activated" vs "hooks pending manual merge". Both tell
|
|
# the user how to verify the install and how to create a new specialist.
|
|
#
|
|
# Requires: say from lib-log.sh.
|
|
# Reads globals: $PROFILE, $DID_ACTIVATE, $KIT_DIR, $AGENTS_DIR, $HOME_DIR.
|
|
|
|
print_summary() {
|
|
local settings_file="$HOME_DIR/.claude/settings.json"
|
|
echo
|
|
say "install complete (profile=$PROFILE)"
|
|
echo
|
|
if [ "$DID_ACTIVATE" = "1" ]; then
|
|
cat <<EOF
|
|
==========================================================================
|
|
Hooks activated. Settings merged into $settings_file
|
|
==========================================================================
|
|
|
|
To verify install:
|
|
ls $AGENTS_DIR/*.md # should show 12 generated agents
|
|
$AGENTS_DIR/_assembler/target/release/assemble --validate
|
|
./install.sh --list # show installed primitives
|
|
|
|
To create a new project-specialist agent:
|
|
/new-agent
|
|
|
|
==========================================================================
|
|
EOF
|
|
else
|
|
cat <<EOF
|
|
==========================================================================
|
|
NEXT STEP: merge settings-snippet.json into ~/.claude/settings.json
|
|
==========================================================================
|
|
|
|
KeiSeiKit ships 9 hooks (assemble-agents, assemble-validate, no-hand-edit,
|
|
tomd-preread, agent-fork-logger, site-wysiwyd-check, session-end-dump,
|
|
milestone-commit-hook, error-spike-detector).
|
|
To activate them, merge entries from:
|
|
$KIT_DIR/settings-snippet.json
|
|
into your:
|
|
$settings_file
|
|
|
|
Or re-run with automatic activation:
|
|
./install.sh --activate-hooks
|
|
|
|
To verify install:
|
|
ls $AGENTS_DIR/*.md # should show 12 generated agents
|
|
$AGENTS_DIR/_assembler/target/release/assemble --validate
|
|
./install.sh --list # show installed primitives
|
|
|
|
To create a new project-specialist agent:
|
|
/new-agent
|
|
|
|
==========================================================================
|
|
EOF
|
|
fi
|
|
}
|