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
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ installer, and test changes can all change future agent behavior.
- Method invocation references live in `skills/debug-tools-method-invocation/references/`.
- Hotswap run configuration guidance lives in `skills/debug-tools-hotswap/SKILL.md`.
- Spring configuration guidance lives in `skills/debug-tools-spring-config/SKILL.md`.
- Code and route search guidance lives in `skills/debug-tools-code-search/SKILL.md`.
- Read-only database query guidance lives in `skills/debug-tools-database-query/SKILL.md`.
- Pressure scenarios live in `tests/pressure/`.
- Installers, validation, release, and adapter sync scripts live in `scripts/`.
- Agent entry files include `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and packaged
Expand Down Expand Up @@ -226,7 +228,9 @@ When DebugTools workflow details are needed, read these in order:
2. `docs/tool-contracts.md`
3. `skills/debug-tools-method-invocation/SKILL.md` or
`skills/debug-tools-hotswap/SKILL.md` or
`skills/debug-tools-spring-config/SKILL.md`
`skills/debug-tools-spring-config/SKILL.md` or
`skills/debug-tools-code-search/SKILL.md` or
`skills/debug-tools-database-query/SKILL.md`
4. Relevant files in `skills/debug-tools-method-invocation/references/`

For release work, read `docs/release.md`. For installation behavior, read
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

- Add DebugTools Code Search skill for indexed HTTP route, symbol, text, file, regex, IDE-action, and file-problem lookup.
- Add DebugTools Database Query skill for read-only SQL through IDE-managed data sources.
- Add pressure scenarios 22 and 23 covering code search routing and read-only database queries.

## 0.1.0

- Add DebugTools Method Invocation skill for JVM attachment, connection inspection, argsJson template generation, ClassLoader recovery, and Java method invocation.
Expand Down
11 changes: 11 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,15 @@ Spring config flow:

Report returned values as Spring runtime Environment resolved values, not as direct file reads.

Code search flow:

1. `search_http_url` for HTTP routes, `search_symbol` for classes/methods, `search_text`/`search_regex`/`search_file` for other lookups
2. `get_file_problems` for IDE-reported problems in one file
3. Unknown parameters are silently ignored: use exact parameter names and inspect the raw response shape (`search_http_url` wraps results in `data.items`; the other search tools return `items` directly)

Database flow (read-only):

1. `list_database_connections`, then `list_database_schemas` with `connectionId`
2. `execute_sql_query` with empty `databaseName` and uppercase Oracle `schemaName`; keep queries bounded

Use `run_and_invoke` for the complete reload → invoke → optional logs/SQL loop. It may start only with an exact `runConfigurationName` and `allowStart=true`, or attach only with an explicit `pid` and `allowAttach=true`.
2 changes: 2 additions & 0 deletions GEMINI.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ Skip listing only when the exact run configuration name is already known. Hotswa
Use `resultView=JSON|DEBUG|NONE` on `invoke_java_method` only when requested. Use `read_target_application_logs` and `get_last_sql_statements` with bounded filters for post-invocation evidence. Multiple active connections require an explicit `connectionId`; startup and attach through `run_and_invoke` require an exact run configuration name or PID.

For Spring config reads, use `debug-tools-spring-config`: ask for config keys if missing, discover or attach a DebugTools connection through MCP first, then call direct DebugTools HTTP `POST /spring/config` with a JSON string array body using the selected connection `host` and `httpPort`.

For code and route search, prefer `search_http_url`, `search_symbol`, `search_text`, `search_regex`, `search_file`, and `get_file_problems` over shell grep. Unknown parameters are silently ignored (use exact names), `search_http_url` wraps results in `data.items` while the other search tools return `items`, and `indexState` other than `READY` means results may be incomplete. For read-only data checks, use `list_database_connections`, `list_database_schemas`, and `execute_sql_query` with an empty `databaseName` and an uppercase Oracle schema name; DML reports success without committing, so write data through an application or direct JDBC path.
27 changes: 26 additions & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ debug-tools-ai installation finished

DebugTools AI 只安装 Agent 指令、Skills 和插件元数据,不会安装 IntelliJ IDEA、DebugTools 插件、DebugTools agent 或 MCP Server。

## 三个 Skill
## 五个 Skill

### 方法调用

Expand Down Expand Up @@ -103,6 +103,29 @@ DebugTools AI 只安装 Agent 指令、Skills 和插件元数据,不会安装

特殊注意:这里读取的是 Spring 运行时解析后的值,不是直接读取 `application.yml` 或 `application.properties`。因此结果会包含 profile、环境变量、启动参数等配置源覆盖后的最终值。

### 代码与路由检索

`debug-tools-code-search` 用于按 IDE 索引检索 HTTP 路由、符号、文件、文本与正则匹配,并可读取单个文件的 IDE 检查结果。

适合这类需求:

- “`/baseOrderformWarn/check` 这个路由对应哪个类和方法?”
- “`FundAuditRule` 在哪个文件、哪些行?”
- “看看这个文件 IDE 报了什么错。”

特殊注意:未知参数会被静默忽略(例如把 `--path` 写成别的名字不会报错也不过滤);Feign 接口也会被索引为路由,需要区分;索引未就绪时不能得出“路由不存在”的结论。

### 数据库查询(只读)

`debug-tools-database-query` 用于通过 IDE 已配置的数据源执行只读 SQL,查测试/开发库数据时无需另写 JDBC 程序。

适合这类需求:

- “查一下 `T7_CESHI` 里 `BASE_ORDERFORM_WARN` 各状态的条数。”
- “这个订单在库里是什么状态?”

特殊注意:仅只读——DML 会显示成功但不会提交,PL/SQL 会超时;Oracle schema 名必须大写(`T7_CESHI`);造数/清数需要走直连工具。

## 安装、更新与卸载

从源码安装:
Expand Down Expand Up @@ -179,6 +202,8 @@ Agent:run_and_invoke(必要时显式传 allowStart/runConfigurationName 或
- [方法调用 Skill](skills/debug-tools-method-invocation/SKILL.md)
- [Hotswap Skill](skills/debug-tools-hotswap/SKILL.md)
- [Spring 配置 Skill](skills/debug-tools-spring-config/SKILL.md)
- [代码与路由检索 Skill](skills/debug-tools-code-search/SKILL.md)
- [数据库查询 Skill](skills/debug-tools-database-query/SKILL.md)
- [压力测试场景](tests/pressure)

## 校验
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,18 @@ compile_and_reload_modified_files
get_hotswap_operation # when an operationId is pending
```

