chore: auto-commit (799 archivos)
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "analyze_disk_space([target_dir: string], [mode: string]) -> void"
|
||||
description: "Analiza el uso de espacio en disco. Modos: partitions (df con filtros), top-dirs (du top 10), top-files (find top 20), inodes (df -i), all (todos). Emite advertencias si el uso supera el 90%."
|
||||
tags: [bash, disk, space, analysis, filesystem]
|
||||
tags: [bash, disk, space, analysis, filesystem, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_app_clear([--serial <S>], package: string) -> void"
|
||||
description: "Wipe app data + cache via pm clear. App keeps installed but factory-state. Multi-emulator via --serial."
|
||||
tags: [android, adb, app, clear, reset]
|
||||
tags: [android, adb, app, clear, reset, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional target device/emulator serial. Auto-detected if omitted."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_app_info([--serial <S>], package, [--json]) -> stdout"
|
||||
description: "Inspect installed app: version, target SDK, activities via dumpsys package."
|
||||
tags: [android, adb, app, info, dumpsys]
|
||||
tags: [android, adb, app, info, dumpsys, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional ADB serial to target a specific device/emulator. Auto-detected if omitted."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_app_kill([--serial <S>], package: string) -> void"
|
||||
description: "Force-stop running app via am force-stop. Multi-emulator via --serial."
|
||||
tags: [android, adb, app, kill, force-stop]
|
||||
tags: [android, adb, app, kill, force-stop, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional target device/emulator serial. Auto-detected if omitted."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_app_launch([--serial <S>], package: string, [activity: string]) -> void"
|
||||
description: "Launch app activity via am start. Multi-emulator via --serial."
|
||||
tags: [android, adb, app, launch, activity]
|
||||
tags: [android, adb, app, launch, activity, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional target serial. Default: first device"
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_app_uninstall([--serial <S>] package [--keep-data]) -> void"
|
||||
description: "Uninstall app via adb uninstall. Optionally keep data with --keep-data."
|
||||
tags: [android, adb, app, uninstall]
|
||||
tags: [android, adb, app, uninstall, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional target device/emulator serial. Auto-detects first connected device if omitted."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_emu_battery([--serial <S>], level: int, [--charging <true|false>]) -> void"
|
||||
description: "Simulate battery state on emulator (level + charging). Emulator-only."
|
||||
tags: [android, emulator, battery, power]
|
||||
tags: [android, emulator, battery, power, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional emulator serial (e.g. emulator-5554). Auto-detected if omitted."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_emu_geo_fix([--serial <S>], longitude: string, latitude: string, [altitude: string]) -> void"
|
||||
description: "Fake GPS location on Android emulator via emu geo fix. Emulator-only (not physical devices)."
|
||||
tags: [android, emulator, geo, gps, location]
|
||||
tags: [android, emulator, geo, gps, location, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional emulator serial. Auto-detected if omitted."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_emu_rotate([--serial <S>] [portrait|landscape|0|90|180|270])"
|
||||
description: "Rotate emulator screen. Empty=toggle, or fixed orientation. Locks autorotate."
|
||||
tags: [android, emulator, rotation, orientation]
|
||||
tags: [android, emulator, rotation, orientation, pendiente-usar]
|
||||
uses_functions: [adb_wsl_bash_infra]
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_input_keyevent([--serial <S>] key: string)"
|
||||
description: "Send key event via adb shell input keyevent. Accepts aliases (BACK, HOME, POWER, ENTER, MENU, RECENT_APPS, VOLUME_UP, VOLUME_DOWN), raw numeric codes, or explicit KEYCODE_* names."
|
||||
tags: [android, adb, input, keyevent, ui-test]
|
||||
tags: [android, adb, input, keyevent, ui-test, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional target device/emulator serial. If omitted, adb_pick_serial resolves the single connected device."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_input_swipe([--serial <S>], x1: int, y1: int, x2: int, y2: int, [duration_ms: int])"
|
||||
description: "Send swipe gesture between two points with duration."
|
||||
tags: [android, adb, input, swipe, gesture, ui-test]
|
||||
tags: [android, adb, input, swipe, gesture, ui-test, pendiente-usar]
|
||||
uses_functions: [adb_wsl_bash_infra]
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_input_tap([--serial <S>], x: int, y: int) -> void"
|
||||
description: "Send tap gesture at screen coordinates via adb shell input tap."
|
||||
tags: [android, adb, input, tap, ui-test, gesture]
|
||||
tags: [android, adb, input, tap, ui-test, gesture, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional target device serial. Auto-detected if omitted."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_input_text([--serial <S>], text: string) -> void"
|
||||
description: "Type text in focused field via adb shell input text. Spaces handled."
|
||||
tags: [android, adb, input, text, ui-test]
|
||||
tags: [android, adb, input, text, ui-test, pendiente-usar]
|
||||
uses_functions: [adb_wsl_bash_infra]
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_pull [--serial <S>] remote_path local_path"
|
||||
description: "Pull file/dir from Android device to WSL via adb pull."
|
||||
tags: [android, adb, pull, file, transfer]
|
||||
tags: [android, adb, pull, file, transfer, pendiente-usar]
|
||||
uses_functions: [adb_wsl_bash_infra]
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_push([--serial <S>], local_path: string, remote_path: string) -> void"
|
||||
description: "Push file/dir from WSL to Android device via adb push."
|
||||
tags: [android, adb, push, file, transfer]
|
||||
tags: [android, adb, push, file, transfer, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional target device/emulator serial. Auto-detected if omitted."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_screen_record([--serial <S>] [--duration <s>] [--bit-rate <bps>] [--size <WxH>] output_path: string) -> void"
|
||||
description: "Record screen video via adb screenrecord, pulls to local path."
|
||||
tags: [android, adb, screen, record, video]
|
||||
tags: [android, adb, screen, record, video, pendiente-usar]
|
||||
uses_functions: [adb_wsl_bash_infra]
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_screenshot([--serial <S>], output_path: string) -> void"
|
||||
description: "Capture screen as PNG via adb exec-out screencap -p."
|
||||
tags: [android, adb, screenshot, screen, capture]
|
||||
tags: [android, adb, screenshot, screen, capture, pendiente-usar]
|
||||
uses_functions: [adb_wsl_bash_infra]
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "android_shell([--serial <S>], cmd ...args)"
|
||||
description: "Execute arbitrary shell command on Android device. Multi-emulator via --serial."
|
||||
tags: [android, adb, shell, exec]
|
||||
tags: [android, adb, shell, exec, pendiente-usar]
|
||||
params:
|
||||
- name: "--serial <S>"
|
||||
desc: "Optional target device serial. Omit to auto-pick (single device) or use ADB_SERIAL env."
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "append_diary_entry(titulo: string, cuerpo: string) -> string"
|
||||
description: "Añade una entrada al diario del dia en ${DIARY_DIR:-docs/diary}/YYYY-MM-DD.md. Crea el archivo con cabecera si no existe. Nunca reescribe contenido previo. Si cuerpo es vacio escribe solo el header de la seccion."
|
||||
tags: [diary, markdown, append, idempotent, infra]
|
||||
tags: [diary, markdown, append, idempotent, infra, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "build_cpp_linux(target?: string) -> void"
|
||||
description: "Compila las funciones y apps C++ del registry para Linux nativo usando cmake"
|
||||
tags: [cpp, build, cmake, linux, imgui]
|
||||
tags: [cpp, build, cmake, linux, imgui, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "0.1.0"
|
||||
purity: impure
|
||||
signature: "build_wasm_cpp_app(app_name: string, [--no-budget-check]) -> void"
|
||||
description: "Compila una app C++ del registry (cpp/apps/<name>) a WASM via emscripten. Sale build/wasm/<name>/<name>.{html,js,wasm,wasm.gz}. Falla si gzip > 2 MB."
|
||||
tags: [wasm, emscripten, cpp, build, gamedev]
|
||||
tags: [wasm, emscripten, cpp, build, gamedev, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "cuda_toolkit_check() -> void"
|
||||
description: "Detecta componentes CUDA instalados en el sistema y emite pares key=value a stdout: nvcc (version o missing), nvidia_smi (present/missing), driver_version, cuda_libs (path o missing) y overall (ok|partial|missing). Exit code 0 siempre — funcion informativa, no fatal."
|
||||
tags: [cuda, nvidia, gpu, hardware, probe, infra, toolkit]
|
||||
tags: [cuda, nvidia, gpu, hardware, probe, infra, toolkit, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "detect_wsl([--check]) -> void"
|
||||
description: "Detecta si el sistema es WSL (Windows Subsystem for Linux). Con --check retorna solo exit code (0=WSL, 1=no WSL) sin output. Sin argumentos imprime versión WSL, usuario Windows, distribución, hostname, unidades montadas y ruta Windows del directorio actual."
|
||||
tags: [bash, wsl, windows, detect, integration]
|
||||
tags: [bash, wsl, windows, detect, integration, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -3,7 +3,7 @@ name: e2e_run_cpp_windows
|
||||
lang: bash
|
||||
domain: infra
|
||||
description: "Cross-compila una app C++ del registry para Windows con mingw-w64, deploy al Desktop\\apps de Windows (matando instancia previa con taskkill.exe), lanza el .exe nativamente desde WSL y devuelve stdout + exit code. Pensado para tests headless tipo altsnap_jitter_test."
|
||||
tags: [windows, e2e, cross-compile, test, mingw]
|
||||
tags: [windows, e2e, cross-compile, test, mingw, pendiente-usar]
|
||||
purity: impure
|
||||
kind: function
|
||||
signature: "e2e_run_cpp_windows(target string, --no-build, --no-deploy) int"
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "frontend_doctor(project_dir: string) -> diagnostics_stdout"
|
||||
description: "Diagnostica la salud de un proyecto frontend Mantine. Verifica Node, React, Mantine, PostCSS, TypeScript, vite.config y detecta residuos de shadcn/@base-ui. Imprime tabla de checks con exit code 0/1."
|
||||
tags: [frontend, mantine, doctor, diagnostics, health, validation]
|
||||
tags: [frontend, mantine, doctor, diagnostics, health, validation, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: 1.0.0
|
||||
purity: impure
|
||||
signature: "git_hook_audit_app_drift <repo_dir>"
|
||||
description: "Pre-commit guard: bloquea commit si los archivos staged tocan una app cuyo app.md tiene drift de uses_functions. Permite ediciones a app.md (correcciones)."
|
||||
tags: [git, hook, precommit, registry-first, audit]
|
||||
tags: [git, hook, precommit, registry-first, audit, pendiente-usar]
|
||||
uses_functions:
|
||||
- audit_uses_functions_go_infra
|
||||
uses_types: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "gitea_create_webhook(owner: string, repo: string, target_url: string, secret?: string) -> json"
|
||||
description: "Crea un webhook de push en un repositorio Gitea. El webhook notifica a target_url en cada push."
|
||||
tags: [gitea, webhook, push, deploy, ci, infra]
|
||||
tags: [gitea, webhook, push, deploy, ci, infra, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "gitea_list_repos(owner: string) -> string"
|
||||
description: "Lista repositorios de un owner en Gitea. Intenta listar como org primero; si falla, lista como usuario. Imprime una línea por repo en formato name<TAB>html_url<TAB>description."
|
||||
tags: [gitea, git, repo, list, org, user, api, infra]
|
||||
tags: [gitea, git, repo, list, org, user, api, infra, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "gradle_clean(project_dir: string) -> int"
|
||||
description: "Limpia build artifacts de un proyecto Android (gradle clean + rm .gradle + rm build)."
|
||||
tags: [android, gradle, clean, build]
|
||||
tags: [android, gradle, clean, build, pendiente-usar]
|
||||
params:
|
||||
- name: project_dir
|
||||
desc: "Raiz del proyecto Gradle"
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "install_cpp_deps() -> void"
|
||||
description: "Verifica e instala las dependencias de sistema necesarias para compilar C++ con ImGui (cmake, g++, glfw, mesa)"
|
||||
tags: [cpp, dependencies, setup, cmake, imgui]
|
||||
tags: [cpp, dependencies, setup, cmake, imgui, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "install_mantine(project_dir: string) -> void"
|
||||
description: "Instala Mantine UI con todas sus dependencias (@mantine/core, hooks, charts, notifications, form) y PostCSS en un proyecto frontend. Detecta package manager por lockfile. Genera postcss.config.cjs si no existe. Idempotente."
|
||||
tags: [mantine, frontend, install, react, ui, postcss]
|
||||
tags: [mantine, frontend, install, react, ui, postcss, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "install_nodejs([version: string]) -> void"
|
||||
description: "Instala Node.js en Linux usando nvm. Instala nvm v0.39.7 si no está presente. Instala la versión de Node indicada, la activa con 'nvm use' y la configura como default. Idempotente si nvm ya está instalado."
|
||||
tags: [bash, install, nodejs, nvm]
|
||||
tags: [bash, install, nodejs, nvm, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "install_nordvpn() -> void"
|
||||
description: "Instala NordVPN CLI en Ubuntu/Debian (incluido WSL2). Configura repositorio oficial, instala paquete y habilita servicio nordvpnd. Idempotente."
|
||||
tags: [vpn, nordvpn, install, infra, wsl2]
|
||||
tags: [vpn, nordvpn, install, infra, wsl2, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "install_pnpm() -> void"
|
||||
description: "Instala pnpm globalmente usando npm (npm install -g pnpm). Verifica que npm esté disponible. Idempotente: si pnpm ya está instalado, informa y termina sin hacer nada."
|
||||
tags: [bash, install, pnpm, node]
|
||||
tags: [bash, install, pnpm, node, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "install_python312() -> void"
|
||||
description: "Instala Python 3.12 detectando la distribución Linux automáticamente. Ubuntu/Debian/Mint usan deadsnakes PPA; Fedora/RHEL usan dnf; Arch/Manjaro usan pacman. Instala también python3.12-venv, python3.12-dev y verifica pip. Idempotente."
|
||||
tags: [bash, install, python, python312]
|
||||
tags: [bash, install, python, python312, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "install_uv() -> void"
|
||||
description: "Instala uv, el gestor de paquetes Python ultra-rápido escrito en Rust, usando el instalador oficial de astral.sh. Configura PATH en ~/.bashrc y ~/.zshrc. Idempotente: si uv ya está instalado, informa y termina."
|
||||
tags: [bash, install, uv, python]
|
||||
tags: [bash, install, uv, python, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "install_volta() -> void"
|
||||
description: "Instala Volta, el gestor de versiones de Node.js, usando el instalador oficial de get.volta.sh. Configura VOLTA_HOME y PATH en ~/.bashrc y ~/.zshrc. Idempotente: si Volta ya está instalado, informa y termina."
|
||||
tags: [bash, install, volta, node]
|
||||
tags: [bash, install, volta, node, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "keepass_delete(entry: string)"
|
||||
description: "Elimina una entry del KeePassXC database via keepassxc-cli rm. La entry pasa a la papelera dentro del .kdbx (no se borra fisicamente)."
|
||||
tags: [keepass, keepassxc, secret, credential, delete]
|
||||
tags: [keepass, keepassxc, secret, credential, delete, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "keepass_generate(entry: string, length?: int, username?: string, url?: string) -> string"
|
||||
description: "Genera un password aleatorio (lower+upper+digits+special), lo almacena en una entry nueva y lo imprime a stdout. Length default 24."
|
||||
tags: [keepass, keepassxc, secret, credential, generate, random]
|
||||
tags: [keepass, keepassxc, secret, credential, generate, random, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "keepass_get(entry: string, attr?: string) -> string"
|
||||
description: "Lee un atributo (Password por defecto) de una entry del KeePassXC database via keepassxc-cli. Resuelve master password desde pass (meta/keepassxc-master) o env KEEPASS_PASSWORD."
|
||||
tags: [keepass, keepassxc, secret, credential, get]
|
||||
tags: [keepass, keepassxc, secret, credential, get, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "keepass_list(prefix?: string) -> json"
|
||||
description: "Lista paths de entries del KeePassXC database como array JSON. Filtra opcionalmente por prefijo de grupo. Internamente usa keepass_dump y proyecta solo los paths."
|
||||
tags: [keepass, keepassxc, list]
|
||||
tags: [keepass, keepassxc, list, pendiente-usar]
|
||||
uses_functions:
|
||||
- keepass_dump_bash_infra
|
||||
uses_types: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "keepass_search(term: string) -> json"
|
||||
description: "Busca entries en el KeePassXC database por substring. Devuelve array JSON de paths que matchean (title/username/url/notes)."
|
||||
tags: [keepass, keepassxc, search, query]
|
||||
tags: [keepass, keepassxc, search, query, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "keepass_set(entry: string, password: string, username?: string, url?: string)"
|
||||
description: "Crea o sobreescribe una entry en el KeePassXC database. Auto-detecta si existe (edit) o no (add). Soporta username y url opcionales."
|
||||
tags: [keepass, keepassxc, secret, credential, set, write]
|
||||
tags: [keepass, keepassxc, secret, credential, set, write, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "list_listening_ports([mode: string]) -> void"
|
||||
description: "Lista puertos activos del sistema usando ss (preferido) o netstat como fallback. Modos: all (LISTEN), tcp, udp, established (conexiones activas), stats (resumen + interfaces). Imprime salida tabulada a stdout."
|
||||
tags: [bash, ports, network, listening, monitoring]
|
||||
tags: [bash, ports, network, listening, monitoring, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "nordvpn_connect(country?: string, city?: string) -> json"
|
||||
description: "Conecta a NordVPN por pais, ciudad o servidor especifico. Sin argumentos conecta al mejor servidor disponible. Devuelve JSON con resultado."
|
||||
tags: [vpn, nordvpn, connect, infra, network]
|
||||
tags: [vpn, nordvpn, connect, infra, network, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "nordvpn_disconnect() -> json"
|
||||
description: "Desconecta de NordVPN. Idempotente — si no hay conexion activa retorna ok. Devuelve JSON con resultado."
|
||||
tags: [vpn, nordvpn, disconnect, infra, network]
|
||||
tags: [vpn, nordvpn, disconnect, infra, network, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "nordvpn_get_ip() -> json"
|
||||
description: "Obtiene IP publica actual con fallback entre multiples servicios. Indica si la conexion VPN esta activa y el servidor usado."
|
||||
tags: [vpn, nordvpn, ip, infra, network, verification]
|
||||
tags: [vpn, nordvpn, ip, infra, network, verification, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "nordvpn_list_cities(country: string) -> json"
|
||||
description: "Lista ciudades disponibles de un pais en NordVPN como array JSON ordenado."
|
||||
tags: [vpn, nordvpn, cities, infra, network]
|
||||
tags: [vpn, nordvpn, cities, infra, network, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "nordvpn_list_countries() -> json"
|
||||
description: "Lista paises disponibles en NordVPN como array JSON ordenado alfabeticamente."
|
||||
tags: [vpn, nordvpn, countries, infra, network]
|
||||
tags: [vpn, nordvpn, countries, infra, network, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "nordvpn_set_protocol(protocol: string) -> json"
|
||||
description: "Cambia el protocolo de NordVPN entre NordLynx (WireGuard) y OpenVPN. NordLynx recomendado por velocidad."
|
||||
tags: [vpn, nordvpn, protocol, nordlynx, wireguard, openvpn, infra]
|
||||
tags: [vpn, nordvpn, protocol, nordlynx, wireguard, openvpn, infra, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "nordvpn_status() -> json"
|
||||
description: "Obtiene estado actual de NordVPN como JSON estructurado. Incluye servidor, IP, pais, protocolo y estado de conexion."
|
||||
tags: [vpn, nordvpn, status, infra, network]
|
||||
tags: [vpn, nordvpn, status, infra, network, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "pass_delete(entry: string) -> void"
|
||||
description: "Elimina un secreto del password store (pass)."
|
||||
tags: [pass, secret, credential, delete]
|
||||
tags: [pass, secret, credential, delete, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "pass_generate(entry: string, [length: int]) -> string"
|
||||
description: "Genera un password aleatorio, lo almacena en el password store e imprime el valor generado."
|
||||
tags: [pass, secret, credential, generate, random]
|
||||
tags: [pass, secret, credential, generate, random, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "pass_list([prefix: string]) -> json"
|
||||
description: "Lista entradas del password store como JSON array. Filtra opcionalmente por prefijo."
|
||||
tags: [pass, secret, credential, list]
|
||||
tags: [pass, secret, credential, list, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "pass_sync() -> json"
|
||||
description: "Sincroniza el password store con el repositorio git remoto (pull + push)."
|
||||
tags: [pass, secret, sync, git]
|
||||
tags: [pass, secret, sync, git, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "port_kill(port: int, signal: string) -> void"
|
||||
description: "Mata los procesos que escuchan en un puerto TCP dado. Idempotente: si no hay proceso en el puerto retorna exit 0. Hace un segundo intento con SIGKILL si el primer intento con signal no libera el puerto."
|
||||
tags: ["port", "kill", "process", "tcp"]
|
||||
tags: [port, kill, process, tcp, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "pre_commit_hook_install(repo_dir: string, [--force]) -> void"
|
||||
description: "Instala un hook pre-commit en .git/hooks/pre-commit de un repo dado. El hook invoca scan_secrets_in_dirty para abortar el commit si detecta secrets en archivos staged. Idempotente: si el hook ya esta instalado (marca fn_registry-pre-commit-v1) no lo sobreescribe a menos que se pase --force."
|
||||
tags: ["git", "hook", "precommit", "secrets"]
|
||||
tags: [git, hook, precommit, secrets, pendiente-usar]
|
||||
uses_functions: ["scan_secrets_in_dirty_bash_cybersecurity"]
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "systemd_local_restart(name: string) -> json"
|
||||
description: "Reinicia un servicio systemd local con systemctl restart. Útil tras actualizar el binario o cambiar el unit. Requiere sudo."
|
||||
tags: [systemd, service, local, infra, restart]
|
||||
tags: [systemd, service, local, infra, restart, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "systemd_local_uninstall(name: string) -> json"
|
||||
description: "Detiene, deshabilita y elimina el unit file de un servicio systemd local. Idempotente: no falla si el servicio ya está parado o el unit no existe. Requiere sudo."
|
||||
tags: [systemd, service, local, infra, uninstall, cleanup]
|
||||
tags: [systemd, service, local, infra, uninstall, cleanup, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "tail_journal(unit: string, lines: int=100, follow: bool=false, since: string=\"\", priority: string=\"info\") -> void"
|
||||
description: "Wrapper sobre journalctl con formato consistente. Tail logs de una unidad systemd con coloreado, filtro por prioridad y seguimiento opcional."
|
||||
tags: ["journal", "systemd", "logs"]
|
||||
tags: [journal, systemd, logs, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "tbd_branch_create(mode: string, ...args: string) -> void"
|
||||
description: "Crea una rama TBD (trunk-based development) desde master/main actualizado. Soporta modos 'issue <NNNN> <slug>' y 'quick <slug>'. Autodetecta la rama base (master/main), verifica working tree limpio, hace pull --rebase y crea la rama. Valida formato de numero de issue (4 digitos) y slug (kebab-case ASCII)."
|
||||
tags: [git, tbd, branch, trunk-based-development, workflow]
|
||||
tags: [git, tbd, branch, trunk-based-development, workflow, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "tbd_branch_finish([merge_title: string]) -> void"
|
||||
description: "Integra una rama TBD (issue/* o quick/*) a master/main con merge --no-ff, publica el merge al remote y elimina la rama local. Autodetecta la rama base (master/main), verifica working tree limpio y construye el titulo del merge commit. NO ejecuta tests — esa responsabilidad es del caller. Exit 2 si hay conflicto de merge (deja al usuario resolver)."
|
||||
tags: [git, tbd, merge, trunk-based-development, workflow]
|
||||
tags: [git, tbd, merge, trunk-based-development, workflow, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
name: telemetry_prelude
|
||||
lang: bash
|
||||
domain: infra
|
||||
version: 0.1.0
|
||||
purity: impure
|
||||
kind: function
|
||||
description: "Prelude bash que envuelve cada funcion del registry definida en el shell con un wrapper que mide duration y registra cada llamada en call_monitor.operations.db. Activable con FN_TELEMETRY=1. Issue 0085c."
|
||||
tags: [telemetry, monitoring, registry, bash-wrapper, pendiente-usar]
|
||||
signature: "source telemetry_prelude.sh"
|
||||
error_type: "error_go_core"
|
||||
returns_optional: false
|
||||
params:
|
||||
- name: FN_TELEMETRY (env)
|
||||
desc: "Si vale '1', el prelude auto-envuelve cada funcion bash conocida del registry. Si no, return 0 inmediato sin hacer nada."
|
||||
- name: FN_REGISTRY_ROOT (env)
|
||||
desc: "Override de la raiz. Si no se setea, se descubre walking up desde cwd buscando registry.db."
|
||||
- name: CLAUDE_SESSION_ID (env)
|
||||
desc: "ID de sesion Claude Code persistido en cada fila de calls."
|
||||
output: "Sin output. Side effect: cada funcion del registry sourceada queda reemplazada por un wrapper con telemetria. Idempotente."
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
imports:
|
||||
- sqlite3 (CLI)
|
||||
- date (coreutils)
|
||||
- find (coreutils)
|
||||
example: |
|
||||
# Auto-wrap
|
||||
export FN_TELEMETRY=1
|
||||
source bash/functions/infra/android_screenshot.sh # define android_screenshot()
|
||||
source bash/functions/infra/telemetry_prelude.sh # envuelve android_screenshot
|
||||
android_screenshot /tmp/out.png # registrado en calls como android_screenshot_bash_infra
|
||||
file_path: "bash/functions/infra/telemetry_prelude.sh"
|
||||
tested: false
|
||||
notes: |
|
||||
Mecanismo: `declare -f <name>` extrae el cuerpo de la funcion. Se renombra
|
||||
a `_fn_t_orig_<name>` via eval. La funcion original queda reemplazada por
|
||||
un wrapper que mide `date +%s%3N` antes/despues, ejecuta `_fn_t_orig_<name>`,
|
||||
captura exit code, y llama `_fn_t_log function_id duration_ms success error_class`.
|
||||
|
||||
function_id heuristic: `{name}_bash_{domain}` donde `name`=basename del .sh
|
||||
y `domain`=basename del directorio padre. Coincide con convencion del registry.
|
||||
|
||||
Fail-safe: si la BD no existe, sqlite3 falta, o INSERT falla, el wrapper
|
||||
ignora silenciosamente y retorna el exit code del original. NUNCA aborta
|
||||
ni modifica el comportamiento de la funcion envuelta.
|
||||
|
||||
Idempotente: marca cada wrapper con `_FN_T_WRAPPED_<name>=1` y no
|
||||
re-envuelve. Sourcear el prelude N veces es seguro.
|
||||
|
||||
Limitacion: el wrapper requiere que las funciones del registry ya esten
|
||||
sourceadas antes de cargarse este prelude. Si la app sourcea una funcion
|
||||
DESPUES del prelude, esa funcion NO queda envuelta automaticamente — hay
|
||||
que llamar `_fn_t_autowrap` manualmente o usar `_fn_t_wrap <name> <id>`.
|
||||
---
|
||||
@@ -0,0 +1,124 @@
|
||||
#!/usr/bin/env bash
|
||||
# telemetry_prelude — Wrapper de telemetria para funciones bash del registry.
|
||||
# Issue 0085c-bash.
|
||||
#
|
||||
# Uso 1 (manual): source bash/functions/<dom>/<fn>.sh primero, despues source
|
||||
# este archivo, y todas las funciones bash del registry
|
||||
# quedaran envueltas con logging a call_monitor.operations.db.
|
||||
#
|
||||
# Uso 2 (auto): exportar FN_TELEMETRY=1 antes de sourcear; este prelude
|
||||
# detecta cada funcion definida que coincida con una funcion
|
||||
# del registry (bash/functions/<dom>/<name>.sh) y la
|
||||
# redefine como wrapper.
|
||||
#
|
||||
# Reglas:
|
||||
# - Idempotente: marca cada wrapper con flag _FN_T_WRAPPED_<name>=1; no
|
||||
# re-envuelve si ya esta envuelta.
|
||||
# - No-op silencioso si BD no existe o INSERT falla. NUNCA aborta el caller.
|
||||
# - Solo guarda function_id, duration_ms, success, error_class. NUNCA args.
|
||||
|
||||
if [ "${FN_TELEMETRY:-0}" != "1" ]; then
|
||||
return 0 2>/dev/null || exit 0
|
||||
fi
|
||||
|
||||
# ---- Resolve registry root ----
|
||||
_fn_t_root() {
|
||||
if [ -n "${FN_REGISTRY_ROOT:-}" ] && [ -f "$FN_REGISTRY_ROOT/registry.db" ]; then
|
||||
printf '%s' "$FN_REGISTRY_ROOT"
|
||||
return 0
|
||||
fi
|
||||
local d="${PWD}"
|
||||
while [ "$d" != "/" ]; do
|
||||
if [ -f "$d/registry.db" ]; then
|
||||
printf '%s' "$d"
|
||||
return 0
|
||||
fi
|
||||
d=$(dirname "$d")
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# ---- Resolve operations.db ----
|
||||
_FN_T_DB=""
|
||||
_fn_t_resolve_db() {
|
||||
if [ -n "$_FN_T_DB" ] && [ -f "$_FN_T_DB" ]; then return 0; fi
|
||||
local root
|
||||
root=$(_fn_t_root) || return 1
|
||||
_FN_T_DB="$root/projects/fn_monitoring/apps/call_monitor/operations.db"
|
||||
if [ ! -f "$_FN_T_DB" ]; then
|
||||
_FN_T_DB=""
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# ---- Log call ----
|
||||
_fn_t_log() {
|
||||
local fn_id="$1" duration_ms="$2" success="$3" error_class="${4:-}"
|
||||
_fn_t_resolve_db || return 0
|
||||
command -v sqlite3 >/dev/null 2>&1 || return 0
|
||||
local sid="${CLAUDE_SESSION_ID:-}"
|
||||
local ts
|
||||
ts=$(date -u +%s)
|
||||
sid="${sid//\'/\'\'}"
|
||||
fn_id="${fn_id//\'/\'\'}"
|
||||
error_class="${error_class//\'/\'\'}"
|
||||
sqlite3 "$_FN_T_DB" "INSERT INTO calls (session_id, function_id, tool_used, args_hash, duration_ms, success, error_class, error_snippet, ts) VALUES ('$sid','$fn_id','bash_wrapper','',$duration_ms,$success,'$error_class','',$ts);" 2>/dev/null || true
|
||||
}
|
||||
|
||||
# ---- Wrap a single function by name ----
|
||||
_fn_t_wrap() {
|
||||
local orig="$1" fn_id="$2"
|
||||
|
||||
# already wrapped?
|
||||
local guard
|
||||
guard="_FN_T_WRAPPED_${orig}"
|
||||
if [ "${!guard:-0}" = "1" ]; then return 0; fi
|
||||
|
||||
# must exist as a function
|
||||
declare -F "$orig" >/dev/null 2>&1 || return 1
|
||||
|
||||
# capture original body, rename to _fn_t_orig_<name>
|
||||
local body
|
||||
body=$(declare -f "$orig") || return 1
|
||||
# body starts with "<orig> ()"; prepend prefix to rename
|
||||
local renamed="_fn_t_orig_${body}"
|
||||
eval "$renamed"
|
||||
|
||||
# define wrapper with the original name
|
||||
eval "
|
||||
${orig}() {
|
||||
local _t0_ms _t1_ms _rc _dur
|
||||
_t0_ms=\$(date +%s%3N)
|
||||
_fn_t_orig_${orig} \"\$@\"
|
||||
_rc=\$?
|
||||
_t1_ms=\$(date +%s%3N)
|
||||
_dur=\$((_t1_ms - _t0_ms))
|
||||
if [ \$_rc -eq 0 ]; then
|
||||
_fn_t_log \"${fn_id}\" \$_dur 1 \"\"
|
||||
else
|
||||
_fn_t_log \"${fn_id}\" \$_dur 0 \"exit_\$_rc\"
|
||||
fi
|
||||
return \$_rc
|
||||
}
|
||||
"
|
||||
eval "$guard=1"
|
||||
}
|
||||
|
||||
# ---- Auto-wrap: walk bash/functions and wrap every function currently defined ----
|
||||
_fn_t_autowrap() {
|
||||
local root
|
||||
root=$(_fn_t_root) || return 1
|
||||
local f domain name fn_id
|
||||
while IFS= read -r f; do
|
||||
domain=$(basename "$(dirname "$f")")
|
||||
name=$(basename "$f" .sh)
|
||||
fn_id="${name}_bash_${domain}"
|
||||
if declare -F "$name" >/dev/null 2>&1; then
|
||||
_fn_t_wrap "$name" "$fn_id"
|
||||
fi
|
||||
done < <(find "$root/bash/functions" -type f -name '*.sh' 2>/dev/null)
|
||||
}
|
||||
|
||||
# ---- Run autowrap on source ----
|
||||
_fn_t_autowrap
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "wait_for_http <url> [timeout_seconds] [interval_seconds]"
|
||||
description: "Hace polling a una URL HTTP/HTTPS hasta recibir respuesta 2xx o agotar el timeout. Util en deploys, post-restart de servicios y smoke tests."
|
||||
tags: [http, wait, poll, health, deploy, smoke-test]
|
||||
tags: [http, wait, poll, health, deploy, smoke-test, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
@@ -7,7 +7,7 @@ version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "wait_for_port(host: string, port: int, timeout_seconds: int, interval_seconds: int) -> int"
|
||||
description: "Hace polling TCP a host:puerto hasta que acepte conexiones o agote el timeout. Util para esperar a que un servicio (DB, API, container) este listo antes de ejecutar pasos siguientes."
|
||||
tags: [tcp, wait, poll, port]
|
||||
tags: [tcp, wait, poll, port, pendiente-usar]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
|
||||
Reference in New Issue
Block a user