Skip to content

feat: add --division flag for selective agent installation#157

Open
kienbui1995 wants to merge 1 commit intomsitarzewski:mainfrom
kienbui1995:fix/selective-division-install
Open

feat: add --division flag for selective agent installation#157
kienbui1995 wants to merge 1 commit intomsitarzewski:mainfrom
kienbui1995:fix/selective-division-install

Conversation

@kienbui1995
Copy link
Copy Markdown
Contributor

@kienbui1995 kienbui1995 commented Mar 12, 2026

Closes #134

What

Adds a --division flag to install.sh so users can install agents from specific divisions only, instead of all 120 agents.

Usage

# Install only engineering agents
./scripts/install.sh --tool claude-code --division engineering

# Install multiple divisions (comma-separated)
./scripts/install.sh --tool copilot --division engineering,design

# Invalid division names are caught with helpful error
./scripts/install.sh --division invalid
# [ERR] Unknown division 'invalid'. Valid: design engineering ...

How It Works

  • claude-code/copilot: Filters source directories directly
  • cursor/antigravity/gemini-cli/opencode/openclaw: Builds allowed slug set from source files in filtered divisions, then matches integration filenames
  • aider/windsurf: Single-file output, division filter not applicable (installs full file)
  • No flag = installs all divisions (fully backward compatible)

Test Results

$ ./scripts/install.sh --tool claude-code --division engineering
  Divisions:  engineering
  Claude Code: 16 agents

$ ./scripts/install.sh --tool claude-code --division engineering,design,testing
  Divisions:  engineering design testing
  Claude Code: 32 agents

$ ./scripts/install.sh --tool copilot --division sales
  Divisions:  sales
  Copilot: 8 agents

$ ./scripts/install.sh --tool claude-code
  Claude Code: 120 agents  (no flag = all, backward compatible)

$ ./scripts/install.sh --division fake
  [ERR] Unknown division 'fake'. Valid: design engineering game-development ...

Per-division breakdown (all verified)

Division Agents
design 8
engineering 16
game-development 19
marketing 18
paid-media 7
sales 8
product 4
project-management 6
testing 8
support 6
spatial-computing 6
specialized 14
Total 120 ✅ matches full install

Changes

  • 1 file changed: scripts/install.sh (+84 lines)
  • Added --division flag parsing with validation
  • Added active_divisions(), slug_allowed() filtering helpers
  • Updated all 7 per-tool installers to respect division filter
  • Zero changes to existing behavior when flag is not used

@msitarzewski
Copy link
Copy Markdown
Owner

Hey @kienbui1995 — love this feature, it's a commonly requested one (see #134). The implementation is clean and backward-compatible.

One thing before we merge: get_field() and slugify() are duplicated from convert.sh. Could you source them from a shared location instead? A small scripts/lib.sh with the common helpers that both scripts source would keep things DRY. Something like:

# scripts/lib.sh
slugify() { ... }
get_field() { ... }
get_body() { ... }

Then both convert.sh and install.sh can . "$SCRIPT_DIR/lib.sh". Keeps maintenance simple as the helper logic evolves.

Otherwise this is good to go!

@kienbui1995
Copy link
Copy Markdown
Contributor Author

Rebased on latest main and addressed your review feedback:

  • Extracted slugify(), get_field(), and get_body() into scripts/lib.sh
  • Both convert.sh and install.sh now source lib.sh instead of duplicating helpers
  • Tested: convert.sh, install.sh, and install.sh --division all working correctly

Ready for re-review!

@kienbui1995 kienbui1995 force-pushed the fix/selective-division-install branch from a618867 to 5c1c444 Compare March 15, 2026 21:28
@msitarzewski
Copy link
Copy Markdown
Owner

Hey @kienbui1995 — the lib.sh extraction and --division feature look solid. Two things before we can merge:

  1. Missing academic division. The academic/ directory was added to main after your last rebase (commit 14cd429). It needs to be added to the ALL_DIVISIONS array and the help text's valid divisions list.

  2. Merge coordination. There are a few other open PRs that touch install.sh (Add dynamic tool path detection in install.sh #216, feat: add --link flag to use symbolic links instead of copy #233, feat: install improvements - dynamic detection, Windows, cursor docs, cross-platform #327). We'll merge yours first since it's the most mature, but you'll need a fresh rebase onto current main to pick up the latest changes (including the Kimi Code integration that just landed).

Could you rebase and add academic? Once that's in, this is ready to go.

@mhc222
Copy link
Copy Markdown

mhc222 commented Mar 30, 2026

Code Review

The --division flag logic, lib.sh extraction, and slug-matching approach are well-structured. The backward-compatible default (empty FILTER_DIVISIONS = all) is correct.

One item to confirm:

Important: ALL_DIVISIONS in install.sh does not include data-analytics (confidence: 80)

ALL_DIVISIONS in this PR is:

design engineering game-development marketing paid-media sales product
project-management testing support spatial-computing specialized

If PR #161 (Add Data & Analytics Division) merges first or alongside this one, --division data-analytics will produce an "Unknown division" error because it is absent from ALL_DIVISIONS. Please coordinate with #161 or add data-analytics to ALL_DIVISIONS here as a forward-compatibility measure.

The removal of the academic directory from the hardcoded install loops is correct cleanup — that directory does not appear to exist in the repository.

Add --division flag to install.sh for installing agents from specific
divisions only. Also extract shared helpers (slugify, get_field, get_body)
into scripts/lib.sh per review feedback.

Changes:
- scripts/lib.sh: new shared helpers sourced by both scripts
- scripts/install.sh: add --division flag, active_divisions(), slug_allowed()
- scripts/convert.sh: source lib.sh instead of duplicating helpers
- ALL_DIVISIONS includes all 14 divisions (academic, strategy, etc.)

Closes msitarzewski#134
@kienbui1995 kienbui1995 force-pushed the fix/selective-division-install branch from 5c1c444 to 3740ec9 Compare March 30, 2026 12:23
@kienbui1995
Copy link
Copy Markdown
Contributor Author

Rebased on latest main and addressed both items:

  1. academic added — included in ALL_DIVISIONS and help text. Also added strategy which was merged recently.
  2. Fresh rebase — based on current main (4feb0cd), picks up Kimi Code integration and all recent merges.

Also added strategy to AGENT_DIRS in convert.sh so it gets converted too.

Ready to merge!

@kienbui1995
Copy link
Copy Markdown
Contributor Author

@msitarzewski Friendly nudge — this PR has been rebased 3 times now due to the fast-moving main branch. Would appreciate an early merge to avoid another round of conflict resolution. Everything you requested is in place (lib.sh extraction, academic + strategy divisions, fresh rebase on latest main). Thanks!

@theDanielJLewis
Copy link
Copy Markdown

This says, "for selective agent installation," but it installs all the agents in a division, not selected agents, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to install the specified Agent folder

5 participants