Code search skill:

```text
skills/debug-tools-code-search/SKILL.md
```

Database query skill:

```text
skills/debug-tools-database-query/SKILL.md
```

For a complete loop, use `run_and_invoke`. Starting and attaching are explicit: pass `allowStart=true` with an exact `runConfigurationName`, or `allowAttach=true` with an explicit `pid`.

Details:
Expand All @@ -260,6 +272,8 @@ Details:
- Method invocation skill: [skills/debug-tools-method-invocation/SKILL.md](skills/debug-tools-method-invocation/SKILL.md)
- Hotswap skill: [skills/debug-tools-hotswap/SKILL.md](skills/debug-tools-hotswap/SKILL.md)
- Spring config skill: [skills/debug-tools-spring-config/SKILL.md](skills/debug-tools-spring-config/SKILL.md)
- Code search skill: [skills/debug-tools-code-search/SKILL.md](skills/debug-tools-code-search/SKILL.md)
- Database query skill: [skills/debug-tools-database-query/SKILL.md](skills/debug-tools-database-query/SKILL.md)

## Validation

Expand Down
18 changes: 18 additions & 0 deletions docs/tool-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,24 @@ Optional:

Returns `{count, items, indexState}`. Each item contains stable metadata such as `method`, `path`, `moduleName`, `className`, `methodName`, `targetMethodIdentity`, and `comment`; it does not return PSI or Swing navigation objects.

## Code search tools

