From 1b31b7a670b72cf53a47fac4265a3d74fb8de080 Mon Sep 17 00:00:00 2001 From: Michael Sitarzewski Date: Mon, 6 Jul 2026 10:49:43 -0500 Subject: [PATCH] fix(install): derive division list from divisions.json (adds healthcare) (#677) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit install.sh hardcoded the division set in two lists (AGENT_DIRS, ALL_DIVISIONS), and both had gone stale — missing healthcare (#655). So `--tool claude-code`/`copilot` skipped healthcare's 2 agents, `--division healthcare` errored "Unknown division", the interactive team list omitted it, and the agent count was low by 2 (#668). Derive both lists from divisions.json (the single source of truth), using the same no-jq awk/grep/sed parse as check-divisions.sh. ALL_DIVISIONS is now exactly the divisions.json entries; AGENT_DIRS is that set plus strategy/ (preserving the intentional scan of its frontmatter-less docs, which is_agent_file filters out). This is the same fix pattern as #659 (check-agent-originality.sh) and #666 (build-hermes-plugin.py): a derived list can't drift, so check-divisions.sh needn't be extended to cover it. Verified: ALL_DIVISIONS resolves to 17 (healthcare in, strategy out), strategy still scanned, and `--division healthcare --dry-run` now finds 2 agents instead of "Unknown division". Fixes #668 Claude-Session: https://claude.ai/code/session_01WKnDRWM4izsB8WAXKszhsq Co-authored-by: Claude Opus 4.8 --- scripts/install.sh | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 5350f500..3970e6be 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -131,25 +131,31 @@ INTEGRATIONS="$REPO_ROOT/integrations" ALL_TOOLS=(claude-code copilot antigravity gemini-cli opencode openclaw cursor aider windsurf qwen kimi codex osaurus hermes vibe) -# Directories scanned for installable agents. Intentionally includes strategy/ -# (its frontmatter-less NEXUS docs are filtered out by is_agent_file at scan time); -# the selectable division list below is this set minus strategy. This is NOT the -# same set as AGENT_DIRS in convert.sh / lint-agents.sh, which exclude strategy -# entirely — see divisions.json (the source of truth) and scripts/check-divisions.sh. -AGENT_DIRS=( - academic design engineering finance game-development gis marketing paid-media product project-management - sales security spatial-computing specialized strategy support testing -) +# The division set is derived from divisions.json (the single source of truth) +# so the installer can never drift from the catalog — a hardcoded copy silently +# dropped healthcare (#655/#668) and can't be seen by check-divisions.sh. Same +# no-jq awk/grep/sed parse as scripts/check-divisions.sh (macOS + Linux). +divisions_from_json() { + local json="$REPO_ROOT/divisions.json" + [[ -f "$json" ]] || { err "divisions.json not found at $json"; exit 1; } + awk '/"divisions"[[:space:]]*:[[:space:]]*\{/{f=1; next} f' "$json" \ + | grep -oE '"[a-z0-9-]+"[[:space:]]*:[[:space:]]*\{' \ + | sed -E 's/"([a-z0-9-]+)".*/\1/' +} + +# Selectable divisions = exactly the divisions.json entries. +ALL_DIVISIONS=() +while IFS= read -r _div; do [[ -n "$_div" ]] && ALL_DIVISIONS+=("$_div"); done < <(divisions_from_json) +[[ ${#ALL_DIVISIONS[@]} -gt 0 ]] || { err "no divisions parsed from divisions.json"; exit 1; } + +# Directories scanned for installable agents = the divisions plus strategy/. +# strategy/ holds frontmatter-less NEXUS docs (filtered out by is_agent_file at +# scan time), so it is scanned but selectable only via ALL_DIVISIONS above. +AGENT_DIRS=("${ALL_DIVISIONS[@]}" strategy) # --------------------------------------------------------------------------- # Selection engine (team / agent / agents-file filtering) # --------------------------------------------------------------------------- -# Selectable divisions = AGENT_DIRS minus strategy/ (NEXUS docs, not agents). -ALL_DIVISIONS=( - academic design engineering finance game-development gis marketing paid-media - product project-management sales security spatial-computing specialized support testing -) - FILTER_DIVISIONS=() # --division FILTER_AGENTS=() # --agent AGENTS_FILE="" # --agents-file