| name | install-dependency |
| description | Install dependencies with monorepo awareness. Use when: user asks to install a package, add a dependency, or setup Python/JS packages. Triggers: "install X", "add package", "setup dependency", "I need lodash", "install docling".
|
| allowed-tools | ["Bash","AskUserQuestion"] |
| context | main |
Install Dependency
Monorepo-aware dependency installation using bundled scripts.
ā ļø AskUserQuestion Guard
CRITICAL: After EVERY AskUserQuestion call, check if answers are empty/blank. Known Claude Code bug: outside Plan Mode, AskUserQuestion silently returns empty answers without showing UI.
If answers are empty: DO NOT proceed with assumptions. Instead:
- Output: "ā ļø Questions didn't display (known Claude Code bug outside Plan Mode)."
- Present the options as a numbered text list and ask user to reply with their choice number.
- WAIT for user reply before continuing.
Quick Reference
Types: python (pip), js (bun), system (apt/brew/dnf)
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SKILL_DIR/scripts/setup-env.sh"
"$SKILL_DIR/scripts/scan.sh" <pkg> <type>
"$SKILL_DIR/scripts/install-{python,js,system}.sh" <pkg> [shared|local]
"$SKILL_DIR/scripts/verify.sh" <pkg> <type>
"$SKILL_DIR/scripts/cleanup.sh"
Workflow
1. Setup Environment
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SKILL_DIR/scripts/setup-env.sh"
Sets $LOCAL_TMP, $GIT_ROOT, overrides $TMPDIR to avoid /tmp/claude conflicts.
2. Scan for Existing Package
if "$SKILL_DIR/scripts/scan.sh" <package> <type>; then
echo "ā Package already installed"
exit 0
fi
Exit codes: 0=found, 1=not found, 2=usage error.
3. Prompt User (if needed)
Decision tree:
if_found_in_parent:
action: Report "ā <package> already at <path>"
install: false
if_at_git_root:
action: Install locally (no prompt)
mode: local
if_in_subproject_not_found:
action: Use AskUserQuestion
options:
- "Shared at {GIT_ROOT} (recommended)" ā mode=shared
- "Local at {PWD} (isolated)" ā mode=local
AskUserQuestion example:
question: "Where should {package} be installed?"
header: "Location"
options:
- label: "Shared at {GIT_ROOT} (recommended)"
description: "Install once, available to all subprojects"
- label: "Local at {PWD} (isolated)"
description: "Install only for this project"
4. Install Package
Python:
"$SKILL_DIR/scripts/install-python.sh" <package> [shared|local]
JavaScript:
"$SKILL_DIR/scripts/install-js.sh" <package> [shared|local]
System (requires approval):
"$SKILL_DIR/scripts/install-system.sh" <package>
APPROVED=1 "$SKILL_DIR/scripts/install-system.sh" <package>
5. Verify Installation
"$SKILL_DIR/scripts/verify.sh" <package> <type> [module_name]
Optional module_name for Python packages where import name differs (e.g., PIL vs pillow).
6. Cleanup (optional)
"$SKILL_DIR/scripts/cleanup.sh"
Removes $LOCAL_TMP (.tmp/) directory.
Output Format
ā Installed <package>
Location: <path>
Method: <pip/bun/apt/brew/dnf>
Scripts Reference
| Script | Args | Exit Codes | Output |
|---|
| setup-env.sh | (none, source it) | - | Sets env vars |
| scan.sh | pkg type | 0=found, 1=not found | FOUND:path or NOT_FOUND |
| install-python.sh | pkg [shared|local] | 0=success | INSTALLED:path |
| install-js.sh | pkg [shared|local] | 0=success | INSTALLED:path |
| install-system.sh | pkg | 0=success | NEEDS_APPROVAL or INSTALLED:system |
| verify.sh | pkg type [module] | 0=success, 1=failed | VERIFIED:path or FAILED |
| cleanup.sh | (none) | 0=success | CLEANED:path |