Files
cleveragents-core/scripts/setup-dev.sh
T
HAL9000 18d00c04c4
CI / lint (pull_request) Failing after 1m15s
CI / quality (pull_request) Successful in 1m21s
CI / typecheck (pull_request) Successful in 1m34s
CI / security (pull_request) Successful in 1m37s
CI / coverage (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 1m37s
CI / docker (pull_request) Has been skipped
CI / build (pull_request) Successful in 33s
CI / helm (pull_request) Successful in 26s
CI / push-validation (pull_request) Successful in 19s
CI / e2e_tests (pull_request) Successful in 3m20s
CI / integration_tests (pull_request) Successful in 4m32s
CI / status-check (pull_request) Failing after 3s
fix(skills): implement multi-scope agent skill discovery for global, project, and local tiers
Implements AgentSkillDiscovery class to support discovering Agent Skills from
multiple configured directories across three scopes (global, project, local).
Handles name collisions with precedence: local > project > global.

Adds comprehensive BDD test coverage for multi-scope discovery scenarios including:
- Global-only, project-only, and local-only discovery
- Combined discovery from all scopes
- Name collision resolution with proper precedence
- Non-existent and empty scope directory handling
- Multiple skills in same scope discovery

ISSUES CLOSED: #9369
2026-05-06 19:55:22 +00:00

88 lines
2.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# Developer setup script for CleverAgents
# Usage: bash scripts/setup-dev.sh
#
# This script sets up the development environment including:
# - Installing all dependencies (dev, tests, docs extras)
# - Installing pre-commit hooks
# - Verifying tool installations
# - Running an initial quality check
set -euo pipefail
BOLD='\033[1m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
info() { echo -e "${BOLD}${GREEN}[INFO]${NC} $*"; }
warn() { echo -e "${BOLD}${YELLOW}[WARN]${NC} $*"; }
error() { echo -e "${BOLD}${RED}[ERROR]${NC} $*"; }
# Check Python version
info "Checking Python version..."
PYTHON_VERSION=$(python3 --version 2>&1 | grep -oP '\d+\.\d+')
REQUIRED_VERSION="3.13"
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then
error "Python >= $REQUIRED_VERSION is required, found $PYTHON_VERSION"
exit 1
fi
info "Python $PYTHON_VERSION detected"
# Install the project with all development extras
info "Installing project with dev, tests, and docs extras..."
pip install -e ".[dev,tests,docs]" --quiet
# Install pre-commit hooks
info "Installing pre-commit hooks..."
pre-commit install
pre-commit install --hook-type commit-msg
info "Pre-commit hooks installed (pre-commit and commit-msg stages)"
# Verify key tools are available
info "Verifying tool installations..."
TOOLS_OK=true
for tool in ruff pyright bandit vulture radon pre-commit behave; do
if command -v "$tool" > /dev/null 2>&1; then
VERSION=$("$tool" --version 2>&1 | head -1)
info " $tool: $VERSION"
else
warn " $tool: NOT FOUND (check PATH or installation)"
TOOLS_OK=false
fi
done
if [ "$TOOLS_OK" = false ]; then
warn "Some tools were not found. They may be installed in a location not on your PATH."
warn "Try: export PATH=\"\$HOME/.local/bin:\$PATH\""
fi
# Run a quick quality check
info "Running initial quality check..."
echo ""
info "--- Ruff Format Check ---"
ruff format --check . 2>&1 || warn "Some files need formatting. Run: ruff format ."
echo ""
info "--- Ruff Lint Check ---"
ruff check . 2>&1 || warn "Some lint issues found. Run: ruff check --fix ."
echo ""
info "--- Pyright Type Check ---"
pyright 2>&1 || warn "Type checking found issues."
echo ""
info "Development environment setup complete."
info ""
info "Available commands:"
info " nox - Run all quality checks and tests"
info " nox -s unit_tests - Run Behave unit tests"
info " nox -s integration_tests - Run Robot integration tests"
info " nox -s coverage_report - Run tests with coverage"
info " nox -s lint - Run linter"
info " nox -s format - Format code"
info " nox -s typecheck - Run type checker"
info " pre-commit run --all-files - Run all pre-commit hooks"