`search_symbol`, `search_text`, `search_regex`, and `search_file` share one shape: a required `q` query (plus optional `projectPath` and `limit`) with a direct `{items:[{filePath, startLine, startColumn, endLine, endColumn}]}` response. `search_file` matches on file names instead of contents.

`get_file_problems` requires `filePath` and returns `{filePath, errors:[...]}`; an empty `errors` array means "no IDE-reported errors", not a compile guarantee.

`search_ide_actions` takes an action-name `query` and returns candidate `actionId` values. `get_all_open_file_paths` returns `{activeFilePath, openFiles:[...]}`.

All of these tools ignore unknown parameters silently: a misspelled parameter yields unfiltered default results instead of an error, while a missing required parameter fails as `Missing required parameters: q`.

## Database tools

`list_database_connections` returns IDE-managed data sources with `id`, `name`, and `dbms`. `list_database_schemas` requires `connectionId`.

`execute_sql_query` requires `connectionId`, `databaseName` (empty string for Oracle), `schemaName` (uppercase on Oracle), and `queryText`, and returns `{resultSetId, text}` where `text` is CSV-style. Queries are read-only: DML statements report success without committing and PL/SQL blocks time out. Connection failures such as `ORA-17868: unknown host` describe IDE-side network reachability, not a parameter mistake.

Present but not yet behavior-verified: `preview_table_data`, `list_schema_objects`, `get_database_object_description`, `fetch_query_result`, `list_recent_sql_queries`, `cancel_sql_query`, `introspect_schema`.

## `read_target_application_logs`

Optional:
Expand Down
12 changes: 11 additions & 1 deletion docs/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ This document is the shared workflow source for AI agents using DebugTools throu
- `read_target_application_logs` - read recent logs from the selected target JVM ring buffer.
- `get_last_sql_statements` - read recent SQL from the target JVM or the IDEA SQL history fallback.
- `search_http_url` - query indexed HTTP endpoints as stable JSON metadata.
- `search_symbol` - look up a symbol name and get its file path with line range.
- `search_text` - literal text lookup in indexed project files.
- `search_regex` - regex lookup in indexed project files.
- `search_file` - file name lookup.
- `get_file_problems` - IDE-reported problems for one file.
- `search_ide_actions` - look up IDE actions by name.
- `get_all_open_file_paths` - files currently open or focused in the IDE.
- `list_database_connections` - list IDE-managed data sources with their `dbms`.
- `list_database_schemas` - list schemas of one data source; Oracle schemas are uppercase.
- `execute_sql_query` - run one read-only SQL statement and return `{resultSetId, text}` with CSV-style text.

`DebugToolsHotswapToolset`:

Expand All @@ -24,7 +34,7 @@ This document is the shared workflow source for AI agents using DebugTools throu
- `get_hotswap_operation` - query a HotSwap operation after the initial request timed out or returned an operation id.
- `run_and_invoke` - orchestrate status, optional explicit start/attach, reload, invocation, and optional logs/SQL verification.

Use `debug-tools-method-invocation` for connection, attach, argument template, ClassLoader recovery, and Java method invocation tasks. Use `debug-tools-hotswap` for run configuration listing, Hotswap startup, and compile/reload tasks. Use `debug-tools-spring-config` when the user asks to read Spring runtime Environment configuration keys from an attached application.
Use `debug-tools-method-invocation` for connection, attach, argument template, ClassLoader recovery, and Java method invocation tasks. Use `debug-tools-hotswap` for run configuration listing, Hotswap startup, and compile/reload tasks. Use `debug-tools-spring-config` when the user asks to read Spring runtime Environment configuration keys from an attached application. Use `debug-tools-code-search` for route, symbol, file, and IDE-problem lookup through the project index, and `debug-tools-database-query` for read-only SQL through IDE-configured data sources.

## Standard Method Invocation Flow

