Includes AirPlan design documents, AircOding-alpha1-plan, AirPlanV2, AirPlan-ParaV2, AirPlan-Para V1 reference docs, and all working code changes across packages. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3.5 KiB
Executable File
3.5 KiB
Executable File
description, argument-hint, allowed-tools
| description | argument-hint | allowed-tools | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Enter, inspect, run, or remote-run AirSDB cppcheck static analysis with exhaustive branch checking |
|
|
/airsdb
控制当前工作区的 AirSDB 静态分析模式。
用户传入参数:$ARGUMENTS
enter或空参数:进入 AirSDB 模式,初始化AirPlan/docs/staticanalysis.md并检测 cppcheck。setup:检测/自动配置本机 cppcheck。status:检查 AirSDB 状态和本机 cppcheck,不自动安装。command:生成本机 cppcheck 命令,不实际执行。scan:运行本机 cppcheck,生成 XML/JSON 并更新AirPlan/docs/staticanalysis.md。remote-setup:检查远程 SSH 和远端 cppcheck;缺失时自动尝试配置。remote-status:只检查远程配置和工具状态,不自动安装。remote-command:生成远程 cppcheck 命令,不实际执行。remote-scan:通过 SSH 在远端运行 cppcheck,拉回报告并更新AirPlan/docs/staticanalysis.md。exit:退出 AirSDB 模式。
执行步骤
- 解析
$ARGUMENTS,默认动作为enter。 enter/setup/status/exit时运行:
python "$HOME/plugins/airsdb/scripts/airsdb_mode.py" --mode <enter|setup|status|exit> --project .
如果 python 不存在,尝试 py、python3 或用户提供的 Python 绝对路径。
- 本机
command/scan时运行:
python "$HOME/plugins/airsdb/scripts/airsdb_cppcheck.py" --project . --action <command|scan>
本机 scan 会优先使用 compile_commands.json,否则扫描当前项目并排除常见噪声目录;默认带 --check-level=exhaustive 以提供尽可能详细的分支分析信息。结果写入 AirPlan/state/airsdb/reports/,摘要写入 AirPlan/docs/staticanalysis.md。
- 如果
$ARGUMENTS包含remote、ssh、远程,或用户说明目标代码在远程设备、测试机、服务器、VM、容器宿主机或 SSH 主机上,优先运行远程 helper:
python "$HOME/plugins/airsdb/scripts/airsdb_remote_device.py" --project . --action <setup|status|command|scan>
首次缺少远程配置时,helper 会生成 AirPlan/state/airsdb/remote-device.env.example 并提示设置 AIRSDB_REMOTE_SSH_TARGET 和 AIRSDB_REMOTE_PROJECT。有 SSH 目标后,helper 会探测远端 cppcheck;缺失时自动尝试安装,只使用非交互式 sudo -n,无法自动配置时停止并提示用户。远程 scan 同样默认带 --check-level=exhaustive。
- 每次 scan 后必须检查并维护:
AirPlan/docs/staticanalysis.md
AirPlan/state/airsdb/reports/<timestamp>-cppcheck.xmlAirPlan/state/airsdb/reports/<timestamp>-cppcheck.json- 必要时更新
AGENTS.md、ADR、C4 module
- 必要时更新
输出文案
进入模式:
AirSDB 模式已开启:已初始化或检查 `AirPlan/docs/staticanalysis.md`,并检测 cppcheck。可运行本机 scan,也可在远程目标上使用 remote device helper 自动检测/配置 cppcheck;本机和远程 scan 默认使用 `--check-level=exhaustive`。
扫描完成:
AirSDB 静态分析完成:XML/JSON 报告已写入 `AirPlan/state/airsdb/reports/`,简短 AI 上下文已追加到 `AirPlan/docs/staticanalysis.md`,可交给 AirDbg 或 AirDo 使用。
状态检查:
AirSDB 状态:<enabled|disabled>
cppcheck:<ok|blocked>
关键文件:逐项列出 ok/missing。