Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agent/scripts/add-skill-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ to_kebab_case() {
# Determine target path in .agent/ based on skill content
determine_target_path() {
local skill_name="$1"
local description="$2"
local _description="$2" # Reserved for future category detection
local source_dir="$3"

# Analyze content to determine category
Expand Down
2 changes: 1 addition & 1 deletion .agent/scripts/beads-sync-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ parse_todo_md() {

# Push TODO.md to Beads
cmd_push() {
local force="${1:-false}"
local _force="${1:-false}" # Reserved for future force-push support
local dry_run="${2:-false}"
local verbose="${3:-false}"

Expand Down
2 changes: 1 addition & 1 deletion .agent/scripts/cloudron-package-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ cmd_debug_off() {

# Run validation checklist
cmd_test() {
local app="${1:-}"
# Note: app parameter reserved for future use (specific app testing)

check_cloudron_cli || return 1

Expand Down
16 changes: 0 additions & 16 deletions .agent/scripts/dspyground-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,6 @@ show_help() {

# Main command handler
main() {
# Assign positional parameters to local variables
local command="${1:-help}"
local account_name="$account_name"
local target="$target"
local options="$options"
# Assign positional parameters to local variables
local command="${1:-help}"
local account_name="$account_name"
local target="$target"
local options="$options"
# Assign positional parameters to local variables
local command="${1:-help}"
local account_name="$account_name"
local target="$target"
local options="$options"
# Assign positional parameters to local variables
case "${1:-help}" in
"install")
install
Expand Down
36 changes: 17 additions & 19 deletions .agent/scripts/eeat-score-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,23 @@ print_header() {

# Load configuration
load_config() {
if [[ -f "$CONFIG_FILE" ]]; then
if command -v jq &> /dev/null; then
LLM_PROVIDER=$(jq -r '.llm_provider // "openai"' "$CONFIG_FILE")
LLM_MODEL=$(jq -r '.llm_model // "gpt-4o"' "$CONFIG_FILE")
TEMPERATURE=$(jq -r '.temperature // 0.3' "$CONFIG_FILE")
MAX_TOKENS=$(jq -r '.max_tokens // 500' "$CONFIG_FILE")
CONCURRENT_REQUESTS=$(jq -r '.concurrent_requests // 3' "$CONFIG_FILE")
OUTPUT_FORMAT=$(jq -r '.output_format // "xlsx"' "$CONFIG_FILE")
INCLUDE_REASONING=$(jq -r '.include_reasoning // true' "$CONFIG_FILE")

# Load weights
WEIGHT_AUTHORSHIP=$(jq -r '.weights.authorship // 0.15' "$CONFIG_FILE")
WEIGHT_CITATION=$(jq -r '.weights.citation // 0.15' "$CONFIG_FILE")
WEIGHT_EFFORT=$(jq -r '.weights.effort // 0.15' "$CONFIG_FILE")
WEIGHT_ORIGINALITY=$(jq -r '.weights.originality // 0.15' "$CONFIG_FILE")
WEIGHT_INTENT=$(jq -r '.weights.intent // 0.15' "$CONFIG_FILE")
WEIGHT_SUBJECTIVE=$(jq -r '.weights.subjective // 0.15' "$CONFIG_FILE")
WEIGHT_WRITING=$(jq -r '.weights.writing // 0.10' "$CONFIG_FILE")
fi
if [[ -f "$CONFIG_FILE" ]] && command -v jq &> /dev/null; then
LLM_PROVIDER=$(jq -r '.llm_provider // "openai"' "$CONFIG_FILE")
LLM_MODEL=$(jq -r '.llm_model // "gpt-4o"' "$CONFIG_FILE")
TEMPERATURE=$(jq -r '.temperature // 0.3' "$CONFIG_FILE")
MAX_TOKENS=$(jq -r '.max_tokens // 500' "$CONFIG_FILE")
CONCURRENT_REQUESTS=$(jq -r '.concurrent_requests // 3' "$CONFIG_FILE")
OUTPUT_FORMAT=$(jq -r '.output_format // "xlsx"' "$CONFIG_FILE")
INCLUDE_REASONING=$(jq -r '.include_reasoning // true' "$CONFIG_FILE")

# Load weights
WEIGHT_AUTHORSHIP=$(jq -r '.weights.authorship // 0.15' "$CONFIG_FILE")
WEIGHT_CITATION=$(jq -r '.weights.citation // 0.15' "$CONFIG_FILE")
WEIGHT_EFFORT=$(jq -r '.weights.effort // 0.15' "$CONFIG_FILE")
WEIGHT_ORIGINALITY=$(jq -r '.weights.originality // 0.15' "$CONFIG_FILE")
WEIGHT_INTENT=$(jq -r '.weights.intent // 0.15' "$CONFIG_FILE")
WEIGHT_SUBJECTIVE=$(jq -r '.weights.subjective // 0.15' "$CONFIG_FILE")
WEIGHT_WRITING=$(jq -r '.weights.writing // 0.10' "$CONFIG_FILE")
fi
return 0
}
Expand Down
2 changes: 0 additions & 2 deletions .agent/scripts/fix-s131-default-cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ process_file() {
local file="$1"
local violations
local count=0
local offset=0

print_info "Processing: $file"

Expand Down Expand Up @@ -204,7 +203,6 @@ process_file() {

# Main execution
main() {
local total_fixed=0
local files_processed=0

print_info "SonarCloud S131 Fixer - Add default case to case statements"
Expand Down
2 changes: 0 additions & 2 deletions .agent/scripts/keyword-research-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@ do_webmaster_research() {
print_info "Period: Last $days days"
print_info "Enrichment: $enrich"

local all_keywords=()
local gsc_data=""
local bing_data=""

Expand Down Expand Up @@ -845,7 +844,6 @@ do_webmaster_research() {
fi

# Enrich with DataForSEO volume/difficulty data if requested
local enriched_data="[]"
if [[ "$enrich" == "true" ]]; then
print_info "Enriching with search volume and difficulty data..."

Expand Down
8 changes: 3 additions & 5 deletions .agent/scripts/linters-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,9 @@ check_toon_syntax() {
else
# Fallback: basic structure validation (non-empty check)
while IFS= read -r file; do
if [[ -f "$file" ]]; then
if [[ ! -s "$file" ]]; then
((violations++))
print_warning "TOON: Empty file $file"
fi
if [[ -f "$file" ]] && [[ ! -s "$file" ]]; then
((violations++))
print_warning "TOON: Empty file $file"
fi
done <<< "$toon_files"
fi
Expand Down
6 changes: 2 additions & 4 deletions .agent/scripts/localhost-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ is_port_free() {
fi

# Double-check with nc if available
if command -v nc >/dev/null 2>&1; then
if nc -z 127.0.0.1 "$port" 2>/dev/null; then
return 1 # Port is in use
fi
if command -v nc >/dev/null 2>&1 && nc -z 127.0.0.1 "$port" 2>/dev/null; then
return 1 # Port is in use
fi

return 0 # Port is free
Expand Down
12 changes: 5 additions & 7 deletions .agent/scripts/mail-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,11 @@ cmd_prune() {
payload=$(sed -n '/^-->$/,$ { /^-->$/d; p; }' "$msg_file" | sed '/^$/d')

# Remember discoveries and important status reports
if [[ "$msg_type" == "discovery" || "$msg_type" == "status_report" ]]; then
if [[ -x "$MEMORY_HELPER" && -n "$payload" ]]; then
"$MEMORY_HELPER" store \
--content "Mailbox ($msg_type): $payload" \
--type CONTEXT \
--tags "mailbox,${msg_type},archived" 2>/dev/null && remembered=$((remembered + 1))
fi
if [[ ("$msg_type" == "discovery" || "$msg_type" == "status_report") && -x "$MEMORY_HELPER" && -n "$payload" ]]; then
"$MEMORY_HELPER" store \
--content "Mailbox ($msg_type): $payload" \
--type CONTEXT \
--tags "mailbox,${msg_type},archived" 2>/dev/null && remembered=$((remembered + 1))
fi

rm -f "$msg_file"
Expand Down
13 changes: 5 additions & 8 deletions .agent/scripts/opencode-github-setup-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ check_github_workflow() {
# Check if AI provider API key is configured in repository secrets
# Looks for ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY
# Arguments:
# $1 - Repository path in "owner/repo" format
# $1 - Repository path in "owner/repo" format (reserved for future multi-repo support)
# Returns: 0 if at least one AI key is configured, 1 otherwise
check_github_secrets() {
local repo_path="$1"
local _repo_path="$1" # Reserved for future multi-repo support

if ! command -v gh &> /dev/null; then
return 1
Expand All @@ -231,11 +231,9 @@ check_github_secrets() {
# Arguments: None
# Returns: 0 if OpenCode is configured in GitLab CI, 1 otherwise
check_gitlab_ci() {
if [[ -f ".gitlab-ci.yml" ]]; then
# Check if it contains opencode configuration
if grep -q "opencode" ".gitlab-ci.yml" 2>/dev/null; then
return 0
fi
# Check if gitlab-ci.yml exists and contains opencode configuration
if [[ -f ".gitlab-ci.yml" ]] && grep -q "opencode" ".gitlab-ci.yml" 2>/dev/null; then
return 0
fi
return 1
}
Expand Down Expand Up @@ -502,7 +500,6 @@ cmd_create_secure_workflow() {
fi

# Check if aidevops has the template
local template_path="$HOME/.aidevops/agents/scripts/../../../.github/workflows/opencode-agent.yml"
local aidevops_template="$HOME/Git/aidevops/.github/workflows/opencode-agent.yml"

mkdir -p .github/workflows
Expand Down
16 changes: 0 additions & 16 deletions .agent/scripts/pagespeed-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -364,22 +364,6 @@ generate_actionable_report() {

# Main function
main() {
# Assign positional parameters to local variables
local command="${1:-help}"
local account_name="$account_name"
local target="$target"
local options="$options"
# Assign positional parameters to local variables
local command="${1:-help}"
local account_name="$account_name"
local target="$target"
local options="$options"
# Assign positional parameters to local variables
local command="${1:-help}"
local account_name="$account_name"
local target="$target"
local options="$options"
# Assign positional parameters to local variables
case "${1:-help}" in
"check"|"audit")
if [[ -z "${2:-}" ]]; then
Expand Down
6 changes: 2 additions & 4 deletions .agent/scripts/quality-loop-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,8 @@ pr_review_loop() {
WAITING)
print_info "Waiting for review..."
# Check if review is stale and trigger re-review if enabled
if [[ "$auto_trigger_review" == "true" ]]; then
if check_and_trigger_review "$pr_number"; then
print_info "Re-review triggered, waiting for response..."
fi
if [[ "$auto_trigger_review" == "true" ]] && check_and_trigger_review "$pr_number"; then
print_info "Re-review triggered, waiting for response..."
fi
;;
*)
Expand Down
20 changes: 8 additions & 12 deletions .agent/scripts/secretlint-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,17 @@ check_rules_installed() {
local missing_rules=()

# Check for preset-recommend (most common)
if grep -q "secretlint-rule-preset-recommend" "$config_file"; then
if ! npm list @secretlint/secretlint-rule-preset-recommend &>/dev/null; then
if ! npm list -g @secretlint/secretlint-rule-preset-recommend &>/dev/null; then
missing_rules+=("@secretlint/secretlint-rule-preset-recommend")
fi
fi
if grep -q "secretlint-rule-preset-recommend" "$config_file" \
&& ! npm list @secretlint/secretlint-rule-preset-recommend &>/dev/null \
&& ! npm list -g @secretlint/secretlint-rule-preset-recommend &>/dev/null; then
missing_rules+=("@secretlint/secretlint-rule-preset-recommend")
fi

# Check for pattern rule
if grep -q "secretlint-rule-pattern" "$config_file"; then
if ! npm list @secretlint/secretlint-rule-pattern &>/dev/null; then
if ! npm list -g @secretlint/secretlint-rule-pattern &>/dev/null; then
missing_rules+=("@secretlint/secretlint-rule-pattern")
fi
fi
if grep -q "secretlint-rule-pattern" "$config_file" \
&& ! npm list @secretlint/secretlint-rule-pattern &>/dev/null \
&& ! npm list -g @secretlint/secretlint-rule-pattern &>/dev/null; then
missing_rules+=("@secretlint/secretlint-rule-pattern")
fi

if [[ ${#missing_rules[@]} -gt 0 ]]; then
Expand Down
8 changes: 4 additions & 4 deletions .agent/scripts/session-time-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ cmd_list() {
local result
result=$(calculate_active_time "$session_file")

local active wall msgs afk first_ts last_ts
IFS='|' read -r active wall msgs afk first_ts last_ts <<< "$result"
local active wall msgs afk first_ts _last_ts
IFS='|' read -r active wall msgs afk first_ts _last_ts <<< "$result"

# Skip empty/trivial sessions
[[ $msgs -lt 3 ]] && continue
Expand Down Expand Up @@ -384,8 +384,8 @@ cmd_summary() {
local result
result=$(calculate_active_time "$session_file")

local active wall msgs afk first_ts last_ts
IFS='|' read -r active wall msgs afk first_ts last_ts <<< "$result"
local active wall msgs _afk _first_ts _last_ts
IFS='|' read -r active wall msgs _afk _first_ts _last_ts <<< "$result"

[[ $msgs -lt 3 ]] && continue

Expand Down
17 changes: 8 additions & 9 deletions .agent/scripts/site-crawler-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,12 @@ find_python() {
local user_site="${HOME}/Library/Python/3.11/lib/python/site-packages"

for py in "${pythons[@]}"; do
if command -v "$py" &> /dev/null; then
# Test if it has the required modules
if PYTHONPATH="${user_site}:${PYTHONPATH:-}" "$py" -c "import aiohttp, bs4" 2>/dev/null; then
PYTHON_CMD="$py"
export PYTHONPATH="${user_site}:${PYTHONPATH:-}"
return 0
fi
# Check if python exists and has the required modules
if command -v "$py" &> /dev/null \
&& PYTHONPATH="${user_site}:${PYTHONPATH:-}" "$py" -c "import aiohttp, bs4" 2>/dev/null; then
PYTHON_CMD="$py"
export PYTHONPATH="${user_site}:${PYTHONPATH:-}"
return 0
fi
done
return 1
Expand Down Expand Up @@ -151,7 +150,7 @@ save_markdown_with_metadata() {
local full_page_dir="$2"
local body_only_dir="$3"
local images_dir="$4"
local base_domain="$5"
local _base_domain="$5" # Reserved for future domain-relative path generation

# Extract basic info
local page_url status_code redirected_url success
Expand Down Expand Up @@ -637,7 +636,7 @@ crawl4ai_generate_reports() {
echo "url,status_code,status,title,title_length,meta_description,description_length,h1,h1_count,canonical,meta_robots,word_count,response_time_ms,crawl_depth,internal_links,external_links,images,images_missing_alt" > "$csv_file"

local broken_links=()
local redirects=()
local _redirects=() # Reserved for future redirect chain analysis
local meta_issues=()
local status_codes=()

Expand Down
11 changes: 5 additions & 6 deletions .agent/scripts/worktree-sessions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ find_matching_sessions() {
local branch="$1"
local project_id="$2"
local branch_start_epoch="$3"
local worktree_path="$4"
local _worktree_path="$4" # Reserved for future path-based filtering

local session_dir="$SESSION_BASE/$project_id"

Expand Down Expand Up @@ -431,11 +431,10 @@ cmd_open() {
elif [[ "$line" =~ ^branch\ refs/heads/(.+)$ ]]; then
worktree_branch="${BASH_REMATCH[1]}"
elif [[ -z "$line" ]]; then
if [[ -n "$worktree_path" ]] && [[ -n "$worktree_branch" ]]; then
if [[ "$worktree_branch" != "main" ]] && [[ "$worktree_branch" != "master" ]]; then
worktrees+=("$worktree_path")
branches+=("$worktree_branch")
fi
if [[ -n "$worktree_path" ]] && [[ -n "$worktree_branch" ]] \
&& [[ "$worktree_branch" != "main" ]] && [[ "$worktree_branch" != "master" ]]; then
worktrees+=("$worktree_path")
branches+=("$worktree_branch")
fi
worktree_path=""
worktree_branch=""
Expand Down