Expand Down
16 changes: 16 additions & 0 deletions scripts/doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ echo "Package checkout:"
check_repo_file "Method invocation skill" "skills/debug-tools-method-invocation/SKILL.md"
check_repo_file "Hotswap skill" "skills/debug-tools-hotswap/SKILL.md"
check_repo_file "Spring config skill" "skills/debug-tools-spring-config/SKILL.md"
check_repo_file "Code search skill" "skills/debug-tools-code-search/SKILL.md"
check_repo_file "Database query skill" "skills/debug-tools-database-query/SKILL.md"
check_repo_file "CLI" "bin/debug-tools-ai"
check_repo_file "Installer" "install.sh"
check_repo_file "OpenCode plugin" ".opencode/plugins/debug-tools-ai.js"
Expand All @@ -87,25 +89,39 @@ echo "Installed adapters:"
check_installed_file "Codex method invocation skill" ".codex/skills/debug-tools-method-invocation/SKILL.md"
check_installed_file "Codex hotswap skill" ".codex/skills/debug-tools-hotswap/SKILL.md"
check_installed_file "Codex spring config skill" ".codex/skills/debug-tools-spring-config/SKILL.md"
check_installed_file "Codex code search skill" ".codex/skills/debug-tools-code-search/SKILL.md"
check_installed_file "Codex database query skill" ".codex/skills/debug-tools-database-query/SKILL.md"
check_installed_file "Codex plugin method invocation skill" ".codex/plugins/debug-tools-ai/skills/debug-tools-method-invocation/SKILL.md"
check_installed_file "Codex plugin hotswap skill" ".codex/plugins/debug-tools-ai/skills/debug-tools-hotswap/SKILL.md"
check_installed_file "Codex plugin spring config skill" ".codex/plugins/debug-tools-ai/skills/debug-tools-spring-config/SKILL.md"
check_installed_file "Codex plugin code search skill" ".codex/plugins/debug-tools-ai/skills/debug-tools-code-search/SKILL.md"
check_installed_file "Codex plugin database query skill" ".codex/plugins/debug-tools-ai/skills/debug-tools-database-query/SKILL.md"
check_installed_file "Claude plugin method invocation skill" ".claude/plugins/debug-tools-ai/skills/debug-tools-method-invocation/SKILL.md"
check_installed_file "Claude plugin hotswap skill" ".claude/plugins/debug-tools-ai/skills/debug-tools-hotswap/SKILL.md"
check_installed_file "Claude plugin spring config skill" ".claude/plugins/debug-tools-ai/skills/debug-tools-spring-config/SKILL.md"
check_installed_file "Claude plugin code search skill" ".claude/plugins/debug-tools-ai/skills/debug-tools-code-search/SKILL.md"
check_installed_file "Claude plugin database query skill" ".claude/plugins/debug-tools-ai/skills/debug-tools-database-query/SKILL.md"
check_installed_file "Gemini extension method invocation skill" ".gemini/extensions/debug-tools-ai/skills/debug-tools-method-invocation/SKILL.md"
check_installed_file "Gemini extension hotswap skill" ".gemini/extensions/debug-tools-ai/skills/debug-tools-hotswap/SKILL.md"
check_installed_file "Gemini extension spring config skill" ".gemini/extensions/debug-tools-ai/skills/debug-tools-spring-config/SKILL.md"
check_installed_file "Gemini extension code search skill" ".gemini/extensions/debug-tools-ai/skills/debug-tools-code-search/SKILL.md"
check_installed_file "Gemini extension database query skill" ".gemini/extensions/debug-tools-ai/skills/debug-tools-database-query/SKILL.md"
check_installed_file "OpenCode method invocation skill" ".config/opencode/debug-tools-ai/skills/debug-tools-method-invocation/SKILL.md"
check_installed_file "OpenCode hotswap skill" ".config/opencode/debug-tools-ai/skills/debug-tools-hotswap/SKILL.md"
check_installed_file "OpenCode spring config skill" ".config/opencode/debug-tools-ai/skills/debug-tools-spring-config/SKILL.md"
check_installed_file "OpenCode code search skill" ".config/opencode/debug-tools-ai/skills/debug-tools-code-search/SKILL.md"
check_installed_file "OpenCode database query skill" ".config/opencode/debug-tools-ai/skills/debug-tools-database-query/SKILL.md"
check_installed_file "OpenCode plugin" ".config/opencode/plugins/debug-tools-ai.js"
check_installed_file "Cursor plugin method invocation skill" ".cursor/plugins/debug-tools-ai/skills/debug-tools-method-invocation/SKILL.md"
check_installed_file "Cursor plugin hotswap skill" ".cursor/plugins/debug-tools-ai/skills/debug-tools-hotswap/SKILL.md"
check_installed_file "Cursor plugin spring config skill" ".cursor/plugins/debug-tools-ai/skills/debug-tools-spring-config/SKILL.md"
check_installed_file "Cursor plugin code search skill" ".cursor/plugins/debug-tools-ai/skills/debug-tools-code-search/SKILL.md"
check_installed_file "Cursor plugin database query skill" ".cursor/plugins/debug-tools-ai/skills/debug-tools-database-query/SKILL.md"
check_installed_file "Kimi plugin method invocation skill" ".kimi/plugins/debug-tools-ai/skills/debug-tools-method-invocation/SKILL.md"
check_installed_file "Kimi plugin hotswap skill" ".kimi/plugins/debug-tools-ai/skills/debug-tools-hotswap/SKILL.md"
check_installed_file "Kimi plugin spring config skill" ".kimi/plugins/debug-tools-ai/skills/debug-tools-spring-config/SKILL.md"
check_installed_file "Kimi plugin code search skill" ".kimi/plugins/debug-tools-ai/skills/debug-tools-code-search/SKILL.md"
check_installed_file "Kimi plugin database query skill" ".kimi/plugins/debug-tools-ai/skills/debug-tools-database-query/SKILL.md"
check_installed_file "Pi package CLI" ".pi/packages/debug-tools-ai/bin/debug-tools-ai"

echo
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync-adapters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if ! grep -q "docs/workflow.md" "$ROOT/AGENTS.md"; then
exit 1
fi

for skill in "debug-tools-method-invocation" "debug-tools-hotswap" "debug-tools-spring-config"; do
for skill in "debug-tools-method-invocation" "debug-tools-hotswap" "debug-tools-spring-config" "debug-tools-code-search" "debug-tools-database-query"; do
if ! grep -R "$skill" "$ROOT/README.md" "$ROOT/AGENTS.md" "$ROOT/CLAUDE.md" "$ROOT/GEMINI.md" "$ROOT/docs" "$ROOT/skills" >/dev/null; then
echo "Missing skill reference: $skill" >&2
exit 1
Expand Down
6 changes: 5 additions & 1 deletion scripts/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ required_files=(
"skills/debug-tools-spring-config/agents/openai.yaml"
"skills/debug-tools-spring-config/assets/pluginIcon.png"
"skills/debug-tools-spring-config/references/http-spring-config.md"
"skills/debug-tools-code-search/SKILL.md"
"skills/debug-tools-database-query/SKILL.md"
"tests/pressure/22-code-search-route-lookup.md"
"tests/pressure/23-database-query-readonly.md"
"skills/debug-tools-method-invocation/assets/pluginIcon.png"
".codex-plugin/plugin.json"
".claude-plugin/plugin.json"
Expand Down Expand Up @@ -137,7 +141,7 @@ bash "$ROOT/scripts/check-release-readiness.sh"
bash "$ROOT/scripts/smoke-install.sh"
bash "$ROOT/scripts/doctor.sh"

for skill_file in "$ROOT/skills/debug-tools-method-invocation/SKILL.md" "$ROOT/skills/debug-tools-hotswap/SKILL.md" "$ROOT/skills/debug-tools-spring-config/SKILL.md"; do
for skill_file in "$ROOT/skills/debug-tools-method-invocation/SKILL.md" "$ROOT/skills/debug-tools-hotswap/SKILL.md" "$ROOT/skills/debug-tools-spring-config/SKILL.md" "$ROOT/skills/debug-tools-code-search/SKILL.md" "$ROOT/skills/debug-tools-database-query/SKILL.md"; do
if ! grep -q "^---" "$skill_file"; then
echo "Skill is missing YAML frontmatter: ${skill_file#$ROOT/}" >&2
exit 1
Expand Down
Loading